Class ReducerAggregator
The ReducerAggregator will return a portion of value attributes based on the provided ValueExtractor, instead of returning the complete set of values.
Inherited Members
Namespace: Tangosol.Util.Aggregator
Assembly: Coherence.dll
Syntax
public class ReducerAggregator : AbstractAggregator, IParallelAwareAggregator, IEntryAggregator, IPortableObject
Remarks
This aggregator could be used in combination with Tangosol.Util.Extractor.MultiExtractor allowing one to collect tuples that are a subset of the attributes of each object stored in the cache. MultiExtractor
Constructors
ReducerAggregator()
Default constructor.
Declaration
public ReducerAggregator()
ReducerAggregator(string)
Construct a ReducerAggregator based on the specified method name.
Declaration
public ReducerAggregator(string sMethod)
Parameters
Type | Name | Description |
---|---|---|
string | sMethod | The name of the method that is used to extract the portion of the cached value. |
ReducerAggregator(IValueExtractor)
Construct a ReducerAggregator based on the specified extractor.
Declaration
public ReducerAggregator(IValueExtractor extractor)
Parameters
Type | Name | Description |
---|---|---|
IValueExtractor | extractor | The extractor that is used to extract the portion of the cached value. |
Fields
m_map
The resulting map of reduced values.
Declaration
protected IDictionary m_map
Field Value
Type | Description |
---|---|
IDictionary |
Methods
EnsureMap()
Return a map that can be used to store reduced values, creating it if one has not already been created.
Declaration
protected IDictionary EnsureMap()
Returns
Type | Description |
---|---|
IDictionary | A set that can be used to store distinct values. |
FinalizeResult(bool)
Obtain the result of the aggregation.
Declaration
protected override object FinalizeResult(bool isFinal)
Parameters
Type | Name | Description |
---|---|---|
bool | isFinal | 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
Type | Description |
---|---|
object | The result of the aggregation process. |
Overrides
Remarks
If the isFinal
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.
Init(bool)
Initialize the aggregation result.
Declaration
protected override void Init(bool isFinal)
Parameters
Type | Name | Description |
---|---|---|
bool | isFinal | 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. |
Overrides
Process(object, bool)
Incorporate one aggregatable value into the result.
Declaration
protected override void Process(object o, bool isFinal)
Parameters
Type | Name | Description |
---|---|---|
object | o | The value to incorporate into the aggregated result. |
bool | isFinal | true to indicate that the given object is a partial result returned by a parallel aggregator. |
Overrides
Remarks
If the isFinal
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
IInvocableCacheEntry