You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/07/06 19:20:51 UTC

[GitHub] [hbase] ndimiduk commented on a change in pull request #1970: HBASE-24625 AsyncFSWAL.getLogFileSizeIfBeingWritten does not return the expected synced file length.

ndimiduk commented on a change in pull request #1970:
URL: https://github.com/apache/hbase/pull/1970#discussion_r450430879



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java
##########
@@ -46,6 +46,10 @@
 
   protected FSDataOutputStream output;
 
+  private volatile long syncedLength = 0;

Review comment:
       nit: why do we have `AtomicUtils.updateMax`? It seems [`getAndAccumulate`](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicLong.html#getAndAccumulate-long-java.util.function.LongBinaryOperator-) is designed for this use case, i.e., `syncedLength.getAndAccumulate(fsdos.getPos(), Math::max)`




----------------------------------------------------------------
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.

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