hudi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-hudi] n3nash commented on a change in pull request #1332: [HUDI -409] Match header and footer block length to improve corrupted block detection
Date Fri, 14 Feb 2020 01:37:03 GMT
n3nash commented on a change in pull request #1332: [HUDI -409] Match header and footer block
length to improve corrupted block detection
URL: https://github.com/apache/incubator-hudi/pull/1332#discussion_r379212070
 
 

 ##########
 File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java
 ##########
 @@ -239,6 +239,15 @@ private boolean isBlockCorrupt(int blocksize) throws IOException {
       return true;
     }
 
+    // check if the blocksize mentioned in the footer is the same as the header; by seeking
back the length of a long
+    // the backward seek does not incur additional IO as {@link org.apache.hadoop.hdfs.DFSInputStream#seek()}
+    // only moves the index. actual IO happens on the next read operation
+    inputStream.seek(inputStream.getPos() - Long.BYTES);
 
 Review comment:
   This is assuming that the block length will always be the last thing written in the footer,
can we add comments in the footer writer part to denote this 

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


With regards,
Apache Git Services

Mime
View raw message