Class ReducerAggregator<K,V,T,E>

Type Parameters:
K - the type of the Map entry keys
V - the type of the Map entry values
T - the type of the value to extract from
E - the type of the extracted value
All Implemented Interfaces:
ExternalizableLite, PortableObject, InvocableMap.EntryAggregator<K,V,Map<K,E>>, InvocableMap.StreamingAggregator<K,V,Object,Map<K,E>>, Serializable, Cloneable

public class ReducerAggregator<K,V,T,E> extends AbstractAggregator<K,V,T,E,Map<K,E>>
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.

Author:
djl 2009.03.02
See Also:
  • Field Details

    • m_map

      protected transient Map<K,E> m_map
      The resulting map of reduced values.
  • Constructor Details

    • ReducerAggregator

      public ReducerAggregator()
      Default constructor (necessary for the ExternalizableLite interface).
    • ReducerAggregator

      public ReducerAggregator(String sMethod)
      Construct a ReducerAggregator based on the specified method name.
      Parameters:
      sMethod - the name of the method that is used to extract the portion of the cached value
    • ReducerAggregator

      public ReducerAggregator(ValueExtractor<? super T,? extends E> extractor)
      Construct a ReducerAggregator based on the specified extractor.
      Parameters:
      extractor - the extractor that is used to extract the portion of the cached value
  • Method Details