/** * Method hasNext returns true if there more {@link Tuple} instances available. * * @return boolean */ public boolean hasNext() { getNextReader(); return !complete; }
/** * Constructor TapIterator creates a new TapIterator instance. * * @throws IOException when */ public MultiRecordReaderIterator( FlowProcess<? extends Configuration> flowProcess, Tap tap ) throws IOException { this.flowProcess = flowProcess; this.tap = tap; this.conf = flowProcess.getConfigCopy(); initialize(); }
private static CloseableIterator<RecordReader> makeIterator( FlowProcess<? extends Configuration> flowProcess, Tap parentTap, RecordReader recordReader ) throws IOException { if( recordReader != null ) return new RecordReaderIterator( recordReader ); return new MultiRecordReaderIterator( flowProcess, parentTap ); }
private void getNextReader() { if( complete || reader != null ) return; try { if( currentSplit < splits.length ) { if( lastReader != null ) lastReader.close(); reader = makeReader( currentSplit++ ); lastReader = reader; } else { complete = true; } } catch( IOException exception ) { throw new TapException( "could not get next tuple", exception ); } }
/** * Constructor TapIterator creates a new TapIterator instance. * * @throws IOException when */ public MultiRecordReaderIterator( FlowProcess<? extends Configuration> flowProcess, Tap tap ) throws IOException { this.flowProcess = flowProcess; this.tap = tap; this.conf = flowProcess.getConfigCopy(); initialize(); }
private static CloseableIterator<RecordReader> makeIterator( FlowProcess<? extends Configuration> flowProcess, Tap parentTap, RecordReader recordReader ) throws IOException { if( recordReader != null ) return new RecordReaderIterator( recordReader ); return new MultiRecordReaderIterator( flowProcess, parentTap ); }
private void getNextReader() { if( complete || reader != null ) return; try { if( currentSplit < splits.length ) { if( lastReader != null ) lastReader.close(); reader = makeReader( currentSplit++ ); lastReader = reader; } else { complete = true; } } catch( IOException exception ) { throw new TapException( "could not get next tuple", exception ); } }
/** * Method hasNext returns true if there more {@link Tuple} instances available. * * @return boolean */ public boolean hasNext() { getNextReader(); return !complete; }
/** * Method next returns the next {@link Tuple}. * * @return Tuple */ public RecordReader next() { if( complete ) throw new IllegalStateException( "no more values" ); try { getNextReader(); return reader; } finally { reader = null; } }
/** * Method next returns the next {@link Tuple}. * * @return Tuple */ public RecordReader next() { if( complete ) throw new IllegalStateException( "no more values" ); try { getNextReader(); return reader; } finally { reader = null; } }