Class WatermarkCountTriggerPolicy<T extends Serializable>
- java.lang.Object
-
- org.apache.heron.api.windowing.triggers.AbstractBaseTriggerPolicy<T,Long>
-
- org.apache.heron.api.windowing.triggers.WatermarkCountTriggerPolicy<T>
-
- Type Parameters:
T- the type of event tracked by this policy.
- All Implemented Interfaces:
TriggerPolicy<T,Long>
public class WatermarkCountTriggerPolicy<T extends Serializable> extends AbstractBaseTriggerPolicy<T,Long>
A trigger policy that tracks event counts and sets the context for eviction policy to evict based on latest watermark time.
-
-
Field Summary
-
Fields inherited from class org.apache.heron.api.windowing.triggers.AbstractBaseTriggerPolicy
evictionPolicy, handler, started, topoConf, windowManager
-
-
Constructor Summary
Constructors Constructor Description WatermarkCountTriggerPolicy(int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LonggetState()Return runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.voidreset()resets the trigger policy.voidrestoreState(Long state)Restore the trigger policy from the state that was earlier checkpointed by the framework.voidshutdown()Any clean up could be handled here.StringtoString()voidtrack(Event<T> event)Tracks the event and could use this to invoke the trigger.-
Methods inherited from class org.apache.heron.api.windowing.triggers.AbstractBaseTriggerPolicy
setEvictionPolicy, setTopologyConfig, setTriggerHandler, setWindowManager, start
-
-
-
-
Method Detail
-
track
public void track(Event<T> event)
Description copied from interface:TriggerPolicyTracks the event and could use this to invoke the trigger.- Parameters:
event- the input event
-
reset
public void reset()
Description copied from interface:TriggerPolicyresets the trigger policy.
-
shutdown
public void shutdown()
Description copied from interface:TriggerPolicyAny clean up could be handled here.
-
getState
public Long getState()
Description copied from interface:TriggerPolicyReturn runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.- Returns:
- the state
-
restoreState
public void restoreState(Long state)
Description copied from interface:TriggerPolicyRestore the trigger policy from the state that was earlier checkpointed by the framework.- Parameters:
state- the state
-
-