Class ComparableMaxAggregator<K, V extends Comparable<? super V>>
java.lang.Object
com.loomcache.server.compute.ComparableMaxAggregator<K,V>
- Type Parameters:
K- the type of the keyV- the comparable value type
- All Implemented Interfaces:
Aggregator<K,V, V>
public class ComparableMaxAggregator<K, V extends Comparable<? super V>>
extends Object
implements Aggregator<K,V,V>
Built-in aggregator that returns the maximum value by natural ordering.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulate(Map.Entry<K, V> entry) Accumulate a single entry into this aggregator.@Nullable VGet the final aggregated result.Aggregator<K, V, V> combine(Aggregator<K, V, V> other) Combine this aggregator with another from a parallel execution.
-
Constructor Details
-
ComparableMaxAggregator
public ComparableMaxAggregator()Create a new comparable max aggregator.
-
-
Method Details
-
accumulate
Description copied from interface:AggregatorAccumulate a single entry into this aggregator.This method is called once for each entry in the map during the scan.
- Specified by:
accumulatein interfaceAggregator<K, V extends Comparable<? super V>, V extends Comparable<? super V>>- Parameters:
entry- the entry to accumulate (may be null if entry was deleted)
-
combine
Description copied from interface:AggregatorCombine this aggregator with another from a parallel execution.This method is used to merge results from multiple parallel aggregations into a single result. Implementations should combine the internal state of both aggregators.
- Specified by:
combinein interfaceAggregator<K, V extends Comparable<? super V>, V extends Comparable<? super V>>- Parameters:
other- the other aggregator to combine with (must not be null)- Returns:
- a new aggregator combining both results (may be this or other)
-
aggregate
Description copied from interface:AggregatorGet the final aggregated result.This is called after all entries have been accumulated and all partial results have been combined.
- Specified by:
aggregatein interfaceAggregator<K, V extends Comparable<? super V>, V extends Comparable<? super V>>- Returns:
- the aggregated result
-