1
0

[HUDI-1298] Add better error messages when IOException occurs during log file reading (#2133)

This commit is contained in:
lw0090
2020-10-13 15:45:10 +08:00
committed by GitHub
parent 0d407342ef
commit b66c3ef23a
2 changed files with 6 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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);
}
}