public static class CountBy.CountPartials extends java.lang.Object implements AggregateBy.Functor
AggregateBy.Functor
that is used to count observed duplicates from the tuple stream.
Use this class typically in tandem with a Sum
Aggregator
in order to improve counting performance by removing as many values
as possible before the intermediate GroupBy
operator.CountBy
,
Serialized FormConstructor and Description |
---|
CountBy.CountPartials(Fields declaredFields)
Constructor CountPartials creates a new CountPartials instance.
|
CountBy.CountPartials(Fields declaredFields,
CountBy.Include include) |
Modifier and Type | Method and Description |
---|---|
Tuple |
aggregate(FlowProcess flowProcess,
TupleEntry args,
Tuple context)
Method aggregate operates on the given args in tandem (optionally) with the given context values.
|
Tuple |
complete(FlowProcess flowProcess,
Tuple context)
Method complete allows the final aggregate computation to be performed before the return value is collected.
|
Fields |
getDeclaredFields()
Method getDeclaredFields returns the declaredFields of this Functor object.
|
public CountBy.CountPartials(Fields declaredFields)
declaredFields
- of type Fieldspublic CountBy.CountPartials(Fields declaredFields, CountBy.Include include)
public Fields getDeclaredFields()
AggregateBy.Functor
getDeclaredFields
in interface AggregateBy.Functor
public Tuple aggregate(FlowProcess flowProcess, TupleEntry args, Tuple context)
AggregateBy.Functor
null
. All subsequent
invocations context will be the value returned on the previous invocation.aggregate
in interface AggregateBy.Functor
flowProcess
- of type FlowProcessargs
- of type TupleEntrycontext
- of type Tuple @return Tuplepublic Tuple complete(FlowProcess flowProcess, Tuple context)
AggregateBy.Functor
Tuple
instance must match the number of declaredFields.
It is safe to return the context object as the result value.complete
in interface AggregateBy.Functor
flowProcess
- of type FlowProcesscontext
- of type Tuple @return TupleCopyright © 2007-2015 Xplenty, Inc. All Rights Reserved.