Package org.apache.storm.windowing
Class TimeTriggerPolicy<T>
- java.lang.Object
-
- org.apache.storm.windowing.TimeTriggerPolicy<T>
-
- All Implemented Interfaces:
TriggerPolicy<T,Void>
public class TimeTriggerPolicy<T> extends Object implements TriggerPolicy<T,Void>
InvokesTriggerHandler.onTrigger()
after the duration.
-
-
Constructor Summary
Constructors Constructor Description TimeTriggerPolicy(long millis, TriggerHandler handler)
TimeTriggerPolicy(long millis, TriggerHandler handler, EvictionPolicy<T,?> evictionPolicy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(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.String
toString()
void
track(Event<T> event)
Tracks the event and could use this to invoke the trigger.
-
-
-
Constructor Detail
-
TimeTriggerPolicy
public TimeTriggerPolicy(long millis, TriggerHandler handler)
-
TimeTriggerPolicy
public TimeTriggerPolicy(long millis, TriggerHandler handler, EvictionPolicy<T,?> evictionPolicy)
-
-
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 interfaceTriggerPolicy<T,Void>
- Parameters:
event
- the input event
-
reset
public void reset()
Description copied from interface:TriggerPolicy
resets the trigger policy.- Specified by:
reset
in interfaceTriggerPolicy<T,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 interfaceTriggerPolicy<T,Void>
-
shutdown
public void shutdown()
Description copied from interface:TriggerPolicy
Any clean up could be handled here.- Specified by:
shutdown
in interfaceTriggerPolicy<T,Void>
-
getState
public 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 interfaceTriggerPolicy<T,Void>
- Returns:
- the state
-
restoreState
public void restoreState(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 interfaceTriggerPolicy<T,Void>
- Parameters:
state
- the state
-
-