http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestLoadExampleAppJson.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestLoadExampleAppJson.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestLoadExampleAppJson.java deleted file mode 100644 index 8310530..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestLoadExampleAppJson.java +++ /dev/null @@ -1,78 +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.hadoop.yarn.service.conf; - -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.yarn.conf.YarnConfiguration; -import org.apache.hadoop.yarn.service.api.records.Application; -import org.apache.hadoop.yarn.service.utils.ServiceApiUtil; -import org.apache.hadoop.yarn.service.utils.SliderFileSystem; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -import java.util.Arrays; -import java.util.Collection; - -import static org.apache.hadoop.yarn.service.ServiceTestUtils.JSON_SER_DESER; -import static org.easymock.EasyMock.*; - -/** - * Test loading example resources. - */ -@RunWith(value = Parameterized.class) -public class TestLoadExampleAppJson extends Assert { - private String resource; - - public TestLoadExampleAppJson(String resource) { - this.resource = resource; - } - - @Parameterized.Parameters - public static Collection<String[]> filenames() { - String[][] stringArray = new String[ExampleAppJson - .ALL_EXAMPLE_RESOURCES.size()][1]; - int i = 0; - for (String s : ExampleAppJson.ALL_EXAMPLE_RESOURCES) { - stringArray[i++][0] = s; - } - return Arrays.asList(stringArray); - } - - @Test - public void testLoadResource() throws Throwable { - try { - Application application = JSON_SER_DESER.fromResource(resource); - - SliderFileSystem sfs = createNiceMock(SliderFileSystem.class); - FileSystem mockFs = createNiceMock(FileSystem.class); - expect(sfs.getFileSystem()).andReturn(mockFs).anyTimes(); - expect(sfs.buildClusterDirPath(anyObject())).andReturn( - new Path("cluster_dir_path")).anyTimes(); - replay(sfs, mockFs); - - ServiceApiUtil.validateAndResolveApplication(application, sfs, - new YarnConfiguration()); - } catch (Exception e) { - throw new Exception("exception loading " + resource + ":" + e.toString()); - } - } -}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestValidateServiceNames.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestValidateServiceNames.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestValidateServiceNames.java deleted file mode 100644 index 98c78d3..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestValidateServiceNames.java +++ /dev/null @@ -1,123 +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.hadoop.yarn.service.conf; - -import org.apache.hadoop.yarn.service.utils.SliderUtils; -import org.junit.Assert; -import org.junit.Test; - -import java.util.Arrays; -import java.util.List; - -/** - * Test cluster name validation. - */ -public class TestValidateServiceNames { - - void assertValidName(String name) { - boolean valid = SliderUtils.isClusternameValid(name); - Assert.assertTrue("Clustername '" + name + "' mistakenly declared invalid", - valid); - } - - void assertInvalidName(String name) { - boolean valid = SliderUtils.isClusternameValid(name); - Assert.assertFalse("Clustername '\" + name + \"' mistakenly declared valid", - valid); - } - - void assertInvalid(List<String> names) { - for (String name : names) { - assertInvalidName(name); - } - } - - void assertValid(List<String> names) { - for (String name : names) { - assertValidName(name); - } - } - - @Test - public void testEmptyName() throws Throwable { - assertInvalidName(""); - } - - @Test - public void testSpaceName() throws Throwable { - assertInvalidName(" "); - } - - - @Test - public void testLeadingHyphen() throws Throwable { - assertInvalidName("-hyphen"); - } - - @Test - public void testTitleLetters() throws Throwable { - assertInvalidName("Title"); - } - - @Test - public void testCapitalLetters() throws Throwable { - assertInvalidName("UPPER-CASE-CLUSTER"); - } - - @Test - public void testInnerBraced() throws Throwable { - assertInvalidName("a[a"); - } - - @Test - public void testLeadingBrace() throws Throwable { - assertInvalidName("["); - } - - @Test - public void testNonalphaLeadingChars() throws Throwable { - assertInvalid(Arrays.asList( - "[a", "#", "@", "=", "*", "." - )); - } - - @Test - public void testNonalphaInnerChars() throws Throwable { - assertInvalid(Arrays.asList( - "a[a", "b#", "c@", "d=", "e*", "f.", "g ", "h i" - )); - } - - @Test - public void testClusterValid() throws Throwable { - assertValidName("cluster"); - } - - @Test - public void testValidNames() throws Throwable { - assertValid(Arrays.asList( - "cluster", - "cluster1", - "very-very-very-long-cluster-name", - "c1234567890" - )); - - } - -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestAbstractClientProvider.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestAbstractClientProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestAbstractClientProvider.java deleted file mode 100644 index 5b24a1d..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestAbstractClientProvider.java +++ /dev/null @@ -1,118 +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.hadoop.yarn.service.providers; - -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.yarn.service.api.records.Artifact; -import org.apache.hadoop.yarn.service.api.records.ConfigFile; -import org.apache.hadoop.yarn.service.provider.AbstractClientProvider; -import org.junit.Assert; -import org.junit.Test; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import static org.easymock.EasyMock.*; - -/** - * Test the AbstractClientProvider shared methods. - */ -public class TestAbstractClientProvider { - private static final String EXCEPTION_PREFIX = "Should have thrown " + - "exception: "; - private static final String NO_EXCEPTION_PREFIX = "Should not have thrown " + - "exception: "; - - private static class ClientProvider extends AbstractClientProvider { - @Override - public void validateArtifact(Artifact artifact, FileSystem fileSystem) - throws IOException { - } - - @Override - protected void validateConfigFile(ConfigFile configFile, - FileSystem fileSystem) throws IOException { - } - } - - @Test - public void testConfigFiles() throws IOException { - ClientProvider clientProvider = new ClientProvider(); - FileSystem mockFs = createNiceMock(FileSystem.class); - expect(mockFs.exists(anyObject(Path.class))).andReturn(true).anyTimes(); - replay(mockFs); - - ConfigFile configFile = new ConfigFile(); - List<ConfigFile> configFiles = new ArrayList<>(); - configFiles.add(configFile); - - try { - clientProvider.validateConfigFiles(configFiles, mockFs); - Assert.fail(EXCEPTION_PREFIX + "null file type"); - } catch (IllegalArgumentException e) { - } - - configFile.setType(ConfigFile.TypeEnum.TEMPLATE); - try { - clientProvider.validateConfigFiles(configFiles, mockFs); - Assert.fail(EXCEPTION_PREFIX + "empty src_file for type template"); - } catch (IllegalArgumentException e) { - } - - configFile.setSrcFile("srcfile"); - try { - clientProvider.validateConfigFiles(configFiles, mockFs); - Assert.fail(EXCEPTION_PREFIX + "empty dest file"); - } catch (IllegalArgumentException e) { - } - - configFile.setDestFile("destfile"); - try { - clientProvider.validateConfigFiles(configFiles, mockFs); - } catch (IllegalArgumentException e) { - Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); - } - - configFile = new ConfigFile(); - configFile.setType(ConfigFile.TypeEnum.JSON); - configFile.setSrcFile(null); - configFile.setDestFile("path/destfile2"); - configFiles.add(configFile); - try { - clientProvider.validateConfigFiles(configFiles, mockFs); - Assert.fail(EXCEPTION_PREFIX + "dest file with multiple path elements"); - } catch (IllegalArgumentException e) { - } - - configFile.setDestFile("/path/destfile2"); - try { - clientProvider.validateConfigFiles(configFiles, mockFs); - } catch (IllegalArgumentException e) { - Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); - } - - configFile.setDestFile("destfile"); - try { - clientProvider.validateConfigFiles(configFiles, mockFs); - Assert.fail(EXCEPTION_PREFIX + "duplicate dest file"); - } catch (IllegalArgumentException e) { - } - } -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestProviderFactory.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestProviderFactory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestProviderFactory.java deleted file mode 100644 index 489578d..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestProviderFactory.java +++ /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.hadoop.yarn.service.providers; - -import org.apache.hadoop.yarn.service.api.records.Artifact; -import org.apache.hadoop.yarn.service.api.records.Artifact.TypeEnum; -import org.apache.hadoop.yarn.service.provider.ProviderFactory; -import org.apache.hadoop.yarn.service.provider.defaultImpl.DefaultClientProvider; -import org.apache.hadoop.yarn.service.provider.defaultImpl.DefaultProviderFactory; -import org.apache.hadoop.yarn.service.provider.defaultImpl.DefaultProviderService; -import org.apache.hadoop.yarn.service.provider.docker.DockerClientProvider; -import org.apache.hadoop.yarn.service.provider.docker.DockerProviderFactory; -import org.apache.hadoop.yarn.service.provider.docker.DockerProviderService; -import org.apache.hadoop.yarn.service.provider.tarball.TarballClientProvider; -import org.apache.hadoop.yarn.service.provider.tarball.TarballProviderFactory; -import org.apache.hadoop.yarn.service.provider.tarball.TarballProviderService; - -import org.junit.Test; - -import static org.junit.Assert.assertTrue; - -/** - * Test provider factories. - */ -public class TestProviderFactory { - @Test - public void testDockerFactory() throws Throwable { - ProviderFactory factory = ProviderFactory - .createSliderProviderFactory(new Artifact().type(TypeEnum.DOCKER)); - assertTrue(factory instanceof DockerProviderFactory); - assertTrue(factory.createClientProvider() instanceof DockerClientProvider); - assertTrue(factory.createServerProvider() instanceof DockerProviderService); - assertTrue(ProviderFactory.getProviderService(new Artifact() - .type(TypeEnum.DOCKER)) instanceof DockerProviderService); - } - - @Test - public void testTarballFactory() throws Throwable { - ProviderFactory factory = ProviderFactory - .createSliderProviderFactory(new Artifact().type(TypeEnum.TARBALL)); - assertTrue(factory instanceof TarballProviderFactory); - assertTrue(factory.createClientProvider() instanceof TarballClientProvider); - assertTrue(factory.createServerProvider() instanceof - TarballProviderService); - assertTrue(ProviderFactory.getProviderService(new Artifact() - .type(TypeEnum.TARBALL)) instanceof TarballProviderService); - } - - @Test - public void testDefaultFactory() throws Throwable { - ProviderFactory factory = ProviderFactory - .createSliderProviderFactory(null); - assertTrue(factory instanceof DefaultProviderFactory); - assertTrue(factory.createClientProvider() instanceof DefaultClientProvider); - assertTrue(factory.createServerProvider() instanceof DefaultProviderService); - assertTrue(ProviderFactory.getProviderService(null) instanceof - DefaultProviderService); - } - -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/servicemonitor/TestServiceMonitor.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/servicemonitor/TestServiceMonitor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/servicemonitor/TestServiceMonitor.java deleted file mode 100644 index 6f5653f..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/servicemonitor/TestServiceMonitor.java +++ /dev/null @@ -1,104 +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.hadoop.yarn.service.servicemonitor; - -import org.apache.commons.io.FileUtils; -import org.apache.hadoop.yarn.api.records.ApplicationId; -import org.apache.hadoop.yarn.conf.YarnConfiguration; -import org.apache.hadoop.yarn.service.MockServiceAM; -import org.apache.hadoop.yarn.service.ServiceTestUtils; - -import org.apache.hadoop.yarn.service.api.records.Application; -import org.apache.hadoop.yarn.service.api.records.Component; -import org.apache.hadoop.yarn.service.conf.YarnServiceConf; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import java.io.File; -import java.io.IOException; -import java.util.Collections; - -public class TestServiceMonitor extends ServiceTestUtils { - - private File basedir; - YarnConfiguration conf = new YarnConfiguration(); - - @Before - public void setup() throws Exception { - basedir = new File("target", "apps"); - if (basedir.exists()) { - FileUtils.deleteDirectory(basedir); - } else { - basedir.mkdirs(); - } - conf.setLong(YarnServiceConf.READINESS_CHECK_INTERVAL, 2); - } - - @After - public void tearDown() throws IOException { - if (basedir != null) { - FileUtils.deleteDirectory(basedir); - } - } - - // Create compa with 1 container - // Create compb with 1 container - // Verify compb dependency satisfied - // Increase compa to 2 containers - // Verify compb dependency becomes unsatisfied. - @Test - public void testComponentDependency() throws Exception{ - ApplicationId applicationId = ApplicationId.newInstance(123456, 1); - Application exampleApp = new Application(); - exampleApp.setId(applicationId.toString()); - exampleApp.setName("testComponentDependency"); - exampleApp.addComponent(createComponent("compa", 1, "sleep 1000")); - Component compb = createComponent("compb", 1, "sleep 1000"); - - // Let compb depends on compa; - compb.setDependencies(Collections.singletonList("compa")); - exampleApp.addComponent(compb); - - MockServiceAM am = new MockServiceAM(exampleApp); - am.init(conf); - am.start(); - - // compa ready - Assert.assertTrue(am.getComponent("compa").areDependenciesReady()); - //compb not ready - Assert.assertFalse(am.getComponent("compb").areDependenciesReady()); - - // feed 1 container to compa, - am.feedContainerToComp(exampleApp, 1, "compa"); - // waiting for compb's dependencies are satisfied - am.waitForDependenciesSatisfied("compb"); - - // feed 1 container to compb - am.feedContainerToComp(exampleApp, 2, "compb"); - am.flexComponent("compa", 2); - am.waitForNumDesiredContainers("compa", 2); - - // compb dependencies not satisfied again. - Assert.assertFalse(am.getComponent("compb").areDependenciesReady()); - am.stop(); - } -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java deleted file mode 100644 index a891df8..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java +++ /dev/null @@ -1,293 +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.hadoop.yarn.service.timelineservice; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; -import org.apache.hadoop.yarn.api.records.ApplicationId; -import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity; -import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity.Identifier; -import org.apache.hadoop.yarn.client.api.TimelineV2Client; -import org.apache.hadoop.yarn.client.api.impl.TimelineV2ClientImpl; -import org.apache.hadoop.yarn.conf.YarnConfiguration; -import org.apache.hadoop.yarn.exceptions.YarnException; -import org.apache.hadoop.yarn.service.ServiceContext; -import org.apache.hadoop.yarn.service.api.records.Application; -import org.apache.hadoop.yarn.service.api.records.ApplicationState; -import org.apache.hadoop.yarn.service.api.records.Artifact; -import org.apache.hadoop.yarn.service.api.records.Component; -import org.apache.hadoop.yarn.service.api.records.Container; -import org.apache.hadoop.yarn.service.api.records.ContainerState; -import org.apache.hadoop.yarn.service.api.records.PlacementPolicy; -import org.apache.hadoop.yarn.service.api.records.Resource; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstanceId; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -/** - * Test class for ServiceTimelinePublisher. - */ -public class TestServiceTimelinePublisher { - private TimelineV2Client timelineClient; - private Configuration config; - private ServiceTimelinePublisher serviceTimelinePublisher; - private static String SERVICE_NAME = "HBASE"; - private static String SERVICEID = "application_1490093646524_0005"; - private static String ARTIFACTID = "ARTIFACTID"; - private static String COMPONENT_NAME = "DEFAULT"; - private static String CONTAINER_ID = - "container_e02_1490093646524_0005_01_000001"; - private static String CONTAINER_IP = - "localhost"; - private static String CONTAINER_HOSTNAME = - "cnl124-localhost.site"; - private static String CONTAINER_BAREHOST = - "localhost.com"; - - @Before - public void setUp() throws Exception { - config = new Configuration(); - config.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true); - config.setFloat(YarnConfiguration.TIMELINE_SERVICE_VERSION, 2.0f); - timelineClient = - new DummyTimelineClient(ApplicationId.fromString(SERVICEID)); - serviceTimelinePublisher = new ServiceTimelinePublisher(timelineClient); - timelineClient.init(config); - serviceTimelinePublisher.init(config); - timelineClient.start(); - serviceTimelinePublisher.start(); - } - - @After - public void tearDown() throws Exception { - if (serviceTimelinePublisher != null) { - serviceTimelinePublisher.stop(); - } - if (timelineClient != null) { - timelineClient.stop(); - } - } - - @Test - public void testServiceAttemptEntity() { - Application application = createMockApplication(); - serviceTimelinePublisher - .serviceAttemptRegistered(application, new YarnConfiguration()); - - Collection<TimelineEntity> lastPublishedEntities = - ((DummyTimelineClient) timelineClient).getLastPublishedEntities(); - // 2 entities because during registration component also registered. - assertEquals(2, lastPublishedEntities.size()); - for (TimelineEntity timelineEntity : lastPublishedEntities) { - if (timelineEntity.getType() == ServiceTimelineEntityType.COMPONENT - .toString()) { - verifyComponentTimelineEntity(timelineEntity); - } else { - verifyServiceAttemptTimelineEntity(timelineEntity, null, true); - } - } - - ServiceContext context = new ServiceContext(); - context.attemptId = ApplicationAttemptId - .newInstance(ApplicationId.fromString(application.getId()), 1); - String exitDiags = "service killed"; - serviceTimelinePublisher.serviceAttemptUnregistered(context, exitDiags); - lastPublishedEntities = - ((DummyTimelineClient) timelineClient).getLastPublishedEntities(); - for (TimelineEntity timelineEntity : lastPublishedEntities) { - if (timelineEntity.getType() == ServiceTimelineEntityType.SERVICE_ATTEMPT - .toString()) { - verifyServiceAttemptTimelineEntity(timelineEntity, exitDiags, - false); - } - } - } - - @Test - public void testComponentInstanceEntity() { - Container container = new Container(); - container.id(CONTAINER_ID).ip(CONTAINER_IP).bareHost(CONTAINER_BAREHOST) - .hostname(CONTAINER_HOSTNAME).state(ContainerState.RUNNING_BUT_UNREADY) - .launchTime(new Date()); - ComponentInstanceId id = new ComponentInstanceId(0, COMPONENT_NAME); - ComponentInstance instance = mock(ComponentInstance.class); - when(instance.getCompName()).thenReturn(COMPONENT_NAME); - when(instance.getCompInstanceName()).thenReturn("comp_instance_name"); - serviceTimelinePublisher.componentInstanceStarted(container, - instance); - - Collection<TimelineEntity> lastPublishedEntities = - ((DummyTimelineClient) timelineClient).getLastPublishedEntities(); - assertEquals(1, lastPublishedEntities.size()); - TimelineEntity entity = lastPublishedEntities.iterator().next(); - - assertEquals(1, entity.getEvents().size()); - assertEquals(CONTAINER_ID, entity.getId()); - assertEquals(CONTAINER_BAREHOST, - entity.getInfo().get(ServiceTimelineMetricsConstants.BARE_HOST)); - assertEquals(COMPONENT_NAME, - entity.getInfo().get(ServiceTimelineMetricsConstants.COMPONENT_NAME)); - assertEquals(ContainerState.RUNNING_BUT_UNREADY.toString(), - entity.getInfo().get(ServiceTimelineMetricsConstants.STATE)); - - // updated container state - container.setState(ContainerState.READY); - serviceTimelinePublisher.componentInstanceUpdated(container); - lastPublishedEntities = - ((DummyTimelineClient) timelineClient).getLastPublishedEntities(); - assertEquals(1, lastPublishedEntities.size()); - entity = lastPublishedEntities.iterator().next(); - assertEquals(2, entity.getEvents().size()); - assertEquals(ContainerState.READY.toString(), - entity.getInfo().get(ServiceTimelineMetricsConstants.STATE)); - - } - - private void verifyServiceAttemptTimelineEntity(TimelineEntity timelineEntity, - String message, boolean isRegistedEntity) { - assertEquals(SERVICEID, timelineEntity.getId()); - assertEquals(SERVICE_NAME, - timelineEntity.getInfo().get(ServiceTimelineMetricsConstants.NAME)); - if (isRegistedEntity) { - assertEquals(ApplicationState.STARTED.toString(), - timelineEntity.getInfo().get(ServiceTimelineMetricsConstants.STATE)); - assertEquals(ServiceTimelineEvent.SERVICE_ATTEMPT_REGISTERED.toString(), - timelineEntity.getEvents().iterator().next().getId()); - } else { - assertEquals("ENDED", - timelineEntity.getInfo().get(ServiceTimelineMetricsConstants.STATE).toString()); - assertEquals(message, timelineEntity.getInfo() - .get(ServiceTimelineMetricsConstants.DIAGNOSTICS_INFO)); - assertEquals(2, timelineEntity.getEvents().size()); - assertEquals(ServiceTimelineEvent.SERVICE_ATTEMPT_UNREGISTERED.toString(), - timelineEntity.getEvents().iterator().next().getId()); - } - } - - private void verifyComponentTimelineEntity(TimelineEntity entity) { - Map<String, Object> info = entity.getInfo(); - assertEquals("DEFAULT", entity.getId()); - assertEquals(ARTIFACTID, - info.get(ServiceTimelineMetricsConstants.ARTIFACT_ID)); - assertEquals("DOCKER", - info.get(ServiceTimelineMetricsConstants.ARTIFACT_TYPE)); - assertEquals("medium", - info.get(ServiceTimelineMetricsConstants.RESOURCE_PROFILE)); - assertEquals(1, info.get(ServiceTimelineMetricsConstants.RESOURCE_CPU)); - assertEquals("1024", - info.get(ServiceTimelineMetricsConstants.RESOURCE_MEMORY)); - assertEquals("sleep 1", - info.get(ServiceTimelineMetricsConstants.LAUNCH_COMMAND)); - assertEquals("false", - info.get(ServiceTimelineMetricsConstants.RUN_PRIVILEGED_CONTAINER)); - assertEquals("label", - info.get(ServiceTimelineMetricsConstants.PLACEMENT_POLICY)); - } - - private static Application createMockApplication() { - Application application = mock(Application.class); - - when(application.getId()).thenReturn(SERVICEID); - when(application.getLaunchTime()).thenReturn(new Date()); - when(application.getState()).thenReturn(ApplicationState.STARTED); - when(application.getName()).thenReturn(SERVICE_NAME); - when(application.getConfiguration()).thenReturn( - new org.apache.hadoop.yarn.service.api.records.Configuration()); - - Component component = mock(Component.class); - Artifact artifact = new Artifact(); - artifact.setId(ARTIFACTID); - Resource resource = new Resource(); - resource.setCpus(1); - resource.setMemory(1024 + ""); - resource.setProfile("medium"); - when(component.getArtifact()).thenReturn(artifact); - when(component.getName()).thenReturn(COMPONENT_NAME); - when(component.getResource()).thenReturn(resource); - when(component.getLaunchCommand()).thenReturn("sleep 1"); - PlacementPolicy placementPolicy = new PlacementPolicy(); - placementPolicy.setLabel("label"); - when(component.getPlacementPolicy()).thenReturn(placementPolicy); - when(component.getConfiguration()).thenReturn( - new org.apache.hadoop.yarn.service.api.records.Configuration()); - List<Component> components = new ArrayList<Component>(); - components.add(component); - - when(application.getComponents()).thenReturn(components); - return application; - } - - protected static class DummyTimelineClient extends TimelineV2ClientImpl { - private Map<Identifier, TimelineEntity> lastPublishedEntities = - new HashMap<>(); - - public DummyTimelineClient(ApplicationId appId) { - super(appId); - } - - @Override - public void putEntitiesAsync(TimelineEntity... entities) - throws IOException, YarnException { - putEntities(entities); - } - - @Override - public void putEntities(TimelineEntity... entities) - throws IOException, YarnException { - for (TimelineEntity timelineEntity : entities) { - TimelineEntity entity = - lastPublishedEntities.get(timelineEntity.getIdentifier()); - if (entity == null) { - lastPublishedEntities.put(timelineEntity.getIdentifier(), - timelineEntity); - } else { - entity.addMetrics(timelineEntity.getMetrics()); - entity.addEvents(timelineEntity.getEvents()); - entity.addInfo(timelineEntity.getInfo()); - entity.addConfigs(timelineEntity.getConfigs()); - entity.addRelatesToEntities(timelineEntity.getRelatesToEntities()); - entity - .addIsRelatedToEntities(timelineEntity.getIsRelatedToEntities()); - } - } - } - - public Collection<TimelineEntity> getLastPublishedEntities() { - return lastPublishedEntities.values(); - } - - public void reset() { - lastPublishedEntities = null; - } - } -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/example-app.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/example-app.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/example-app.json deleted file mode 100644 index 5dfbd64..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/example-app.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "example-app", - "components" : - [ - { - "name": "simple", - "number_of_containers": 1, - "launch_command": "sleep 2", - "resource": { - "cpus": 1, - "memory": "128" - } - } - ] -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/log4j.properties b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/log4j.properties deleted file mode 100644 index 3adbaa4..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/log4j.properties +++ /dev/null @@ -1,66 +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.registry=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.ipc.CallQueueManager=WARN - -log4j.logger.org.apache.hadoop.util.Shell=ERROR -log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR -log4j.logger.org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager=FATAL -org.apache.hadoop.security.authentication.server.AuthenticationFilter=WARN -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.factories.impl.pb.RpcServerFactoryPBImpl=WARN -log4j.logger.org.apache.hadoop.yarn.server.nodemanager.NodeResourceMonitorImpl=ERROR -log4j.logger.org.apache.hadoop.yarn.server.resourcemanager.security=WARN -log4j.logger.org.apache.hadoop.yarn.server.resourcemanager.metrics.SystemMetricsPublisher=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 http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app-override.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app-override.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app-override.json deleted file mode 100644 index d7e2fd0..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app-override.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "app-1", - "lifetime": "3600", - "launch_command": "sleep 3600", - "configuration": { - "properties": { - "g1": "a", - "g2": "b" - }, - "files": [ - { - "type": "PROPERTIES", - "dest_file": "file1", - "props": { - "k1": "v1", - "k2": "v2" - } - }, - { - "type": "XML", - "dest_file": "file2", - "props": { - "k3": "v3" - } - } - ] - }, - "resource": { - "cpus": 1, - "memory": "512" - }, - "number_of_containers": 2, - "components": [ - { - "name": "simple", - "configuration": { - "files": [ - { - "type": "PROPERTIES", - "dest_file": "file1", - "props": { - "k1": "overridden" - } - } - ] - } - }, - { - "name": "master", - "configuration": { - "properties": { - "name": "m", - "g1": "overridden" - } - } - }, - { - "name": "worker", - "resource": { - "cpus": 1, - "memory": "1024" - }, - "configuration": { - "properties": { - "name": "worker", - "g1": "overridden-by-worker", - "timeout": "1000" - } - } - } - ] -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app.json deleted file mode 100644 index a163b33..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "app-1", - "lifetime": "3600", - "launch_command": "sleep 3600", - "configuration": { - "properties": { - "g1": "a", - "g2": "b", - "yarn.service.failure-count-reset.window": "60" - } - }, - "resource": { - "cpus": 1, - "memory": "512" - }, - "number_of_containers": 2, - "components": [ - { - "name": "simple" - }, - { - "name": "master", - "number_of_containers": 1, - "configuration": { - "properties": { - "g1": "overridden", - "g3": "will-be-overridden", - "jvm.heapsize": "512M" - } - } - }, - { - "name": "worker", - "number_of_containers": 5, - "resource": { - "cpus": 1, - "memory": "1024" - }, - "configuration": { - "properties": { - "g1": "overridden-by-worker", - "jvm.heapsize": "512M" - } - } - } - ] -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/default.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/default.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/default.json deleted file mode 100644 index 73d4e7b..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/default.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "default-app-1", - "lifetime": "3600", - "components" : - [ - { - "name": "sleep", - "number_of_containers": 1, - "launch_command": "sleep 3600", - "resource": { - "cpus": 2, - "memory": "256" - } - } - ] -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external0.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external0.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external0.json deleted file mode 100644 index 1f9dfeb..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external0.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "external-0", - "lifetime": "3600", - "artifact": { - "type": "APPLICATION", - "id": "app-1" - } -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external1.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external1.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external1.json deleted file mode 100644 index 03ebce5..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external1.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "external-1", - "lifetime": "3600", - "components": [ - { - "name": "simple", - "artifact": { - "type": "APPLICATION", - "id": "app-1" - } - }, - { - "name": "master", - "configuration": { - "properties": { - "g3": "is-overridden" - } - } - }, - { - "name": "other", - "launch_command": "sleep 3600", - "number_of_containers": 2, - "resource": { - "cpus": 1, - "memory": "512" - } - } - ] -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external2.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external2.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external2.json deleted file mode 100644 index 9e61fba..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external2.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "external-2", - "lifetime": "3600", - "components": [ - { - "name": "ext", - "artifact": { - "type": "APPLICATION", - "id": "external-1" - } - }, - { - "name": "another", - "launch_command": "sleep 3600", - "number_of_containers": 1, - "resource": { - "cpus": 1, - "memory": "512" - } - } - ] -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/appConfig.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/appConfig.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/appConfig.json deleted file mode 100644 index c87f77c..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/appConfig.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "schema": "http://example.org/specification/v2.0.0", - "metadata": {}, - "global": { - "am.config.generation": "true", - "component.unique.names": "true", - - "export.app.monitor": "${COMPONENT1_HOST} : ${@//site/test-xml/xmlkey}", - "export.other.key": "exportvalue", - - "docker.image": "docker.io/centos:centos6", - "docker.startCommand": "sleep 600", - - "conf.test-json.type": "json", - "conf.test-json.name": "/tmp/test.json", - "conf.test-xml.type": "xml", - "conf.test-xml.name": "/tmp/test.xml", - "conf.test-properties.type": "properties", - "conf.test-properties.name": "/tmp/test.xml", - "conf.test-yaml.type": "yaml", - "conf.test-yaml.name": "/tmp/test.yaml", - "conf.test-env.type": "env", - "conf.test-env.name": "/tmp/testenv", - "conf.test-template.type": "template", - "conf.test-template.name": "/tmp/test.template", - "conf.test-hadoop-xml.type": "hadoop-xml", - "conf.test-hadoop-xml.name": "/tmp/test-hadoop.xml", - - "site.test-json.jsonkey": "val1", - "site.test-xml.xmlkey": "val2", - "site.test-hadoop-xml.xmlkey": "val3", - "site.test-properties.propkey": "val4", - "site.test-yaml.yamlkey": "val5", - "site.test-env.content": "test ${envkey1} {{envkey2}} content", - "site.test-env.envkey1": "envval1", - "site.test-env.envkey2": "envval2", - "site.test-template.templatekey1": "templateval1", - "site.test-template.templatekey2": "templateval2" - }, - "components": { - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/resources.json ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/resources.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/resources.json deleted file mode 100644 index 1b06224..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/resources.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "schema": "http://example.org/specification/v2.0.0", - "metadata": {}, - "global": {}, - "components": { - "slider-appmaster": { - "yarn.memory": "384" - }, - "COMPONENT": { - "yarn.role.priority": "1", - "yarn.component.instances": 2, - "yarn.memory": "512", - "yarn.vcores": "2" - } - } -} http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/test.template ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/test.template b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/test.template deleted file mode 100644 index 2922655..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/org/apache/hadoop/yarn/service/provider/docker/test.template +++ /dev/null @@ -1,16 +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. - -test ${templatekey1} {{templatekey2}} content http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/yarn-site.xml ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/yarn-site.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/yarn-site.xml deleted file mode 100644 index 266caa9..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/yarn-site.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> -<!-- - Licensed 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. See accompanying LICENSE file. ---> - -<configuration> - <!-- Dummy (invalid) config file to be overwriten by TestYarnNativeServices with MiniCluster configuration. --> -</configuration> http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/pom.xml ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/pom.xml deleted file mode 100644 index 6a208d8..0000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed 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. See accompanying LICENSE file. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>hadoop-yarn-applications</artifactId> - <groupId>org.apache.hadoop</groupId> - <version>3.0.0-beta1-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-yarn-slider</artifactId> - <name>Apache Hadoop YARN Slider</name> - <packaging>pom</packaging> - - <properties> - <hadoop.common.build.dir>${basedir}/../../../../hadoop-common-project/hadoop-common/target</hadoop.common.build.dir> - </properties> - - <!-- Do not add dependencies here, add them to the POM of the leaf module --> - - <modules> - <module>hadoop-yarn-slider-core</module> - </modules> -</project> http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/pom.xml ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/pom.xml index 0fc5ceb..4fb579c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/pom.xml @@ -36,7 +36,7 @@ <modules> <module>hadoop-yarn-applications-distributedshell</module> <module>hadoop-yarn-applications-unmanaged-am-launcher</module> - <module>hadoop-yarn-slider</module> + <module>hadoop-yarn-services</module> <module>hadoop-yarn-services-api</module> </modules> http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesDiscovery.md ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesDiscovery.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesDiscovery.md index 4a048af..fa54a09 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesDiscovery.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesDiscovery.md @@ -1,3 +1,17 @@ +<!--- + Licensed 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. See accompanying LICENSE file. +--> + # YARN DNS Server ## Introduction http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesIntro.md ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesIntro.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesIntro.md index e69de29..89fefe9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesIntro.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/native-services/NativeServicesIntro.md @@ -0,0 +1,13 @@ +<!--- + Licensed 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. See accompanying LICENSE file. +--> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/9ae16ae9/hadoop-yarn-project/hadoop-yarn/pom.xml ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/pom.xml b/hadoop-yarn-project/hadoop-yarn/pom.xml index 6303853..c94c24a 100644 --- a/hadoop-yarn-project/hadoop-yarn/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/pom.xml @@ -75,7 +75,7 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> - <excludePackageNames>org.apache.hadoop.yarn.proto:org.apache.hadoop.yarn.federation.proto:org.apache.slider</excludePackageNames> + <excludePackageNames>org.apache.hadoop.yarn.proto:org.apache.hadoop.yarn.federation.proto:org.apache.hadoop.yarn.service</excludePackageNames> </configuration> </plugin> </plugins> --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org