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)); } }
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)); } }