public static void renameWithConfirm(String from, String to) { renameWithConfirm(new File(from), new File(to)); }
public static void renameWithConfirm(String from, String to) { renameWithConfirm(new File(from), new File(to)); }
public static void renameWithConfirm(String from, String to) { renameWithConfirm(new File(from), new File(to)); }
public static void renameWithConfirm(String from, String to) { renameWithConfirm(new File(from), new File(to)); }
public static void renameWithConfirm(String from, String to) { renameWithConfirm(new File(from), new File(to)); }
/** * Move files to cdc_raw after replay, since recovery will flush to SSTable and these mutations won't be available * in the CL subsystem otherwise. */ void handleReplayedSegment(final File file) { logger.trace("Moving (Unopened) segment {} to cdc_raw directory after replay", file); FileUtils.renameWithConfirm(file.getAbsolutePath(), DatabaseDescriptor.getCDCLogLocation() + File.separator + file.getName()); cdcSizeTracker.addFlushedSize(file.length()); }
/** * Move files to cdc_raw after replay, since recovery will flush to SSTable and these mutations won't be available * in the CL subsystem otherwise. */ void handleReplayedSegment(final File file) { logger.trace("Moving (Unopened) segment {} to cdc_raw directory after replay", file); FileUtils.renameWithConfirm(file.getAbsolutePath(), DatabaseDescriptor.getCDCLogLocation() + File.separator + file.getName()); cdcSizeTracker.addFlushedSize(file.length()); }
/** * Move files to cdc_raw after replay, since recovery will flush to SSTable and these mutations won't be available * in the CL subsystem otherwise. */ void handleReplayedSegment(final File file) { logger.trace("Moving (Unopened) segment {} to cdc_raw directory after replay", file); FileUtils.renameWithConfirm(file.getAbsolutePath(), DatabaseDescriptor.getCDCLogLocation() + File.separator + file.getName()); cdcSizeTracker.addFlushedSize(file.length()); }
private static File handleHistoryFiles() { File outputDir = FBUtilities.getToolsOutputDirectory(); File historyFile = new File(outputDir, HISTORYFILE); File oldHistoryFile = new File(System.getProperty("user.home"), OLD_HISTORYFILE); if(oldHistoryFile.exists()) FileUtils.renameWithConfirm(oldHistoryFile, historyFile); return historyFile; }
public static void rename(Descriptor tmpdesc, Descriptor newdesc, Set<Component> components) { for (Component component : Sets.difference(components, Sets.newHashSet(Component.DATA, Component.SUMMARY))) { FileUtils.renameWithConfirm(tmpdesc.filenameFor(component), newdesc.filenameFor(component)); } // do -Data last because -Data present should mean the sstable was completely renamed before crash FileUtils.renameWithConfirm(tmpdesc.filenameFor(Component.DATA), newdesc.filenameFor(Component.DATA)); // rename it without confirmation because summary can be available for loadNewSSTables but not for closeAndOpenReader FileUtils.renameWithOutConfirm(tmpdesc.filenameFor(Component.SUMMARY), newdesc.filenameFor(Component.SUMMARY)); }
public static void rename(Descriptor tmpdesc, Descriptor newdesc, Set<Component> components) { for (Component component : Sets.difference(components, Sets.newHashSet(Component.DATA, Component.SUMMARY))) { FileUtils.renameWithConfirm(tmpdesc.filenameFor(component), newdesc.filenameFor(component)); } // do -Data last because -Data present should mean the sstable was completely renamed before crash FileUtils.renameWithConfirm(tmpdesc.filenameFor(Component.DATA), newdesc.filenameFor(Component.DATA)); // rename it without confirmation because summary can be available for loadNewSSTables but not for closeAndOpenReader FileUtils.renameWithOutConfirm(tmpdesc.filenameFor(Component.SUMMARY), newdesc.filenameFor(Component.SUMMARY)); }
public static void rename(Descriptor tmpdesc, Descriptor newdesc, Set<Component> components) { for (Component component : Sets.difference(components, Sets.newHashSet(Component.DATA, Component.SUMMARY))) { FileUtils.renameWithConfirm(tmpdesc.filenameFor(component), newdesc.filenameFor(component)); } // do -Data last because -Data present should mean the sstable was completely renamed before crash FileUtils.renameWithConfirm(tmpdesc.filenameFor(Component.DATA), newdesc.filenameFor(Component.DATA)); // rename it without confirmation because summary can be available for loadNewSSTables but not for closeAndOpenReader FileUtils.renameWithOutConfirm(tmpdesc.filenameFor(Component.SUMMARY), newdesc.filenameFor(Component.SUMMARY)); }
public void discard(CommitLogSegment segment, boolean delete) { segment.close(); addSize(-segment.onDiskSize()); cdcSizeTracker.processDiscardedSegment(segment); if (segment.getCDCState() == CDCState.CONTAINS) FileUtils.renameWithConfirm(segment.logFile.getAbsolutePath(), DatabaseDescriptor.getCDCLogLocation() + File.separator + segment.logFile.getName()); else { if (delete) FileUtils.deleteWithConfirm(segment.logFile); } }
public void discard(CommitLogSegment segment, boolean delete) { segment.close(); addSize(-segment.onDiskSize()); cdcSizeTracker.processDiscardedSegment(segment); if (segment.getCDCState() == CDCState.CONTAINS) FileUtils.renameWithConfirm(segment.logFile.getAbsolutePath(), DatabaseDescriptor.getCDCLogLocation() + File.separator + segment.logFile.getName()); else { if (delete) FileUtils.deleteWithConfirm(segment.logFile); } }
public void discard(CommitLogSegment segment, boolean delete) { segment.close(); addSize(-segment.onDiskSize()); cdcSizeTracker.processDiscardedSegment(segment); if (segment.getCDCState() == CDCState.CONTAINS) FileUtils.renameWithConfirm(segment.logFile.getAbsolutePath(), DatabaseDescriptor.getCDCLogLocation() + File.separator + segment.logFile.getName()); else { if (delete) FileUtils.deleteWithConfirm(segment.logFile); } }
private void rewriteSSTableMetadata(Descriptor descriptor, Map<MetadataType, MetadataComponent> currentComponents) throws IOException { String filePath = descriptor.tmpFilenameFor(Component.STATS); try (DataOutputStreamPlus out = new BufferedDataOutputStreamPlus(new FileOutputStream(filePath))) { serialize(currentComponents, out, descriptor.version); out.flush(); } // we cant move a file on top of another file in windows: if (FBUtilities.isWindows) FileUtils.delete(descriptor.filenameFor(Component.STATS)); FileUtils.renameWithConfirm(filePath, descriptor.filenameFor(Component.STATS)); } }
public static void rename(Descriptor tmpdesc, Descriptor newdesc, Set<Component> components) { for (Component component : Sets.difference(components, Sets.newHashSet(Component.DATA, Component.SUMMARY))) { FileUtils.renameWithConfirm(tmpdesc.filenameFor(component), newdesc.filenameFor(component)); } // do -Data last because -Data present should mean the sstable was completely renamed before crash FileUtils.renameWithConfirm(tmpdesc.filenameFor(Component.DATA), newdesc.filenameFor(Component.DATA)); // rename it without confirmation because summary can be available for loadNewSSTables but not for closeAndOpenReader FileUtils.renameWithOutConfirm(tmpdesc.filenameFor(Component.SUMMARY), newdesc.filenameFor(Component.SUMMARY)); }
private void rewriteSSTableMetadata(Descriptor descriptor, Map<MetadataType, MetadataComponent> currentComponents) throws IOException { String filePath = descriptor.tmpFilenameFor(Component.STATS); try (DataOutputStreamPlus out = new BufferedDataOutputStreamPlus(new FileOutputStream(filePath))) { serialize(currentComponents, out, descriptor.version); out.flush(); } // we cant move a file on top of another file in windows: if (FBUtilities.isWindows) FileUtils.delete(descriptor.filenameFor(Component.STATS)); FileUtils.renameWithConfirm(filePath, descriptor.filenameFor(Component.STATS)); } }
private void rewriteSSTableMetadata(Descriptor descriptor, Map<MetadataType, MetadataComponent> currentComponents) throws IOException { String filePath = descriptor.tmpFilenameFor(Component.STATS); try (DataOutputStreamPlus out = new BufferedDataOutputStreamPlus(new FileOutputStream(filePath))) { serialize(currentComponents, out, descriptor.version); out.flush(); } // we cant move a file on top of another file in windows: if (FBUtilities.isWindows) FileUtils.delete(descriptor.filenameFor(Component.STATS)); FileUtils.renameWithConfirm(filePath, descriptor.filenameFor(Component.STATS)); } }
public static void rename(Descriptor tmpdesc, Descriptor newdesc, Set<Component> components) { for (Component component : Sets.difference(components, Sets.newHashSet(Component.DATA, Component.SUMMARY))) { FileUtils.renameWithConfirm(tmpdesc.filenameFor(component), newdesc.filenameFor(component)); } // do -Data last because -Data present should mean the sstable was completely renamed before crash FileUtils.renameWithConfirm(tmpdesc.filenameFor(Component.DATA), newdesc.filenameFor(Component.DATA)); // rename it without confirmation because summary can be available for loadNewSSTables but not for closeAndOpenReader FileUtils.renameWithOutConfirm(tmpdesc.filenameFor(Component.SUMMARY), newdesc.filenameFor(Component.SUMMARY)); }