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)); } }
private void rewriteSSTableMetadata(Descriptor descriptor, Map<MetadataType, MetadataComponent> currentComponents) throws IOException { Descriptor tmpDescriptor = descriptor.asType(Descriptor.Type.TEMP); try (DataOutputStreamAndChannel out = new DataOutputStreamAndChannel(new FileOutputStream(tmpDescriptor.filenameFor(Component.STATS)))) { serialize(currentComponents, out); 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(tmpDescriptor.filenameFor(Component.STATS), descriptor.filenameFor(Component.STATS)); } }