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

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

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

Utils.addVersions介绍

[英]Add version information to the given topology.
[中]向给定拓扑添加版本信息。

代码示例

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

private static void submitTopologyInDistributeMode(String name, StormTopology topology, SubmitOptions opts,
                          ProgressListener progressListener, String asUser, Map<String, Object> conf,
                          String serConf, NimbusClient client) throws TException {
  try {
    String jar = submitJarAs(conf, System.getProperty("storm.jar"), progressListener, client);
    LOG.info("Submitting topology {} in distributed mode with conf {}", name, serConf);
    Utils.addVersions(topology);
    if (opts != null) {
      client.getClient().submitTopologyWithOpts(name, jar, serConf, topology, opts);
    } else {
      // this is for backwards compatibility
      client.getClient().submitTopology(name, jar, serConf, topology);
    }
    LOG.info("Finished submitting topology: {}", name);
  } catch (InvalidTopologyException e) {
    LOG.error("Topology submission exception: {}", e.get_msg());
    throw e;
  } catch (AlreadyAliveException e) {
    LOG.error("Topology already alive exception", e);
    throw e;
  }
}

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

@Override
public LocalTopology submitTopologyWithOpts(String topologyName, Map<String, Object> conf, StormTopology topology,
                      SubmitOptions submitOpts)
  throws TException {
  if (!Utils.isValidConf(conf)) {
    throw new IllegalArgumentException("Topology conf is not json-serializable");
  }
  getNimbus().submitTopologyWithOpts(topologyName, null, JSONValue.toJSONString(conf), Utils.addVersions(topology), submitOpts);
  return new LocalTopology(topologyName, topology);
}

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

return Utils.addVersions(stormTopology);

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

@Override
public LocalTopology submitTopology(String topologyName, Map<String, Object> conf, StormTopology topology)
  throws TException {
  if (!Utils.isValidConf(conf)) {
    throw new IllegalArgumentException("Topology conf is not json-serializable");
  }
  getNimbus().submitTopology(topologyName, null, JSONValue.toJSONString(conf), Utils.addVersions(topology));
  ISubmitterHook hook = (ISubmitterHook) Utils.getConfiguredClass(conf, Config.STORM_TOPOLOGY_SUBMISSION_NOTIFIER_PLUGIN);
  if (hook != null) {
    TopologyInfo topologyInfo = Utils.getTopologyInfo(topologyName, null, conf);
    try {
      hook.notify(topologyInfo, conf, topology);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    }
  }
  return new LocalTopology(topologyName, topology);
}

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

private static void submitTopologyInDistributeMode(String name, StormTopology topology, SubmitOptions opts,
                          ProgressListener progressListener, String asUser, Map conf,
                          String serConf, NimbusClient client) throws TException {
  try {
    String jar = submitJarAs(conf, System.getProperty("storm.jar"), progressListener, client);
    LOG.info("Submitting topology {} in distributed mode with conf {}", name, serConf);
    Utils.addVersions(topology);
    if (opts != null) {
      client.getClient().submitTopologyWithOpts(name, jar, serConf, topology, opts);
    } else {
      // this is for backwards compatibility
      client.getClient().submitTopology(name, jar, serConf, topology);
    }
    LOG.info("Finished submitting topology: {}", name);
  } catch (InvalidTopologyException e) {
    LOG.warn("Topology submission exception: {}", e.get_msg());
    throw e;
  } catch (AlreadyAliveException e) {
    LOG.warn("Topology already alive exception", e);
    throw e;
  }
}

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

return Utils.addVersions(stormTopology);

相关文章

Utils类方法