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

E90870-01

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.

Author:
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.

Returns:
the aggregator that will be run in parallel

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

Parameters:
vCollResults the parallel aggregation results
Returns:
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.

Parameters:
vSetEntries a Set of read-only InvocableMap::Entry objects to aggregate
Returns:
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.

Parameters:
vColPartialResults the partial results
Returns:
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.
FinalView
< ValueExtractor
f_vExtractor
 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.

Classes

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.

Parameters:
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.

Parameters:
vIterValues the iterator of values to add
hResult the result

ObjectArray::Handle finalizeResult ( PartialResult::View  vResult  )  [protected]

Finalize the partial aggregation result.

Parameters:
result the partial result
Returns:
the final aggregation result


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