|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.util.aggregator.AbstractAggregator
com.tangosol.util.aggregator.ReducerAggregator
public class ReducerAggregator
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 MultiExtractor
allowing one to collect tuples that are a subset of the attributes of each object stored in the cache.
Field Summary | |
---|---|
protected java.util.Map |
m_map The resulting map of reduced values. |
Fields inherited from class com.tangosol.util.aggregator.AbstractAggregator |
---|
m_fParallel |
Constructor Summary | |
---|---|
ReducerAggregator() Default constructor (necessary for the ExternalizableLite interface). |
|
ReducerAggregator(java.lang.String sMethod) Construct a ReducerAggregator based on the specified method name. |
|
ReducerAggregator(ValueExtractor extractor) Construct a ReducerAggregator based on the specified extractor. |
Method Summary | |
---|---|
protected java.util.Map |
ensureMap() Return a map that can be used to store reduced values, creating it if one has not already been created. |
protected java.lang.Object |
finalizeResult(boolean fFinal) Obtain the result of the aggregation. |
protected void |
init(boolean fFinal) Initialize the aggregation result. |
protected void |
process(java.lang.Object o, boolean fFinal) Incorporate one aggregatable value into the result. |
protected void |
processEntry(InvocableMap.Entry entry) Incorporate one aggregatable entry into the result. |
Methods inherited from class com.tangosol.util.aggregator.AbstractAggregator |
---|
aggregate, aggregateResults, equals, getParallelAggregator, getValueExtractor, hashCode, readExternal, readExternal, toString, writeExternal, writeExternal |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString |
Field Detail |
---|
protected transient java.util.Map m_map
Constructor Detail |
---|
public ReducerAggregator()
public ReducerAggregator(java.lang.String sMethod)
sMethod
- the name of the method that is used to extract the portion of the cached valuepublic ReducerAggregator(ValueExtractor extractor)
extractor
- the extractor that is used to extract the portion of the cached valueMethod Detail |
---|
protected void init(boolean fFinal)
init
in class AbstractAggregator
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 initializedprotected void processEntry(InvocableMap.Entry entry)
processEntry
in class AbstractAggregator
entry
- the entry to incorporate into the aggregation resultprotected void process(java.lang.Object o, boolean fFinal)
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 InvocableMap.Entry
.
process
in class AbstractAggregator
o
- the value to incorporate into the aggregated resultfFinal
- true to indicate that the given object is a partial result returned by a parallel aggregatorprotected java.lang.Object finalizeResult(boolean fFinal)
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.
finalizeResult
in class AbstractAggregator
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 usedprotected java.util.Map ensureMap()
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |