Class Aggregator<S,​T>

  • Type Parameters:
    S - individual message
    T - aggregated message (i.e. bucket)
    All Implemented Interfaces:
    java.lang.AutoCloseable, java.lang.Runnable
    Direct Known Subclasses:
    SinkAggregator

    public class Aggregator<S,​T>
    extends java.lang.Object
    implements java.lang.AutoCloseable, java.lang.Runnable
    This aggregator is used to realize a given AggregationPolicy. This class is designed to delegate dispatching to the calling threads as much as possible (those which make calls to {@link #aggregate(Message).}
    Author:
    jwhite
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  Aggregator.Bucket  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T aggregate​(S message)
      Aggregates the given messages into a bucket and returns the bucket if it is ready to be dispatched.
      void close()  
      void run()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NUM_STRIPE_LOCKS_SYS_PROP

        public static final java.lang.String NUM_STRIPE_LOCKS_SYS_PROP
        System property used to override the default number of stripe locks.
        See Also:
        Constant Field Values
      • DEFAULT_NUM_STRIPE_LOCKS

        public static final int DEFAULT_NUM_STRIPE_LOCKS
        See Also:
        Constant Field Values
    • Method Detail

      • aggregate

        public T aggregate​(S message)
        Aggregates the given messages into a bucket and returns the bucket if it is ready to be dispatched.
        Parameters:
        message - the message to aggregated
        Returns:
        the bucket if it is ready to be dispatched, or null if nothing is ready to be dispatched
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception