You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by vi...@apache.org on 2020/10/13 07:45:22 UTC
[hudi] branch master updated: [HUDI-1298] Add better error messages
when IOException occurs during log file reading (#2133)
This is an automated email from the ASF dual-hosted git repository.
vinoth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new b66c3ef [HUDI-1298] Add better error messages when IOException occurs during log file reading (#2133)
b66c3ef is described below
commit b66c3ef23a021114c3c05ccf4d724b4a16926c53
Author: lw0090 <lw...@gmail.com>
AuthorDate: Tue Oct 13 15:45:10 2020 +0800
[HUDI-1298] Add better error messages when IOException occurs during log file reading (#2133)
---
.../hudi/common/table/log/AbstractHoodieLogRecordScanner.java | 6 +++++-
.../apache/hudi/common/table/log/HoodieMergedLogRecordScanner.java | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordScanner.java b/hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordScanner.java
index 52483ea..8d8ef56 100644
--- a/hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordScanner.java
+++ b/hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordScanner.java
@@ -31,6 +31,7 @@ import org.apache.hudi.common.table.log.block.HoodieHFileDataBlock;
import org.apache.hudi.common.table.log.block.HoodieLogBlock;
import org.apache.hudi.common.table.timeline.HoodieTimeline;
import org.apache.hudi.common.util.SpillableMapUtils;
+import org.apache.hudi.exception.HoodieException;
import org.apache.hudi.exception.HoodieIOException;
import org.apache.avro.Schema;
@@ -242,9 +243,12 @@ public abstract class AbstractHoodieLogRecordScanner {
}
// Done
progress = 1.0f;
+ } catch (IOException e) {
+ LOG.error("Got IOException when reading log file", e);
+ throw new HoodieIOException("IOException when reading log file ", e);
} catch (Exception e) {
LOG.error("Got exception when reading log file", e);
- throw new HoodieIOException("IOException when reading log file ");
+ throw new HoodieException("Exception when reading log file ", e);
} finally {
try {
if (null != logFormatReaderWrapper) {
diff --git a/hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieMergedLogRecordScanner.java b/hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieMergedLogRecordScanner.java
index e6246c4..025ae91 100644
--- a/hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieMergedLogRecordScanner.java
+++ b/hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieMergedLogRecordScanner.java
@@ -88,7 +88,7 @@ public class HoodieMergedLogRecordScanner extends AbstractHoodieLogRecordScanner
LOG.info("Number of entries in DiskBasedMap in ExternalSpillableMap => " + records.getDiskBasedMapNumEntries());
LOG.info("Size of file spilled to disk => " + records.getSizeOfFileOnDiskInBytes());
} catch (IOException e) {
- throw new HoodieIOException("IOException when reading log file ");
+ throw new HoodieIOException("IOException when reading log file ", e);
}
}