/** * Get parameters for the class path of the worker process. Also used by the log Writer. * * @param stormRoot the root dist dir for the topology * @return the classpath for the topology as command line arguments. * * @throws IOException on any error. */ private List<String> getClassPathParams(final String stormRoot, final SimpleVersion topoVersion) throws IOException { final String stormJar = ConfigUtils.supervisorStormJarPath(stormRoot); final List<String> dependencyLocations = getDependencyLocationsFor(_conf, _topologyId, _ops, stormRoot); final String workerClassPath = getWorkerClassPath(stormJar, dependencyLocations, topoVersion); List<String> classPathParams = new ArrayList<>(); classPathParams.add("-cp"); classPathParams.add(workerClassPath); return classPathParams; }
static boolean doRequiredTopoFilesExist(Map<String, Object> conf, String stormId) throws IOException { String stormroot = ConfigUtils.supervisorStormDistRoot(conf, stormId); String stormjarpath = ConfigUtils.supervisorStormJarPath(stormroot); String stormcodepath = ConfigUtils.supervisorStormCodePath(stormroot); String stormconfpath = ConfigUtils.supervisorStormConfPath(stormroot); if (!Utils.checkFileExists(stormroot)) { return false; } if (!Utils.checkFileExists(stormcodepath)) { return false; } if (!Utils.checkFileExists(stormconfpath)) { return false; } if (ConfigUtils.isLocalMode(conf) || Utils.checkFileExists(stormjarpath)) { return true; } return false; }
/** * Get parameters for the class path of the worker process. Also used by the * log Writer * @param stormRoot the root dist dir for the topology * @return the classpath for the topology as command line arguments. * @throws IOException on any error. */ private List<String> getClassPathParams(final String stormRoot) throws IOException { final String stormJar = ConfigUtils.supervisorStormJarPath(stormRoot); final List<String> dependencyLocations = getDependencyLocationsFor(_conf, _topologyId, _ops, stormRoot); final String workerClassPath = getWorkerClassPath(stormJar, dependencyLocations); List<String> classPathParams = new ArrayList<>(); classPathParams.add("-cp"); classPathParams.add(workerClassPath); return classPathParams; }
protected void downloadBaseBlobs(File tmproot) throws Exception { String stormJarKey = ConfigUtils.masterStormJarKey(_topologyId); String stormCodeKey = ConfigUtils.masterStormCodeKey(_topologyId); String stormConfKey = ConfigUtils.masterStormConfKey(_topologyId); String jarPath = ConfigUtils.supervisorStormJarPath(tmproot.getAbsolutePath()); String codePath = ConfigUtils.supervisorStormCodePath(tmproot.getAbsolutePath()); String confPath = ConfigUtils.supervisorStormConfPath(tmproot.getAbsolutePath()); _fsOps.forceMkdir(tmproot); _fsOps.restrictDirectoryPermissions(tmproot); ClientBlobStore blobStore = Utils.getClientBlobStoreForSupervisor(_conf); try { Utils.downloadResourcesAsSupervisor(stormJarKey, jarPath, blobStore); Utils.downloadResourcesAsSupervisor(stormCodeKey, codePath, blobStore); Utils.downloadResourcesAsSupervisor(stormConfKey, confPath, blobStore); } finally { blobStore.shutdown(); } Utils.extractDirFromJar(jarPath, ConfigUtils.RESOURCES_SUBDIR, tmproot); }
static boolean doRequiredTopoFilesExist(Map<String, Object> conf, String stormId) throws IOException { String stormroot = ConfigUtils.supervisorStormDistRoot(conf, stormId); String stormjarpath = ConfigUtils.supervisorStormJarPath(stormroot); String stormcodepath = ConfigUtils.supervisorStormCodePath(stormroot); String stormconfpath = ConfigUtils.supervisorStormConfPath(stormroot); if (!Utils.checkFileExists(stormroot)) return false; if (!Utils.checkFileExists(stormcodepath)) return false; if (!Utils.checkFileExists(stormconfpath)) return false; if (ConfigUtils.isLocalMode(conf) || Utils.checkFileExists(stormjarpath)) return true; return false; }