SLIDER-441. Rename DO_NOT_PROPAGATE to be more user-friendly
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/9ce88ced Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/9ce88ced Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/9ce88ced Branch: refs/heads/feature/SLIDER-158_slider_diagnostic_option Commit: 9ce88ced4fe24c5284e110877200367d24248430 Parents: 47b4a9c Author: Sumit Mohanty <[email protected]> Authored: Tue Sep 23 21:34:00 2014 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Tue Sep 23 21:34:00 2014 -0700 ---------------------------------------------------------------------- app-packages/memcached-win/appConfig.json | 2 +- app-packages/memcached/appConfig.json | 2 +- app-packages/storm/appConfig.json | 4 ++-- .../src/main/python/agent/CustomServiceOrchestrator.py | 8 ++++---- .../test/python/agent/TestCustomServiceOrchestrator.py | 10 +++++----- .../slider/providers/agent/AgentProviderService.java | 4 ++-- .../slider/providers/agent/TestAgentProviderService.java | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9ce88ced/app-packages/memcached-win/appConfig.json ---------------------------------------------------------------------- diff --git a/app-packages/memcached-win/appConfig.json b/app-packages/memcached-win/appConfig.json index 7863579..059c712 100644 --- a/app-packages/memcached-win/appConfig.json +++ b/app-packages/memcached-win/appConfig.json @@ -13,7 +13,7 @@ "site.global.xmx_val": "256m", "site.global.xms_val": "128m", "site.global.memory_val": "200M", - "site.global.listen_port": "${MEMCACHED.ALLOCATED_PORT}{DO_NOT_PROPAGATE}" + "site.global.listen_port": "${MEMCACHED.ALLOCATED_PORT}{PER_CONTAINER}" }, "components": { http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9ce88ced/app-packages/memcached/appConfig.json ---------------------------------------------------------------------- diff --git a/app-packages/memcached/appConfig.json b/app-packages/memcached/appConfig.json index cf4a838..7b4aa97 100644 --- a/app-packages/memcached/appConfig.json +++ b/app-packages/memcached/appConfig.json @@ -14,7 +14,7 @@ "site.global.xmx_val": "256m", "site.global.xms_val": "128m", "site.global.memory_val": "200M", - "site.global.listen_port": "${MEMCACHED.ALLOCATED_PORT}{DO_NOT_PROPAGATE}" + "site.global.listen_port": "${MEMCACHED.ALLOCATED_PORT}{PER_CONTAINER}" }, "components": { "slider-appmaster": { http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9ce88ced/app-packages/storm/appConfig.json ---------------------------------------------------------------------- diff --git a/app-packages/storm/appConfig.json b/app-packages/storm/appConfig.json index 9a926c2..683b8cc 100644 --- a/app-packages/storm/appConfig.json +++ b/app-packages/storm/appConfig.json @@ -33,10 +33,10 @@ "site.storm-site.transactional.zookeeper.port": "null", "site.storm-site.nimbus.host": "${NIMBUS_HOST}", "site.storm-site.ui.port": "${STORM_UI_SERVER.ALLOCATED_PORT}", - "site.storm-site.supervisor.slots.ports": "[${SUPERVISOR.ALLOCATED_PORT}{DO_NOT_PROPAGATE},${SUPERVISOR.ALLOCATED_PORT}{DO_NOT_PROPAGATE}]", + "site.storm-site.supervisor.slots.ports": "[${SUPERVISOR.ALLOCATED_PORT}{PER_CONTAINER},${SUPERVISOR.ALLOCATED_PORT}{PER_CONTAINER}]", "site.storm-site.supervisor.childopts": "-Xmx256m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=0 -javaagent:${AGENT_WORK_ROOT}/app/install/apache-storm-${pkg.version}/external/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=${NN_HOST},port=8668,wireformat31x=true,mode=multicast,config=${AGENT_WORK_ROOT}/app/install/apache-storm-${pkg.version}/external/storm-jmxetric/conf/jmxetric-conf.xml,process=Supervisor_JVM", "site.storm-site.drpc.port": "0", - "site.storm-site.logviewer.port": "${SUPERVISOR.ALLOCATED_PORT}{DO_NOT_PROPAGATE}" + "site.storm-site.logviewer.port": "${SUPERVISOR.ALLOCATED_PORT}{PER_CONTAINER}" }, "components": { "slider-appmaster": { http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9ce88ced/slider-agent/src/main/python/agent/CustomServiceOrchestrator.py ---------------------------------------------------------------------- diff --git a/slider-agent/src/main/python/agent/CustomServiceOrchestrator.py b/slider-agent/src/main/python/agent/CustomServiceOrchestrator.py index dd8e9b9..30eedde 100644 --- a/slider-agent/src/main/python/agent/CustomServiceOrchestrator.py +++ b/slider-agent/src/main/python/agent/CustomServiceOrchestrator.py @@ -246,7 +246,7 @@ class CustomServiceOrchestrator(): ${AGENT_WORK_ROOT} -> AgentConfig.getWorkRootPath() ${AGENT_LOG_ROOT} -> AgentConfig.getLogPath() ALLOCATED_PORT is a hint to allocate port. It works as follows: - Its of the form {component_name.ALLOCATED_PORT}[{DEFAULT_default_port}][{DO_NOT_PROPAGATE}] + Its of the form {component_name.ALLOCATED_PORT}[{DEFAULT_default_port}][{PER_CONTAINER}] Either a port gets allocated or if not then just set the value to "0" """ @@ -289,7 +289,7 @@ class CustomServiceOrchestrator(): All unallocated ports should be set to 0 Look for "${SOME_COMPONENT_NAME.ALLOCATED_PORT}" or "${component.ALLOCATED_PORT}{DEFAULT_port}" - or "${component.ALLOCATED_PORT}{DEFAULT_port}{DO_NOT_PROPAGATE}" + or "${component.ALLOCATED_PORT}{DEFAULT_port}{PER_CONTAINER}" """ def set_all_unallocated_ports(self, value): @@ -318,11 +318,11 @@ class CustomServiceOrchestrator(): Port allocation can asks for multiple dynamic ports port_req_pattern is of type ${component_name.ALLOCATED_PORT} append {DEFAULT_ and find the default value - append {DO_NOT_PROPAGATE} if it exists + append {PER_CONTAINER} if it exists """ def allocate_ports(self, value, port_req_pattern): default_port_pattern = "{DEFAULT_" - do_not_propagate_pattern = "{DO_NOT_PROPAGATE}" + do_not_propagate_pattern = "{PER_CONTAINER}" index = value.find(port_req_pattern) while index != -1: replaced_pattern = port_req_pattern http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9ce88ced/slider-agent/src/test/python/agent/TestCustomServiceOrchestrator.py ---------------------------------------------------------------------- diff --git a/slider-agent/src/test/python/agent/TestCustomServiceOrchestrator.py b/slider-agent/src/test/python/agent/TestCustomServiceOrchestrator.py index e545afe..4548aac 100644 --- a/slider-agent/src/test/python/agent/TestCustomServiceOrchestrator.py +++ b/slider-agent/src/test/python/agent/TestCustomServiceOrchestrator.py @@ -310,9 +310,9 @@ class TestCustomServiceOrchestrator(TestCase): self.assertEqual(ret, "102,103") ret = orchestrator.allocate_ports("${A.ALLOCATED_PORT}{DEFAULT_0}", "${A.ALLOCATED_PORT}") self.assertEqual(ret, "104") - ret = orchestrator.allocate_ports("${A.ALLOCATED_PORT}{DEFAULT_0}{DO_NOT_PROPAGATE}", "${A.ALLOCATED_PORT}") + ret = orchestrator.allocate_ports("${A.ALLOCATED_PORT}{DEFAULT_0}{PER_CONTAINER}", "${A.ALLOCATED_PORT}") self.assertEqual(ret, "105") - ret = orchestrator.allocate_ports("${A.ALLOCATED_PORT}{DO_NOT_PROPAGATE}", "${A.ALLOCATED_PORT}") + ret = orchestrator.allocate_ports("${A.ALLOCATED_PORT}{PER_CONTAINER}", "${A.ALLOCATED_PORT}") self.assertEqual(ret, "106") @@ -336,7 +336,7 @@ class TestCustomServiceOrchestrator(TestCase): "${A.ALLOCATED_PORT}") self.assertEqual(ret, "1005-1006") - ret = orchestrator.allocate_ports("${A.ALLOCATED_PORT}{DEFAULT_1006}{DO_NOT_PROPAGATE}", + ret = orchestrator.allocate_ports("${A.ALLOCATED_PORT}{DEFAULT_1006}{PER_CONTAINER}", "${A.ALLOCATED_PORT}") self.assertEqual(ret, "1006") @@ -489,8 +489,8 @@ class TestCustomServiceOrchestrator(TestCase): command['configurations']['oozie-site']['log_root'] = "${AGENT_LOG_ROOT}" command['configurations']['oozie-site']['a_port'] = "${HBASE_MASTER.ALLOCATED_PORT}" command['configurations']['oozie-site']['ignore_port1'] = "[${HBASE_RS.ALLOCATED_PORT}]" - command['configurations']['oozie-site']['ignore_port2'] = "[${HBASE_RS.ALLOCATED_PORT},${HBASE_REST.ALLOCATED_PORT}{DO_NOT_PROPAGATE}]" - command['configurations']['oozie-site']['ignore_port3'] = "[${HBASE_RS.ALLOCATED_PORT}{a}{b}{c},${A.ALLOCATED_PORT}{DO_NOT_PROPAGATE},${A.ALLOCATED_PORT}{DEFAULT_3}{DO_NOT_PROPAGATE}]" + command['configurations']['oozie-site']['ignore_port2'] = "[${HBASE_RS.ALLOCATED_PORT},${HBASE_REST.ALLOCATED_PORT}{PER_CONTAINER}]" + command['configurations']['oozie-site']['ignore_port3'] = "[${HBASE_RS.ALLOCATED_PORT}{a}{b}{c},${A.ALLOCATED_PORT}{PER_CONTAINER},${A.ALLOCATED_PORT}{DEFAULT_3}{PER_CONTAINER}]" command['configurations']['oozie-site']['ignore_port4'] = "${HBASE_RS}{a}{b}{c}" allocated_ports = {} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9ce88ced/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java index 6976f50..f37150e 100644 --- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java +++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java @@ -126,7 +126,7 @@ public class AgentProviderService extends AbstractProviderService implements private static final String LOG_FOLDERS_TAG = "LogFolders"; private static final String COMPONENT_DATA_TAG = "ComponentInstanceData"; private static final String SHARED_PORT_TAG = "SHARED"; - private static final String DO_NOT_PROPAGATE_TAG = "{DO_NOT_PROPAGATE}"; + private static final String PER_CONTAINER_TAG = "{PER_CONTAINER}"; private static final int MAX_LOG_ENTRIES = 20; private static final int DEFAULT_HEARTBEAT_MONITOR_INTERVAL = 60 * 1000; @@ -1482,7 +1482,7 @@ public class AgentProviderService extends AbstractProviderService implements for (String key : config.keySet()) { String value = config.get(key); String lookupKey = configName + "." + key; - if (!value.contains(DO_NOT_PROPAGATE_TAG)) { + if (!value.contains(PER_CONTAINER_TAG)) { // If the config property is shared then pass on the already allocated value // from any container if (this.getAllocatedPorts().containsKey(lookupKey)) { http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9ce88ced/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentProviderService.java ---------------------------------------------------------------------- diff --git a/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentProviderService.java b/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentProviderService.java index b652bb5..10b20d0 100644 --- a/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentProviderService.java +++ b/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentProviderService.java @@ -1268,7 +1268,7 @@ public class TestAgentProviderService { treeOps.set(OptionKeys.ZOOKEEPER_HOSTS, "HOST1"); treeOps.getGlobalOptions().put("site.hbase-site.a.port", "${HBASE_MASTER.ALLOCATED_PORT}"); treeOps.getGlobalOptions().put("site.hbase-site.b.port", "${HBASE_MASTER.ALLOCATED_PORT}"); - treeOps.getGlobalOptions().put("site.hbase-site.random.port", "${HBASE_MASTER.ALLOCATED_PORT}{DO_NOT_PROPAGATE}"); + treeOps.getGlobalOptions().put("site.hbase-site.random.port", "${HBASE_MASTER.ALLOCATED_PORT}{PER_CONTAINER}"); treeOps.getGlobalOptions().put("site.hbase-site.random2.port", "${HBASE_MASTER.ALLOCATED_PORT}"); Map<String, DefaultConfig> defaultConfigMap = new HashMap<String, DefaultConfig>();
