コード例 #1
0
  @Override
  public void ack(Tuple input) {

    if (ackerNum > 0) {

      Long ack_val = Long.valueOf(0);
      Object pend_val = pending_acks.remove(input);
      if (pend_val != null) {
        ack_val = (Long) (pend_val);
      }

      for (Entry<Long, Long> e : input.getMessageId().getAnchorsToIds().entrySet()) {

        UnanchoredSend.send(
            topologyContext,
            sendTargets,
            taskTransfer,
            Acker.ACKER_ACK_STREAM_ID,
            JStormUtils.mk_list((Object) e.getKey(), JStormUtils.bit_xor(e.getValue(), ack_val)));
      }
    }

    Long delta = tuple_time_delta(tuple_start_times, input);
    if (delta != null) {
      task_stats.bolt_acked_tuple(input.getSourceComponent(), input.getSourceStreamId(), delta);
    }
  }
コード例 #2
0
 public static void put_xor(Map<Long, Long> pending, Long key, Long id) {
   // synchronized (pending) {
   Long curr = pending.get(key);
   if (curr == null) {
     curr = Long.valueOf(0);
   }
   pending.put(key, JStormUtils.bit_xor(curr, id));
   // }
 }