public void receive( Duct previous, int ordinal, Incoming incoming ) { next.receive( this, ordinal, (Outgoing) incoming ); } }
@Override public void completeGroup( Duct previous, Outgoing outgoing ) { next.receive( previous, 0, outgoing ); } }
public void receive( Duct previous, int ordinal, Incoming incoming ) { // override ordinal value next.receive( previous, this.ordinal, (Outgoing) incoming ); }
@Override public void receive( Duct previous, int ordinal, Incoming incoming ) { for( int i = 0; i < allNext.length; i++ ) allNext[ i ].receive( previous, i, incoming ); }
public final void receiveFirst( Incoming incoming ) { receive( null, 0, incoming ); }
public void passOn( Duct next ) { next.receive( previous, ordinal, tuple ); }
@Override public void receive( Duct previous, int ordinal, Grouping<Incoming, Iterator<Incoming>> grouping ) { while( grouping.joinIterator.hasNext() ) next.receive( previous, 0, (Outgoing) grouping.joinIterator.next() ); }
@Override public void receive( Duct previous, int ordinal, Grouping<Incoming, Iterator<Incoming>> grouping ) { // don't start a grouping if there are no values in the group if( !grouping.joinIterator.hasNext() ) return; reducing.startGroup( previous, grouping.key ); while( grouping.joinIterator.hasNext() ) next.receive( this, 0, (Outgoing) grouping.joinIterator.next() ); reducing.completeGroup( previous, grouping.key ); } }
@SuppressWarnings("unchecked") @Override public void run(Object input) throws Throwable { Tuple2<Tuple, Tuple[]> joinInputTuples; try { joinInputTuples = (Tuple2<Tuple, Tuple[]>)input; } catch(ClassCastException cce) { throw new RuntimeException("JoinBoundaryInStage expects Tuple2<Tuple, Tuple[]>", cce); } flowProcess.increment( StepCounters.Tuples_Read, 1 ); flowProcess.increment( SliceCounters.Tuples_Read, 1 ); next.receive(this, joinInputTuples); } }
private void performJoinWith( Tuple keyTuple ) { // never replace the first array, pos == 0 for( int i = 1; i < keyValues.length; i++ ) { // if key does not exist, #get will create an empty array list, // and store the key, which is not a copy if( keyValues[ i ].containsKey( keyTuple ) ) collections[ i ] = keyValues[ i ].get( keyTuple ); else collections[ i ] = Collections.EMPTY_LIST; } closure.reset( collections ); keyEntry.setTuple( keyTuple ); tupleEntryIterator.reset( splice.getJoiner().getIterator( closure ) ); next.receive( this, 0, grouping ); }
@Override public void run(Object input) { Iterator<Tuple2<Tuple, Tuple[]>> iterator; try { iterator = (Iterator<Tuple2<Tuple, Tuple[]>>) input; } catch(ClassCastException cce) { throw new RuntimeException("CoGroupInGate requires Iterator<Tuple2<Tuple, Tuple[]>", cce); } resultIterator.reset(iterator); resultIterator.hasNext(); // load first element into closure tupleEntryIterator.reset(resultIterator); keyEntry.setTuple( this.closure.getGroupTuple(null) ); next.receive( this, grouping ); }
@Override public void receive( Duct previous, int ordinal, Void value ) { next.start( this ); for( Outgoing item : values ) next.receive( this, 0, item ); next.complete( this ); } }
@Override public void receive(Duct previous, Tuple2<Tuple, Tuple[]> t) { closure.reset(t); entryIterator.reset(joiner.getIterator(closure)); while(entryIterator.hasNext()) { next.receive(this, entryIterator.next()); } }
@Override protected void collect( TupleEntry resultEntry ) throws IOException { Tuple outgoing = outgoingBuilder.makeResult( incomingEntry.getTuple(), resultEntry.getTuple() ); outgoingEntry.setTuple( outgoing ); try { next.receive( BufferEveryWindow.this, 0, outgoingEntry ); } finally { Tuples.asModifiable( outgoing ); } } };
private void push( Collection<Tuple>[] collections, Tuple keysTuple ) { closure.reset( collections ); keyEntry.setTuple( closure.getGroupTuple( keysTuple ) ); // create Closure type here tupleEntryIterator.reset( splice.getJoiner().getIterator( closure ) ); next.receive( this, 0, grouping ); } }
public void accept( Tuple key, Iterator<Tuple>[] values ) { key = unwrapGrouping( key ); closure.reset( key, values ); // Buffer is using JoinerClosure directly if( !isBufferJoin ) tupleEntryIterator.reset( splice.getJoiner().getIterator( closure ) ); else tupleEntryIterator.reset( values ); keyEntry.setTuple( closure.getGroupTuple( key ) ); next.receive( this, 0, grouping ); }
public void accept( Tuple key, Iterator<Tuple>[] values ) { key = unwrapGrouping( key ); closure.reset( key, values ); // Buffer is using JoinerClosure directly if( !isBufferJoin ) tupleEntryIterator.reset( splice.getJoiner().getIterator( closure ) ); else tupleEntryIterator.reset( values ); keyEntry.setTuple( closure.getGroupTuple( key ) ); next.receive( this, 0, grouping ); }
@Override protected void collect( TupleEntry input ) throws IOException { Tuple outgoing = outgoingBuilder.makeResult( incomingEntry.getTuple(), input.getTuple() ); outgoingEntry.setTuple( outgoing ); try { next.receive( FunctionEachStage.this, 0, outgoingEntry ); } finally { Tuples.asModifiable( input.getTuple() ); Tuples.asModifiable( outgoing ); } } } );
@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 ); }