lide-reed commented on code in PR #9180:
URL: https://github.com/apache/incubator-doris/pull/9180#discussion_r857355310


##########
fe/fe-core/src/main/java/org/apache/doris/common/MetaWriter.java:
##########
@@ -94,14 +94,15 @@ 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 save image to {}. is ckpt: {}", 
imageFile.getAbsolutePath(), Catalog.isCheckpointThread());
-
+        LOG.info("start to save image to {}. is ckpt: {}", 
imageFile.getAbsolutePath(), Catalog.isCheckpointThread());
         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(
-                new FileOutputStream(imageFile, true)), startPosition)) {
+                imageFileOut), startPosition)) {

Review Comment:
   It seems remove append will cover header?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to