[HUDI-1298] Add better error messages when IOException occurs during log file reading (#2133)
This commit is contained in:
@@ -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.log.block.HoodieLogBlock;
|
||||||
import org.apache.hudi.common.table.timeline.HoodieTimeline;
|
import org.apache.hudi.common.table.timeline.HoodieTimeline;
|
||||||
import org.apache.hudi.common.util.SpillableMapUtils;
|
import org.apache.hudi.common.util.SpillableMapUtils;
|
||||||
|
import org.apache.hudi.exception.HoodieException;
|
||||||
import org.apache.hudi.exception.HoodieIOException;
|
import org.apache.hudi.exception.HoodieIOException;
|
||||||
|
|
||||||
import org.apache.avro.Schema;
|
import org.apache.avro.Schema;
|
||||||
@@ -242,9 +243,12 @@ public abstract class AbstractHoodieLogRecordScanner {
|
|||||||
}
|
}
|
||||||
// Done
|
// Done
|
||||||
progress = 1.0f;
|
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) {
|
} catch (Exception e) {
|
||||||
LOG.error("Got exception when reading log file", 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 {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (null != logFormatReaderWrapper) {
|
if (null != logFormatReaderWrapper) {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class HoodieMergedLogRecordScanner extends AbstractHoodieLogRecordScanner
|
|||||||
LOG.info("Number of entries in DiskBasedMap in ExternalSpillableMap => " + records.getDiskBasedMapNumEntries());
|
LOG.info("Number of entries in DiskBasedMap in ExternalSpillableMap => " + records.getDiskBasedMapNumEntries());
|
||||||
LOG.info("Size of file spilled to disk => " + records.getSizeOfFileOnDiskInBytes());
|
LOG.info("Size of file spilled to disk => " + records.getSizeOfFileOnDiskInBytes());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new HoodieIOException("IOException when reading log file ");
|
throw new HoodieIOException("IOException when reading log file ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user