Repository: incubator-slider Updated Branches: refs/heads/develop 6ef541c5b -> 15693336d
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/Test2Master2RS.groovy ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/Test2Master2RS.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/Test2Master2RS.groovy deleted file mode 100644 index 10a502b..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/Test2Master2RS.groovy +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.live - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.hadoop.conf.Configuration -import org.apache.hadoop.hbase.ClusterStatus -import org.apache.slider.api.ClusterDescription -import org.apache.slider.client.SliderClient -import org.apache.slider.common.tools.Duration -import org.apache.slider.core.main.ServiceLauncher -import org.apache.slider.providers.hbase.HBaseTestUtils -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.junit.Test - -/** - * test create a live region service - */ -@CompileStatic -@Slf4j - -class Test2Master2RS extends HBaseMiniClusterTestBase { - - @Test - public void test2Master2RS() throws Throwable { - - int regionServerCount = 2 - String clustername = createMiniCluster("", configuration, 1, 1, 1, true, false) - - describe(" Create a two master, two region service cluster"); - //now launch the cluster - int masterCount = 2 - - ServiceLauncher<SliderClient> launcher = createHBaseCluster( - clustername, - masterCount, - regionServerCount, - [], - true, - true) - - SliderClient sliderClient = launcher.service - addToTeardown(sliderClient); - ClusterDescription status = sliderClient.getClusterDescription(clustername) - log.info("${status.toJsonString()}") - ClusterStatus clustat = basicHBaseClusterStartupSequence(sliderClient) - - status = waitForWorkerInstanceCount( - sliderClient, - regionServerCount, - hbaseClusterStartupToLiveTime) - //get the hbase status - - Duration duration = new Duration(hbaseClusterStartupToLiveTime) - duration.start() - - Configuration clientConf = HBaseTestUtils.createHBaseConfiguration( - sliderClient) - - - while (!duration.limitExceeded && clustat.backupMastersSize != 1) { - clustat = HBaseTestUtils.getHBaseClusterStatus(clientConf); - Thread.sleep(1000); - } - if (duration.limitExceeded) { - describe("Cluster region server count of ${regionServerCount} not met:"); - log.info(HBaseTestUtils.hbaseStatusToString(clustat)); - fail("Backup master count not reached"); - } - - } -} - http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMaster.groovy ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMaster.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMaster.groovy deleted file mode 100644 index db102cb..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMaster.groovy +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.live - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.hadoop.registry.client.binding.RegistryUtils -import org.apache.hadoop.registry.client.types.ServiceRecord -import org.apache.hadoop.registry.client.types.yarn.YarnRegistryAttributes -import org.apache.slider.api.ClusterDescription -import org.apache.slider.api.RoleKeys -import org.apache.slider.client.SliderClient -import org.apache.slider.common.SliderXmlConfKeys -import org.apache.slider.common.params.Arguments -import org.apache.slider.core.main.ServiceLauncher -import org.apache.slider.core.registry.docstore.PublishedConfigSet -import org.apache.slider.core.registry.retrieve.RegistryRetriever -import org.apache.slider.providers.hbase.HBaseKeys -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.junit.Test - -/** - * Create a master against the File:// fs - */ -@CompileStatic -@Slf4j -class TestHBaseMaster extends HBaseMiniClusterTestBase { - public static final String HBASE_SITE = HBaseKeys.HBASE_SITE_PUBLISHED_CONFIG; - - @Test - public void testHBaseMaster() throws Throwable { - String clustername = createMiniCluster("", configuration, 1, true) - //now launch the cluster with 1 region server - int regionServerCount = 1 - ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, regionServerCount, - [ - Arguments.ARG_COMP_OPT, HBaseKeys.ROLE_MASTER, RoleKeys.JVM_HEAP, "256M", - Arguments.ARG_DEFINE, SliderXmlConfKeys.KEY_YARN_QUEUE + "=default" - ], - true, - true) - SliderClient client = launcher.service - addToTeardown(client); - ClusterDescription status = client.getClusterDescription(clustername) - - //dumpFullHBaseConf(sliderClient, clustername) - - basicHBaseClusterStartupSequence(client) - - //verify the #of region servers is as expected - dumpClusterStatus(client, "post-hbase-boot status") - - //get the hbase status - waitForHBaseRegionServerCount(client, clustername, 1, hbaseClusterStartupToLiveTime) - waitForWorkerInstanceCount(client, 1, hbaseClusterStartupToLiveTime) - waitForRoleCount(client, HBaseKeys.ROLE_MASTER, 1, - hbaseClusterStartupToLiveTime) - - // look up the registry entries for HBase - describe "service registry names" - Map<String, ServiceRecord> records = RegistryUtils.listServiceRecords( - client.registryOperations, - RegistryUtils.serviceclassPath( - RegistryUtils.homePathForCurrentUser(), - HBaseKeys.HBASE_SERVICE_TYPE - ) - ) - - def names = records.keySet() - dumpRegistryServiceTypes(names) - - - - def hbaseInstances = records.values() - assert hbaseInstances.size() == 1 - ServiceRecord hbaseServiceData = hbaseInstances[0] - log.info "HBase service 0 == $hbaseServiceData" - assert hbaseServiceData[YarnRegistryAttributes.YARN_ID] - - RegistryRetriever retriever = new RegistryRetriever(hbaseServiceData) - log.info retriever.toString() - assert retriever.hasConfigurations(true) - PublishedConfigSet externalConfSet = retriever.getConfigurations(true) - dumpConfigurationSet(externalConfSet) - assert externalConfSet[HBASE_SITE] - - - def yarnSite = retriever.retrieveConfiguration( - externalConfSet, - HBASE_SITE, - true) - assert !yarnSite.empty - def siteXML = yarnSite.asConfiguration() - } - -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterOnHDFS.groovy ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterOnHDFS.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterOnHDFS.groovy deleted file mode 100644 index 5e8adca..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterOnHDFS.groovy +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.live - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.slider.api.ClusterDescription -import org.apache.slider.client.SliderClient -import org.apache.slider.core.main.ServiceLauncher -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.junit.Test - -/** - * Test of RM creation. This is so the later test's prereq's can be met - */ -@CompileStatic -@Slf4j -class TestHBaseMasterOnHDFS extends HBaseMiniClusterTestBase { - - @Test - public void testHBaseMasteOnHDFS() throws Throwable { - String clustername = createMiniCluster( - "", configuration, 1, 1, 1, true, true) - log.info("HDFS is at $fsDefaultName") - assert fsDefaultName.startsWith("hdfs://") - ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, 1, [], true, true) - SliderClient sliderClient = launcher.service - addToTeardown(sliderClient); - ClusterDescription status = sliderClient.getClusterDescription(clustername) - log.info("Status $status") - - basicHBaseClusterStartupSequence(sliderClient) - dumpClusterStatus(sliderClient, "post-hbase-boot status") - - //get the hbase status - status = waitForWorkerInstanceCount(sliderClient, 1, hbaseClusterStartupToLiveTime) - waitForHBaseRegionServerCount(sliderClient, clustername, 1, hbaseClusterStartupToLiveTime) - - clusterActionFreeze(sliderClient, clustername) - - } - - -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterWithBadHeap.groovy ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterWithBadHeap.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterWithBadHeap.groovy deleted file mode 100644 index aeb3c47..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestHBaseMasterWithBadHeap.groovy +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.live - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.hadoop.hbase.ClusterStatus -import org.apache.slider.api.RoleKeys -import org.apache.slider.client.SliderClient -import org.apache.slider.common.SliderExitCodes -import org.apache.slider.common.params.Arguments -import org.apache.slider.core.conf.AggregateConf -import org.apache.slider.core.main.ServiceLaunchException -import org.apache.slider.core.main.ServiceLauncher -import org.apache.slider.providers.hbase.HBaseKeys -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.junit.Test - -/** - * Create a master against the File:// fs - */ -@CompileStatic -@Slf4j -class TestHBaseMasterWithBadHeap extends HBaseMiniClusterTestBase { - - - @Test - public void testHBaseMasterWithBadHeap() throws Throwable { - String clustername = createMiniCluster("", configuration, 1, true) - - describe "verify that bad Java heap options are picked up" - //now launch the cluster with 1 region server - int regionServerCount = 1 - try { - ServiceLauncher launcher = createHBaseCluster(clustername, regionServerCount, - [Arguments.ARG_COMP_OPT, HBaseKeys.ROLE_WORKER, RoleKeys.JVM_HEAP, "invalid"], true, true) - SliderClient sliderClient = (SliderClient) launcher.service - addToTeardown(sliderClient); - - AggregateConf launchedInstance = sliderClient.launchedInstanceDefinition - AggregateConf liveInstance = sliderClient.launchedInstanceDefinition - - - - basicHBaseClusterStartupSequence(sliderClient) - def report = waitForClusterLive(sliderClient) - - ClusterStatus clustat = getHBaseClusterStatus(sliderClient); - // verify that region server cannot start - if (clustat.servers.size()) { - dumpClusterDescription("original",launchedInstance ) - dumpClusterDescription("live", sliderClient.liveInstanceDefinition) - dumpClusterStatus(sliderClient,"JVM heap option not picked up") - } - assert 0 == clustat.servers.size() - } catch (ServiceLaunchException e) { - assertExceptionDetails(e, SliderExitCodes.EXIT_DEPLOYMENT_FAILED) - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveRegionServiceOnHDFS.groovy ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveRegionServiceOnHDFS.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveRegionServiceOnHDFS.groovy deleted file mode 100644 index 1392535..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveRegionServiceOnHDFS.groovy +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.live - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.hadoop.hbase.ClusterStatus -import org.apache.slider.api.ClusterDescription -import org.apache.slider.client.SliderClient -import org.apache.slider.core.main.ServiceLauncher -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.junit.Test - -/** - * test create a live region service - */ -@CompileStatic -@Slf4j -class TestLiveRegionServiceOnHDFS extends HBaseMiniClusterTestBase { - - @Test - public void testLiveRegionServiceOnHDFS() throws Throwable { - int regionServerCount = 1 - String clustername = createMiniCluster( - "", configuration, 1, 1, 1, true, true) - describe(" Create a single region service cluster"); - - //now launch the cluster - ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, regionServerCount, [], true, true) - SliderClient sliderClient = launcher.service - addToTeardown(sliderClient); - ClusterDescription status = sliderClient.getClusterDescription(clustername) - log.info("${status.toJsonString()}") - -// dumpFullHBaseConf(sliderClient) - - log.info("Running basic HBase cluster startup sequence") - ClusterStatus clustat = basicHBaseClusterStartupSequence(sliderClient) - - - status = waitForWorkerInstanceCount(sliderClient, regionServerCount, hbaseClusterStartupToLiveTime) - describe("Cluster status") - log.info(prettyPrint(status.toJsonString())) - //get the hbase status - waitForHBaseRegionServerCount(sliderClient, clustername, regionServerCount, hbaseClusterStartupToLiveTime) - - } - -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveTwoNodeRegionService.groovy ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveTwoNodeRegionService.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveTwoNodeRegionService.groovy deleted file mode 100644 index f10e296..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestLiveTwoNodeRegionService.groovy +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.live - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.hadoop.hbase.ClusterStatus -import org.apache.slider.api.ClusterDescription -import org.apache.slider.api.RoleKeys -import org.apache.slider.client.SliderClient -import org.apache.slider.common.params.Arguments -import org.apache.slider.core.main.ServiceLauncher -import org.apache.slider.providers.hbase.HBaseKeys -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.junit.Test - -/** - * test create a live region service - */ -@CompileStatic -@Slf4j - -class TestLiveTwoNodeRegionService extends HBaseMiniClusterTestBase { - - @Test - public void testLiveTwoNodeRegionService() throws Throwable { - - int regionServerCount = 2 - String clustername = createMiniCluster( - "", configuration, 1, 1, 1, true, false) - - describe(" Create a two node region service cluster"); - - //now launch the cluster - ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername, regionServerCount, - [ - Arguments.ARG_COMP_OPT, HBaseKeys.ROLE_MASTER, RoleKeys.JVM_HEAP , HB_HEAP, - Arguments.ARG_COMP_OPT, HBaseKeys.ROLE_WORKER, RoleKeys.JVM_HEAP , HB_HEAP - ], - true, - true) - SliderClient sliderClient = launcher.service - addToTeardown(sliderClient); - ClusterDescription status = sliderClient.getClusterDescription(clustername) - dumpClusterDescription("initial status", status) - - ClusterStatus clustat = basicHBaseClusterStartupSequence(sliderClient) - - waitForWorkerInstanceCount(sliderClient, regionServerCount, hbaseClusterStartupToLiveTime) - //get the hbase status - waitForHBaseRegionServerCount(sliderClient, clustername, regionServerCount, hbaseClusterStartupToLiveTime) - - //now log the final status - status = sliderClient.getClusterDescription(clustername) - - dumpClusterDescription("final status", status) - - String rootPage = sliderClient.applicationReport.originalTrackingUrl - assert rootPage - log.info("Slider root = ${rootPage}") - def page = fetchWebPage(rootPage) - log.info(page) - } - -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/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 deleted file mode 100644 index 029f424..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/live/TestTwoLiveClusters.groovy +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.live - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.hadoop.registry.client.api.RegistryOperations -import org.apache.hadoop.registry.client.binding.RegistryPathUtils -import org.apache.hadoop.registry.client.binding.RegistryUtils -import org.apache.hadoop.registry.client.types.ServiceRecord -import org.apache.slider.client.SliderClient -import org.apache.slider.common.SliderKeys -import org.apache.slider.common.params.Arguments -import org.apache.slider.core.main.ServiceLauncher -import org.apache.slider.providers.hbase.HBaseKeys -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.junit.Test - -@CompileStatic -@Slf4j - -class TestTwoLiveClusters extends HBaseMiniClusterTestBase { - - /** - * Create two clusters simultaneously and verify that their lifecycle is - * independent. - * @throws Throwable - */ - @Test - public void testTwoLiveClusters() throws Throwable { - String clustername = createMiniCluster("", configuration, 1, true) - - String clustername1 = clustername + "-1" - //now launch the cluster - int regionServerCount = 1 - ServiceLauncher<SliderClient> launcher = createHBaseCluster(clustername1, regionServerCount, [], true, true) - SliderClient sliderClient = launcher.service - addToTeardown(sliderClient); - - basicHBaseClusterStartupSequence(sliderClient) - - //verify the #of region servers is as expected - dumpClusterStatus(sliderClient, "post-hbase-boot status") - - //get the hbase status - waitForWorkerInstanceCount(sliderClient, 1, hbaseClusterStartupToLiveTime) - waitForHBaseRegionServerCount(sliderClient, clustername1, 1, hbaseClusterStartupToLiveTime) - - //now here comes cluster #2 - String clustername2 = clustername + "-2" - - - String zkpath = "/$clustername2" - launcher = createHBaseCluster(clustername2, regionServerCount, - [ - Arguments.ARG_ZKPATH, zkpath - ], - true, - true) - SliderClient cluster2Client = launcher.service - addToTeardown(cluster2Client); - - basicHBaseClusterStartupSequence(cluster2Client) - waitForWorkerInstanceCount(cluster2Client, 1, hbaseClusterStartupToLiveTime) - waitForHBaseRegionServerCount(cluster2Client, clustername2, 1, hbaseClusterStartupToLiveTime) - - //and now verify that cluster 1 is still happy - waitForHBaseRegionServerCount(sliderClient, clustername1, 1, hbaseClusterStartupToLiveTime) - - // registry instances def names = client.listRegistryNames(clustername) - describe "service registry names" - RegistryOperations registry = cluster2Client.registryOperations - def home = RegistryUtils.homePathForCurrentUser() - - def userSliderInstancesPath = RegistryUtils.serviceclassPath( - RegistryUtils.currentUser(), SliderKeys.APP_TYPE) - - - def names = RegistryUtils.listServiceRecords(registry, - userSliderInstancesPath) - dumpMap(names) - def statMap = RegistryUtils.statChildren(registry, userSliderInstancesPath) - assert statMap.size() == 2 - List<String> instanceIds = sliderClient.listRegisteredSliderInstances() - - dumpRegistryInstanceIDs(instanceIds) - assert names.size() == 2 - assert instanceIds.size() == 2 - - - Map<String, ServiceRecord> instances = - sliderClient.listRegistryInstances() - dumpRegistryInstances(instances) - assert instances.size() == 2 - - - def hbaseServicePath = RegistryUtils.serviceclassPath( - RegistryUtils.currentUser(), - HBaseKeys.HBASE_SERVICE_TYPE) - Map<String, ServiceRecord> hbaseInstances = - RegistryUtils.listServiceRecords(registry, - hbaseServicePath); - - assert hbaseInstances.size() == 2 - 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") - - } - -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestRoleOptPropagation.groovy ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestRoleOptPropagation.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestRoleOptPropagation.groovy deleted file mode 100644 index cffde39..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestRoleOptPropagation.groovy +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.masterless - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.slider.common.SliderKeys -import org.apache.slider.api.ClusterDescription -import org.apache.slider.core.exceptions.BadCommandArgumentsException -import org.apache.slider.providers.hbase.HBaseKeys -import org.apache.slider.common.params.Arguments -import org.apache.slider.client.SliderClient -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.apache.slider.core.main.ServiceLauncher -import org.junit.Test - -import static HBaseKeys.PROVIDER_HBASE -import static Arguments.ARG_PROVIDER - -@CompileStatic -@Slf4j - -class TestRoleOptPropagation extends HBaseMiniClusterTestBase { - - @Test - - public void testRoleOptPropagation() throws Throwable { - skip("Disabled") - String clustername = createMiniCluster("", getConfiguration(), 1, true) - - describe "verify that role options propagate down to deployed roles" - - String ENV = "env.ENV_VAR" - ServiceLauncher launcher = createCluster(clustername, - [ - (HBaseKeys.ROLE_MASTER): 0, - (HBaseKeys.ROLE_WORKER): 0, - ], - [ - Arguments.ARG_COMP_OPT, HBaseKeys.ROLE_MASTER, ENV, "4", - ARG_PROVIDER, PROVIDER_HBASE - ], - true, - true, - [:]) - SliderClient sliderClient = (SliderClient) launcher.service - addToTeardown(sliderClient); - ClusterDescription status = sliderClient.clusterDescription - Map<String, String> masterRole = status.getRole(HBaseKeys.ROLE_MASTER); - dumpClusterDescription("Remote CD", status) - assert masterRole[ENV] == "4" - - } - - @Test - public void testUnknownRole() throws Throwable { - String clustername = createMiniCluster("", configuration, 1, true) - - describe "verify that unknown role results in cluster creation failure" - try { - String MALLOC_ARENA = "env.MALLOC_ARENA_MAX" - ServiceLauncher launcher = createCluster(clustername, - [ - (HBaseKeys.ROLE_MASTER): 0, - (HBaseKeys.ROLE_WORKER): 0, - ], - [ - Arguments.ARG_COMP_OPT, SliderKeys.COMPONENT_AM, MALLOC_ARENA, "4", - Arguments.ARG_COMP_OPT, "unknown", MALLOC_ARENA, "3", - ARG_PROVIDER, PROVIDER_HBASE - ], - true, - true, - [:]) - assert false - } catch (BadCommandArgumentsException bcae) { - /* expected */ - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestSliderConfDirToMasterlessAM.groovy ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestSliderConfDirToMasterlessAM.groovy b/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestSliderConfDirToMasterlessAM.groovy deleted file mode 100644 index c5e0282..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/groovy/org/apache/slider/providers/hbase/minicluster/masterless/TestSliderConfDirToMasterlessAM.groovy +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase.minicluster.masterless - -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import org.apache.hadoop.fs.Path -import org.apache.slider.common.SliderKeys -import org.apache.slider.api.ClusterDescription -import org.apache.slider.common.tools.SliderFileSystem -import org.apache.slider.common.tools.SliderUtils -import org.apache.slider.client.SliderClient -import org.apache.slider.providers.hbase.minicluster.HBaseMiniClusterTestBase -import org.apache.hadoop.yarn.api.records.ApplicationReport -import org.apache.hadoop.yarn.conf.YarnConfiguration -import org.apache.slider.core.main.ServiceLauncher -import org.apache.hadoop.fs.FileSystem as HadoopFS - -import org.junit.Test - -/** - * create masterless AMs and work with them. This is faster than - * bringing up full clusters - */ -@CompileStatic -@Slf4j - -class TestSliderConfDirToMasterlessAM extends HBaseMiniClusterTestBase { - - - @Test - public void testSliderConfDirToMasterlessAM() throws Throwable { - YarnConfiguration conf = configuration - String clustername = createMiniCluster("", conf, 1, true) - - describe "verify that a conf dir will propagate via the sytem proerpty" - - File localConf = File.createTempDir("conf","dir") - String name = "slider.xml" - File sliderXML = new File(localConf, name) - def out = new FileWriter(sliderXML) - out.write(['a','b','c'] as char[]) - out.write("as string") - out.flush() - out.close() - try { - System.setProperty(SliderKeys.PROPERTY_CONF_DIR,localConf.absolutePath); - ServiceLauncher<SliderClient> launcher = createMasterlessAM(clustername, 0, true, true) - SliderClient client = launcher.service - addToTeardown(client); - ApplicationReport report = waitForClusterLive(client) - - ClusterDescription cd = waitForRoleCount(client,SliderKeys.COMPONENT_AM, - 1, hbaseClusterStartupTime) - HadoopFS fs = HadoopFS.getLocal(conf); - - Path clusterDir = new SliderFileSystem(fs, conf).buildClusterDirPath(clustername) - assert fs.exists(clusterDir); - Path sliderConfDir = new Path(clusterDir, SliderKeys.SUBMITTED_CONF_DIR) - assert fs.exists(sliderConfDir); - Path remoteXml = new Path(sliderConfDir,name) - assert fs.exists(remoteXml) - - - clusterActionFreeze(client, clustername) - } finally { - SliderUtils.deleteDirectoryTree(localConf) - } - - } - -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/java/org/apache/slider/providers/hbase/StubCompile.java ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/java/org/apache/slider/providers/hbase/StubCompile.java b/slider-providers/hbase/slider-hbase-provider/src/test/java/org/apache/slider/providers/hbase/StubCompile.java deleted file mode 100644 index 7f062a4..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/java/org/apache/slider/providers/hbase/StubCompile.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.slider.providers.hbase; - -class StubCompile { -} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d405543/slider-providers/hbase/slider-hbase-provider/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/slider-providers/hbase/slider-hbase-provider/src/test/resources/log4j.properties b/slider-providers/hbase/slider-hbase-provider/src/test/resources/log4j.properties deleted file mode 100644 index 8f633b2..0000000 --- a/slider-providers/hbase/slider-hbase-provider/src/test/resources/log4j.properties +++ /dev/null @@ -1,61 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# log4j configuration used during build and unit tests - -log4j.rootLogger=INFO,stdout -log4j.threshhold=ALL -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n - -log4j.appender.subprocess=org.apache.log4j.ConsoleAppender -log4j.appender.subprocess.layout=org.apache.log4j.PatternLayout -log4j.appender.subprocess.layout.ConversionPattern=[%c{1}]: %m%n -#log4j.logger.org.apache.slider.yarn.appmaster.SliderAppMasterer.master=INFO,subprocess - -log4j.logger.org.apache.slider=DEBUG -log4j.logger.org.apache.hadoop.yarn.service.launcher=DEBUG - - - -#log4j.logger.org.apache.hadoop.yarn.service.launcher=DEBUG -#log4j.logger.org.apache.hadoop.yarn.service=DEBUG -#log4j.logger.org.apache.hadoop.yarn.client=DEBUG - -#crank back on some noise -log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR -log4j.logger.org.apache.hadoop.hdfs.server.datanode.BlockPoolSliceScanner=WARN -log4j.logger.org.apache.hadoop.hdfs.server.blockmanagement=WARN -log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=WARN -log4j.logger.org.apache.hadoop.hdfs=WARN -log4j.logger.BlockStateChange=WARN - - -log4j.logger.org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor=WARN -log4j.logger.org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl=WARN -log4j.logger.org.apache.zookeeper=WARN -log4j.logger.org.apache.zookeeper.ClientCnxn=FATAL - -log4j.logger.org.apache.hadoop.yarn.server.resourcemanager.security=WARN -log4j.logger.org.apache.hadoop.metrics2=ERROR -log4j.logger.org.apache.hadoop.util.HostsFileReader=WARN -log4j.logger.org.apache.hadoop.yarn.event.AsyncDispatcher=WARN -log4j.logger.org.apache.hadoop.security.token.delegation=WARN -log4j.logger.org.apache.hadoop.yarn.util.AbstractLivelinessMonitor=WARN -log4j.logger.org.apache.hadoop.yarn.server.nodemanager.security=WARN -log4j.logger.org.apache.hadoop.yarn.server.resourcemanager.RMNMInfo=WARN -log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager=WARN \ No newline at end of file
