@Override public RecordReader<Text,PeekingIterator<Entry<Key,Value>>> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { log.setLevel(getLogLevel(context)); return new RecordReaderBase<Text,PeekingIterator<Entry<Key,Value>>>() { RowIterator rowIterator; @Override public void initialize(InputSplit inSplit, TaskAttemptContext attempt) throws IOException { super.initialize(inSplit, attempt); rowIterator = new RowIterator(scannerIterator); currentK = new Text(); currentV = null; } @Override public boolean nextKeyValue() throws IOException, InterruptedException { if (!rowIterator.hasNext()) return false; currentV = new PeekingIterator<>(rowIterator.next()); numKeysRead = rowIterator.getKVCount(); currentKey = currentV.peek().getKey(); currentK = new Text(currentKey.getRow()); return true; } }; } }
@Override public RecordReader<Text,PeekingIterator<Entry<Key,Value>>> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { log.setLevel(getLogLevel(context)); return new RecordReaderBase<Text,PeekingIterator<Entry<Key,Value>>>() { RowIterator rowIterator; @Override public void initialize(InputSplit inSplit, TaskAttemptContext attempt) throws IOException { super.initialize(inSplit, attempt); rowIterator = new RowIterator(scannerIterator); currentK = new Text(); currentV = null; } @Override public boolean nextKeyValue() throws IOException, InterruptedException { if (!rowIterator.hasNext()) return false; currentV = new PeekingIterator<>(rowIterator.next()); numKeysRead = rowIterator.getKVCount(); currentKey = currentV.peek().getKey(); currentK = new Text(currentKey.getRow()); return true; } }; } }
@Override public RecordReader<Text,PeekingIterator<Entry<Key,Value>>> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { log.setLevel(getLogLevel(context)); return new RecordReaderBase<Text,PeekingIterator<Entry<Key,Value>>>() { RowIterator rowIterator; @Override public void initialize(InputSplit inSplit, TaskAttemptContext attempt) throws IOException { super.initialize(inSplit, attempt); rowIterator = new RowIterator(scannerIterator); currentK = new Text(); currentV = null; } @Override public boolean nextKeyValue() throws IOException, InterruptedException { if (!rowIterator.hasNext()) return false; currentV = new PeekingIterator<>(rowIterator.next()); numKeysRead = rowIterator.getKVCount(); currentKey = currentV.peek().getKey(); currentK = new Text(currentKey.getRow()); return true; } }; } }