Search in sources :

Example 6 with TupleExt

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!");
        }
    }
}
Also used : TupleExt(backtype.storm.tuple.TupleExt) TupleImplExt(backtype.storm.tuple.TupleImplExt) Values(backtype.storm.tuple.Values) List(java.util.List)

Aggregations

TupleExt (backtype.storm.tuple.TupleExt)6 List (java.util.List)4 MessageId (backtype.storm.tuple.MessageId)3 TupleImplExt (backtype.storm.tuple.TupleImplExt)3 Pair (com.alibaba.jstorm.utils.Pair)3 Tuple (backtype.storm.tuple.Tuple)2 TimerTrigger (com.alibaba.jstorm.daemon.worker.timer.TimerTrigger)2 KryoTupleSerializer (backtype.storm.serialization.KryoTupleSerializer)1 IRichBatchBolt (backtype.storm.topology.IRichBatchBolt)1 ITupleExt (backtype.storm.tuple.ITupleExt)1 Values (backtype.storm.tuple.Values)1 IAckValueSpout (com.alibaba.jstorm.client.spout.IAckValueSpout)1 IOException (java.io.IOException)1