Ticktuple can meet every time a tuple is sent, "__system" component periodically sends a tuple of "__tick" stream to the task,
The sending frequency is configured by Topology_tick_tuple_freq_secs and can be configured in the Default.ymal,
It can also be configured in the code via Getcomponentconfiguration ().
The code is configured as follows
Public map<string, Object> getcomponentconfiguration () {
map<string, object> conf = new hashmap<string, object> ();
Conf.put (Config.topology_tick_tuple_freq_secs, 1); Interval 1s
return conf;
}
public static Boolean isticktuple (tuple tuple) {
Return Tuple.getsourcecomponent (). Equals (constants.system_component_id)//system_component_id = = "__system"
&& tuple.getsourcestreamid (). Equals (constants.system_tick_stream_id); system_tick_stream_id = = "__tick"
}
When the configuration is complete, storm will periodically send ticktuple to the task
The function of timing trigger can be completed only by Isticktuple to determine whether it is ticktuple.
Public final void execute (tuple tuple, basicoutputcollector basicoutputcollector) {
if (!isticktuple (tuple)) {}
}
Storm sends a tuple every time