Repository: incubator-slider
Updated Branches:
  refs/heads/feature/SLIDER-531-registry-enhancements [created] b0c222430


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/b0c22243
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/b0c22243
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/b0c22243

Branch: refs/heads/feature/SLIDER-531-registry-enhancements
Commit: b0c222430bd6139c7e579d8f0a264eff26b2551d
Parents: 186d3ba
Author: Steve Loughran <[email protected]>
Authored: Thu Oct 23 16:00:32 2014 +0100
Committer: Steve Loughran <[email protected]>
Committed: Thu Oct 23 22:44:24 2014 +0100

----------------------------------------------------------------------
 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, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b0c22243/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/b0c22243/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 029f901..441ead6 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
@@ -1057,8 +1057,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/b0c22243/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 50da8ae..28d498b 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
@@ -49,8 +49,6 @@ public class AgentRegistryIT extends AgentCommandTestBase
   @Before
   public void prepareCluster() {
     setupCluster(CLUSTER)
-
-
   }
 
   @After

Reply via email to