duongkame commented on code in PR #6968:
URL: https://github.com/apache/ozone/pull/6968#discussion_r1686936091
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java:
##########
@@ -150,6 +153,7 @@ public class BlockOutputStream extends OutputStream {
private boolean allowPutBlockPiggybacking;
private CompletableFuture<Void> lastFlushFuture;
+ private Set<CompletableFuture<Void>> allFlushFutures =
Collections.newSetFromMap(new ConcurrentHashMap<>());
Review Comment:
@szetszwo That's a good idea. However, there are a few points.
1. The normal `hsync()` should only wait for the last flush future to
fulfill its guarantee. And we only want the `close()` event to wait for all
pending flush futures.
2. The chain of futures for a BlockOutputStream can get very long. E.g.
Hbase may call hsync after a few kb, suppose in a 128Mb block, hsync is called
every 2kb, and there will be 64K futures in that chain. The list of futures
must be reduced when any of them is completed.
--
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]