Skip to content

Commit

Permalink
Make XML parsing error message more explicit (PR #97)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengnanli authored and xkrogen committed May 24, 2019
1 parent 6e42297 commit 2d2591e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ public void setup(Mapper.Context context) {
public void map(LongWritable lineNum, Text line,
Mapper<LongWritable, Text, IntWritable, BlockInfo>.Context context)
throws IOException, InterruptedException {
List<BlockInfo> blockInfos = parser.parseLine(line.toString());
List<BlockInfo> blockInfos;
try {
blockInfos = parser.parseLine(line.toString());
} catch (IOException e) {
throw new IOException(String.format("IOException %s happened for line %s", e.getMessage(), line));
}

for (BlockInfo blockInfo : blockInfos) {
for (short i = 0; i < blockInfo.getReplication(); i++) {
context.write(new IntWritable((blockIndex + i) % numDataNodes), blockInfo);
Expand Down

0 comments on commit 2d2591e

Please sign in to comment.