comnetwork commented on a change in pull request #2055:
URL: https://github.com/apache/hbase/pull/2055#discussion_r458684871



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java
##########
@@ -59,7 +59,7 @@
 
   private final Class<? extends Channel> channelClass;
 
-  private AsyncFSOutput output;
+  private volatile AsyncFSOutput output;

Review comment:
       @Apache9 , I modify PR to introduce `finalSyncedLength` to save the 
syncedLength when `AsyncProtobufLogWriter.close`.
   
   But in `getSyncedLength` method,  I check whether output is  null  instead 
of  checking whether `finalSyncedLength` is set, because I think the statement 
"this.output = null;" in `AsyncProtobufLogWriter.close` is a  good sync point, 
if output is null, then `finalSyncedLength` must set, so we can return 
`finalSyncedLength`, else we return `output.getSyncedLength`.
   
   If we use `finalSyncedLength` as a sync point, it is hard to decide whether 
the `output `is null or not.




----------------------------------------------------------------
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:
[email protected]


Reply via email to