You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/10/09 00:53:20 UTC

[31/50] [abbrv] git commit: SLIDER-149 sync with move to short-named status

SLIDER-149 sync with move to short-named status


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/62335bfd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/62335bfd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/62335bfd

Branch: refs/heads/develop
Commit: 62335bfd1a894db41016fb0aa14268c5e21737e2
Parents: 969b734
Author: Steve Loughran <st...@apache.org>
Authored: Tue Sep 30 15:24:18 2014 -0700
Committer: Steve Loughran <st...@apache.org>
Committed: Tue Sep 30 15:24:18 2014 -0700

----------------------------------------------------------------------
 .../TestStandaloneYarnRegistryAM.groovy         |  1 +
 .../apache/slider/test/SliderTestUtils.groovy   |  7 +++++
 .../minicluster/live/TestTwoLiveClusters.groovy | 32 ++++++++++++--------
 3 files changed, 28 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/62335bfd/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
index d081676..0155232 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneYarnRegistryAM.groovy
@@ -154,6 +154,7 @@ class TestStandaloneYarnRegistryAM extends AgentMiniClusterTestBase {
 
     Map < String, ServiceRecord > recordMap = RecordOperations.extractServiceRecords(
         registryService,
+        recordsPath,
         registryService.listFull(recordsPath))
     def serviceRecords = recordMap.values();
     dumpCollection(serviceRecords)

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/62335bfd/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
index 9f8e850..fe9e587 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
@@ -713,6 +713,13 @@ class SliderTestUtils extends Assert {
     log.info("number of entries: ${entries.length}")
     entries.each { log.info(it.toString()) }
   }
+
+  public static void dumpMap(Map map) {
+    map.entrySet().each { Map.Entry it ->
+      log.info("\"${it.key.toString()}\": \"${it.value.toString()}\"")
+    }
+  }
+  
   /**
    * Get a time option in seconds if set, otherwise the default value (also in seconds).
    * This operation picks up the time value as a system property if set -that

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/62335bfd/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy
index a415524..01a67c7 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy
+++ b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy
@@ -20,11 +20,11 @@ package org.apache.slider.providers.hbase.minicluster.live
 
 import groovy.transform.CompileStatic
 import groovy.util.logging.Slf4j
-import org.apache.hadoop.yarn.registry.client.api.RegistryConstants
 import org.apache.hadoop.yarn.registry.client.api.RegistryOperations
 import org.apache.hadoop.yarn.registry.client.binding.RegistryOperationUtils
 import org.apache.hadoop.yarn.registry.client.binding.RegistryPathUtils
 import org.apache.hadoop.yarn.registry.client.types.ServiceRecord
+import org.apache.slider.common.SliderKeys
 import org.apache.slider.common.params.Arguments
 import org.apache.slider.client.SliderClient
 import org.apache.slider.providers.hbase.HBaseKeys
@@ -87,16 +87,20 @@ class TestTwoLiveClusters extends HBaseMiniClusterTestBase {
     describe "service registry names"
     RegistryOperations registry = cluster2Client.registryOperations
     def home = RegistryOperationUtils.homePathForCurrentUser()
-    def names = RegistryOperationUtils.listServiceRecords(registry,
-        RegistryPathUtils.join(home, RegistryConstants.PATH_USER_SERVICES))
 
-    def stats = registry.listFull(
-        RegistryPathUtils.join(home, RegistryConstants.PATH_USER_SERVICES))
+    def userSliderInstancesPath = RegistryOperationUtils.serviceclassPath(
+        RegistryOperationUtils.currentUser(), SliderKeys.APP_TYPE)
+    
+   
+    def names = RegistryOperationUtils.listServiceRecords(registry,
+        userSliderInstancesPath)
+    dumpMap(names)
+    
+    def stats = registry.listFull(userSliderInstancesPath)
     
     dumpCollection(stats)
     List<String> instanceIds = sliderClient.listRegisteredSliderInstances()
 
-
     dumpRegistryInstanceIDs(instanceIds)
     assert names.size() == 2
     assert instanceIds.size() == 2
@@ -107,16 +111,20 @@ class TestTwoLiveClusters extends HBaseMiniClusterTestBase {
     dumpRegistryInstances(instances)
     assert instances.size() == 2
 
+
+    def hbaseServicePath = RegistryOperationUtils.serviceclassPath(
+        RegistryOperationUtils.currentUser(),
+        HBaseKeys.HBASE_SERVICE_TYPE)
     Map<String, ServiceRecord> hbaseInstances =
         RegistryOperationUtils.listServiceRecords(registry,
-        RegistryOperationUtils.serviceclassPath(
-            RegistryOperationUtils.currentUser(),
-            HBaseKeys.HBASE_SERVICE_TYPE));
+            hbaseServicePath);
         
     assert hbaseInstances.size() == 2
-    def hbase1ServiceData = hbaseInstances[clustername1]
-    def hbase2ServiceData = hbaseInstances[clustername2]
-    assert !(hbase1ServiceData == hbase2ServiceData)
+    String clusterPath1 = RegistryPathUtils.join(hbaseServicePath, clustername1)
+    String clusterPath2 = RegistryPathUtils.join(hbaseServicePath, clustername2)
+    assert hbaseInstances[clusterPath1] != null
+    assert hbaseInstances[clusterPath2] != null
+    assert hbaseInstances[clusterPath1] != hbaseInstances[clusterPath2]
 
     clusterActionFreeze(cluster2Client, clustername2, "stop cluster 2")
     clusterActionFreeze(sliderClient, clustername1, "Stop cluster 1")