Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
14c (14.1.1.0.0)

F23533-01

ReducerAggregator Class Reference

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

Inherits AbstractAggregator.

List of all members.


Detailed Description

The ReducerAggregator is used to implement functionality similar to CacheMap::getAll(Collection) API.

Instead of returning the complete set of values, it will return a portion of value attributes based on the provided ValueExtractor.

This aggregator could be used in combination with coherence.util.extractor.MultiExtractor allowing one to collect tuples that are a subset of the attributes of each object stored in the cache.

Author:
par 04.25.13

Public Types

typedef spec::Handle Handle
 ReducerAggregator Handle definition.
typedef spec::View View
 ReducerAggregator View definition.
typedef spec::Holder Holder
 ReducerAggregator Holder definition.

Protected Member Functions

 ReducerAggregator ()
 Default constructor.
 ReducerAggregator (ValueExtractor::View vExtractor)
 Construct a ReducerAggregator based on the specified extractor.
 ReducerAggregator (String::View vsMethod)
 Construct a ReducerAggregator based on the specified method name.
virtual void init (bool fFinal)
 Initialize the aggregation result.

This implementation throws an UnsupportedOperationException.

Parameters:
fFinal true is passed if the aggregation process that is being initialized must produce a final aggregation result; this will only be false if a parallel approach is being used and the initial (partial) aggregation process is being initialized

virtual void process (Object::View vO, bool fFinal)
 Incorporate one aggregatable value into the result.

If the fFinal parameter is true, the given object is a partial result (returned by an individual parallel aggregator) that should be incorporated into the final result; otherwise, the object is a value extracted from an coherence::util::InvocableMap::Entry.

This implementation throws an UnsupportedOperationException.

Parameters:
vO the value to incorporate into the aggregated result
fFinal true to indicate that the given object is a partial result returned by a parallel aggregator

virtual Object::Holder finalizeResult (bool fFinal)
 Obtain the result of the aggregation.

If the fFinal parameter is true, the returned object must be the final result of the aggregation; otherwise, the returned object will be treated as a partial result that should be incorporated into the final result.

This implementation throws an UnsupportedOperationException.

Parameters:
fFinal true to indicate that the final result of the aggregation process should be returned; this will only be false if a parallel approach is being used
Returns:
the result of the aggregation process

virtual Map::Handle ensureMap ()
 Return a map that can be used to store reduced values, creating it if one has not already been created.

Constructor & Destructor Documentation

ReducerAggregator ( ValueExtractor::View  vExtractor  )  [protected]

Construct a ReducerAggregator based on the specified extractor.

Parameters:
vExtractor the extractor that is used to extract the portion of the cached value

ReducerAggregator ( String::View  vsMethod  )  [protected]

Construct a ReducerAggregator based on the specified method name.

Parameters:
vsMethod the name of the method that is used to extract the portion of the cached value


Member Function Documentation

virtual Map::Handle ensureMap (  )  [protected, virtual]

Return a map that can be used to store reduced values, creating it if one has not already been created.

Returns:
a set that can be used to store distinct values


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