Class WatermarkCountTriggerPolicy<T>

java.lang.Object
org.apache.storm.windowing.WatermarkCountTriggerPolicy<T>
Type Parameters:
T - the type of event tracked by this policy.
All Implemented Interfaces:
TriggerPolicy<T,Long>

public class WatermarkCountTriggerPolicy<T> extends Object implements TriggerPolicy<T,Long>
A trigger policy that tracks event counts and sets the context for eviction policy to evict based on latest watermark time.
  • Constructor Details

  • Method Details

    • track

      public void track(Event<T> event)
      Description copied from interface: TriggerPolicy
      Tracks the event and could use this to invoke the trigger.
      Specified by:
      track in interface TriggerPolicy<T,Long>
      Parameters:
      event - the input event
    • reset

      public void reset()
      Description copied from interface: TriggerPolicy
      resets the trigger policy.
      Specified by:
      reset in interface TriggerPolicy<T,Long>
    • start

      public void start()
      Description copied from interface: TriggerPolicy
      Starts the trigger policy. This can be used during recovery to start the triggers after recovery is complete.
      Specified by:
      start in interface TriggerPolicy<T,Long>
    • shutdown

      public void shutdown()
      Description copied from interface: TriggerPolicy
      Any clean up could be handled here.
      Specified by:
      shutdown in interface TriggerPolicy<T,Long>
    • getState

      public Long getState()
      Description copied from interface: TriggerPolicy
      Return runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.
      Specified by:
      getState in interface TriggerPolicy<T,Long>
      Returns:
      the state
    • restoreState

      public void restoreState(Long state)
      Description copied from interface: TriggerPolicy
      Restore the trigger policy from the state that was earlier checkpointed by the framework.
      Specified by:
      restoreState in interface TriggerPolicy<T,Long>
      Parameters:
      state - the state
    • toString

      public String toString()
      Overrides:
      toString in class Object