Skip to content

Commit

Permalink
append other data after MetaHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Apr 24, 2022
1 parent 3a70112 commit 36b6c62
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ public long doWork(String name, WriteMethod method) throws IOException {
public static void write(File imageFile, Catalog catalog) throws IOException {
// save image does not need any lock. because only checkpoint thread will call this method.
LOG.info("start to save image to {}. is ckpt: {}", imageFile.getAbsolutePath(), Catalog.isCheckpointThread());
FileOutputStream imageFileOut = new FileOutputStream(imageFile);
final Reference<Long> checksum = new Reference<>(0L);
long saveImageStartTime = System.currentTimeMillis();
// MetaHeader should use output stream in the future.
long startPosition = MetaHeader.write(imageFile);
List<MetaIndex> metaIndices = Lists.newArrayList();
FileOutputStream imageFileOut = new FileOutputStream(imageFile, true);
try (CountingDataOutputStream dos = new CountingDataOutputStream(new BufferedOutputStream(
imageFileOut), startPosition)) {
writer.setDelegate(dos, metaIndices);
Expand Down

0 comments on commit 36b6c62

Please sign in to comment.