NCache 4.6 - Online Documentation

How does Aggregator Work?

 
The NCache Aggregator has the following components:
 
ValueExtractor
This component extracts the meaningful attributes from the given object, similar to the Mapper in the MapReduce Framework.
 
Aggregator
The actual grouping and analytical operations take place here as in the Combiner and Reducer of MapReduce. The following operations are supported in the built-in Aggregator of NCache, the BuiltinAggregator:
 
Operation
Description
Supporting Data Types
Avg
Returns the average of the given data present in the cache. The data is returned cumulatively from all the nodes in the cluster.
Integer, Double, Float, BigInteger, Long, Short, Decimal
Sum
Returns the sum of the value of the item in the data set.
 
Min
Returns the least value of the item in the data set.
Integer, Double, Float, BigInteger, Long, Short, Decimal, String, DateTime
Max
Returns the maximum value of the item in the data set.
Integer, Double, Float, BigInteger, Long, Short, Decimal, String, DateTime
Count
Returns the total number of occurrences of the item in the data set.
-
Distinct
Returns the unique occurrence of the item in the data set.
-
 
  • If Aggregator’s MapReduce Task fails due to any exception, an Exception will be thrown about the task failure.
 
  • If the result returned after Aggregator execution is null, it will return the default value of the built-in Aggregator for that data type.
 
  • Apart from these built-in features, users can also provide their own aggregations such as Mean, Median or Mode. These are logical statistical functions and the user has the ability to make as many variants of aggregation suited to their needs.
 
  • The user can provide own data types as well such as custom objects as the Map Reducer takes value of type Object.
 
 
See Also