in core/src/main/java/com/twitter/elephantbird/mapred/input/DeprecatedInputFormatWrapper.java [324:375]
public boolean next(K key, V value) throws IOException {
if (eof) {
return false;
}
if (firstRecord) { // key & value are already read.
firstRecord = false;
return true;
}
if (mifcReader != null) {
mifcReader.setKeyValue(key, value);
}
try {
if (realReader.nextKeyValue()) {
if (key != realReader.getCurrentKey()) {
if (mifcReader != null) {
throw new IOException("The RecordReader returned a key and value that do not match "
+ "the key and value sent to it. This means the RecordReader did not properly implement "
+ "com.twitter.elephantbird.mapred.input.MapredInputFormatCompatible. "
+ "Current reader class : " + realReader.getClass());
} else {
throw new IOException("DeprecatedInputFormatWrapper only "
+ "supports RecordReaders that return the same key & value "
+ "objects or implement com.twitter.elephantbird.mapred.input.MapredInputFormatCompatible. "
+ "Current reader class : " + realReader.getClass());
}
}
if (value != realReader.getCurrentValue()) {
if (null != valueCopier)
valueCopier.copyValue(value, realReader.getCurrentValue());
else {
throw new IOException("DeprecatedInputFormatWrapper - value is different "
+ "and no value copier provided. "
+ "Current reader class : " + realReader.getClass());
}
}
return true;
}
} catch (InterruptedException e) {
throw new IOException(e);
}
eof = true; // strictly not required, just for consistency
return false;
}