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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]