public static String workerPidsRoot(Map<String, Object> conf, String id) { return (workerRoot(conf, id) + FILE_SEPARATOR + "pids"); }
public static String workerRoot(Map<String, Object> conf, String id) { return (workerRoot(conf) + FILE_SEPARATOR + id); }
public static String workerHeartbeatsRoot(Map<String, Object> conf, String id) { return (workerRoot(conf, id) + FILE_SEPARATOR + "heartbeats"); }
public static String workerTmpRoot(Map<String, Object> conf, String id) { return (workerRoot(conf, id) + FILE_SEPARATOR + "tmp"); }
public static Collection<String> supervisorWorkerIds(Map<String, Object> conf) { String workerRoot = ConfigUtils.workerRoot(conf); return ConfigUtils.readDirContents(workerRoot); }
/** * Create symlink from the containers directory/artifacts to the artifacts directory. * * @throws IOException on any error */ protected void createArtifactsLink() throws IOException { _type.assertFull(); if (!_symlinksDisabled) { File workerDir = new File(ConfigUtils.workerRoot(_conf, _workerId)); File topoDir = new File(ConfigUtils.workerArtifactsRoot(_conf, _topologyId, _port)); if (_ops.fileExists(workerDir)) { LOG.debug("Creating symlinks for worker-id: {} topology-id: {} to its port artifacts directory", _workerId, _topologyId); _ops.createSymlink(new File(workerDir, "artifacts"), topoDir); } } }
_type.assertFull(); String stormRoot = ConfigUtils.supervisorStormDistRoot(_conf, _topologyId); String workerRoot = ConfigUtils.workerRoot(_conf, _workerId);
String workerDir = ConfigUtils.workerRoot(_conf, _workerId);
/** * Clean up the container partly preparing for restart. By default delete all of the temp directories we are going to get a new * worker_id anyways. POST CONDITION: the workerId will be set to null * * @throws IOException on any error */ public void cleanUpForRestart() throws IOException { LOG.info("Cleaning up {}:{}", _supervisorId, _workerId); Set<Long> pids = getAllPids(); String user = getWorkerUser(); for (Long pid : pids) { File path = new File(ConfigUtils.workerPidPath(_conf, _workerId, pid)); _ops.deleteIfExists(path, user, _workerId); } //clean up for resource isolation if enabled if (_resourceIsolationManager != null) { _resourceIsolationManager.releaseResourcesForWorker(_workerId); } //Always make sure to clean up everything else before worker directory //is removed since that is what is going to trigger the retry for cleanup _ops.deleteIfExists(new File(ConfigUtils.workerHeartbeatsRoot(_conf, _workerId)), user, _workerId); _ops.deleteIfExists(new File(ConfigUtils.workerPidsRoot(_conf, _workerId)), user, _workerId); _ops.deleteIfExists(new File(ConfigUtils.workerTmpRoot(_conf, _workerId)), user, _workerId); _ops.deleteIfExists(new File(ConfigUtils.workerRoot(_conf, _workerId)), user, _workerId); deleteSavedWorkerUser(); _workerId = null; }
public static String workerRoot(Map conf, String id) { return (workerRoot(conf) + FILE_SEPARATOR + id); }
public static String workerPidsRoot(Map conf, String id) { return (workerRoot(conf, id) + FILE_SEPARATOR + "pids"); }
public static String workerTmpRoot(Map conf, String id) { return (workerRoot(conf, id) + FILE_SEPARATOR + "tmp"); }
public static String workerHeartbeatsRoot(Map conf, String id) { return (workerRoot(conf, id) + FILE_SEPARATOR + "heartbeats"); }
public static Collection<String> supervisorWorkerIds(Map<String, Object> conf) { String workerRoot = ConfigUtils.workerRoot(conf); return Utils.readDirContents(workerRoot); }
/** * Create symlink from the containers directory/artifacts to the artifacts directory * @throws IOException on any error */ protected void createArtifactsLink() throws IOException { _type.assertFull(); if (!_symlinksDisabled) { File workerDir = new File(ConfigUtils.workerRoot(_conf, _workerId)); File topoDir = new File(ConfigUtils.workerArtifactsRoot(_conf, _topologyId, _port)); if (_ops.fileExists(workerDir)) { LOG.debug("Creating symlinks for worker-id: {} topology-id: {} to its port artifacts directory", _workerId, _topologyId); _ops.createSymlink(new File(workerDir, "artifacts"), topoDir); } } }
_type.assertFull(); String stormRoot = ConfigUtils.supervisorStormDistRoot(_conf, _topologyId); String workerRoot = ConfigUtils.workerRoot(_conf, _workerId);
String workerDir = ConfigUtils.workerRoot(_conf, _workerId);
/** * Clean up the container partly preparing for restart. * By default delete all of the temp directories we are going * to get a new worker_id anyways. * POST CONDITION: the workerId will be set to null * @throws IOException on any error */ public void cleanUpForRestart() throws IOException { LOG.info("Cleaning up {}:{}", _supervisorId, _workerId); Set<Long> pids = getAllPids(); String user = getWorkerUser(); for (Long pid : pids) { File path = new File(ConfigUtils.workerPidPath(_conf, _workerId, pid)); _ops.deleteIfExists(path, user, _workerId); } //Always make sure to clean up everything else before worker directory //is removed since that is what is going to trigger the retry for cleanup _ops.deleteIfExists(new File(ConfigUtils.workerHeartbeatsRoot(_conf, _workerId)), user, _workerId); _ops.deleteIfExists(new File(ConfigUtils.workerPidsRoot(_conf, _workerId)), user, _workerId); _ops.deleteIfExists(new File(ConfigUtils.workerTmpRoot(_conf, _workerId)), user, _workerId); _ops.deleteIfExists(new File(ConfigUtils.workerRoot(_conf, _workerId)), user, _workerId); deleteSavedWorkerUser(); _workerId = null; }