SLIDER-531. YARN-2678 new registry formats
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/ee929430 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/ee929430 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/ee929430 Branch: refs/heads/feature/SLIDER-531-registry-enhancements Commit: ee9294302551c4cb4f52c41f67f8fc17b357787a Parents: 96c9006 Author: Steve Loughran <[email protected]> Authored: Thu Oct 23 16:00:32 2014 +0100 Committer: Steve Loughran <[email protected]> Committed: Sun Nov 2 14:14:08 2014 +0000 ---------------------------------------------------------------------- slider-agent/src/main/python/agent/Registry.py | 11 ++++++----- .../apache/slider/server/appmaster/SliderAppMaster.java | 3 +-- .../slider/funtest/lifecycle/AgentRegistryIT.groovy | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ee929430/slider-agent/src/main/python/agent/Registry.py ---------------------------------------------------------------------- diff --git a/slider-agent/src/main/python/agent/Registry.py b/slider-agent/src/main/python/agent/Registry.py index ad84053..6d34956 100644 --- a/slider-agent/src/main/python/agent/Registry.py +++ b/slider-agent/src/main/python/agent/Registry.py @@ -24,7 +24,7 @@ from kazoo.client import KazooClient logger = logging.getLogger() -class Registry: +class Registry(object): def __init__(self, zk_quorum, zk_reg_path): self.zk_quorum = zk_quorum self.zk_reg_path = zk_reg_path @@ -39,17 +39,18 @@ class Registry: zk = KazooClient(hosts=self.zk_quorum, read_only=True) zk.start() data, stat = zk.get(self.zk_reg_path) - data = data.lstrip("jsonservicerec") logger.debug("Registry Data: %s" % (data.decode("utf-8"))) sliderRegistry = json.loads(data) internalAttr = sliderRegistry["internal"] for internal in internalAttr: if internal["api"] == "org.apache.slider.agents.secure": - amUrl = internal["addresses"][0][0] + address0 = internal["addresses"][0] + amUrl = address0["uri"] amHost = amUrl.split("/")[2].split(":")[0] amSecuredPort = amUrl.split(":")[2].split("/")[0] if internal["api"] == "org.apache.slider.agents.oneway": - amUnsecureUrl = internal["addresses"][0][0] + address0 = internal["addresses"][0] + amUnsecureUrl = address0["uri"] amHost = amUnsecureUrl.split("/")[2].split(":")[0] amUnsecuredPort = amUnsecureUrl.split(":")[2].split("/")[0] @@ -62,7 +63,7 @@ class Registry: (self.zk_reg_path, self.zk_quorum, str(e))) pass finally: - if not zk == None: + if not zk is None: zk.stop() zk.close() logger.info("AM Host = %s, AM Secured Port = %s, ping port = %s" % (amHost, amSecuredPort, amUnsecuredPort)) http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ee929430/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java index f2ea00f..3bee4a4 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java @@ -1060,8 +1060,7 @@ public class SliderAppMaster extends AbstractSliderLaunchedService serviceRecord.addExternalEndpoint( RegistryTypeUtils.ipcEndpoint( CustomRegistryConstants.AM_IPC_PROTOCOL, - true, - RegistryTypeUtils.marshall(rpcServiceAddress))); + rpcServiceAddress)); // internal services sliderAMProvider.applyInitialRegistryDefinitions(amWebURI, http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ee929430/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy ---------------------------------------------------------------------- diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy index 5b8b3cd..ee9ef61 100644 --- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy +++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy @@ -50,7 +50,7 @@ public class AgentRegistryIT extends AgentCommandTestBase @Before public void prepareCluster() { setupCluster(CLUSTER) - } + } @After public void destroyCluster() {
