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

    • Field Detail

      • m_eReason

        protected volatile Throwable m_eReason
        Reason for the failed operation.
    • Constructor Detail

      • AsynchronousAggregator

        public AsynchronousAggregator​(InvocableMap.StreamingAggregator<K,​V,​P,​R> aggregator)
        Construct an AsynchronousAggregator for a given streaming aggregator.
        Parameters:
        aggregator - the underlying streaming aggregator
      • AsynchronousAggregator

        public AsynchronousAggregator​(InvocableMap.StreamingAggregator<K,​V,​P,​R> aggregator,
                                      int iUnitOrderId)
        Construct an AsynchronousAggregator for a given streaming aggregator.
        Parameters:
        aggregator - the underlying streaming aggregator
        iUnitOrderId - the unit-of-order id for this aggregator
    • Method Detail

      • onException

        public void onException​(Throwable eReason)
        Called if the operation failed for any reason.

        Note: Overriding implementations of this method must be non-blocking.

        Specified by:
        onException in class AbstractAsynchronousAggregator<K,​V,​P,​R>
        Parameters:
        eReason - the reason of failure
      • onComplete

        public void onComplete()
        Description copied from class: AbstractAsynchronousAggregator
        Called after this asynchronous aggregator has been notified about all possible partial results or failures and no more are forthcoming.

        As long as this aggregator was submitted to any of InvocableMap's methods, this method is guaranteed to be called once and only once.

        Possible call back sequences are:

          cache.aggregate
            ...
            onResult
            onComplete
        
          cache.aggregate
            ...
            onException
            onComplete
        
          cache.aggregate
            ...
             onResult
             onException
             onException
             onResult
             onComplete
         
        For ordering guarantees across processors see AbstractAsynchronousAggregator.getUnitOfOrderId().

        Note:

        Overriding implementations of this method must be non-blocking.

        If the StreamingAggregator signaled to short-circuit the aggregation while combining partial results, onComplete() could be called before all the results are received.

        Specified by:
        onComplete in class AbstractAsynchronousAggregator<K,​V,​P,​R>