Class TimeTriggerPolicy<T>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Void getState()
      Return runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.
      void reset()
      resets the trigger policy.
      void restoreState​(java.lang.Void state)
      Restore the trigger policy from the state that was earlier checkpointed by the framework.
      void shutdown()
      Any clean up could be handled here.
      void start()
      Starts the trigger policy.
      java.lang.String toString()  
      void track​(Event<T> event)
      Tracks the event and could use this to invoke the trigger.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TimeTriggerPolicy

        public TimeTriggerPolicy​(long millis,
                                 TriggerHandler handler,
                                 EvictionPolicy<T,​?> evictionPolicy,
                                 org.apache.pulsar.functions.api.Context context)
    • Method Detail

      • 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,​java.lang.Void>
        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,​java.lang.Void>
      • 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,​java.lang.Void>
      • shutdown

        public void shutdown()
        Description copied from interface: TriggerPolicy
        Any clean up could be handled here.
        Specified by:
        shutdown in interface TriggerPolicy<T,​java.lang.Void>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getState

        public java.lang.Void 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,​java.lang.Void>
        Returns:
        the state
      • restoreState

        public void restoreState​(java.lang.Void 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,​java.lang.Void>
        Parameters:
        state - the state