@Override public FlowProcessContext getFlowProcessContext() { return delegate.getFlowProcessContext(); }
@Override public InputStream next() { safeClose(); Path path = iterator.next(); flowProcess.getFlowProcessContext().setSourcePath( path.toAbsolutePath().toString() ); if( LOG.isDebugEnabled() ) LOG.debug( "opening: {}", path ); try { lastInputStream = Files.newInputStream( path ); return lastInputStream; } catch( IOException exception ) { throw new TapException( "unable to open path: " + path, exception ); } }
/** * Copy constructor. * <p> * Shares the underlying trap collector collection across copies to avoid a static collection. * * @param flowProcess */ protected FlowProcess( FlowProcess<Config> flowProcess ) { setCurrentSession( flowProcess.getCurrentSession() ); // lazy initialize trap collectors collection and share across copies this.trapCollectors = flowProcess.getTrapCollectors(); this.flowProcessContext = flowProcess.getFlowProcessContext(); }
@Override public TupleEntryIterator openForRead( FlowProcess<? extends Properties> flowProcess, InputStream input ) throws IOException { if( input == null ) input = new FileInputStream( getIdentifier() ); flowProcess.getFlowProcessContext().setSourcePath( getFullIdentifier( flowProcess ) ); return new TupleEntrySchemeIterator<Properties, InputStream>( flowProcess, this, getScheme(), input, getIdentifier() ); }
return new TupleEntrySchemeIterator<Properties, InputStream>( flowProcess, this, getScheme(), iterator, () -> flowProcess.getFlowProcessContext().getSourcePath() );