@Override public TupleEntryIterator openForRead(FlowProcess<Object> flowProcess, Object input) throws IOException { initInnerTapIfNotSetFromFlowProcess(flowProcess); return actualTap.openForRead(flowProcess, input); }
@Override public TupleEntryIterator openTapForRead( Tap tap ) throws IOException { return tap.openForRead( this ); }
@Override public TupleEntryIterator openForRead( FlowProcess<? extends Config> flowProcess ) throws IOException { return original.openForRead( flowProcess ); }
@Override public TupleEntryIterator openForRead( FlowProcess<? extends Config> flowProcess, Input input ) throws IOException { return original.openForRead( flowProcess, input ); }
@Override public TupleEntryIterator openTapForRead( Tap tap ) throws IOException { return tap.openForRead( this ); }
@Override public TupleEntryIterator openTapForRead( Tap tap ) throws IOException { return tap.openForRead( this ); }
@Override public TupleEntryIterator openTapForRead( Tap tap ) throws IOException { return tap.openForRead( this ); }
protected TupleEntryIterator openForReadUnchecked( FlowProcess<? extends Config> flowProcess ) { try { return openForRead( flowProcess ); } catch( IOException exception ) { throw new UncheckedIOException( exception ); } }
@Override public TupleEntryIterator openForRead( FlowProcess<? extends TConfig> flowProcess ) throws IOException { return original.openForRead( processProvider.apply( flowProcess ) ); }
@Override public TupleEntryIterator openForRead( FlowProcess<? extends TConfig> flowProcess, TInput input ) throws IOException { return original.openForRead( processProvider.apply( flowProcess ), null ); }
@Override public TupleEntryIterator openSink() throws IOException { return sinks.values().iterator().next().openForRead( getFlowProcess() ); }
@Override public TupleEntryIterator openTapForRead( Tap tap ) throws IOException { return tap.openForRead( getFlowProcess() ); }
@Override public TupleEntryIterator openSource() throws IOException { return sources.values().iterator().next().openForRead( getFlowProcess() ); }
@Override public TupleEntryIterator openSink( String name ) throws IOException { if( !sinks.containsKey( name ) ) throw new IllegalArgumentException( "sink does not exist: " + name ); return sinks.get( name ).openForRead( getFlowProcess() ); }
@Override public TupleEntryIterator openForRead(FlowProcess<Object> flowProcess, Object input) throws IOException { initInnerTapIfNotSetFromFlowProcess(flowProcess); return actualTap.openForRead(flowProcess, input); }
private TupleEntryIterator getHadoopTupleEntryIterator() throws IOException { @SuppressWarnings("unchecked") Tap<JobConf, ?, ?> hadoopTap = (Tap<JobConf, ?, ?>) source; JobConf conf = new JobConf(); FlowProcess<JobConf> flowProcess = new HadoopFlowProcess(conf); hadoopTap.sourceConfInit(flowProcess, conf); return hadoopTap.openForRead(flowProcess); }
private TupleEntryIterator getLocalTupleEntryIterator() throws IOException { @SuppressWarnings("unchecked") Tap<Properties, ?, ?> localTap = (Tap<Properties, ?, ?>) source; Properties properties = new Properties(); FlowProcess<Properties> flowProcess = new LocalFlowProcess(properties); localTap.sourceConfInit(flowProcess, properties); return localTap.openForRead(flowProcess); }
@Override public TupleEntryIterator openForRead( FlowProcess<? extends Config> flowProcess, Input input ) throws IOException { if( input != null ) return findMatchingTap( flowProcess ).openForRead( flowProcess, input ); Iterator iterators[] = new Iterator[ getTaps().length ]; for( int i = 0; i < getTaps().length; i++ ) iterators[ i ] = new TupleIterator( getTaps()[ i ].openForRead( flowProcess ) ); return new TupleEntryChainIterator( getSourceFields(), iterators ); }
@Test public void testMultiSourceIterator() throws Exception { getPlatform().copyFromLocal( inputFileLower ); getPlatform().copyFromLocal( inputFileUpper ); Tap sourceLower = getPlatform().getTextFile( new Fields( "offset", "line" ), inputFileLower ); Tap sourceUpper = getPlatform().getTextFile( new Fields( "offset", "line" ), inputFileUpper ); Tap source = new MultiSourceTap( sourceLower, sourceUpper ); validateLength( source.openForRead( getPlatform().getFlowProcess() ), 10 ); }
@Test public void testMultiSourceIterator() throws Exception { getPlatform().copyFromLocal( inputFileLower ); getPlatform().copyFromLocal( inputFileUpper ); Tap sourceLower = getPlatform().getTextFile( new Fields( "offset", "line" ), inputFileLower ); Tap sourceUpper = getPlatform().getTextFile( new Fields( "offset", "line" ), inputFileUpper ); Tap source = new MultiSourceTap( sourceLower, sourceUpper ); validateLength( source.openForRead( getPlatform().getFlowProcess() ), 10 ); }