alexeykudinkin commented on code in PR #4015:
URL: https://github.com/apache/hudi/pull/4015#discussion_r978963296
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java:
##########
@@ -150,21 +150,22 @@ private void addShutDownHook() {
// for max of Integer size
private HoodieLogBlock readBlock() throws IOException {
int blockSize;
+ long blockStartPos = inputStream.getPos();
try {
// 1 Read the total size of the block
blockSize = (int) inputStream.readLong();
} catch (EOFException | CorruptedLogFileException e) {
// An exception reading any of the above indicates a corrupt block
// Create a corrupt block by finding the next MAGIC marker or EOF
- return createCorruptBlock();
+ return createCorruptBlock(blockStartPos);
}
// We may have had a crash which could have written this block partially
// Skip blockSize in the stream and we should either find a sync marker
(start of the next
// block) or EOF. If we did not find either of it, then this block is a
corrupted block.
- boolean isCorrupted = isBlockCorrupted(blockSize);
Review Comment:
nit: Frankly, `isBlockCorrupted` seems to be more idiomatic than corrupt
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]