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

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

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

Utils.getAlternativeVersionsMap介绍

[英]Get a mapping of the configured supported versions of storm to their actual versions.
[中]获取配置的受支持的storm版本到其实际版本的映射。

代码示例

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

NavigableMap<String, IVersionInfo> versionsMap = Utils.getAlternativeVersionsMap(conf);
List<Map<String, String>> versionList = new ArrayList<>();
for (Map.Entry<String, IVersionInfo> entry : versionsMap.entrySet()) {

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

@Test
  public void checkVersionInfo() {
    Map<String, String> versions = new HashMap<>();
    String key = VersionInfo.getVersion();
    assertNotEquals("Unknown", key, "Looks like we don't know what version of storm we are");
    versions.put(key, System.getProperty("java.class.path"));
    Map<String, Object> conf = new HashMap<>();
    conf.put(Config.SUPERVISOR_WORKER_VERSION_CLASSPATH_MAP, versions);
    NavigableMap<String, IVersionInfo> alternativeVersions = Utils.getAlternativeVersionsMap(conf);
    assertEquals(1, alternativeVersions.size());
    IVersionInfo found = alternativeVersions.get(key);
    assertNotNull(found);
    assertEquals(key, found.getVersion());
  }
}

相关文章

Utils类方法