Aggregators Class
Namespace: Hazelcast.Aggregation
Assembly: Hazelcast.Net.dll
Creates IAggregator<TResult> instances.
public static class Aggregators
Inherited Members
Remarks
Min/Max/Average aggregators are type specific, so an IntegerAvg() aggregator expects all elements to be integers.
There is no conversion executed while accumulating, so if there is any other type met an exception will be thrown.
In order to operate on a generic Number type use the FixedPointSum(string),
FloatingPointSum(string) and NumberAvg(string) aggregators.
All of them will convert the given number to either Long or Double during the accumulation phase.
It will result in a lot of allocations since each number has to be converted, but it enables the user
to operate on the whole family of numbers. It is especially useful if the numbers given to the aggregators
may not be of one type only.
The attributePath given in the factory method allows the aggregator to operate on the value extracted by navigating
to the given attributePath on each object that has been returned from a query.
The attribute path may be simple, e.g. "name", or nested "address.city".
If an aggregator does not accept null values pass a predicate to the aggregate call that will filter them out.
If the input value or the extracted value is a collection it won't be "unfolded" - so for example
count aggregation on "person.postalCodes" will return 1 for each input object and not the size of the collection.
In order to calculate the size of the collection use the [any] operator, e.g. "person.postalCodes[any]".
Methods
Name | Description |
---|---|
BigIntegerSum() | An aggregator that calculates the sum of the input values. Does NOT accept null input values. Accepts only BigInteger input values. |
BigIntegerSum(string) | an aggregator that calculates the sum of the input values extracted from the given attributePath. Does NOT accept null input values nor null extracted values. Accepts only BigInteger input values. |
Count() | Counts input values (accepts nulls). |
Count(string) | Counts input values (accepts nulls). |
DoubleAvg() | Averages double input values (does not accept nulls). |
DoubleAvg(string) | Averages double input values (does not accept nulls). |
DoubleSum() | an aggregator that calculates the sum of the input values. Does NOT accept null input values. Accepts only double input values. |
DoubleSum(string) | An aggregator that calculates the sum of the input values extracted from the given attributePath. Does NOT accept null input values nor null extracted values. Accepts only double input values. |
FixedPointSum() | an aggregator that calculates the sum of the input values. Does NOT accept null input values. Accepts float or double input values. |
FixedPointSum(string) | An aggregator that calculates the sum of the input values extracted from the given attributePath. Does NOT accept null input values nor null extracted values. Accepts float or double input values. |
FloatingPointSum() | an aggregator that calculates the sum of the input values. Does NOT accept null input values. Accepts float or double input values. |
FloatingPointSum(string) | An aggregator that calculates the sum of the input values extracted from the given attributePath. Does NOT accept null input values nor null extracted values. Accepts float or double input values. |
IntegerAvg() | an aggregator that calculates the average of the input values. Does NOT accept null input values. Accepts only int input values |
IntegerAvg(string) | an aggregator that calculates the average of the input values extracted from the given attributePath. Does NOT accept null input values nor null extracted values. Accepts only int input values |
IntegerSum() | an aggregator that calculates the sum of the input values. Does NOT accept null input values. Accepts only int input values. |
IntegerSum(string) | An aggregator that calculates the sum of the input values extracted from the given attributePath. Does NOT accept null input values nor null extracted values. Accepts only int input values. |
LongAvg() | an aggregator that calculates the average of the input values. Does NOT accept null input values. Accepts only long input values |
LongAvg(string) | an aggregator that calculates the average of the input values extracted from the given attributePath. Does NOT accept null input values nor null extracted values. Accepts only long input values |
LongSum() | an aggregator that calculates the sum of the input values. Does NOT accept null input values. Accepts only long input values. |
LongSum(string) | An aggregator that calculates the sum of the input values extracted from the given attributePath. Does NOT accept null input values nor null extracted values. Accepts only long input values. |
Max<TResult>() | an aggregator that calculates the max of the input values. Accepts null input values |
Max<TResult>(string) | an aggregator that calculates the max of the input values extracted from the given attributePath. Accepts null input values and null extracted values. |
Min<TResult>() | an aggregator that calculates the min of the input values. Accepts null input values |
Min<TResult>(string) | an aggregator that calculates the min of the input values extracted from the given attributePath. Accepts null input values and null extracted values. |
NumberAvg() | an aggregator that calculates the average of the input values. Does NOT accept null input values. Accepts float or double input values. |
NumberAvg(string) | an aggregator that calculates the average of the input values. Does NOT accept null input values nor null extracted values. Accepts float or double input values. |