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

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

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

Utils.downloadFromMaster介绍

暂无

代码示例

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

public static void downloadCodeFromMaster(Map conf, String localRoot, String masterCodeDir,
                     String topologyId, boolean isSupervisor) throws IOException, TException {
  FileUtils.forceMkdir(new File(localRoot));
  FileUtils.forceMkdir(new File(StormConfig.stormlib_path(localRoot)));
  String localStormjarPath = StormConfig.stormjar_path(localRoot);
  String masterStormjarPath = StormConfig.stormjar_path(masterCodeDir);
  Utils.downloadFromMaster(conf, masterStormjarPath, localStormjarPath);
  String localStormcodePath = StormConfig.stormcode_path(localRoot);
  String masterStormcodePath = StormConfig.stormcode_path(masterCodeDir);
  Utils.downloadFromMaster(conf, masterStormcodePath, localStormcodePath);
  String localStormConfPath = StormConfig.stormconf_path(localRoot);
  String masterStormConfPath = StormConfig.stormconf_path(masterCodeDir);
  Utils.downloadFromMaster(conf, masterStormConfPath, localStormConfPath);
  Map stormConf = (Map) StormConfig.readLocalObject(topologyId, localStormConfPath);
  if (stormConf == null)
    throw new IOException("Get topology conf error: " + topologyId);
  List<String> libs = (List<String>) stormConf.get(GenericOptionsParser.TOPOLOGY_LIB_NAME);
  if (libs == null)
    return;
  for (String libName : libs) {
    String localStromLibPath = StormConfig.stormlib_path(localRoot, libName);
    String masterStormLibPath = StormConfig.stormlib_path(masterCodeDir, libName);
    Utils.downloadFromMaster(conf, masterStormLibPath, localStromLibPath);
  }
}

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

Utils.downloadFromMaster(conf, masterStormjarPath, localFileJarTmp);// load
    .supervisor_stormcode_path(tmproot);
Utils.downloadFromMaster(conf, masterStormcodePath, localFileCodeTmp);
    .supervisor_sotrmconf_path(tmproot);
Utils.downloadFromMaster(conf, masterStormConfPath, localFileConfTmp);

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

public static void downloadCodeFromMaster(Map conf, String localRoot, String masterCodeDir, String topologyId, boolean isSupervisor) throws IOException,
    TException {
  FileUtils.forceMkdir(new File(localRoot));
  FileUtils.forceMkdir(new File(StormConfig.stormlib_path(localRoot)));
  String localStormjarPath = StormConfig.stormjar_path(localRoot);
  String masterStormjarPath = StormConfig.stormjar_path(masterCodeDir);
  Utils.downloadFromMaster(conf, masterStormjarPath, localStormjarPath);
  String localStormcodePath = StormConfig.stormcode_path(localRoot);
  String masterStormcodePath = StormConfig.stormcode_path(masterCodeDir);
  Utils.downloadFromMaster(conf, masterStormcodePath, localStormcodePath);
  String localStormConfPath = StormConfig.stormconf_path(localRoot);
  String masterStormConfPath = StormConfig.stormconf_path(masterCodeDir);
  Utils.downloadFromMaster(conf, masterStormConfPath, localStormConfPath);
  Map stormConf = (Map) StormConfig.readLocalObject(topologyId, localStormConfPath);
  if (stormConf == null)
    throw new IOException("Get topology conf error: " + topologyId);
  List<String> libs = (List<String>) stormConf.get(GenericOptionsParser.TOPOLOGY_LIB_NAME);
  if (libs == null)
    return;
  for (String libName : libs) {
    String localStromLibPath = StormConfig.stormlib_path(localRoot, libName);
    String masterStormLibPath = StormConfig.stormlib_path(masterCodeDir, libName);
    Utils.downloadFromMaster(conf, masterStormLibPath, localStromLibPath);
  }
}

相关文章