Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (


TopNAggregator Class Reference

#include <coherence/util/aggregator/TopNAggregator.hpp>

Inherits Object, PortableObject, InvocableMap::ParallelAwareAggregator, and InvocableMap::ParallelAwareAggregator::PartialResultAggregator.

List of all members.

Detailed Description

TopNAggregator is a ParallelAwareAggregator that aggregates the top N extracted values into an array.

The extracted values must not be null, but do not need to be unique.

rhl 2013.04.24

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.

the aggregator that will be run in parallel

Object::Holder aggregateResults (Collection::View vColResults)
 Aggregate the results of the parallel aggregations.

vCollResults the parallel aggregation results
the aggregation of the parallel aggregation results

Object::Holder aggregate (Set::View vSetEntries)
 Process a set of InvocableMap::Entry objects in order to produce an aggregated result.

vSetEntries a Set of read-only InvocableMap::Entry objects to aggregate
the aggregated result from processing the entries

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.

vColPartialResults the partial results
an aggregation of the collection of partial results

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.
< ValueExtractor
 The ValueExtractor used by this aggregator.
FinalView< Comparatorf_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.


class  PartialResult
 The sorted partial result. More...

Constructor & Destructor Documentation

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

Member Function Documentation

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
the final aggregation result

The documentation for this class was generated from the following file:
Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.