#include <coherence/util/aggregator/TopNAggregator.hpp>
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 () |
Object::Holder | aggregateResults (Collection::View vColResults) |
Object::Holder | aggregate (Set::View vSetEntries) |
Object::Holder | aggregatePartialResults (Collection::View vColPartialResults) |
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 |