Class AggregatorRegistry
- java.lang.Object
-
- com.tangosol.coherence.rest.util.aggregator.AggregatorRegistry
-
public class AggregatorRegistry extends Object
A registry forAggregatorFactory
instances.- Author:
- vp 2011.07.07
-
-
Field Summary
Fields Modifier and Type Field Description static String
AGGREGATOR_REQUEST_REGEX
Regex pattern that defines the aggregator request syntax.
-
Constructor Summary
Constructors Constructor Description AggregatorRegistry()
Construct an AggregatorRegistry.AggregatorRegistry(Collection<AggregatorConfig> colConfig)
Construct an AggregatorRegistry that includes built-in aggregators in addition to the specified aggregators.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvocableMap.EntryAggregator
getAggregator(String sRequest)
Returns a configured aggregator.void
register(String sName, AggregatorFactory factory)
Register an aggregator factory with the given name.void
register(String sName, Class clz)
Register an aggregator or aggregator factory with the given name.void
register(Collection<AggregatorConfig> colConfig)
Register a collection of aggregators.
-
-
-
Field Detail
-
AGGREGATOR_REQUEST_REGEX
public static final String AGGREGATOR_REQUEST_REGEX
Regex pattern that defines the aggregator request syntax.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AggregatorRegistry
public AggregatorRegistry()
Construct an AggregatorRegistry.By default the following built-in aggregators will be registered:
- big-decimal-average
- big-decimal-max
- big-decimal-min
- big-decimal-sum
- comparable-max
- comparable-min
- count
- distinct-values
- double-average
- double-max
- double-min
- double-sum
- long-max
- long-min
- long-sum
-
AggregatorRegistry
public AggregatorRegistry(Collection<AggregatorConfig> colConfig)
Construct an AggregatorRegistry that includes built-in aggregators in addition to the specified aggregators.- Parameters:
colConfig
- aggregator configurations
-
-
Method Detail
-
getAggregator
public InvocableMap.EntryAggregator getAggregator(String sRequest)
Returns a configured aggregator.- Parameters:
sRequest
- the aggregator request- Returns:
- aggregator
-
register
public void register(String sName, AggregatorFactory factory)
Register an aggregator factory with the given name.- Parameters:
sName
- the aggregator namefactory
- the aggregator factory
-
register
public void register(String sName, Class clz)
Register an aggregator or aggregator factory with the given name.A
DefaultAggregatorFactory
will be used if theclz
parameter is a class that implements InvocableMap.EntryAggregator.- Parameters:
sName
- the aggregator nameclz
- the aggregator or aggregator factory class
-
register
public void register(Collection<AggregatorConfig> colConfig)
Register a collection of aggregators.- Parameters:
colConfig
- the aggregator configurations
-
-