Oracle Coherence for C++ API
Release 3.6.1.0
E18813-01

- Main Page
- Namespaces
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ParallelGroupAggregator Class Reference

`#include <coherence/util/aggregator/ParallelGroupAggregator.hpp>`

Inherits GroupAggregator, and InvocableMap::ParallelAwareAggregator.

List of all members.

## Detailed Description

The ParallelGroupAggregator provides an ability to split a subset of entries in an InvocableMap 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 ValueExtractor in such a way that two entries will belong to the same group if and only if the result of the corresponding ValueExtractor::extract 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 the GroupAggregator 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" and "having" clauses. Note that the "having" 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, the "group by" predicate should not span multiple partitions if the "having" clause is used.

The ParallelGroupAggregator is somewhat similar to the DistinctValues aggregator, which returns back a list of distinct values (tuples) without performing any additional aggregation work.

Unlike many other concrete EntryAggregator implementations that are constructed directly, instances of ParallelGroupAggregator should only be created indirectly by using the factory method of GroupAggregator.

Author:
  djl 2008.05.16

## Public Types
typedef spec::Handle | Handle
| ParallelGroupAggregator Handle definition.
typedef spec::View | View
| ParallelGroupAggregator View definition.
typedef spec::Holder | Holder
| ParallelGroupAggregator Holder definition.
## Public Member Functions
virtual InvocableMap::EntryAggregator::Handle | getParallelAggregator ()
| Get an aggregator that can take the place of this aggregator in situations in which the InvocableMap can aggregate in parallel. Returns: the aggregator that will be run in parallel
virtual Object::Holder | aggregateResults (Collection::View vCollResults)
  | Aggregate the results of the parallel aggregations. Parameters:
  | vCollResults | the parallel aggregation results
Returns: the aggregation of the parallel aggregation results
## Protected Member Functions
| ParallelGroupAggregator ()
| Default constructor (necessary for the PortableObject interface).
| ParallelGroupAggregator (ValueExtractor::View vExtractor, InvocableMap::ParallelAwareAggregator::Handle hAggregator, Filter::View vFilter)
| Create an instance of GroupAggregator based on a specified extractor and anInvocableMap::EntryAggregator and a result evaluation filter.

## Constructor & Destructor Documentation

ParallelGroupAggregator | ( | ValueExtractor::View | vExtractor,
|  | InvocableMap::ParallelAwareAggregator::Handle | hAggregator,
|  | Filter::View | vFilter |
| ) |  |  | `[protected]`

Create an instance of GroupAggregator based on a specified extractor and anInvocableMap::EntryAggregator and a result evaluation filter.

If the specified aggregator is an instance of coherence::util::InvocableMap::ParallelAwareAggregator, then a parallel-aware instance of the GroupAggregator will be created. Otherwise, the resulting GroupAggregator will not be parallel-aware and could be ill-suited for aggregations run against large partitioned caches.

Parameters:

  | vExtractor | a ValueExtractor that will be used to split a set of InvocableMap entries into distinct groups
  | hAggregator | an underlying EntryAggregator
  | vFilter | an optional Filter object used to filter out results of individual group aggregation results

The documentation for this class was generated from the following file:

- coherence/util/aggregator/ParallelGroupAggregator.hpp

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.