ddupg commented on a change in pull request #3045:
URL: https://github.com/apache/hbase/pull/3045#discussion_r599267260



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALProvider.java
##########
@@ -130,7 +130,12 @@ void init(WALFactory factory, Configuration conf, String 
providerId, Abortable s
   void addWALActionsListener(WALActionsListener listener);
 
   default WALFileLengthProvider getWALFileLengthProvider() {
-    return path -> getWALs().stream().map(w -> 
w.getLogFileSizeIfBeingWritten(path))
-        .filter(o -> o.isPresent()).findAny().orElse(OptionalLong.empty());
+    return path -> getWALs().stream().map(w -> {
+      try {
+        return w.getLogFileSizeIfBeingWritten(path);
+      } catch (IOException e) {
+        return OptionalLong.empty();

Review comment:
       Thanks @Apache9  for reviewing.
   In this PR, I introduce `RemoteWALFileLengthProvider` implementing 
WALFileLengthProvider, it is hold by ReplicationServer and gets the length of 
wals from RS through RPC,  it may throw an IOE. So I need declare 
`WALFileLengthProvider.getLogFileSizeIfBeingWritten` as throwing IOException.
   But this is safe here, `WALProvider` is only used by RS, `getWALs` returns 
`WAL` that `extents WALFileLengthProvider` and won't throw IOE.




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