return invokeAggregator( aggregator, null, argumentsArray, resultFields );
}
public static TupleListCollector invokeAggregator( Aggregator aggregator, TupleEntry group, TupleEntry[] argumentsArray, Fields resultFields )
{
ConcreteCall operationCall = new ConcreteCall( argumentsArray[ 0 ].getFields() );
operationCall.setGroup( group );
aggregator.prepare( FlowProcess.NULL, operationCall );
aggregator.start( FlowProcess.NULL, operationCall );
for( TupleEntry arguments : argumentsArray )
{
operationCall.setArguments( arguments );
aggregator.aggregate( FlowProcess.NULL, operationCall );
}
TupleListCollector collector = new TupleListCollector( resultFields, true );
operationCall.setOutputCollector( collector );
aggregator.complete( FlowProcess.NULL, operationCall );
aggregator.cleanup( null, operationCall );