Package org.apache.storm.windowing
Class WatermarkTimeTriggerPolicy<T>
java.lang.Object
org.apache.storm.windowing.WatermarkTimeTriggerPolicy<T>
- All Implemented Interfaces:
TriggerPolicy<T,
Long>
Handles watermark events and triggers
TriggerHandler.onTrigger()
for each window interval that has events to be processed up to
the watermark ts.-
Constructor Summary
ConstructorDescriptionWatermarkTimeTriggerPolicy
(long slidingIntervalMs, TriggerHandler handler, EvictionPolicy<T, ?> evictionPolicy, WindowManager<T> windowManager) -
Method Summary
Modifier and TypeMethodDescriptiongetState()
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.toString()
void
Tracks the event and could use this to invoke the trigger.
-
Constructor Details
-
WatermarkTimeTriggerPolicy
public WatermarkTimeTriggerPolicy(long slidingIntervalMs, TriggerHandler handler, EvictionPolicy<T, ?> evictionPolicy, WindowManager<T> windowManager)
-
-
Method Details
-
track
Description copied from interface:TriggerPolicy
Tracks the event and could use this to invoke the trigger.- Specified by:
track
in interfaceTriggerPolicy<T,
Long> - Parameters:
event
- the input event
-
reset
public void reset()Description copied from interface:TriggerPolicy
resets the trigger policy.- Specified by:
reset
in interfaceTriggerPolicy<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 interfaceTriggerPolicy<T,
Long>
-
shutdown
public void shutdown()Description copied from interface:TriggerPolicy
Any clean up could be handled here.- Specified by:
shutdown
in interfaceTriggerPolicy<T,
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 interfaceTriggerPolicy<T,
Long> - Returns:
- the state
-
restoreState
Description copied from interface:TriggerPolicy
Restore the trigger policy from the state that was earlier checkpointed by the framework.- Specified by:
restoreState
in interfaceTriggerPolicy<T,
Long> - Parameters:
state
- the state
-
toString
-