本文整理了Java中backtype.storm.utils.Utils.downloadFromMaster()
方法的一些代码示例,展示了Utils.downloadFromMaster()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.downloadFromMaster()
方法的具体详情如下:
包路径:backtype.storm.utils.Utils
类名称: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!