Package com.alibaba.jstorm.task.comm

Examples of com.alibaba.jstorm.task.comm.TupleInfo


  public void expire(K key, V val) {
    if (val == null) {
      return;
    }
    try {
      TupleInfo tupleInfo = (TupleInfo) val;
      FailSpoutMsg fail = new FailSpoutMsg(key, spout, (TupleInfo) tupleInfo,
          task_stats, isDebug);

      disruptorEventQueue.publish(fail);
    } catch (Exception e) {
View Full Code Here


            LOG.info("Pending map no entry:" + id );
          }
          return;
        }

        TupleInfo tupleInfo = (TupleInfo) obj;

        String stream_id = tuple.getSourceStreamId();

        if (stream_id.equals(Acker.ACKER_ACK_STREAM_ID)) {

          runnable = new AckSpoutMsg(spout, tupleInfo, task_stats,
              isDebug);
        } else if (stream_id.equals(Acker.ACKER_FAIL_STREAM_ID)) {
          runnable = new FailSpoutMsg(id, spout, tupleInfo, task_stats,
              isDebug);
        } else {
          LOG.warn("Receive one unknow source Tuple " + idStr);
          return;
        }

        task_stats.recv_tuple(tuple.getSourceComponent(),
            tuple.getSourceStreamId());

      } else if (event instanceof TimeTick.Tick) {

        Map<Long, TupleInfo> timeoutMap = pending.rotate();
        for (java.util.Map.Entry<Long, TupleInfo> entry : timeoutMap
            .entrySet()) {
          TupleInfo tupleInfo = entry.getValue();
          FailSpoutMsg fail = new FailSpoutMsg(entry.getKey(), spout,
              (TupleInfo) tupleInfo, task_stats, isDebug);
          fail.run();
        }
        return;
View Full Code Here

      }

      if (needAck) {

        TupleInfo info = new TupleInfo();
        info.setStream(out_stream_id);
        info.setValues(values);
        info.setMessageId(message_id);
        info.setTimestamp(System.currentTimeMillis());

        pending.putHead(root_id, info);

        List<Object> ackerTuple = JStormUtils.mk_list((Object) root_id,
            JStormUtils.bit_xor_vals(ackSeq), task_id);

        UnanchoredSend.send(topology_context, sendTargets, transfer_fn,
            Acker.ACKER_INIT_STREAM_ID, ackerTuple);

      } else if (message_id != null) {
        TupleInfo info = new TupleInfo();
        info.setStream(out_stream_id);
        info.setValues(values);
        info.setMessageId(message_id);
        info.setTimestamp(0);

        AckSpoutMsg ack = new AckSpoutMsg(spout, info, task_stats,
            isDebug);
        ack.run();
View Full Code Here

TOP

Related Classes of com.alibaba.jstorm.task.comm.TupleInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.