public String workerArtifactsRootImpl(Map<String, Object> conf) { String artifactsDir = (String) conf.get(Config.STORM_WORKERS_ARTIFACTS_DIR); if (artifactsDir == null) { return (getLogDir() + FILE_SEPARATOR + "workers-artifacts"); } else { if (new File(artifactsDir).isAbsolute()) { return artifactsDir; } else { return (getLogDir() + FILE_SEPARATOR + artifactsDir); } } }
/** * Get a set of java properties that are common to both the log writer and the worker processes. These are mostly system properties that * are used by logging. * * @return a list of command line options */ private List<String> getCommonParams() { final String workersArtifacts = ConfigUtils.workerArtifactsRoot(_conf); String stormLogDir = ConfigUtils.getLogDir(); List<String> commonParams = new ArrayList<>(); commonParams.add("-Dlogging.sensitivity=" + OR((String) _topoConf.get(Config.TOPOLOGY_LOGGING_SENSITIVITY), "S3")); commonParams.add("-Dlogfile.name=worker.log"); commonParams.add("-Dstorm.home=" + OR(_stormHome, "")); commonParams.add("-Dworkers.artifacts=" + workersArtifacts); commonParams.add("-Dstorm.id=" + _topologyId); commonParams.add("-Dworker.id=" + _workerId); commonParams.add("-Dworker.port=" + _port); commonParams.add("-Dstorm.log.dir=" + stormLogDir); commonParams.add("-DLog4jContextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector"); commonParams.add("-Dstorm.local.dir=" + _conf.get(Config.STORM_LOCAL_DIR)); if (memoryLimitMB > 0) { commonParams.add("-Dworker.memory_limit_mb=" + memoryLimitMB); } return commonParams; }
public String workerArtifactsRootImpl(Map conf) { String artifactsDir = (String)conf.get(Config.STORM_WORKERS_ARTIFACTS_DIR); if (artifactsDir == null) { return (getLogDir() + FILE_SEPARATOR + "workers-artifacts"); } else { if (new File(artifactsDir).isAbsolute()) { return artifactsDir; } else { return (getLogDir() + FILE_SEPARATOR + artifactsDir); } } }
/** * Get a set of java properties that are common to both the log writer and the worker processes. * These are mostly system properties that are used by logging. * @return a list of command line options */ private List<String> getCommonParams() { final String workersArtifacts = ConfigUtils.workerArtifactsRoot(_conf); String stormLogDir = ConfigUtils.getLogDir(); String log4jConfigurationFile = getWorkerLoggingConfigFile(); List<String> commonParams = new ArrayList<>(); commonParams.add("-Dlogging.sensitivity=" + OR((String) _topoConf.get(Config.TOPOLOGY_LOGGING_SENSITIVITY), "S3")); commonParams.add("-Dlogfile.name=worker.log"); commonParams.add("-Dstorm.home=" + OR(_stormHome, "")); commonParams.add("-Dworkers.artifacts=" + workersArtifacts); commonParams.add("-Dstorm.id=" + _topologyId); commonParams.add("-Dworker.id=" + _workerId); commonParams.add("-Dworker.port=" + _port); commonParams.add("-Dstorm.log.dir=" + stormLogDir); commonParams.add("-Dlog4j.configurationFile=" + log4jConfigurationFile); commonParams.add("-DLog4jContextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector"); commonParams.add("-Dstorm.local.dir=" + _conf.get(Config.STORM_LOCAL_DIR)); return commonParams; }