Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/main/java/com/hadoop/mapred/DeprecatedLzoTextInputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,43 @@ public RecordReader<LongWritable, Text> getRecordReader(InputSplit split,
if (LzoInputFormatCommon.isLzoFile(fileSplit.getPath().toString())) {
reporter.setStatus(split.toString());
return new DeprecatedLzoLineRecordReader(conf, (FileSplit)split);
} else if (LzoInputFormatCommon.isLzoIndexFile(fileSplit.getPath().toString())) {
return new DummyRecordReader();
} else {
// delegate non-LZO files to the TextInputFormat base class.
return super.getRecordReader(split, conf, reporter);
}
}

public static class DummyRecordReader implements RecordReader<LongWritable, Text> {

@Override
public float getProgress() throws IOException {
return 0;
}

@Override
public boolean next(LongWritable s, Text aLong) throws IOException {
return false;
}

@Override
public LongWritable createKey() {
return null;
}

@Override
public Text createValue() {
return null;
}

@Override
public long getPos() throws IOException {
return 0;
}

@Override
public void close() throws IOException {}
}

}