Package org.apache.storm.windowing
Class TimeTriggerPolicy<T>
java.lang.Object
org.apache.storm.windowing.TimeTriggerPolicy<T>
- All Implemented Interfaces:
TriggerPolicy<T,Void>
Invokes
TriggerHandler.onTrigger() after the duration.-
Constructor Summary
ConstructorsConstructorDescriptionTimeTriggerPolicy(long millis, TriggerHandler handler) TimeTriggerPolicy(long millis, TriggerHandler handler, EvictionPolicy<T, ?> evictionPolicy) -
Method Summary
Modifier and TypeMethodDescriptiongetState()Return runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.voidreset()resets the trigger policy.voidrestoreState(Void state) Restore the trigger policy from the state that was earlier checkpointed by the framework.voidshutdown()Any clean up could be handled here.voidstart()Starts the trigger policy.toString()voidTracks the event and could use this to invoke the trigger.
-
Constructor Details
-
TimeTriggerPolicy
-
TimeTriggerPolicy
-
-
Method Details
-
track
Description copied from interface:TriggerPolicyTracks the event and could use this to invoke the trigger.- Specified by:
trackin interfaceTriggerPolicy<T,Void> - Parameters:
event- the input event
-
reset
public void reset()Description copied from interface:TriggerPolicyresets the trigger policy.- Specified by:
resetin interfaceTriggerPolicy<T,Void>
-
start
public void start()Description copied from interface:TriggerPolicyStarts the trigger policy. This can be used during recovery to start the triggers after recovery is complete.- Specified by:
startin interfaceTriggerPolicy<T,Void>
-
shutdown
public void shutdown()Description copied from interface:TriggerPolicyAny clean up could be handled here.- Specified by:
shutdownin interfaceTriggerPolicy<T,Void>
-
toString
-
getState
Description copied from interface:TriggerPolicyReturn runtime state to be checkpointed by the framework for restoring the trigger policy in case of failures.- Specified by:
getStatein interfaceTriggerPolicy<T,Void> - Returns:
- the state
-
restoreState
Description copied from interface:TriggerPolicyRestore the trigger policy from the state that was earlier checkpointed by the framework.- Specified by:
restoreStatein interfaceTriggerPolicy<T,Void> - Parameters:
state- the state
-