Created
August 21, 2013 14:52
-
-
Save emaxerrno/6295510 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public boolean next(K key, V value) throws IOException { | |
| if (eof) { | |
| return false; | |
| } | |
| if (firstRecord) { // key & value are already read. | |
| firstRecord = false; | |
| return true; | |
| } | |
| try { | |
| if (realReader.nextKeyValue()) { | |
| if (key != realReader.getCurrentKey()) { | |
| throw new IOException("DeprecatedInputFormatWrapper can not " | |
| + "support RecordReaders that don't return same key & value " | |
| + "objects. 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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment