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 and Description |
---|
WatermarkCountTriggerPolicy(int count,
TriggerHandler handler,
EvictionPolicy<T,?> evictionPolicy,
WindowManager<T> windowManager) |
Modifier and Type | Method and Description |
---|---|
Long |
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(Long 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.
|
String |
toString() |
void |
track(Event<T> event)
Tracks the event and could use this to invoke the trigger.
|
public WatermarkCountTriggerPolicy(int count, TriggerHandler handler, EvictionPolicy<T,?> evictionPolicy, WindowManager<T> windowManager)
public void track(Event<T> event)
TriggerPolicy
Tracks the event and could use this to invoke the trigger.
track
in interface TriggerPolicy<T,Long>
event
- the input eventpublic void reset()
TriggerPolicy
resets the trigger policy.
reset
in interface TriggerPolicy<T,Long>
public void start()
TriggerPolicy
Starts the trigger policy. This can be used during recovery to start the triggers after recovery is complete.
start
in interface TriggerPolicy<T,Long>
public void shutdown()
TriggerPolicy
Any clean up could be handled here.
shutdown
in interface TriggerPolicy<T,Long>
public Long getState()
TriggerPolicy
Return runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.
getState
in interface TriggerPolicy<T,Long>
public void restoreState(Long state)
TriggerPolicy
Restore the trigger policy from the state that was earlier checkpointed by the framework.
restoreState
in interface TriggerPolicy<T,Long>
state
- the stateCopyright © 2020 The Apache Software Foundation. All rights reserved.