Package org.apache.heron.api.windowing
Interface TriggerPolicy<T extends Serializable,S>
-
- Type Parameters:
T- the type of the event that is trackedS- the type of state that is used
- All Known Implementing Classes:
AbstractBaseTriggerPolicy,CountTriggerPolicy,TimeTriggerPolicy,WatermarkCountTriggerPolicy,WatermarkTimeTriggerPolicy
public interface TriggerPolicy<T extends Serializable,S>Triggers the window calculations based on the policy.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SgetState()Return runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.voidreset()resets the trigger policy.voidrestoreState(S state)Restore the trigger policy from the state that was earlier checkpointed by the framework.voidsetEvictionPolicy(EvictionPolicy<T,?> evictionPolicy)Set the eviction policy to whatever eviction policy to use this withvoidsetTopologyConfig(Map<String,Object> config)Sets the Config used for this topologyvoidsetTriggerHandler(TriggerHandler triggerHandler)Set the trigger handler for this trigger policy to triggervoidsetWindowManager(WindowManager<T> windowManager)Sets the window manager that uses this trigger policyvoidshutdown()Any clean up could be handled here.voidstart()Starts the trigger policy.voidtrack(Event<T> event)Tracks the event and could use this to invoke the trigger.
-
-
-
Method Detail
-
track
void track(Event<T> event)
Tracks the event and could use this to invoke the trigger.- Parameters:
event- the input event
-
reset
void reset()
resets the trigger policy.
-
start
void start()
Starts the trigger policy. This can be used during recovery to start the triggers after recovery is complete.
-
shutdown
void shutdown()
Any clean up could be handled here.
-
getState
S getState()
Return runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.- Returns:
- the state
-
restoreState
void restoreState(S state)
Restore the trigger policy from the state that was earlier checkpointed by the framework.- Parameters:
state- the state
-
setEvictionPolicy
void setEvictionPolicy(EvictionPolicy<T,?> evictionPolicy)
Set the eviction policy to whatever eviction policy to use this with- Parameters:
evictionPolicy- the eviction policy
-
setTriggerHandler
void setTriggerHandler(TriggerHandler triggerHandler)
Set the trigger handler for this trigger policy to trigger- Parameters:
triggerHandler- the trigger handler
-
setWindowManager
void setWindowManager(WindowManager<T> windowManager)
Sets the window manager that uses this trigger policy- Parameters:
windowManager- the window manager
-
-