You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/09/08 01:50:13 UTC

[GitHub] [hudi] nsivabalan commented on a diff in pull request #6031: [HUDI-4282] Repair IOException in some other dfs, except hdfs,when check block corrupted in HoodieLogFileReader

nsivabalan commented on code in PR #6031:
URL: https://github.com/apache/hudi/pull/6031#discussion_r965431369


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java:
##########
@@ -516,4 +521,23 @@ private static FSDataInputStream getFSDataInputStreamForGCS(FSDataInputStream fs
 
     return fsDataInputStream;
   }
+
+  /**
+   * Some filesystem(such as chdfs) will throw {@code IOException} instead of {@code EOFException}. It will cause error in isBlockCorrupted().
+   * Wrapped by {@code BoundedFsDataInputStream}, to check whether the desired offset is out of the file size in advance.
+   */
+  private static FSDataInputStream wrapStreamByBoundedFsDataInputStream(FileSystem fs,

Review Comment:
   if we call this method in Line 490 above, we don't need lines 533 to 539 right. 
   essentially
   line 493 could be
   ```
   return FSUtils.shouldWrappedByBoundedDataStream(fs) : new BoundedFsDataInputStream(fs, logFile.getPath(), fsDataInputStream): fsDataInputStream; 
   ```
   



-- 
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: commits-unsubscribe@hudi.apache.org

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