#include <coherence/util/aggregator/TopNAggregator.hpp>
Inherits Object, PortableObject, InvocableMap::ParallelAwareAggregator, and InvocableMap::ParallelAwareAggregator::PartialResultAggregator.
The extracted values must not be null, but do not need to be unique.
Public Types | ||||
typedef spec::Handle | Handle | |||
TopNAggregator Handle definition. | ||||
typedef spec::View | View | |||
TopNAggregator View definition. | ||||
typedef spec::Holder | Holder | |||
TopNAggregator Holder definition. | ||||
Public Member Functions | ||||
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.
| ||||
Object::Holder | aggregateResults (Collection::View vColResults) | |||
Aggregate the results of the parallel aggregations.
| ||||
Object::Holder | aggregate (Set::View vSetEntries) | |||
Process a set of InvocableMap::Entry objects in order to produce an aggregated result.
| ||||
Object::Holder | aggregatePartialResults (Collection::View vColPartialResults) | |||
Aggregate the results of the parallel aggregations, producing a partial result logically representing the partial aggregation. The returned partial result will be further aggregated to produce the final result.
| ||||
virtual void | readExternal (PofReader::Handle hIn) | |||
virtual void | writeExternal (PofWriter::Handle hOut) const | |||
Public Attributes | ||||
bool | m_fParallel | |||
True iff this aggregator is to be used in parallel. | ||||
FinalView < ValueExtractor > | f_vExtractor | |||
The ValueExtractor used by this aggregator. | ||||
FinalView< Comparator > | f_vComparator | |||
The Comparator used to order the extracted values. | ||||
int32_t | m_cResults | |||
The maximum number of results to include in the aggregation result. | ||||
Protected Member Functions | ||||
TopNAggregator (ValueExtractor::View vExtractor, Comparator::View vComparator, int32_t cResults) | ||||
Construct a TopNAggregator that will aggregate the top extracted values, as determined by the specified comparator. | ||||
void | addToResult (Iterator::Handle hIterValues, PartialResult::Handle hResult) | |||
Add the specified values to the result if they are within the top-N. | ||||
ObjectArray::Handle | finalizeResult (PartialResult::View vResult) | |||
Finalize the partial aggregation result. | ||||
Classes | ||||
class | PartialResult | |||
The sorted partial result. More... |
TopNAggregator | ( | ValueExtractor::View | vExtractor, | |
Comparator::View | vComparator, | |||
int32_t | cResults | |||
) | [protected] |
Construct a TopNAggregator that will aggregate the top extracted values, as determined by the specified comparator.
vExtractor | the extractor | |
vComparator | the comparator for extracted values | |
cResults | the maximum number of results to return |
void addToResult | ( | Iterator::Handle | hIterValues, | |
PartialResult::Handle | hResult | |||
) | [protected] |
Add the specified values to the result if they are within the top-N.
vIterValues | the iterator of values to add | |
hResult | the result |
ObjectArray::Handle finalizeResult | ( | PartialResult::View | vResult | ) | [protected] |
Finalize the partial aggregation result.
result | the partial result |