Class PriorityAggregator<K,​V,​P,​R>

  • Type Parameters:
    K - the type of the Map entry keys
    V - the type of the Map entry values
    P - the type of the partial result
    R - the type of the final result
    All Implemented Interfaces:
    ExternalizableLite, PortableObject, PriorityTask, InvocableMap.EntryAggregator<K,​V,​R>, InvocableMap.StreamingAggregator<K,​V,​P,​R>, Serializable

    public class PriorityAggregator<K,​V,​P,​R>
    extends AbstractPriorityTask
    implements InvocableMap.StreamingAggregator<K,​V,​P,​R>, ExternalizableLite, PortableObject
    PriorityAggregator is used to explicitly control the scheduling priority and timeouts for execution of EntryAggregator-based methods.

    For example, let's assume that there is an Orders cache that belongs to a partitioned cache service configured with a request-timeout and task-timeout of 5 seconds. Also assume that we are willing to wait longer for a particular aggregation request that scans the entire cache. Then we could override the default timeout values by using the PriorityAggregator as follows:

       DoubleAverage      aggrStandard = new DoubleAverage("getPrice");
       PriorityAggregator aggrPriority = new PriorityAggregator(aggrStandard);
       aggrPriority.setExecutionTimeoutMillis(PriorityTask.TIMEOUT_NONE);
       aggrPriority.setRequestTimeoutMillis(PriorityTask.TIMEOUT_NONE);
       cacheOrders.aggregate((Filter) null, aggrPriority);
     

    This is an advanced feature which should be used judiciously.

    Since:
    Coherence 3.3
    Author:
    gg 2007.03.20
    See Also:
    Serialized Form