public abstract class ExtremaValueBase extends BaseOperation<ExtremaValueBase.Context> implements Aggregator<ExtremaValueBase.Context>
Comparable
types and the Comparable.compareTo(Object)
result is use for max/min
comparison.Modifier and Type | Class and Description |
---|---|
protected static class |
ExtremaValueBase.Context |
Modifier and Type | Field and Description |
---|---|
protected Collection |
ignoreValues
Field ignoreValues
|
fieldDeclaration, numArgs, trace
Modifier | Constructor and Description |
---|---|
|
ExtremaValueBase(Fields fieldDeclaration) |
protected |
ExtremaValueBase(Fields fieldDeclaration,
Object... ignoreValues) |
|
ExtremaValueBase(int numArgs,
Fields fieldDeclaration) |
Modifier and Type | Method and Description |
---|---|
void |
aggregate(FlowProcess flowProcess,
AggregatorCall<ExtremaValueBase.Context> aggregatorCall)
Method aggregate is called for each
TupleEntry value in the current grouping. |
protected abstract boolean |
compare(Comparable lhs,
Comparable rhs)
Allows subclasses to provide own comparison method.
|
void |
complete(FlowProcess flowProcess,
AggregatorCall<ExtremaValueBase.Context> aggregatorCall)
Method complete will be issued last after every
TupleEntry has been passed to the
Aggregator.aggregate(cascading.flow.FlowProcess, AggregatorCall)
method. |
boolean |
equals(Object object) |
Collection |
getIgnoreValues() |
protected Tuple |
getResult(AggregatorCall<ExtremaValueBase.Context> aggregatorCall) |
int |
hashCode() |
void |
prepare(FlowProcess flowProcess,
OperationCall<ExtremaValueBase.Context> operationCall)
Method prepare does nothing, and may safely be overridden.
|
void |
start(FlowProcess flowProcess,
AggregatorCall<ExtremaValueBase.Context> aggregatorCall)
Method start initializes the aggregation procedure and is called for every unique grouping.
|
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe
protected final Collection ignoreValues
@ConstructorProperties(value="fieldDeclaration") public ExtremaValueBase(Fields fieldDeclaration)
@ConstructorProperties(value={"numArgs","fieldDeclaration"}) public ExtremaValueBase(int numArgs, Fields fieldDeclaration)
@ConstructorProperties(value={"fieldDeclaration","ignoreValues"}) protected ExtremaValueBase(Fields fieldDeclaration, Object... ignoreValues)
public Collection getIgnoreValues()
public void prepare(FlowProcess flowProcess, OperationCall<ExtremaValueBase.Context> operationCall)
BaseOperation
prepare
in interface Operation<ExtremaValueBase.Context>
prepare
in class BaseOperation<ExtremaValueBase.Context>
public void start(FlowProcess flowProcess, AggregatorCall<ExtremaValueBase.Context> aggregatorCall)
Aggregator
Aggregator.aggregate(cascading.flow.FlowProcess, AggregatorCall)
call,
new HashMap() should be set on the AggregatorCall instance when OperationCall.getContext()
is null.
On the next grouping, start() will be called again, but this time with the old Map instance. In this case,
map.clear() should be invoked before returning.start
in interface Aggregator<ExtremaValueBase.Context>
flowProcess
- of type FlowProcessaggregatorCall
- of type AggregatorCallpublic void aggregate(FlowProcess flowProcess, AggregatorCall<ExtremaValueBase.Context> aggregatorCall)
Aggregator
TupleEntry
value in the current grouping.
TupleEntry entry, or entry.getTuple() should not be stored directly in the context. A copy of the tuple
should be made via the new Tuple( entry.getTuple() )
copy constructor.aggregate
in interface Aggregator<ExtremaValueBase.Context>
flowProcess
- of type FlowProcessaggregatorCall
- of type AggregatorCallprotected abstract boolean compare(Comparable lhs, Comparable rhs)
lhs
- Comparable typerhs
- Comparable typepublic void complete(FlowProcess flowProcess, AggregatorCall<ExtremaValueBase.Context> aggregatorCall)
Aggregator
TupleEntry
has been passed to the
Aggregator.aggregate(cascading.flow.FlowProcess, AggregatorCall)
method. Any final calculation should be completed here and passed to the outputCollector.complete
in interface Aggregator<ExtremaValueBase.Context>
flowProcess
- of type FlowProcessaggregatorCall
- of type AggregatorCallprotected Tuple getResult(AggregatorCall<ExtremaValueBase.Context> aggregatorCall)
public boolean equals(Object object)
equals
in class BaseOperation<ExtremaValueBase.Context>
public int hashCode()
hashCode
in class BaseOperation<ExtremaValueBase.Context>
Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.