@Override public void completeGroup( Duct previous, TupleEntry incomingEntry ) { this.incomingEntry = incomingEntry; operationCall.setArguments( null ); operationCall.setOutputCollector( outputCollector ); try { aggregator.complete( flowProcess, operationCall ); // collector calls next } catch( CascadingException exception ) { handleException( exception, incomingEntry ); } catch( Throwable throwable ) { handleException( new OperatorException( every, "operator Every failed completing operation: " + every.getOperation(), throwable ), incomingEntry ); } } }
@Override public void completeGroup( Duct previous, TupleEntry incomingEntry ) { this.incomingEntry = incomingEntry; operationCall.setArguments( null ); try { groupAssertion.doAssert( flowProcess, operationCall ); // collector calls next reducing.completeGroup( this, incomingEntry ); } catch( CascadingException exception ) { handleException( exception, incomingEntry ); } catch( Throwable throwable ) { handleException( new OperatorException( every, "operator Every failed completing operation: " + every.getOperation(), throwable ), incomingEntry ); } } }
rhsDuct = new GroupAssertionEveryStage( flowProcess, everyElement ); else throw new IllegalStateException( "unknown operation: " + everyElement.getOperation().getClass().getCanonicalName() );
@Override public void startGroup( Duct previous, TupleEntry groupEntry ) { operationCall.setGroup( groupEntry ); operationCall.setArguments( null ); // zero it out operationCall.setOutputCollector( null ); // zero it out try { groupAssertion.start( flowProcess, operationCall ); } catch( CascadingException exception ) { handleException( exception, groupEntry ); } catch( Throwable throwable ) { handleException( new OperatorException( every, "operator Every failed starting operation: " + every.getOperation(), throwable ), groupEntry ); } reducing.startGroup( this, groupEntry ); }
@Override public void startGroup( Duct previous, TupleEntry groupEntry ) { operationCall.setGroup( groupEntry ); operationCall.setArguments( null ); // zero it out operationCall.setOutputCollector( null ); // zero it out try { aggregator.start( flowProcess, operationCall ); } catch( CascadingException exception ) { handleException( exception, groupEntry ); } catch( Throwable throwable ) { handleException( new OperatorException( every, "operator Every failed starting operation: " + every.getOperation(), throwable ), groupEntry ); } reducing.startGroup( this, groupEntry ); }
@Override public void receive( Duct previous, int ordinal, TupleEntry tupleEntry ) { try { argumentsEntry.setTuple( argumentsBuilder.makeResult( tupleEntry.getTuple(), null ) ); operationCall.setArguments( argumentsEntry ); groupAssertion.aggregate( flowProcess, operationCall ); } catch( CascadingException exception ) { handleException( exception, argumentsEntry ); } catch( Throwable throwable ) { handleException( new OperatorException( every, "operator Every failed executing operation: " + every.getOperation(), throwable ), argumentsEntry ); } next.receive( this, 0, tupleEntry ); }
@Override public void receive( Duct previous, int ordinal, TupleEntry tupleEntry ) { try { argumentsEntry.setTuple( argumentsBuilder.makeResult( tupleEntry.getTuple(), null ) ); operationCall.setArguments( argumentsEntry ); aggregator.aggregate( flowProcess, operationCall ); } catch( CascadingException exception ) { handleException( exception, argumentsEntry ); } catch( Throwable throwable ) { handleException( new OperatorException( every, "operator Every failed executing operation: " + every.getOperation(), throwable ), argumentsEntry ); } next.receive( this, ordinal, tupleEntry ); }
@Override public void receive( Duct previous, int ordinal, final Grouping<TupleEntry, TupleEntryIterator> grouping ) { try { // we want to null out any 'values' before and after the iterator begins/ends // this allows buffers to emit tuples before next() and when hasNext() return false; final TupleEntry tupleEntry = grouping.joinIterator.getTupleEntry(); incomingEntry = tupleEntry; // if Fields.NONE are declared on the CoGroup, we don't provide arguments, only the joinerClosure if( !tupleEntry.getFields().isNone() ) { final Tuple valueNulledTuple = Tuples.setOnEmpty( tupleEntry, grouping.key ); tupleEntry.setTuple( valueNulledTuple ); operationCall.setArgumentsIterator( createArgumentsIterator( grouping, tupleEntry, valueNulledTuple ) ); } operationCall.setOutputCollector( outputCollector ); operationCall.setJoinerClosure( grouping.joinerClosure ); operationCall.setGroup( grouping.key ); buffer.operate( flowProcess, operationCall ); } catch( CascadingException exception ) { handleException( exception, argumentsEntry ); } catch( Throwable throwable ) { handleException( new OperatorException( every, "operator Every failed executing operation: " + every.getOperation(), throwable ), argumentsEntry ); } }