use of backtype.storm.tuple.TupleExt in project jstorm by alibaba.
the class TaskHeartbeatTrigger method sendHbMsg.
//taskheartbeat send control message
public void sendHbMsg() {
if (componentId.equals(Common.TOPOLOGY_MASTER_COMPONENT_ID)) {
Values values = new Values(uptime.uptime(), executorStatus.getStatus());
TupleExt tuple = new TupleImplExt(sysTopologyCtx, values, taskId, Common.TOPOLOGY_MASTER_HB_STREAM_ID);
queue.publish(tuple);
} else {
// Send task heartbeat to topology master
List values = JStormUtils.mk_list(uptime.uptime(), executorStatus.getStatus());
if (spoutCollector != null) {
spoutCollector.emitCtrl(Common.TOPOLOGY_MASTER_HB_STREAM_ID, values, null);
} else if (boltCollector != null) {
boltCollector.emitCtrl(Common.TOPOLOGY_MASTER_HB_STREAM_ID, null, values);
} else {
LOG.warn("Failed to send hearbeat msg. OutputCollector has not been initialized!");
}
}
}
Aggregations