@Override public void complete(Duct previous) { if( next != null ) { super.complete(previous); } }
@Override public void bind( StreamGraph streamGraph ) { super.bind( streamGraph ); numIncomingPaths = streamGraph.findAllPreviousFor( this ).length; }
@Override public void initialize() { super.initialize(); completeCount.set( numIncomingPaths ); }
private ElementDuct unwind( Duct next ) { if( next instanceof ElementDuct ) return (ElementDuct) next; return unwind( next.getNext() ); }
@Override public void cleanup() { try { if( collector != null ) { long start = System.currentTimeMillis(); try { collector.close(); // may flush underlying system } finally { flowProcess.increment( StepCounters.Write_Duration, System.currentTimeMillis() - start ); } } collector = null; } finally { super.cleanup(); } } }
@Override public synchronized void start( Duct previous ) { if( started ) return; super.start( previous ); started = true; }
@Override public void prepare() { super.prepare(); // if fails, skip the this prepare ( (Operator) getFlowElement() ).getOperation().prepare( flowProcess, operationCall ); }
protected Fields getOutgoingFields() { return ( (ScopedElement) unwind( next ).getFlowElement() ).resolveIncomingOperationPassThroughFields( outgoingScopes.get( 0 ) ); }
@Override public void cleanup() { if( !retainCollector ) // see comments for RETAIN_COLLECTOR operationCall.setOutputCollector( null ); try { ( (Operator) getFlowElement() ).getOperation().cleanup( flowProcess, operationCall ); } finally { super.cleanup(); // guarantee this happens } } }
@Override public void complete( Duct previous ) { if( completeCount.decrementAndGet() != 0 ) return; super.complete( previous ); completeCount.set( numIncomingPaths ); } }
@Override public void complete( Duct previous ) { try { ( (Operator) getFlowElement() ).getOperation().flush( flowProcess, operationCall ); } finally { super.complete( previous ); } }