org.apache.storm.utils.Utils.isSystemId()方法的使用及代码示例

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

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

Utils.isSystemId介绍

暂无

代码示例

代码示例来源:origin: apache/storm

/**
 * getStreamBox.
 * @param visualization visualization
 * @return getStreamBox
 */
public static Map<String, Object> getStreamBox(Object visualization) {
  Map<String, Object> visualizationData = (Map<String, Object>) visualization;
  Map<String, Object> result = new HashMap();
  Map<String, Object> temp = (Map<String, Object>) visualizationData.get("inputs");
  result.put("stream", temp.get("stream"));
  result.put("sani-stream", temp.get("sani-stream"));
  result.put("checked", !Utils.isSystemId((String) temp.get("stream")));
  return result;
}

代码示例来源:origin: apache/storm

/**
 * filter system streams from stats.
 *
 * @param stream2stat { stream id -> value }
 * @param includeSys  whether to filter system streams
 * @return filtered stats
 */
private static <K, V> Map<K, V> filterSysStreams2Stat(Map<K, V> stream2stat, boolean includeSys) {
  LOG.trace("Filter Sys Streams2Stat {}", stream2stat);
  if (!includeSys) {
    for (Iterator itr = stream2stat.keySet().iterator(); itr.hasNext(); ) {
      Object key = itr.next();
      if (key instanceof String && Utils.isSystemId((String) key)) {
        itr.remove();
      }
    }
  }
  return stream2stat;
}

代码示例来源:origin: apache/storm

/**
 * Get the coponenet type for a give id.
 * @param topology the topology this is a part of.
 * @param compId the id of the component.
 * @return the type as a String "BOLT" or "SPOUT".
 */
public static String componentType(StormTopology topology, String compId) {
  if (compId == null) {
    return null;
  }
  Map<String, Bolt> bolts = topology.get_bolts();
  if (Utils.isSystemId(compId) || bolts.containsKey(compId)) {
    return ClientStatsUtil.BOLT;
  }
  return ClientStatsUtil.SPOUT;
}

代码示例来源:origin: apache/storm

/**
 * filter system streams from stats.
 *
 * @param stats      { win -> stream id -> value }
 * @param includeSys whether to filter system streams
 * @return filtered stats
 */
private static <K, V> Map<String, Map<K, V>> filterSysStreams(Map<String, Map<K, V>> stats, boolean includeSys) {
  LOG.trace("Filter Sys Streams {}", stats);
  if (!includeSys) {
    for (Iterator<String> itr = stats.keySet().iterator(); itr.hasNext(); ) {
      String winOrStream = itr.next();
      Map<K, V> stream2stat = stats.get(winOrStream);
      for (Iterator subItr = stream2stat.keySet().iterator(); subItr.hasNext(); ) {
        Object key = subItr.next();
        if (key instanceof String && Utils.isSystemId((String) key)) {
          subItr.remove();
        }
      }
    }
  }
  return stats;
}

代码示例来源:origin: apache/storm

Integer port = (Integer) value.get(1);
String comp = task2component.get(start);
if ((compId == null || compId.equals(comp)) && (includeSys || !Utils.isSystemId(comp))) {
  hostPorts.add(Lists.newArrayList(host, port));

代码示例来源:origin: apache/storm

private static Set<String> validateIds(Map<String, ? extends Object> componentMap) throws InvalidTopologyException {
  Set<String> keys = componentMap.keySet();
  for (String id : keys) {
    if (Utils.isSystemId(id)) {
      throw new WrappedInvalidTopologyException(id + " is not a valid component id.");
    }
  }
  for (Object componentObj : componentMap.values()) {
    ComponentCommon common = getComponentCommon(componentObj);
    Set<String> streamIds = common.get_streams().keySet();
    for (String id : streamIds) {
      if (Utils.isSystemId(id)) {
        throw new WrappedInvalidTopologyException(id + " is not a valid stream id.");
      }
    }
  }
  return keys;
}

代码示例来源:origin: apache/storm

if ((compId == null || compId.equals(id)) && (includeSys || !Utils.isSystemId(id))) {
  m.put("exec-id", entry.getKey());
  m.put("comp-id", id);

代码示例来源:origin: apache/storm

/**
 * getBoltExecutors.
 * @param executorSummaries executorSummaries
 * @param stormTopology stormTopology
 * @param sys sys
 * @return getBoltExecutors.
 */
public static Map<String, List<ExecutorSummary>> getBoltExecutors(List<ExecutorSummary> executorSummaries,
                              StormTopology stormTopology, boolean sys) {
  Map<String, List<ExecutorSummary>> result = new HashMap();
  for (ExecutorSummary executorSummary : executorSummaries) {
    if (StatsUtil.componentType(stormTopology, executorSummary.get_component_id()).equals("bolt")
        && (sys || !Utils.isSystemId(executorSummary.get_component_id()))) {
      List<ExecutorSummary> executorSummaryList = result.getOrDefault(executorSummary.get_component_id(), new ArrayList());
      executorSummaryList.add(executorSummary);
      result.put(executorSummary.get_component_id(), executorSummaryList);
    }
  }
  return result;
}

代码示例来源:origin: apache/storm

if (boltSummaries.containsKey(boltComponentId) && (sys || !Utils.isSystemId(boltComponentId))) {
  Map<String, Object> boltMap = new HashMap();
  boltMap.put(":type", "bolt");

代码示例来源:origin: apache/storm

for (Map.Entry<String, SpoutSpec> entry : spouts.entrySet()) {
  String compId = entry.getKey();
  if (!Utils.isSystemId(compId)) {
    Component comp = new Component(ComponentType.SPOUT, compId, componentToExecs(compId));
    ret.put(compId, comp);
for (Map.Entry<String, Bolt> entry : bolts.entrySet()) {
  String compId = entry.getKey();
  if (!Utils.isSystemId(compId)) {
    Component comp = new Component(ComponentType.BOLT, compId, componentToExecs(compId));
    ret.put(compId, comp);

代码示例来源:origin: apache/storm

boolean enableMessageTimeout = (Boolean) topoConf.get(Config.TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS);
boolean isAcker = Acker.ACKER_COMPONENT_ID.equals(componentId);
if ((!isAcker && Utils.isSystemId(componentId))
  || (!enableMessageTimeout && isSpout)
  || (!enableMessageTimeout && isAcker)) {

代码示例来源:origin: apache/storm

if (!Utils.isSystemId(key)) {
  Long count = txMap.get(key);
  totalTransferred += count;

代码示例来源:origin: apache/storm

if (!includeSys && Utils.isSystemId(component)) {
  continue;

代码示例来源:origin: org.apache.storm/storm-core

for (Map.Entry<String, SpoutSpec> spoutEntry : storm_topo
    .get_spouts().entrySet()) {
  if (!Utils.isSystemId(spoutEntry.getKey())) {
    Component newComp;
    if (all_comp.containsKey(spoutEntry.getKey())) {
for (Map.Entry<String, Bolt> boltEntry : storm_topo.get_bolts()
    .entrySet()) {
  if (!Utils.isSystemId(boltEntry.getKey())) {
    Component newComp;
    if (all_comp.containsKey(boltEntry.getKey())) {

相关文章

Utils类方法