backtype.storm.utils.Utils.get()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中backtype.storm.utils.Utils.get()方法的一些代码示例,展示了Utils.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.get()方法的具体详情如下:
包路径:backtype.storm.utils.Utils
类名称:Utils
方法名:get

Utils.get介绍

暂无

代码示例

代码示例来源:origin: alibaba/jstorm

public static int getNumAcked(String stormId) {
  synchronized (acked) {
    return get(acked, stormId, 0);
  }
}

代码示例来源:origin: alibaba/jstorm

public static int getNumFailed(String stormId) {
  synchronized (failed) {
    return get(failed, stormId, 0);
  }
}

代码示例来源:origin: alibaba/jstorm

public static int getNumFailed(String stormId) {
  synchronized (failed) {
    return get(failed, stormId, 0);
  }
}

代码示例来源:origin: alibaba/jstorm

public static int getNumAcked(String stormId) {
  synchronized (acked) {
    return get(acked, stormId, 0);
  }
}

代码示例来源:origin: alibaba/mdrill

public static int getNumAcked(String stormId) {
  synchronized(acked) {
    return get(acked, stormId, 0);
  }
}

代码示例来源:origin: alibaba/mdrill

public static int getNumFailed(String stormId) {
  synchronized(failed) {
    return get(failed, stormId, 0);
  }
}

代码示例来源:origin: alibaba/jstorm

public void fail(Object msgId) {
  synchronized (failed) {
    int curr = get(failed, _id, 0);
    failed.put(_id, curr + 1);
  }
}

代码示例来源:origin: alibaba/jstorm

public void ack(Object msgId) {
  synchronized (acked) {
    int curr = get(acked, uid, 0);
    acked.put(uid, curr + 1);
  }
}

代码示例来源:origin: alibaba/jstorm

private void updateTaskCounts(List<Integer> tasks) {
    synchronized (_currBatch) {
      if (_currBatch != null) {
        Map<Integer, Integer> taskEmittedTuples = _currBatch.taskEmittedTuples;
        for (Integer task : tasks) {
          int newCount = Utils.get(taskEmittedTuples, task, 0) + 1;
          taskEmittedTuples.put(task, newCount);
        }
      }
    }
  }
}

代码示例来源:origin: alibaba/jstorm

public void ack(Object msgId) {
  synchronized (acked) {
    int curr = get(acked, _id, 0);
    acked.put(_id, curr + 1);
  }
}

代码示例来源:origin: alibaba/jstorm

public void fail(Object msgId) {
  synchronized (failed) {
    int curr = get(failed, uid, 0);
    failed.put(uid, curr + 1);
  }
}

代码示例来源:origin: alibaba/mdrill

public void ack(Object msgId) {
  synchronized(acked) {
    int curr = get(acked, _id, 0);
    acked.put(_id, curr+1);
  }
}

代码示例来源:origin: alibaba/mdrill

public void fail(Object msgId) {
    synchronized(failed) {
      int curr = get(failed, _id, 0);
      failed.put(_id, curr+1);
    }
  }
}

代码示例来源:origin: alibaba/jstorm

@Override
public void execute(Tuple tuple) {
  Object key = tuple.getValue(1);
  int curr = Utils.get(_counts, key, 0);
  _counts.put(key, curr + 1);
}

代码示例来源:origin: alibaba/jstorm

private void updateTaskCounts(Object id, List<Integer> tasks) {
  synchronized (_tracked) {
    TrackingInfo track = _tracked.get(id);
    if (track != null) {
      Map<Integer, Integer> taskEmittedTuples = track.taskEmittedTuples;
      for (Integer task : tasks) {
        int newCount = get(taskEmittedTuples, task, 0) + 1;
        taskEmittedTuples.put(task, newCount);
      }
    }
  }
}

代码示例来源:origin: alibaba/mdrill

@Override
public void execute(Tuple tuple) {
  Object key = tuple.getValue(1);
  int curr = Utils.get(_counts, key, 0);
  _counts.put(key, curr + 1);
}

代码示例来源:origin: alibaba/mdrill

private void updateTaskCounts(Object id, List<Integer> tasks) {
    synchronized(_tracked) {
    TrackingInfo tinfo=_tracked.get(id);
    if(tinfo!=null)
    {
        Map<Integer, Integer> taskEmittedTuples = tinfo.taskEmittedTuples;
        for(Integer task: tasks) {
          int newCount = get(taskEmittedTuples, task, 0) + 1;
          taskEmittedTuples.put(task, newCount);
        }
    }
    }
  }
}

代码示例来源:origin: alibaba/mdrill

@Override
public void execute(Tuple tuple) {
  Object key = tuple.getValue(1);
  int curr = Utils.get(_sums, key, 0);
  _sums.put(key, curr + tuple.getInteger(2));
}

代码示例来源:origin: alibaba/jstorm

@Override
public void execute(Tuple tuple) {
  Object key = tuple.getValue(1);
  Number curr = Utils.get(_sums, key, 0);
  _sums.put(key, Numbers.add(curr, tuple.getValue(2)));
}

代码示例来源:origin: alibaba/jstorm

@Override
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
  _delegate.open(conf, context, new SpoutOutputCollector(new StreamOverrideCollector(collector)));
  _outputTasks = new ArrayList<>();
  for(String component: Utils.get(context.getThisTargets(),
                  _coordStream,
                  new HashMap<String, Grouping>()).keySet()) {
    _outputTasks.addAll(context.getComponentTasks(component));
  }
  _rand = new Random(Utils.secureRandomLong());
}

相关文章