the type of the Map entry keys
the type of the Map entry values
key return type
the type of the group aggregator result
Construct a GroupAggregator
based on a specified ValueExtractor and
underlying EntryAggregator.
a ValueExtractor object that is used to split entries into non-intersecting
subsets; may not be null
. This parameter can also be a dot-delimited
sequence of method names which would result in an aggregator based on the
ChainedExtractor that is based on an array of corresponding
UniversalExtractor objects; may not be null
an EntryAggregator object; may not be null
Optional
filter: Filteran optional Filter object used to filter out results of individual group aggregation results
Protected
@classServer-side EntryAggregator implementation type identifier.
Protected
aggregatorThe underlying EntryAggregator.
Protected
Optional
extractorThe ValueExtractor to apply when aggregating results.
Protected
Optional
filterThe Filter object representing the having
clause of this group by
aggregator.
Returns a CompositeAggregator comprised of this and the provided aggregator.
a CompositeAggregator comprised of this and the provided aggregator
the next aggregator
The
GroupAggregator
provides an ability to split a subset of entries in a Map into a collection of non-intersecting subsets and then aggregate them separately and independently. The splitting (grouping) is performed using the results of the underlying UniversalExtractor in such a way that two entries will belong to the same group if and only if the result of the corresponding extract call produces the same value or tuple (list of values). After the entries are split into the groups, the underlying aggregator is applied separately to each group. The result of the aggregation by theGroupAggregator
is a Map that has distinct values (or tuples) as keys and results of the individual aggregation as values. Additionally, those results could be further reduced using an optional Filter object.Informally speaking, this aggregator is analogous to the SQL
group by
andhaving
clauses. Note that thehaving
Filter is applied independently on each server against the partial aggregation results; this generally implies that data affinity is required to ensure that all required data used to generate a given result exists within a single cache partition. In other words, thegroup by
predicate should not span multiple partitions if thehaving
clause is used.The
GroupAggregator
is somewhat similar to the DistinctValues aggregator, which returns back a list of distinct values (tuples) without performing any additional aggregation work.