From 40ab068eabe50875449d601471619a4e82fff86d Mon Sep 17 00:00:00 2001 From: Billie Rinaldi Date: Mon, 28 Aug 2017 09:59:55 -0700 Subject: [PATCH] YARN-7091. Rename application to service in yarn-native-services. Contributed by Jian He --- .../resources/assemblies/hadoop-yarn-dist.xml | 8 +- .../assemblies/hadoop-yarn-services-dist.xml | 2 +- hadoop-project/pom.xml | 2 +- hadoop-yarn-project/hadoop-yarn/bin/yarn | 14 +- .../hadoop-yarn/conf/yarn-env.sh | 2 +- .../hadoop-yarn-services-api/pom.xml | 2 +- ...licationApiService.java => ApiServer.java} | 163 ++++---- .../yarn/service/webapp/ApiServerWebApp.java | 159 ++++++++ .../service/webapp/ApplicationApiWebApp.java | 123 ------ ...-Simplified-V1-API-Layer-For-Services.yaml | 185 ++++----- .../src/main/scripts/run_rest_service.sh | 28 -- .../dev-support/findbugs-exclude.xml | 0 .../conf/yarnservice-log4j.properties | 0 .../hadoop-yarn-services-core}/pom.xml | 7 +- .../hadoop/yarn/service/ClientAMProtocol.java | 0 .../hadoop/yarn/service/ClientAMService.java | 2 +- .../yarn/service/ContainerFailureTracker.java | 0 .../hadoop/yarn/service/ServiceContext.java | 4 +- .../hadoop/yarn/service/ServiceMaster.java | 11 +- .../hadoop/yarn/service}/ServiceMetrics.java | 5 +- .../hadoop/yarn/service/ServiceScheduler.java | 31 +- .../service/api}/ServiceApiConstants.java | 2 +- .../yarn/service/api/records/Artifact.java | 10 +- .../service/api/records/BaseResource.java | 6 +- .../yarn/service/api/records/Component.java | 52 +-- .../yarn/service/api/records/ConfigFile.java | 8 +- .../service/api/records/ConfigFormat.java | 0 .../service/api/records/Configuration.java | 16 +- .../yarn/service/api/records/Container.java | 12 +- .../service/api/records/ContainerState.java | 0 .../yarn/service/api/records/Error.java | 0 .../service/api/records/PlacementPolicy.java | 14 +- .../service/api/records/ReadinessCheck.java | 10 +- .../yarn/service/api/records/Resource.java | 10 +- .../yarn/service/api/records/Service.java} | 132 +++--- .../service/api/records/ServiceState.java} | 6 +- .../service/api/records/ServiceStatus.java} | 40 +- .../yarn/service/client/ClientAMProxy.java | 18 +- .../yarn/service/client/ServiceCLI.java | 14 +- .../yarn/service/client/ServiceClient.java | 380 +++++++++--------- .../client/params/AbstractActionArgs.java | 0 .../client/params/AbstractArgsDelegate.java | 0 .../AbstractClusterBuildingActionArgs.java | 6 +- .../client/params/ActionBuildArgs.java | 0 .../client/params/ActionClientArgs.java | 2 +- .../client/params/ActionCreateArgs.java | 0 .../client/params/ActionDependencyArgs.java | 0 .../client/params/ActionDestroyArgs.java | 0 .../client/params/ActionExistsArgs.java | 6 +- .../service/client/params/ActionFlexArgs.java | 0 .../client/params/ActionFreezeArgs.java | 0 .../service/client/params/ActionHelpArgs.java | 0 .../client/params/ActionKDiagArgs.java | 0 .../client/params/ActionKeytabArgs.java | 0 .../service/client/params/ActionListArgs.java | 4 +- .../client/params/ActionRegistryArgs.java | 2 +- .../client/params/ActionResolveArgs.java | 0 .../client/params/ActionResourceArgs.java | 0 .../client/params/ActionStatusArgs.java | 2 +- .../service/client/params/ActionThawArgs.java | 2 +- .../client/params/ActionTokensArgs.java | 0 .../client/params/ActionUpdateArgs.java | 0 .../yarn/service/client/params/ArgOps.java | 0 .../yarn/service/client/params/Arguments.java | 0 .../service/client/params/ClientArgs.java | 0 .../service/client/params/CommonArgs.java | 2 +- .../client/params/ComponentArgsDelegate.java | 0 .../client/params/DontSplitArguments.java | 0 .../client/params/LaunchArgsAccessor.java | 0 .../client/params/LaunchArgsDelegate.java | 2 +- .../client/params/OptionArgsDelegate.java | 0 .../client/params/PathArgumentConverter.java | 0 .../service/client/params/SliderAMArgs.java | 0 .../client/params/SliderAMCreateAction.java | 0 .../service/client/params/SliderActions.java | 4 +- .../client/params/WaitArgsDelegate.java | 0 .../client/params/WaitTimeAccessor.java | 0 .../yarn/service/component/Component.java | 27 +- .../service/component/ComponentEvent.java | 2 +- .../service/component/ComponentEventType.java | 0 .../service/component/ComponentState.java | 0 .../instance}/ComponentInstance.java | 20 +- .../instance}/ComponentInstanceEvent.java | 2 +- .../instance}/ComponentInstanceEventType.java | 5 +- .../instance}/ComponentInstanceId.java | 2 +- .../instance}/ComponentInstanceState.java | 4 +- .../yarn/service/conf/RestApiConstants.java | 12 +- .../yarn/service/conf/SliderExitCodes.java | 8 +- .../yarn/service/conf/YarnServiceConf.java | 4 + .../service/conf/YarnServiceConstants.java | 2 +- .../containerlaunch/AbstractLauncher.java | 0 .../containerlaunch/ClasspathConstructor.java | 0 .../containerlaunch/CommandLineBuilder.java | 0 .../ContainerLaunchService.java | 16 +- .../containerlaunch/CredentialUtils.java | 0 .../JavaCommandLineBuilder.java | 0 .../exceptions/BadClusterStateException.java | 0 .../BadCommandArgumentsException.java | 0 .../exceptions/BadConfigException.java | 0 .../yarn/service/exceptions/ErrorStrings.java | 25 +- .../service/exceptions/ExitCodeProvider.java | 0 .../service/exceptions/LauncherExitCodes.java | 8 +- .../exceptions/RestApiErrorMessages.java | 20 +- .../exceptions/ServiceLaunchException.java | 0 .../service/exceptions/SliderException.java | 0 .../service/exceptions/UsageException.java | 0 .../client/ClientAMProtocolPBClientImpl.java | 0 .../impl/pb/service/ClientAMProtocolPB.java | 0 .../ClientAMProtocolPBServiceImpl.java | 0 .../yarn/service/monitor}/ServiceMonitor.java | 23 +- .../service/monitor}/probe/HttpProbe.java | 4 +- .../monitor}/probe/LogEntryBuilder.java | 2 +- .../service/monitor}/probe/MonitorKeys.java | 2 +- .../service/monitor}/probe/MonitorUtils.java | 2 +- .../service/monitor}/probe/PortProbe.java | 4 +- .../yarn/service/monitor}/probe/Probe.java | 4 +- .../service/monitor}/probe/ProbeStatus.java | 2 +- .../provider/AbstractClientProvider.java | 0 .../provider/AbstractProviderService.java | 14 +- .../service/provider/ProviderFactory.java | 12 +- .../service/provider/ProviderService.java | 6 +- .../yarn/service/provider/ProviderUtils.java | 18 +- .../defaultImpl/DefaultClientProvider.java | 0 .../defaultImpl/DefaultProviderFactory.java | 0 .../defaultImpl/DefaultProviderService.java | 6 +- .../provider/docker/DockerClientProvider.java | 0 .../service/provider/docker/DockerKeys.java | 0 .../docker/DockerProviderFactory.java | 0 .../docker/DockerProviderService.java | 10 +- .../tarball/TarballClientProvider.java | 0 .../tarball/TarballProviderFactory.java | 0 .../tarball/TarballProviderService.java | 6 +- .../registry/CustomRegistryConstants.java | 0 .../YarnRegistryViewForProviders.java | 2 +- .../timelineservice/ServiceMetricsSink.java | 0 .../ServiceTimelineEntityType.java | 0 .../timelineservice/ServiceTimelineEvent.java | 0 .../ServiceTimelineMetricsConstants.java | 0 .../ServiceTimelinePublisher.java | 30 +- .../service/timelineservice/package-info.java | 0 .../utils/ApplicationReportSerDeser.java | 0 .../service/utils/ClientRegistryBinder.java | 0 .../yarn/service/utils/Comparators.java | 0 .../yarn/service/utils/ConfigHelper.java | 0 .../yarn/service/utils/ConfigUtils.java | 0 .../yarn/service/utils/CoreFileSystem.java | 2 +- .../hadoop/yarn/service/utils/Duration.java | 0 .../yarn/service/utils/JsonSerDeser.java | 0 .../yarn/service/utils/KerberosDiags.java | 0 .../yarn/service/utils/PatternValidator.java | 2 +- .../yarn/service/utils/PortScanner.java | 0 .../service/utils/PublishedConfiguration.java | 0 .../PublishedConfigurationOutputter.java | 0 .../utils/SerializedApplicationReport.java | 4 +- .../yarn/service/utils/ServiceApiUtil.java | 191 ++++----- .../service/utils/ServiceRegistryUtils.java | 0 .../yarn/service/utils/SliderFileSystem.java | 0 .../yarn/service/utils/SliderUtils.java | 59 +-- .../yarn/service/utils/ZookeeperUtils.java | 0 .../src/main/proto/ClientAMProtocol.proto | 0 .../hadoop/yarn/service/MockServiceAM.java | 24 +- .../hadoop/yarn/service/ServiceTestUtils.java | 10 +- .../yarn/service/TestServiceApiUtil.java | 141 +++---- .../yarn/service/TestYarnNativeServices.java | 32 +- .../client/TestBuildExternalComponents.java | 10 +- .../yarn/service/client/TestServiceCLI.java | 36 +- .../yarn/service/conf/ExampleAppJson.java | 4 +- .../yarn/service/conf/TestAppJsonResolve.java | 22 +- .../service/conf/TestLoadExampleAppJson.java | 6 +- .../conf/TestValidateServiceNames.java | 15 +- .../service/monitor}/TestServiceMonitor.java | 6 +- .../providers/TestAbstractClientProvider.java | 0 .../providers/TestProviderFactory.java | 6 +- .../TestServiceTimelinePublisher.java | 34 +- .../src/test/resources/example-app.json | 0 .../service/conf/examples/app-override.json | 0 .../yarn/service/conf/examples/app.json | 3 +- .../yarn/service/conf/examples/default.json | 0 .../yarn/service/conf/examples/external0.json | 2 +- .../yarn/service/conf/examples/external1.json | 2 +- .../yarn/service/conf/examples/external2.json | 2 +- .../src/test/resources/yarn-site.xml | 0 .../pom.xml | 7 +- .../src/assembly/executable-jar.xml | 47 --- .../yarn/service/rest/BaseRestClient.java | 149 ------- .../yarn/service/rest/ExceptionConverter.java | 128 ------ .../hadoop/yarn/service/rest/HttpVerb.java | 57 --- .../rest/SliderURLConnectionFactory.java | 176 -------- .../yarn/service/rest/UgiJerseyBinding.java | 153 ------- .../service/rest/UrlConnectionOperations.java | 83 ---- .../src/test/resources/log4j.properties | 66 --- .../service/provider/docker/appConfig.json | 42 -- .../service/provider/docker/resources.json | 16 - .../service/provider/docker/test.template | 16 - .../hadoop-yarn-applications/pom.xml | 2 +- .../NativeServicesDiscovery.md | 14 + .../native-services/NativeServicesIntro.md | 13 + hadoop-yarn-project/hadoop-yarn/pom.xml | 2 +- 198 files changed, 1247 insertions(+), 2151 deletions(-) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/{ApplicationApiService.java => ApiServer.java} (58%) create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServerWebApp.java delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiWebApp.java delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/scripts/run_rest_service.sh rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider => hadoop-yarn-services}/dev-support/findbugs-exclude.xml (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/conf/yarnservice-log4j.properties (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/pom.xml (98%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/ClientAMProtocol.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java (98%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/ContainerFailureTracker.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/ServiceContext.java (93%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/ServiceMaster.java (94%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/metrics => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service}/ServiceMetrics.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/constants => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api}/ServiceApiConstants.java (97%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/Artifact.java (95%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/Component.java (85%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFile.java (97%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFormat.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/Configuration.java (91%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/Container.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/ContainerState.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/Error.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/PlacementPolicy.java (75%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/ReadinessCheck.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/api/records/Resource.java (91%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Application.java => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Service.java} (68%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ApplicationState.java => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ServiceState.java} (90%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ApplicationStatus.java => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ServiceStatus.java} (71%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/ClientAMProxy.java (79%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/ServiceCLI.java (89%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java (73%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractActionArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractArgsDelegate.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractClusterBuildingActionArgs.java (88%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionBuildArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionClientArgs.java (97%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionCreateArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDependencyArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDestroyArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionExistsArgs.java (87%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFlexArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFreezeArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionHelpArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKDiagArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKeytabArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionListArgs.java (94%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionRegistryArgs.java (98%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java (95%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java (99%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMArgs.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java (94%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/component/Component.java (95%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEvent.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEventType.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/component/ComponentState.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance}/ComponentInstance.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance}/ComponentInstanceEvent.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance}/ComponentInstanceEventType.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance}/ComponentInstanceId.java (97%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance}/ComponentInstanceState.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java (83%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java (89%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java (95%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java (98%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/AbstractLauncher.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ClasspathConstructor.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CommandLineBuilder.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ContainerLaunchService.java (87%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CredentialUtils.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/JavaCommandLineBuilder.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadClusterStateException.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadCommandArgumentsException.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadConfigException.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/ErrorStrings.java (53%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/ExitCodeProvider.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/LauncherExitCodes.java (95%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/RestApiErrorMessages.java (84%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/ServiceLaunchException.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/SliderException.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/exceptions/UsageException.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/impl/pb/client/ClientAMProtocolPBClientImpl.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPB.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPBServiceImpl.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor}/ServiceMonitor.java (84%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor}/probe/HttpProbe.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor}/probe/LogEntryBuilder.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor}/probe/MonitorKeys.java (97%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor}/probe/MonitorUtils.java (97%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor}/probe/PortProbe.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor}/probe/Probe.java (95%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor}/probe/ProbeStatus.java (98%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractClientProvider.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractProviderService.java (91%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderFactory.java (86%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderService.java (88%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultClientProvider.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderFactory.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderService.java (89%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerClientProvider.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerKeys.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderFactory.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderService.java (87%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballClientProvider.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderFactory.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderService.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/registry/CustomRegistryConstants.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/registry/YarnRegistryViewForProviders.java (98%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceMetricsSink.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEntityType.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEvent.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineMetricsConstants.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelinePublisher.java (93%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/timelineservice/package-info.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/ApplicationReportSerDeser.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/ClientRegistryBinder.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/Comparators.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigHelper.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigUtils.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/CoreFileSystem.java (99%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/Duration.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/JsonSerDeser.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/KerberosDiags.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/PatternValidator.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/PortScanner.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfiguration.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfigurationOutputter.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/SerializedApplicationReport.java (97%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java (70%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceRegistryUtils.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/SliderFileSystem.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java (96%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/java/org/apache/hadoop/yarn/service/utils/ZookeeperUtils.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/main/proto/ClientAMProtocol.proto (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/MockServiceAM.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/ServiceTestUtils.java (87%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/TestServiceApiUtil.java (74%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java (94%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java (74%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/conf/ExampleAppJson.java (93%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/conf/TestAppJsonResolve.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/conf/TestLoadExampleAppJson.java (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/conf/TestValidateServiceNames.java (88%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/servicemonitor => hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/monitor}/TestServiceMonitor.java (95%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/providers/TestAbstractClientProvider.java (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/providers/TestProviderFactory.java (94%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java (91%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/resources/example-app.json (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app-override.json (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app.json (92%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/default.json (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external0.json (76%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external1.json (93%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external2.json (91%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider/hadoop-yarn-slider-core => hadoop-yarn-services/hadoop-yarn-services-core}/src/test/resources/yarn-site.xml (100%) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/{hadoop-yarn-slider => hadoop-yarn-services}/pom.xml (88%) delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/assembly/executable-jar.xml delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/BaseRestClient.java delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/ExceptionConverter.java delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/HttpVerb.java delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/SliderURLConnectionFactory.java delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/UgiJerseyBinding.java delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/UrlConnectionOperations.java delete mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/log4j.properties delete mode 100644 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 delete mode 100644 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 delete mode 100644 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-assemblies/src/main/resources/assemblies/hadoop-yarn-dist.xml b/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-dist.xml index 4483fa87bb..8aeeabd2bf 100644 --- a/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-dist.xml +++ b/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-dist.xml @@ -87,19 +87,19 @@ - hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/target + hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/target /share/hadoop/${hadoop.component}/sources *-sources.jar - hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/conf + hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/conf etc/hadoop - hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/target/hadoop-yarn-slider-core-${project.version} - /share/hadoop/${hadoop.component}/lib/slider + hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/target/hadoop-yarn-services-core-${project.version} + /share/hadoop/${hadoop.component}/lib/services hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/target diff --git a/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-services-dist.xml b/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-services-dist.xml index 5de45a9c28..1b81f98be5 100644 --- a/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-services-dist.xml +++ b/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-services-dist.xml @@ -17,7 +17,7 @@ - hadoop-yarn-slider-dist + hadoop-yarn-services-dist dir diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index f5b550ffab..3923183c82 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -428,7 +428,7 @@ org.apache.hadoop - hadoop-yarn-slider-core + hadoop-yarn-services-core ${project.version} diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn index 785f7144c0..0a534555a6 100755 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn @@ -49,7 +49,7 @@ function hadoop_usage hadoop_add_subcommand "router" daemon "run the Router daemon" hadoop_add_subcommand "schedulerconf" client "Updates scheduler configuration" hadoop_add_subcommand "scmadmin" admin "SharedCacheManager admin tools" - hadoop_add_subcommand "servicesapi" "run yarn-native-service rest server" + hadoop_add_subcommand "apiserver" "run yarn-native-service rest server" hadoop_add_subcommand "sharedcachemanager" daemon "run the SharedCacheManager daemon" hadoop_add_subcommand "service" "run a service" hadoop_add_subcommand "timelinereader" client "run the timeline reader server" @@ -151,14 +151,14 @@ function yarncmd_case scmadmin) HADOOP_CLASSNAME='org.apache.hadoop.yarn.client.SCMAdmin' ;; - servicesapi) + apiserver) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" - hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider"'/*' + hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/services"'/*' hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/services-api"'/*' - HADOOP_CLASSNAME='org.apache.hadoop.yarn.service.webapp.ApplicationApiWebApp' + HADOOP_CLASSNAME='org.apache.hadoop.yarn.service.webapp.ApiServerWebApp' local sld="${HADOOP_YARN_HOME}/${YARN_DIR},\ ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR},\ -${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider,\ +${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/services,\ ${HADOOP_HDFS_HOME}/${HDFS_DIR},\ ${HADOOP_HDFS_HOME}/${HDFS_LIB_JARS_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_DIR},\ @@ -171,11 +171,11 @@ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.sharedcachemanager.SharedCacheManager' ;; service) - hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider"'/*' + hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/services"'/*' HADOOP_CLASSNAME='org.apache.hadoop.yarn.service.client.ServiceCLI' local sld="${HADOOP_YARN_HOME}/${YARN_DIR},\ ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR},\ -${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider,\ +${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/services,\ ${HADOOP_HDFS_HOME}/${HDFS_DIR},\ ${HADOOP_HDFS_HOME}/${HDFS_LIB_JARS_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_DIR},\ diff --git a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh index 02aec3be48..90a87bfb04 100644 --- a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh +++ b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh @@ -159,4 +159,4 @@ # # See ResourceManager for some examples # -#export YARN_SERVICESAPI_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:${HADOOP_LOG_DIR}/gc-servicesapi.log-$(date +'%Y%m%d%H%M')" +#export YARN_APISERVER_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:${HADOOP_LOG_DIR}/gc-apiserver.log-$(date +'%Y%m%d%H%M')" diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/pom.xml index fb2f2babed..7d9f15cedf 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/pom.xml @@ -91,7 +91,7 @@ org.apache.hadoop - hadoop-yarn-slider-core + hadoop-yarn-services-core ${project.version} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java similarity index 58% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiService.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java index 30fc5ef590..f55e3f1880 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java @@ -24,10 +24,10 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.ApplicationNotFoundException; import org.apache.hadoop.yarn.exceptions.YarnException; +import org.apache.hadoop.yarn.service.api.records.Service; +import org.apache.hadoop.yarn.service.api.records.ServiceState; +import org.apache.hadoop.yarn.service.api.records.ServiceStatus; import org.apache.hadoop.yarn.service.client.ServiceClient; -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.ApplicationStatus; import org.apache.hadoop.yarn.service.api.records.Component; import org.apache.hadoop.yarn.service.utils.SliderUtils; import org.apache.hadoop.yarn.service.utils.ServiceApiUtil; @@ -51,11 +51,14 @@ import static org.apache.hadoop.yarn.service.conf.RestApiConstants.*; +/** + * The rest API endpoints for users to manage services on YARN. + */ @Singleton @Path(CONTEXT_ROOT) -public class ApplicationApiService { +public class ApiServer { private static final Logger LOG = - LoggerFactory.getLogger(ApplicationApiService.class); + LoggerFactory.getLogger(ApiServer.class); private static Configuration YARN_CONFIG = new YarnConfiguration(); private static ServiceClient SERVICE_CLIENT; @@ -81,92 +84,88 @@ public Response getVersion() { } @POST - @Path(APP_ROOT_PATH) + @Path(SERVICE_ROOT_PATH) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public Response createApplication(Application application) { - LOG.info("POST: createApplication = {}", application); - ApplicationStatus applicationStatus = new ApplicationStatus(); + public Response createService(Service service) { + LOG.info("POST: createService = {}", service); + ServiceStatus serviceStatus = new ServiceStatus(); try { - ApplicationId applicationId = SERVICE_CLIENT.actionCreate(application); - LOG.info("Successfully created application " + application.getName() + ApplicationId applicationId = SERVICE_CLIENT.actionCreate(service); + LOG.info("Successfully created service " + service.getName() + " applicationId = " + applicationId); - applicationStatus.setState(ApplicationState.ACCEPTED); - applicationStatus.setUri( - CONTEXT_ROOT + APP_ROOT_PATH + "/" + application + serviceStatus.setState(ServiceState.ACCEPTED); + serviceStatus.setUri( + CONTEXT_ROOT + SERVICE_ROOT_PATH + "/" + service .getName()); - return Response.status(Status.CREATED).entity(applicationStatus).build(); + return Response.status(Status.CREATED).entity(serviceStatus).build(); } catch (IllegalArgumentException e) { - applicationStatus.setDiagnostics(e.getMessage()); - return Response.status(Status.BAD_REQUEST).entity(applicationStatus) + serviceStatus.setDiagnostics(e.getMessage()); + return Response.status(Status.BAD_REQUEST).entity(serviceStatus) .build(); } catch (Exception e) { - String message = "Failed to create application " + application.getName(); + String message = "Failed to create service " + service.getName(); LOG.error(message, e); - applicationStatus.setDiagnostics(message + ": " + e.getMessage()); + serviceStatus.setDiagnostics(message + ": " + e.getMessage()); return Response.status(Status.INTERNAL_SERVER_ERROR) - .entity(applicationStatus).build(); + .entity(serviceStatus).build(); } } @GET - @Path(APP_PATH) + @Path(SERVICE_PATH) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public Response getApplication(@PathParam(APP_NAME) String appName) { - LOG.info("GET: getApplication for appName = {}", appName); - ApplicationStatus applicationStatus = new ApplicationStatus(); - - // app name validation - if (!SliderUtils.isClusternameValid(appName)) { - applicationStatus.setDiagnostics("Invalid application name: " + appName); - applicationStatus.setCode(ERROR_CODE_APP_NAME_INVALID); - return Response.status(Status.NOT_FOUND).entity(applicationStatus) - .build(); - } - + public Response getService(@PathParam(SERVICE_NAME) String appName) { + LOG.info("GET: getService for appName = {}", appName); + ServiceStatus serviceStatus = new ServiceStatus(); try { - Application app = SERVICE_CLIENT.getStatus(appName); + Service app = SERVICE_CLIENT.getStatus(appName); return Response.ok(app).build(); + } catch (IllegalArgumentException e) { + serviceStatus.setDiagnostics(e.getMessage()); + serviceStatus.setCode(ERROR_CODE_APP_NAME_INVALID); + return Response.status(Status.NOT_FOUND).entity(serviceStatus) + .build(); } catch (Exception e) { - LOG.error("Get application failed", e); - applicationStatus - .setDiagnostics("Failed to retrieve application: " + e.getMessage()); + LOG.error("Get service failed", e); + serviceStatus + .setDiagnostics("Failed to retrieve service: " + e.getMessage()); return Response.status(Status.INTERNAL_SERVER_ERROR) - .entity(applicationStatus).build(); + .entity(serviceStatus).build(); } } @DELETE - @Path(APP_PATH) + @Path(SERVICE_PATH) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public Response deleteApplication(@PathParam(APP_NAME) String appName) { - LOG.info("DELETE: deleteApplication for appName = {}", appName); - return stopApplication(appName, true); + public Response deleteService(@PathParam(SERVICE_NAME) String appName) { + LOG.info("DELETE: deleteService for appName = {}", appName); + return stopService(appName, true); } - private Response stopApplication(String appName, boolean destroy) { + private Response stopService(String appName, boolean destroy) { try { SERVICE_CLIENT.actionStop(appName, destroy); if (destroy) { SERVICE_CLIENT.actionDestroy(appName); - LOG.info("Successfully deleted application {}", appName); + LOG.info("Successfully deleted service {}", appName); } else { - LOG.info("Successfully stopped application {}", appName); + LOG.info("Successfully stopped service {}", appName); } return Response.status(Status.NO_CONTENT).build(); } catch (ApplicationNotFoundException e) { - ApplicationStatus applicationStatus = new ApplicationStatus(); - applicationStatus.setDiagnostics( - "Application " + appName + " not found " + e.getMessage()); - return Response.status(Status.NOT_FOUND).entity(applicationStatus) + ServiceStatus serviceStatus = new ServiceStatus(); + serviceStatus.setDiagnostics( + "Service " + appName + " not found " + e.getMessage()); + return Response.status(Status.NOT_FOUND).entity(serviceStatus) .build(); } catch (Exception e) { - ApplicationStatus applicationStatus = new ApplicationStatus(); - applicationStatus.setDiagnostics(e.getMessage()); + ServiceStatus serviceStatus = new ServiceStatus(); + serviceStatus.setDiagnostics(e.getMessage()); return Response.status(Status.INTERNAL_SERVER_ERROR) - .entity(applicationStatus).build(); + .entity(serviceStatus).build(); } } @@ -174,12 +173,12 @@ private Response stopApplication(String appName, boolean destroy) { @Path(COMPONENT_PATH) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN }) - public Response updateComponent(@PathParam(APP_NAME) String appName, + public Response updateComponent(@PathParam(SERVICE_NAME) String appName, @PathParam(COMPONENT_NAME) String componentName, Component component) { if (component.getNumberOfContainers() < 0) { return Response.status(Status.BAD_REQUEST).entity( - "Application = " + appName + ", Component = " + component.getName() + "Service = " + appName + ", Component = " + component.getName() + ": Invalid number of containers specified " + component .getNumberOfContainers()).build(); } @@ -192,7 +191,7 @@ public Response updateComponent(@PathParam(APP_NAME) String appName, .get(componentName) + " to " + component.getNumberOfContainers()) .build(); } catch (YarnException | IOException e) { - ApplicationStatus status = new ApplicationStatus(); + ServiceStatus status = new ServiceStatus(); status.setDiagnostics(e.getMessage()); return Response.status(Status.INTERNAL_SERVER_ERROR).entity(status) .build(); @@ -200,43 +199,43 @@ public Response updateComponent(@PathParam(APP_NAME) String appName, } @PUT - @Path(APP_PATH) + @Path(SERVICE_PATH) @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) - public Response updateApplication(@PathParam(APP_NAME) String appName, - Application updateAppData) { - LOG.info("PUT: updateApplication for app = {} with data = {}", appName, - updateAppData); + public Response updateService(@PathParam(SERVICE_NAME) String appName, + Service updateServiceData) { + LOG.info("PUT: updateService for app = {} with data = {}", appName, + updateServiceData); - // Ignore the app name provided in updateAppData and always use appName + // Ignore the app name provided in updateServiceData and always use appName // path param - updateAppData.setName(appName); + updateServiceData.setName(appName); // For STOP the app should be running. If already stopped then this // operation will be a no-op. For START it should be in stopped state. // If already running then this operation will be a no-op. - if (updateAppData.getState() != null - && updateAppData.getState() == ApplicationState.STOPPED) { - return stopApplication(appName, false); + if (updateServiceData.getState() != null + && updateServiceData.getState() == ServiceState.STOPPED) { + return stopService(appName, false); } // If a START is requested - if (updateAppData.getState() != null - && updateAppData.getState() == ApplicationState.STARTED) { - return startApplication(appName); + if (updateServiceData.getState() != null + && updateServiceData.getState() == ServiceState.STARTED) { + return startService(appName); } // If new lifetime value specified then update it - if (updateAppData.getLifetime() != null - && updateAppData.getLifetime() > 0) { - return updateLifetime(appName, updateAppData); + if (updateServiceData.getLifetime() != null + && updateServiceData.getLifetime() > 0) { + return updateLifetime(appName, updateServiceData); } // flex a single component app - if (updateAppData.getNumberOfContainers() != null && !ServiceApiUtil - .hasComponent(updateAppData)) { - Component defaultComp = ServiceApiUtil.createDefaultComponent(updateAppData); - return updateComponent(updateAppData.getName(), defaultComp.getName(), + if (updateServiceData.getNumberOfContainers() != null && !ServiceApiUtil + .hasComponent(updateServiceData)) { + Component defaultComp = ServiceApiUtil.createDefaultComponent(updateServiceData); + return updateComponent(updateServiceData.getName(), defaultComp.getName(), defaultComp); } @@ -244,15 +243,15 @@ public Response updateApplication(@PathParam(APP_NAME) String appName, return Response.status(Status.NO_CONTENT).build(); } - private Response updateLifetime(String appName, Application updateAppData) { + private Response updateLifetime(String appName, Service updateAppData) { try { String newLifeTime = SERVICE_CLIENT.updateLifetime(appName, updateAppData.getLifetime()); - return Response.ok("Application " + appName + " lifeTime is successfully updated to " + return Response.ok("Service " + appName + " lifeTime is successfully updated to " + updateAppData.getLifetime() + " seconds from now: " + newLifeTime).build(); } catch (Exception e) { String message = - "Failed to update application (" + appName + ") lifetime (" + "Failed to update service (" + appName + ") lifetime (" + updateAppData.getLifetime() + ")"; LOG.error(message, e); return Response.status(Status.INTERNAL_SERVER_ERROR) @@ -260,13 +259,13 @@ private Response updateLifetime(String appName, Application updateAppData) { } } - private Response startApplication(String appName) { + private Response startService(String appName) { try { SERVICE_CLIENT.actionStart(appName); - LOG.info("Successfully started application " + appName); - return Response.ok("Application " + appName + " is successfully started").build(); + LOG.info("Successfully started service " + appName); + return Response.ok("Service " + appName + " is successfully started").build(); } catch (Exception e) { - String message = "Failed to start application " + appName; + String message = "Failed to start service " + appName; LOG.info(message, e); return Response.status(Status.INTERNAL_SERVER_ERROR) .entity(message + ": " + e.getMessage()).build(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServerWebApp.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServerWebApp.java new file mode 100644 index 0000000000..b226df7917 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServerWebApp.java @@ -0,0 +1,159 @@ +/* + * 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.webapp; + +import org.apache.hadoop.http.HttpServer2; +import org.apache.hadoop.net.NetUtils; +import org.apache.hadoop.security.AuthenticationFilterInitializer; +import org.apache.hadoop.security.SecurityUtil; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.service.AbstractService; +import org.apache.hadoop.util.StringUtils; +import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.apache.hadoop.yarn.webapp.GenericExceptionHandler; +import org.apache.hadoop.yarn.webapp.YarnJacksonJaxbJsonProvider; +import org.eclipse.jetty.webapp.Configuration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import static org.apache.hadoop.yarn.conf.YarnConfiguration.RM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY; +import static org.apache.hadoop.yarn.conf.YarnConfiguration.RM_WEBAPP_SPNEGO_USER_NAME_KEY; +import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.*; + +/** + * This class launches the web service using Hadoop HttpServer2 (which uses + * an embedded Jetty container). This is the entry point to your service. + * The Java command used to launch this app should call the main method. + */ +public class ApiServerWebApp extends AbstractService { + private static final Logger logger = LoggerFactory + .getLogger(ApiServerWebApp.class); + private static final String SEP = ";"; + + // REST API server for YARN native services + private HttpServer2 apiServer; + private InetSocketAddress bindAddress; + + public static void main(String[] args) throws IOException { + ApiServerWebApp apiWebApp = new ApiServerWebApp(); + try { + apiWebApp.startWebApp(); + } catch (Exception e) { + apiWebApp.close(); + } + } + + public ApiServerWebApp() { + super(ApiServerWebApp.class.getName()); + } + + @Override + protected void serviceStart() throws Exception { + bindAddress = getConfig().getSocketAddr(API_SERVER_ADDRESS, + DEFAULT_API_SERVER_ADDRESS , DEFAULT_API_SERVER_PORT); + logger.info("YARN API server running on " + bindAddress); + if (UserGroupInformation.isSecurityEnabled()) { + doSecureLogin(getConfig()); + } + startWebApp(); + super.serviceStart(); + } + + @Override + protected void serviceStop() throws Exception { + if (apiServer != null) { + apiServer.stop(); + } + super.serviceStop(); + } + + private void doSecureLogin(org.apache.hadoop.conf.Configuration conf) + throws IOException { + SecurityUtil.login(conf, YarnConfiguration.RM_KEYTAB, + YarnConfiguration.RM_PRINCIPAL, bindAddress.getHostName()); + addFilters(conf); + } + + private void addFilters(org.apache.hadoop.conf.Configuration conf) { + // Always load pseudo authentication filter to parse "user.name" in an URL + // to identify a HTTP request's user. + boolean hasHadoopAuthFilterInitializer = false; + String filterInitializerConfKey = "hadoop.http.filter.initializers"; + Class[] initializersClasses = + conf.getClasses(filterInitializerConfKey); + List targets = new ArrayList(); + if (initializersClasses != null) { + for (Class initializer : initializersClasses) { + if (initializer.getName().equals( + AuthenticationFilterInitializer.class.getName())) { + hasHadoopAuthFilterInitializer = true; + break; + } + targets.add(initializer.getName()); + } + } + if (!hasHadoopAuthFilterInitializer) { + targets.add(AuthenticationFilterInitializer.class.getName()); + conf.set(filterInitializerConfKey, StringUtils.join(",", targets)); + } + } + + private void startWebApp() throws IOException { + URI uri = URI.create("http://" + NetUtils.getHostPortString(bindAddress)); + + apiServer = new HttpServer2.Builder() + .setName("api-server") + .setConf(getConfig()) + .setSecurityEnabled(UserGroupInformation.isSecurityEnabled()) + .setUsernameConfKey(RM_WEBAPP_SPNEGO_USER_NAME_KEY) + .setKeytabConfKey(RM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY) + .addEndpoint(uri).build(); + + String apiPackages = + ApiServer.class.getPackage().getName() + SEP + + GenericExceptionHandler.class.getPackage().getName() + SEP + + YarnJacksonJaxbJsonProvider.class.getPackage().getName(); + apiServer.addJerseyResourcePackage(apiPackages, "/*"); + + try { + logger.info("Service starting up. Logging start..."); + apiServer.start(); + logger.info("Server status = {}", apiServer.toString()); + for (Configuration conf : apiServer.getWebAppContext() + .getConfigurations()) { + logger.info("Configurations = {}", conf); + } + logger.info("Context Path = {}", Collections.singletonList( + apiServer.getWebAppContext().getContextPath())); + logger.info("ResourceBase = {}", Collections.singletonList( + apiServer.getWebAppContext().getResourceBase())); + logger.info("War = {}", Collections + .singletonList(apiServer.getWebAppContext().getWar())); + } catch (Exception ex) { + logger.error("Hadoop HttpServer2 App **failed**", ex); + throw ex; + } + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiWebApp.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiWebApp.java deleted file mode 100644 index 722520982a..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiWebApp.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.webapp; - -import static org.apache.hadoop.yarn.service.conf.RestApiConstants.*; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.URI; -import java.util.Arrays; - -import org.apache.commons.lang.StringUtils; -import org.apache.hadoop.http.HttpServer2; -import org.apache.hadoop.service.AbstractService; -import org.apache.hadoop.yarn.webapp.GenericExceptionHandler; -import org.apache.hadoop.yarn.webapp.YarnJacksonJaxbJsonProvider; -import org.eclipse.jetty.webapp.Configuration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class launches the web application using Hadoop HttpServer2 (which uses - * an embedded Jetty container). This is the entry point to your application. - * The Java command used to launch this app should call the main method. - */ -public class ApplicationApiWebApp extends AbstractService { - private static final Logger logger = LoggerFactory - .getLogger(ApplicationApiWebApp.class); - private static final String SEP = ";"; - - // REST API server for YARN native services - private HttpServer2 applicationApiServer; - - public static void main(String[] args) throws IOException { - ApplicationApiWebApp apiWebApp = new ApplicationApiWebApp(); - try { - apiWebApp.startWebApp(); - } catch (Exception e) { - if (apiWebApp != null) { - apiWebApp.close(); - } - } - } - - public ApplicationApiWebApp() { - super(ApplicationApiWebApp.class.getName()); - } - - @Override - protected void serviceStart() throws Exception { - startWebApp(); - super.serviceStart(); - } - - @Override - protected void serviceStop() throws Exception { - if (applicationApiServer != null) { - applicationApiServer.stop(); - } - super.serviceStop(); - } - - protected void startWebApp() throws IOException { - // The port that we should run on can be set into an environment variable - // Look for that variable and default to 9191 if it isn't there. - String webPort = System.getenv(PROPERTY_REST_SERVICE_PORT); - if (StringUtils.isEmpty(webPort)) { - webPort = "9191"; - } - - String webHost = System.getenv(PROPERTY_REST_SERVICE_HOST); - if (StringUtils.isEmpty(webHost)) { - webHost = InetAddress.getLocalHost().getHostName(); - } - logger.info("YARN native services REST API running on host {} and port {}", - webHost, webPort); - logger.info("Configuration = {}", getConfig()); - - applicationApiServer = new HttpServer2.Builder() - .setName("services-rest-api") - .addEndpoint(URI.create("http://" + webHost + ":" + webPort)).build(); - - String apiPackages = - ApplicationApiService.class.getPackage().getName() + SEP - + GenericExceptionHandler.class.getPackage().getName() + SEP - + YarnJacksonJaxbJsonProvider.class.getPackage().getName(); - applicationApiServer.addJerseyResourcePackage(apiPackages, "/*"); - - try { - logger.info("Application starting up. Logging start..."); - applicationApiServer.start(); - logger.info("Server status = {}", applicationApiServer.toString()); - for (Configuration conf : applicationApiServer.getWebAppContext() - .getConfigurations()) { - logger.info("Configurations = {}", conf); - } - logger.info("Context Path = {}", Arrays.asList(applicationApiServer - .getWebAppContext().getContextPath())); - logger.info("ResourceBase = {}", Arrays.asList(applicationApiServer - .getWebAppContext().getResourceBase())); - logger.info("War = {}", - Arrays.asList(applicationApiServer.getWebAppContext().getWar())); - } catch (Exception ex) { - logger.error("Hadoop HttpServer2 App **failed**", ex); - throw ex; - } - } -} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml index 88f74efe0e..17f8c9599e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml @@ -22,7 +22,7 @@ info: Bringing a new service on YARN today is not a simple experience. The APIs of existing frameworks are either too low level (native YARN), require writing new code (for frameworks with programmatic APIs) or writing a complex spec (for declarative frameworks). In addition to building critical building blocks inside YARN (as part of other efforts at link:https://issues.apache.org/jira/browse/YARN-4692[YARN-4692]), there is a need for simplifying the user facing story for building services. Experience of projects like Apache Slider running real-life services like HBase, Storm, Accumulo, Solr etc, gives us some very good insights on how simplified APIs for services should look like. - To this end, we should look at a new simple-services API layer backed by REST interfaces. This API can be used to create and manage the lifecycle of YARN services. Services here can range from simple single-component apps to complex multi-component assemblies needing orchestration. + To this end, we should look at a new simple-services API layer backed by REST interfaces. This API can be used to create and manage the lifecycle of YARN services. Services here can range from simple single-component service to complex multi-component assemblies needing orchestration. We should also look at making this a unified REST based entry point for other important features like resource-profile management (link:https://issues.apache.org/jira/browse/YARN-3926[YARN-3926]), package-definitions' lifecycle-management and service-discovery (link:https://issues.apache.org/jira/browse/YARN-913[YARN-913]/link:https://issues.apache.org/jira/browse/YARN-4757[YARN-4757]). We also need to flesh out its relation to our present much lower level REST APIs (link:https://issues.apache.org/jira/browse/YARN-1695[YARN-1695]) in YARN for application-submission and management. @@ -41,177 +41,177 @@ schemes: - http - https # will be prefixed to all paths -basePath: /services/v1/ +basePath: /ws/v1/ consumes: - application/json produces: - application/json paths: - /applications: + /services: get: - summary: List of applications/services running in the cluster - description: Get a list of all currently running applications (response includes a minimal projection of the application info). For more details do a GET on a specific application name. + summary: List of services running in the cluster + description: Get a list of all currently running services (response includes a minimal projection of the service info). For more details do a GET on a specific service name. responses: 200: - description: An array of applications + description: An array of services schema: type: array items: - $ref: '#/definitions/Application' + $ref: '#/definitions/Service' default: description: Unexpected error schema: - $ref: '#/definitions/ApplicationStatus' + $ref: '#/definitions/ServiceStatus' post: - summary: Create an application/service - description: Create an application. The request JSON is an Application object with details required for creation. If the request is successful it returns 202 Accepted. A success of this API only confirms success in submission of the application creation request. There is no guarantee that the application will actually reach a RUNNING state. Resource availability and several other factors determines if the application will be deployed in the cluster. It is expected that clients would subsequently call the GET API to get details of the application and determine its state. + summary: Create a service + description: Create a service. The request JSON is a service object with details required for creation. If the request is successful it returns 202 Accepted. A success of this API only confirms success in submission of the service creation request. There is no guarantee that the service will actually reach a RUNNING state. Resource availability and several other factors determines if the service will be deployed in the cluster. It is expected that clients would subsequently call the GET API to get details of the service and determine its state. parameters: - - name: Application + - name: Service in: body - description: Application request object + description: Service request object required: true schema: - $ref: '#/definitions/Application' + $ref: '#/definitions/Service' responses: 202: description: Request accepted default: description: Unexpected error schema: - $ref: '#/definitions/ApplicationStatus' + $ref: '#/definitions/ServiceStatus' - /applications/{app_name}: + /services/{service_name}: get: - summary: Get an application/service details - description: Return the details (including containers) of a running application + summary: Get service details + description: Return the details (including containers) of a running service parameters: - - name: app_name + - name: service_name in: path - description: Application name + description: Service name required: true type: string responses: 200: - description: An application object + description: a service object schema: type: object items: - $ref: '#/definitions/Application' + $ref: '#/definitions/Service' examples: - app_name: logsearch + service_name: logsearch artifact: id: logsearch:latest type: docker 404: - description: Application does not exist + description: Service does not exist default: description: Unexpected error schema: - $ref: '#/definitions/ApplicationStatus' + $ref: '#/definitions/ServiceStatus' put: - summary: Update an application/service or upgrade the binary version of the components of a running application - description: Update the runtime properties of an application. As of now, only update of lifetime and number of instances (flexing) of the components of an application is supported. The PUT operation is also used to orchestrate an upgrade of the application containers to a newer version of their artifacts. + summary: Update a service or upgrade the binary version of the components of a running service + description: Update the runtime properties of a service. As of now, only update of lifetime and number of instances (flexing) of the components of a service is supported. The PUT operation is also used to orchestrate an upgrade of the service containers to a newer version of their artifacts. parameters: - - name: app_name + - name: service_name in: path - description: Application name + description: Service name required: true type: string responses: 204: description: Update or upgrade was successful 404: - description: Application does not exist + description: Service does not exist default: description: Unexpected error schema: - $ref: '#/definitions/ApplicationStatus' + $ref: '#/definitions/ServiceStatus' delete: - summary: Destroy application/service - description: Destroy an application and release all resources. This API might have to return JSON data providing location of logs, etc. Not finalized yet. + summary: Destroy service + description: Destroy a service and release all resources. This API might have to return JSON data providing location of logs, etc. Not finalized yet. parameters: - - name: app_name + - name: service_name in: path - description: Application name + description: Service name required: true type: string responses: 204: description: Destroy was successful 404: - description: Application does not exist + description: Service does not exist default: description: Unexpected error schema: - $ref: '#/definitions/ApplicationStatus' + $ref: '#/definitions/ServiceStatus' definitions: - Application: - description: An Application resource has the following attributes. + Service: + description: a service resource has the following attributes. required: - name properties: name: type: string - description: A unique application name. If Registry DNS is enabled, the max length is 63 characters. + description: A unique service name. If Registry DNS is enabled, the max length is 63 characters. id: type: string - description: A unique application id. + description: A unique service id. artifact: - description: Artifact of single-component applications. + description: Artifact of single-component service. $ref: '#/definitions/Artifact' resource: - description: Resource of single-component applications or the global default for multi-component applications. Mandatory if it is a single-component application and if cpus and memory are not specified at the Application level. + description: Resource of single-component service or the global default for multi-component services. Mandatory if it is a single-component service and if cpus and memory are not specified at the Service level. $ref: '#/definitions/Resource' launch_command: type: string - description: The custom launch command of an application component (optional). If not specified for applications with docker images say, it will default to the default start command of the image. If there is a single component in this application, you can specify this without the need to have a 'components' section. + description: The custom launch command of a service component (optional). If not specified for services with docker images say, it will default to the default start command of the image. If there is a single component in this service, you can specify this without the need to have a 'components' section. launch_time: type: string format: date - description: The time when the application was created, e.g. 2016-03-16T01:01:49.000Z. + description: The time when the service was created, e.g. 2016-03-16T01:01:49.000Z. number_of_containers: type: integer format: int64 - description: Number of containers for each app-component in the application. Each app-component can further override this app-level global default. + description: Number of containers for each component in the service. Each component can further override this service-level global default. number_of_running_containers: type: integer format: int64 - description: In get response this provides the total number of running containers for this application (across all components) at the time of request. Note, a subsequent request can return a different number as and when more containers get allocated until it reaches the total number of containers or if a flex request has been made between the two requests. + description: In get response this provides the total number of running containers for this service (across all components) at the time of request. Note, a subsequent request can return a different number as and when more containers get allocated until it reaches the total number of containers or if a flex request has been made between the two requests. lifetime: type: integer format: int64 - description: Life time (in seconds) of the application from the time it reaches the STARTED state (after which it is automatically destroyed by YARN). For unlimited lifetime do not set a lifetime value. + description: Life time (in seconds) of the service from the time it reaches the STARTED state (after which it is automatically destroyed by YARN). For unlimited lifetime do not set a lifetime value. placement_policy: - description: Advanced scheduling and placement policies (optional). If not specified, it defaults to the default placement policy of the app owner. The design of placement policies are in the works. It is not very clear at this point, how policies in conjunction with labels be exposed to application owners. This is a placeholder for now. The advanced structure of this attribute will be determined by YARN-4902. + description: Advanced scheduling and placement policies (optional). If not specified, it defaults to the default placement policy of the service owner. The design of placement policies are in the works. It is not very clear at this point, how policies in conjunction with labels be exposed to service owners. This is a placeholder for now. The advanced structure of this attribute will be determined by YARN-4902. $ref: '#/definitions/PlacementPolicy' components: - description: Components of an application. + description: Components of a service. type: array items: $ref: '#/definitions/Component' configuration: - description: Config properties of an application. Configurations provided at the application/global level are available to all the components. Specific properties can be overridden at the component level. + description: Config properties of a service. Configurations provided at the service/global level are available to all the components. Specific properties can be overridden at the component level. $ref: '#/definitions/Configuration' containers: - description: Containers of a started application. Specifying a value for this attribute for the POST payload raises a validation error. This blob is available only in the GET response of a started application. + description: Containers of a started service. Specifying a value for this attribute for the POST payload raises a validation error. This blob is available only in the GET response of a started service. type: array items: $ref: '#/definitions/Container' state: - description: State of the application. Specifying a value for this attribute for the POST payload raises a validation error. This attribute is available only in the GET response of a started application. - $ref: '#/definitions/ApplicationState' + description: State of the service. Specifying a value for this attribute for the POST payload raises a validation error. This attribute is available only in the GET response of a started service. + $ref: '#/definitions/ServiceState' quicklinks: type: object - description: A blob of key-value pairs of quicklinks to be exported for an application. + description: A blob of key-value pairs of quicklinks to be exported for a service. additionalProperties: type: string queue: type: string - description: The YARN queue that this application should be submitted to. + description: The YARN queue that this service should be submitted to. Resource: description: - Resource determines the amount of resources (vcores, memory, network, etc.) usable by a container. This field determines the resource to be applied for all the containers of a component or application. The resource specified at the app (or global) level can be overriden at the component level. Only one of profile OR cpu & memory are exepected. It raises a validation exception otherwise. + Resource determines the amount of resources (vcores, memory, network, etc.) usable by a container. This field determines the resource to be applied for all the containers of a component or service. The resource specified at the service (or global) level can be overriden at the component level. Only one of profile OR cpu & memory are expected. It raises a validation exception otherwise. properties: profile: type: string @@ -224,75 +224,75 @@ definitions: type: string description: Amount of memory allocated to each container (optional but overrides memory in profile if specified). Currently accepts only an integer value and default unit is in MB. PlacementPolicy: - description: Placement policy of an instance of an application. This feature is in the works in YARN-4902. + description: Placement policy of an instance of a service. This feature is in the works in YARN-6592. properties: label: type: string - description: Assigns an app to a named partition of the cluster where the application desires to run (optional). If not specified all apps are submitted to a default label of the app owner. One or more labels can be setup for each application owner account with required constraints like no-preemption, sla-99999, preemption-ok, etc. + description: Assigns a service to a named partition of the cluster where the service desires to run (optional). If not specified all services are submitted to a default label of the service owner. One or more labels can be setup for each service owner account with required constraints like no-preemption, sla-99999, preemption-ok, etc. Artifact: - description: Artifact of an application component. If not specified, component will just run the bare launch command and no artifact will be localized. + description: Artifact of a service component. If not specified, component will just run the bare launch command and no artifact will be localized. required: - id properties: id: type: string - description: Artifact id. Examples are package location uri for tarball based apps, image name for docker, name of application, etc. + description: Artifact id. Examples are package location uri for tarball based services, image name for docker, name of service, etc. type: type: string - description: Artifact type, like docker, tarball, etc. (optional). For TARBALL type, the specified tarball will be localized to the container local working directory under a folder named lib. For APPLICATION type, the application specified will be read and its components will be added into this application. The original component with artifact type APPLICATION will be removed (any properties specified in the original component will be ignored). + description: Artifact type, like docker, tarball, etc. (optional). For TARBALL type, the specified tarball will be localized to the container local working directory under a folder named lib. For SERVICE type, the service specified will be read and its components will be added into this service. The original component with artifact type SERVICE will be removed (any properties specified in the original component will be ignored). enum: - DOCKER - TARBALL - - APPLICATION + - SERVICE default: DOCKER uri: type: string description: Artifact location to support multiple artifact stores (optional). Component: - description: One or more components of the application. If the application is HBase say, then the component can be a simple role like master or regionserver. If the application is a complex business webapp then a component can be other applications say Kafka or Storm. Thereby it opens up the support for complex and nested applications. + description: One or more components of the service. If the service is HBase say, then the component can be a simple role like master or regionserver. If the service is a complex business webapp then a component can be other services say Kafka or Storm. Thereby it opens up the support for complex and nested services. required: - name properties: name: type: string - description: Name of the application component (mandatory). If Registry DNS is enabled, the max length is 63 characters. If unique component support is enabled, the max length is lowered to 44 characters. + description: Name of the service component (mandatory). If Registry DNS is enabled, the max length is 63 characters. If unique component support is enabled, the max length is lowered to 44 characters. dependencies: type: array items: type: string - description: An array of application components which should be in READY state (as defined by readiness check), before this component can be started. The dependencies across all components of an application should be represented as a DAG. + description: An array of service components which should be in READY state (as defined by readiness check), before this component can be started. The dependencies across all components of a service should be represented as a DAG. readiness_check: - description: Readiness check for this app-component. + description: Readiness check for this component. $ref: '#/definitions/ReadinessCheck' artifact: - description: Artifact of the component (optional). If not specified, the application level global artifact takes effect. + description: Artifact of the component (optional). If not specified, the service level global artifact takes effect. $ref: '#/definitions/Artifact' launch_command: type: string description: The custom launch command of this component (optional for DOCKER component, required otherwise). When specified at the component level, it overrides the value specified at the global level (if any). resource: - description: Resource of this component (optional). If not specified, the application level global resource takes effect. + description: Resource of this component (optional). If not specified, the service level global resource takes effect. $ref: '#/definitions/Resource' number_of_containers: type: integer format: int64 - description: Number of containers for this app-component (optional). If not specified, the application level global number_of_containers takes effect. + description: Number of containers for this component (optional). If not specified, the service level global number_of_containers takes effect. run_privileged_container: type: boolean description: Run all containers of this component in privileged mode (YARN-4262). placement_policy: - description: Advanced scheduling and placement policies for all containers of this component (optional). If not specified, the app level placement_policy takes effect. Refer to the description at the global level for more details. + description: Advanced scheduling and placement policies for all containers of this component (optional). If not specified, the service level placement_policy takes effect. Refer to the description at the global level for more details. $ref: '#/definitions/PlacementPolicy' configuration: - description: Config properties for this app-component. + description: Config properties for this component. $ref: '#/definitions/Configuration' quicklinks: type: array items: type: string - description: A list of quicklink keys defined at the application level, and to be resolved by this component. + description: A list of quicklink keys defined at the service level, and to be resolved by this component. ReadinessCheck: - description: A custom command or a pluggable helper container to determine the readiness of a container of a component. Readiness for every application is different. Hence the need for a simple interface, with scope to support advanced usecases. + description: A custom command or a pluggable helper container to determine the readiness of a container of a component. Readiness for every service is different. Hence the need for a simple interface, with scope to support advanced usecases. required: - type properties: @@ -308,28 +308,28 @@ definitions: additionalProperties: type: string artifact: - description: Artifact of the pluggable readiness check helper container (optional). If specified, this helper container typically hosts the http uri and encapsulates the complex scripts required to perform actual container readiness check. At the end it is expected to respond a 204 No content just like the simplified use case. This pluggable framework benefits application owners who can run applications without any packaging modifications. Note, artifacts of type docker only is supported for now. NOT IMPLEMENTED YET + description: Artifact of the pluggable readiness check helper container (optional). If specified, this helper container typically hosts the http uri and encapsulates the complex scripts required to perform actual container readiness check. At the end it is expected to respond a 204 No content just like the simplified use case. This pluggable framework benefits service owners who can run services without any packaging modifications. Note, artifacts of type docker only is supported for now. NOT IMPLEMENTED YET $ref: '#/definitions/Artifact' Configuration: - description: Set of configuration properties that can be injected into the application components via envs, files and custom pluggable helper docker containers. Files of several standard formats like xml, properties, json, yaml and templates will be supported. + description: Set of configuration properties that can be injected into the service components via envs, files and custom pluggable helper docker containers. Files of several standard formats like xml, properties, json, yaml and templates will be supported. properties: properties: type: object - description: A blob of key-value pairs of common application properties. + description: A blob of key-value pairs of common service properties. additionalProperties: type: string env: type: object - description: A blob of key-value pairs which will be appended to the default system properties and handed off to the application at start time. All placeholder references to properties will be substituted before injection. + description: A blob of key-value pairs which will be appended to the default system properties and handed off to the service at start time. All placeholder references to properties will be substituted before injection. additionalProperties: type: string files: - description: Array of list of files that needs to be created and made available as volumes in the application component containers. + description: Array of list of files that needs to be created and made available as volumes in the service component containers. type: array items: $ref: '#/definitions/ConfigFile' ConfigFile: - description: A config file that needs to be created and made available as a volume in an application component container. + description: A config file that needs to be created and made available as a volume in a service component container. properties: type: type: string @@ -352,11 +352,11 @@ definitions: type: object description: A blob of key value pairs that will be dumped in the dest_file in the format as specified in type. If src_file is specified, src_file content are dumped in the dest_file and these properties will overwrite, if any, existing properties in src_file or be added as new properties in src_file. Container: - description: An instance of a running application container. + description: An instance of a running service container. properties: id: type: string - description: Unique container id of a running application, e.g. container_e3751_1458061340047_0008_01_000002. + description: Unique container id of a running service, e.g. container_e3751_1458061340047_0008_01_000002. launch_time: type: string format: date @@ -371,7 +371,7 @@ definitions: type: string description: The bare node or host in which the container is running, e.g. cn008.example.com. state: - description: State of the container of an application. + description: State of the container of a service. $ref: '#/definitions/ContainerState' component_name: type: string @@ -385,12 +385,12 @@ definitions: privileged_container: type: boolean description: Container running in privileged mode or not. - ApplicationState: - description: The current state of an application. + ServiceState: + description: The current state of a service. properties: state: type: string - description: enum of the state of the application + description: enum of the state of the service enum: - ACCEPTED - STARTED @@ -398,25 +398,26 @@ definitions: - STOPPED - FAILED ContainerState: - description: The current state of the container of an application. + description: The current state of the container of a service. properties: state: type: string description: enum of the state of the container enum: - INIT + - STARTED - READY - ApplicationStatus: - description: The current status of a submitted application, returned as a response to the GET API. + ServiceStatus: + description: The current status of a submitted service, returned as a response to the GET API. properties: diagnostics: type: string - description: Diagnostic information (if any) for the reason of the current state of the application. It typically has a non-null value, if the application is in a non-running state. + description: Diagnostic information (if any) for the reason of the current state of the service. It typically has a non-null value, if the service is in a non-running state. state: - description: Application state. - $ref: '#/definitions/ApplicationState' + description: Service state. + $ref: '#/definitions/ServiceState' code: type: integer format: int32 - description: An error code specific to a scenario which app owners should be able to use to understand the failure in addition to the diagnostic information. + description: An error code specific to a scenario which service owners should be able to use to understand the failure in addition to the diagnostic information. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/scripts/run_rest_service.sh b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/scripts/run_rest_service.sh deleted file mode 100644 index 9f15b7e9d0..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/scripts/run_rest_service.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# 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. - -export SLIDER_VERSION=${project.version} -export HDP_VERSION=${HDP_VERSION:-$SLIDER_VERSION} -export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -export LIB_PARENT_DIR=`dirname $SCRIPT_DIR` -export JAVA_HOME=${JAVA_HOME:-/usr/jdk64/jdk1.8.0_40} -export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-/etc/hadoop/conf} -export REST_SERVICE_PORT=${REST_SERVICE_PORT:-9191} -export APP_RUNAS_USER=${APP_RUNAS_USER:-root} -export REST_SERVICE_LOG_DIR=${REST_SERVICE_LOG_DIR:-/tmp/} -export JAVA_OPTS="-Xms256m -Xmx1024m -XX:+PrintGC -Xloggc:$REST_SERVICE_LOG_DIR/gc.log" -$JAVA_HOME/bin/java $JAVA_OPTS -cp .:$HADOOP_CONF_DIR:$LIB_PARENT_DIR/services-api/*:$LIB_PARENT_DIR/slider/* -DREST_SERVICE_LOG_DIR=$REST_SERVICE_LOG_DIR -Dlog4j.configuration=log4j-server.properties -Dslider.libdir=$LIB_PARENT_DIR/slider org.apache.hadoop.yarn.services.webapp.ApplicationApiWebApp 1>>$REST_SERVICE_LOG_DIR/restservice-out.log 2>&1 diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/dev-support/findbugs-exclude.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/dev-support/findbugs-exclude.xml similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/dev-support/findbugs-exclude.xml rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/dev-support/findbugs-exclude.xml diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/conf/yarnservice-log4j.properties b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/conf/yarnservice-log4j.properties similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/conf/yarnservice-log4j.properties rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/conf/yarnservice-log4j.properties diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/pom.xml similarity index 98% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/pom.xml rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/pom.xml index c8de03770e..1f8a408a63 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/pom.xml @@ -18,13 +18,12 @@ 4.0.0 org.apache.hadoop - hadoop-yarn-slider + hadoop-yarn-services 3.0.0-beta1-SNAPSHOT - org.apache.hadoop - hadoop-yarn-slider-core + hadoop-yarn-services-core jar - Apache Hadoop YARN Slider Core + Apache Hadoop YARN Services Core diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMProtocol.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMProtocol.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMProtocol.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMProtocol.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java similarity index 98% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java index 6884757dfd..8e4c34dc69 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java @@ -101,7 +101,7 @@ public ClientAMService(ServiceContext context) { @Override public GetStatusResponseProto getStatus(GetStatusRequestProto request) throws IOException, YarnException { - String stat = ServiceApiUtil.jsonSerDeser.toJson(context.application); + String stat = ServiceApiUtil.jsonSerDeser.toJson(context.service); return GetStatusResponseProto.newBuilder().setStatus(stat).build(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ContainerFailureTracker.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ContainerFailureTracker.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ContainerFailureTracker.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ContainerFailureTracker.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceContext.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceContext.java similarity index 93% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceContext.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceContext.java index c7616afa06..94dbc6ee34 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceContext.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceContext.java @@ -21,12 +21,12 @@ import com.google.common.cache.LoadingCache; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.security.client.ClientToAMTokenSecretManager; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.api.records.ConfigFile; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; public class ServiceContext { - public Application application = null; + public Service service = null; public SliderFileSystem fs; public String serviceHdfsDir = ""; public ApplicationAttemptId attemptId; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMaster.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMaster.java similarity index 94% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMaster.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMaster.java index d099f8c18e..e700961f18 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMaster.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMaster.java @@ -35,8 +35,7 @@ import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.security.client.ClientToAMTokenSecretManager; import org.apache.hadoop.yarn.service.client.params.SliderAMArgs; -import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException; -import org.apache.hadoop.yarn.service.servicemonitor.ServiceMonitor; +import org.apache.hadoop.yarn.service.monitor.ServiceMonitor; import org.apache.hadoop.yarn.service.utils.ServiceApiUtil; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; import org.apache.hadoop.yarn.service.utils.SliderUtils; @@ -79,7 +78,7 @@ protected void serviceInit(Configuration conf) throws Exception { ContainerId amContainerId = getAMContainerId(); ApplicationAttemptId attemptId = amContainerId.getApplicationAttemptId(); - LOG.info("Application attemptId: " + attemptId); + LOG.info("Service AppAttemptId: " + attemptId); context.attemptId = attemptId; // configure AM to wait forever for RM @@ -119,9 +118,9 @@ protected ServiceScheduler createServiceScheduler(ServiceContext context) protected void loadApplicationJson(ServiceContext context, SliderFileSystem fs) throws IOException { - context.application = ServiceApiUtil - .loadApplicationFrom(fs, new Path(amArgs.getAppDefPath())); - LOG.info(context.application.toString()); + context.service = ServiceApiUtil + .loadServiceFrom(fs, new Path(amArgs.getAppDefPath())); + LOG.info(context.service.toString()); } @Override diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/metrics/ServiceMetrics.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMetrics.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/metrics/ServiceMetrics.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMetrics.java index bfe3bc9596..9fc886e65a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/metrics/ServiceMetrics.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMetrics.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.metrics; +package org.apache.hadoop.yarn.service; import org.apache.hadoop.metrics2.MetricsCollector; import org.apache.hadoop.metrics2.MetricsInfo; @@ -56,9 +56,6 @@ public class ServiceMetrics implements MetricsSource { @Metric("containers preempted") public MutableGaugeInt containersPreempted; - @Metric("containers exceeded limits") - public MutableGaugeInt containersLimitsExceeded; - @Metric("containers surplus") public MutableGaugeInt surplusContainers; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java index 8c968dc644..fb2fd16b71 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java @@ -54,18 +54,17 @@ import org.apache.hadoop.yarn.event.EventHandler; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; -import org.apache.hadoop.yarn.service.api.constants.ServiceApiConstants; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.ServiceApiConstants; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.api.records.ConfigFile; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEvent; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEventType; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEvent; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEventType; import org.apache.hadoop.yarn.service.component.Component; import org.apache.hadoop.yarn.service.component.ComponentEvent; import org.apache.hadoop.yarn.service.component.ComponentEventType; import org.apache.hadoop.yarn.service.conf.YarnServiceConstants; import org.apache.hadoop.yarn.service.containerlaunch.ContainerLaunchService; -import org.apache.hadoop.yarn.service.metrics.ServiceMetrics; import org.apache.hadoop.yarn.service.provider.ProviderUtils; import org.apache.hadoop.yarn.service.registry.YarnRegistryViewForProviders; import org.apache.hadoop.yarn.service.timelineservice.ServiceMetricsSink; @@ -92,7 +91,7 @@ import static org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY; import static org.apache.hadoop.registry.client.api.RegistryConstants.*; -import static org.apache.hadoop.yarn.service.api.constants.ServiceApiConstants.*; +import static org.apache.hadoop.yarn.service.api.ServiceApiConstants.*; import static org.apache.hadoop.yarn.service.component.ComponentEventType.*; /** @@ -102,7 +101,7 @@ public class ServiceScheduler extends CompositeService { private static final Logger LOG = LoggerFactory.getLogger(ServiceScheduler.class); - private Application app; + private Service app; // component_name -> component private final Map componentsByName = @@ -139,13 +138,13 @@ public class ServiceScheduler extends CompositeService { private ContainerLaunchService containerLaunchService; public ServiceScheduler(ServiceContext context) { - super(context.application.getName()); + super(context.service.getName()); this.context = context; } public void buildInstance(ServiceContext context, Configuration configuration) throws YarnException { - app = context.application; + app = context.service; executorService = Executors.newScheduledThreadPool(10); RegistryOperations registryClient = RegistryOperationsFactory .createInstance("ServiceScheduler", configuration); @@ -157,7 +156,7 @@ public void buildInstance(ServiceContext context, Configuration configuration) serviceMetrics = ServiceMetrics .register(app.getName(), "Metrics for service"); serviceMetrics.tag("type", "Metrics type [component or service]", "service"); - serviceMetrics.tag("appId", "Application id for service", app.getId()); + serviceMetrics.tag("appId", "Service id for service", app.getId()); amRMClient = createAMRMClient(); addIfService(amRMClient); @@ -247,7 +246,7 @@ public void serviceStop() throws Exception { + "Navigate to the failed component for more details."; amRMClient .unregisterApplicationMaster(FinalApplicationStatus.ENDED, msg, ""); - LOG.info("Application " + app.getName() + LOG.info("Service " + app.getName() + " unregistered with RM, with attemptId = " + context.attemptId + ", diagnostics = " + diagnostics); super.serviceStop(); @@ -337,8 +336,8 @@ private void createConfigFileCache(final FileSystem fileSystem) { } private void registerServiceInstance(ApplicationAttemptId attemptId, - Application application) throws IOException { - LOG.info("Registering " + attemptId + ", " + application.getName() + Service service) throws IOException { + LOG.info("Registering " + attemptId + ", " + service.getName() + " into registry"); ServiceRecord serviceRecord = new ServiceRecord(); serviceRecord.set(YarnRegistryAttributes.YARN_ID, @@ -352,7 +351,7 @@ private void registerServiceInstance(ApplicationAttemptId attemptId, context.clientAMService.getBindAddress())); // set any provided attributes - setUserProvidedServiceRecordAttributes(application.getConfiguration(), + setUserProvidedServiceRecordAttributes(service.getConfiguration(), serviceRecord); executorService.submit(new Runnable() { @@ -641,7 +640,7 @@ public Map getAllComponents() { return componentsByName; } - public Application getApp() { + public Service getApp() { return app; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/constants/ServiceApiConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/ServiceApiConstants.java similarity index 97% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/constants/ServiceApiConstants.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/ServiceApiConstants.java index cf9e31fa2f..0bfb2208c5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/constants/ServiceApiConstants.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/ServiceApiConstants.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.api.constants; +package org.apache.hadoop.yarn.service.api; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Artifact.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Artifact.java similarity index 95% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Artifact.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Artifact.java index 0ddc374ca4..4328c6fd1b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Artifact.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Artifact.java @@ -30,11 +30,11 @@ import org.apache.hadoop.classification.InterfaceStability; /** - * Artifact of an application component. + * Artifact of an service component. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "Artifact of an application component") +@ApiModel(description = "Artifact of an service component") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") @JsonInclude(JsonInclude.Include.NON_NULL) public class Artifact implements Serializable { @@ -43,7 +43,7 @@ public class Artifact implements Serializable { private String id = null; public enum TypeEnum { - DOCKER("DOCKER"), TARBALL("TARBALL"), APPLICATION("APPLICATION"); + DOCKER("DOCKER"), TARBALL("TARBALL"), SERVICE("SERVICE"); private String value; @@ -62,7 +62,7 @@ public String toString() { private String uri = null; /** - * Artifact id. Examples are package location uri for tarball based apps, + * Artifact id. Examples are package location uri for tarball based services, * image name for docker, etc. **/ public Artifact id(String id) { @@ -70,7 +70,7 @@ public Artifact id(String id) { return this; } - @ApiModelProperty(example = "null", required = true, value = "Artifact id. Examples are package location uri for tarball based apps, image name for docker, etc.") + @ApiModelProperty(example = "null", required = true, value = "Artifact id. Examples are package location uri for tarball based services, image name for docker, etc.") @JsonProperty("id") public String getId() { return id; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java similarity index 92% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java index a87c97f7e1..7ac86d4c66 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java @@ -29,9 +29,9 @@ public class BaseResource implements Serializable { private String uri; /** - * Resource location, e.g. \ - * "/applications/helloworld/containers/container_e3751_1458061340047_0008_01_000002\ - * " + * Resource location for a service, e.g. + * /ws/v1/services/helloworld + * **/ public String getUri() { return uri; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Component.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Component.java similarity index 85% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Component.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Component.java index 633e862792..b0a8e82ee5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Component.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Component.java @@ -35,15 +35,15 @@ import org.apache.hadoop.classification.InterfaceStability; /** - * One or more components of the application. If the application is HBase say, + * One or more components of the service. If the service is HBase say, * then the component can be a simple role like master or regionserver. If the - * application is a complex business webapp then a component can be other - * applications say Kafka or Storm. Thereby it opens up the support for complex - * and nested applications. + * service is a complex business webapp then a component can be other + * services say Kafka or Storm. Thereby it opens up the support for complex + * and nested services. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "One or more components of the application. If the application is HBase say, then the component can be a simple role like master or regionserver. If the application is a complex business webapp then a component can be other applications say Kafka or Storm. Thereby it opens up the support for complex and nested applications.") +@ApiModel(description = "One or more components of the service. If the service is HBase say, then the component can be a simple role like master or regionserver. If the service is a complex business webapp then a component can be other services say Kafka or Storm. Thereby it opens up the support for complex and nested services.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") @XmlRootElement @JsonInclude(JsonInclude.Include.NON_NULL) @@ -65,14 +65,14 @@ public class Component implements Serializable { Collections.synchronizedList(new ArrayList()); /** - * Name of the application component (mandatory). + * Name of the service component (mandatory). **/ public Component name(String name) { this.name = name; return this; } - @ApiModelProperty(example = "null", required = true, value = "Name of the application component (mandatory).") + @ApiModelProperty(example = "null", required = true, value = "Name of the service component (mandatory).") @JsonProperty("name") public String getName() { return name; @@ -83,9 +83,9 @@ public void setName(String name) { } /** - * An array of application components which should be in READY state (as + * An array of service components which should be in READY state (as * defined by readiness check), before this component can be started. The - * dependencies across all components of an application should be represented + * dependencies across all components of a service should be represented * as a DAG. **/ public Component dependencies(List dependencies) { @@ -93,7 +93,7 @@ public Component dependencies(List dependencies) { return this; } - @ApiModelProperty(example = "null", value = "An array of application components which should be in READY state (as defined by readiness check), before this component can be started. The dependencies across all components of an application should be represented as a DAG.") + @ApiModelProperty(example = "null", value = "An array of service components which should be in READY state (as defined by readiness check), before this component can be started. The dependencies across all components of an service should be represented as a DAG.") @JsonProperty("dependencies") public List getDependencies() { return dependencies; @@ -104,14 +104,14 @@ public void setDependencies(List dependencies) { } /** - * Readiness check for this app-component. + * Readiness check for this component. **/ public Component readinessCheck(ReadinessCheck readinessCheck) { this.readinessCheck = readinessCheck; return this; } - @ApiModelProperty(example = "null", value = "Readiness check for this app-component.") + @ApiModelProperty(example = "null", value = "Readiness check for this component.") @JsonProperty("readiness_check") public ReadinessCheck getReadinessCheck() { return readinessCheck; @@ -123,7 +123,7 @@ public void setReadinessCheck(ReadinessCheck readinessCheck) { } /** - * Artifact of the component (optional). If not specified, the application + * Artifact of the component (optional). If not specified, the service * level global artifact takes effect. **/ public Component artifact(Artifact artifact) { @@ -131,7 +131,7 @@ public Component artifact(Artifact artifact) { return this; } - @ApiModelProperty(example = "null", value = "Artifact of the component (optional). If not specified, the application level global artifact takes effect.") + @ApiModelProperty(example = "null", value = "Artifact of the component (optional). If not specified, the service level global artifact takes effect.") @JsonProperty("artifact") public Artifact getArtifact() { return artifact; @@ -163,7 +163,7 @@ public void setLaunchCommand(String launchCommand) { } /** - * Resource of this component (optional). If not specified, the application + * Resource of this component (optional). If not specified, the service * level global resource takes effect. **/ public Component resource(Resource resource) { @@ -171,7 +171,7 @@ public Component resource(Resource resource) { return this; } - @ApiModelProperty(example = "null", value = "Resource of this component (optional). If not specified, the application level global resource takes effect.") + @ApiModelProperty(example = "null", value = "Resource of this component (optional). If not specified, the service level global resource takes effect.") @JsonProperty("resource") public Resource getResource() { return resource; @@ -182,15 +182,15 @@ public void setResource(Resource resource) { } /** - * Number of containers for this app-component (optional). If not specified, - * the application level global number_of_containers takes effect. + * Number of containers for this component (optional). If not specified, + * the service level global number_of_containers takes effect. **/ public Component numberOfContainers(Long numberOfContainers) { this.numberOfContainers = numberOfContainers; return this; } - @ApiModelProperty(example = "null", value = "Number of containers for this app-component (optional). If not specified, the application level global number_of_containers takes effect.") + @ApiModelProperty(example = "null", value = "Number of containers for this component (optional). If not specified, the service level global number_of_containers takes effect.") @JsonProperty("number_of_containers") public Long getNumberOfContainers() { return numberOfContainers; @@ -201,7 +201,7 @@ public void setNumberOfContainers(Long numberOfContainers) { this.numberOfContainers = numberOfContainers; } - @ApiModelProperty(example = "null", value = "Containers of a started component. Specifying a value for this attribute for the POST payload raises a validation error. This blob is available only in the GET response of a started application.") + @ApiModelProperty(example = "null", value = "Containers of a started component. Specifying a value for this attribute for the POST payload raises a validation error. This blob is available only in the GET response of a started service.") @JsonProperty("containers") public List getContainers() { return containers; @@ -248,7 +248,7 @@ public void setRunPrivilegedContainer(Boolean runPrivilegedContainer) { /** * Advanced scheduling and placement policies for all containers of this - * component (optional). If not specified, the app level placement_policy + * component (optional). If not specified, the service level placement_policy * takes effect. Refer to the description at the global level for more * details. **/ @@ -257,7 +257,7 @@ public Component placementPolicy(PlacementPolicy placementPolicy) { return this; } - @ApiModelProperty(example = "null", value = "Advanced scheduling and placement policies for all containers of this component (optional). If not specified, the app level placement_policy takes effect. Refer to the description at the global level for more details.") + @ApiModelProperty(example = "null", value = "Advanced scheduling and placement policies for all containers of this component (optional). If not specified, the service level placement_policy takes effect. Refer to the description at the global level for more details.") @JsonProperty("placement_policy") public PlacementPolicy getPlacementPolicy() { return placementPolicy; @@ -269,14 +269,14 @@ public void setPlacementPolicy(PlacementPolicy placementPolicy) { } /** - * Config properties for this app-component. + * Config properties for this component. **/ public Component configuration(Configuration configuration) { this.configuration = configuration; return this; } - @ApiModelProperty(example = "null", value = "Config properties for this app-component.") + @ApiModelProperty(example = "null", value = "Config properties for this component.") @JsonProperty("configuration") public Configuration getConfiguration() { return configuration; @@ -287,7 +287,7 @@ public void setConfiguration(Configuration configuration) { } /** - * A list of quicklink keys defined at the application level, and to be + * A list of quicklink keys defined at the service level, and to be * resolved by this component. **/ public Component quicklinks(List quicklinks) { @@ -295,7 +295,7 @@ public Component quicklinks(List quicklinks) { return this; } - @ApiModelProperty(example = "null", value = "A list of quicklink keys defined at the application level, and to be resolved by this component.") + @ApiModelProperty(example = "null", value = "A list of quicklink keys defined at the service level, and to be resolved by this component.") @JsonProperty("quicklinks") public List getQuicklinks() { return quicklinks; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFile.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFile.java similarity index 97% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFile.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFile.java index 2fb494ea06..c1502c71df 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFile.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFile.java @@ -34,11 +34,11 @@ /** * A config file that needs to be created and made available as a volume in an - * application component container. + * service component container. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "A config file that needs to be created and made available as a volume in an application component container.") +@ApiModel(description = "A config file that needs to be created and made available as a volume in an service component container.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") @XmlRootElement @JsonInclude(JsonInclude.Include.NON_NULL) @@ -99,14 +99,14 @@ public void setType(TypeEnum type) { /** * The absolute path that this configuration file should be mounted as, in the - * application container. + * service container. **/ public ConfigFile destFile(String destFile) { this.destFile = destFile; return this; } - @ApiModelProperty(example = "null", value = "The absolute path that this configuration file should be mounted as, in the application container.") + @ApiModelProperty(example = "null", value = "The absolute path that this configuration file should be mounted as, in the service container.") @JsonProperty("dest_file") public String getDestFile() { return destFile; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFormat.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFormat.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFormat.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ConfigFormat.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Configuration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Configuration.java similarity index 91% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Configuration.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Configuration.java index 0ac508b8a1..2f8ca9641f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Configuration.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Configuration.java @@ -34,14 +34,14 @@ import java.util.Objects; /** - * Set of configuration properties that can be injected into the application + * Set of configuration properties that can be injected into the service * components via envs, files and custom pluggable helper docker containers. * Files of several standard formats like xml, properties, json, yaml and * templates will be supported. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "Set of configuration properties that can be injected into the application components via envs, files and custom pluggable helper docker containers. Files of several standard formats like xml, properties, json, yaml and templates will be supported.") +@ApiModel(description = "Set of configuration properties that can be injected into the service components via envs, files and custom pluggable helper docker containers. Files of several standard formats like xml, properties, json, yaml and templates will be supported.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") @JsonInclude(JsonInclude.Include.NON_NULL) public class Configuration implements Serializable { @@ -52,14 +52,14 @@ public class Configuration implements Serializable { private List files = new ArrayList(); /** - * A blob of key-value pairs of common application properties. + * A blob of key-value pairs of common service properties. **/ public Configuration properties(Map properties) { this.properties = properties; return this; } - @ApiModelProperty(example = "null", value = "A blob of key-value pairs of common application properties.") + @ApiModelProperty(example = "null", value = "A blob of key-value pairs of common service properties.") @JsonProperty("properties") public Map getProperties() { return properties; @@ -71,7 +71,7 @@ public void setProperties(Map properties) { /** * A blob of key-value pairs which will be appended to the default system - * properties and handed off to the application at start time. All placeholder + * properties and handed off to the service at start time. All placeholder * references to properties will be substituted before injection. **/ public Configuration env(Map env) { @@ -79,7 +79,7 @@ public Configuration env(Map env) { return this; } - @ApiModelProperty(example = "null", value = "A blob of key-value pairs which will be appended to the default system properties and handed off to the application at start time. All placeholder references to properties will be substituted before injection.") + @ApiModelProperty(example = "null", value = "A blob of key-value pairs which will be appended to the default system properties and handed off to the service at start time. All placeholder references to properties will be substituted before injection.") @JsonProperty("env") public Map getEnv() { return env; @@ -91,14 +91,14 @@ public void setEnv(Map env) { /** * Array of list of files that needs to be created and made available as - * volumes in the application component containers. + * volumes in the service component containers. **/ public Configuration files(List files) { this.files = files; return this; } - @ApiModelProperty(example = "null", value = "Array of list of files that needs to be created and made available as volumes in the application component containers.") + @ApiModelProperty(example = "null", value = "Array of list of files that needs to be created and made available as volumes in the service component containers.") @JsonProperty("files") public List getFiles() { return files; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Container.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Container.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Container.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Container.java index 8b687bb9d4..cf8cd79a8b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Container.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Container.java @@ -32,11 +32,11 @@ import org.apache.hadoop.classification.InterfaceStability; /** - * An instance of a running application container. + * An instance of a running service container. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "An instance of a running application container") +@ApiModel(description = "An instance of a running service container") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") @XmlRootElement @JsonInclude(JsonInclude.Include.NON_NULL) @@ -55,7 +55,7 @@ public class Container extends BaseResource { private Boolean privilegedContainer = null; /** - * Unique container id of a running application, e.g. + * Unique container id of a running service, e.g. * container_e3751_1458061340047_0008_01_000002. **/ public Container id(String id) { @@ -63,7 +63,7 @@ public Container id(String id) { return this; } - @ApiModelProperty(example = "null", value = "Unique container id of a running application, e.g. container_e3751_1458061340047_0008_01_000002.") + @ApiModelProperty(example = "null", value = "Unique container id of a running service, e.g. container_e3751_1458061340047_0008_01_000002.") @JsonProperty("id") public String getId() { return id; @@ -155,14 +155,14 @@ public void setBareHost(String bareHost) { } /** - * State of the container of an application. + * State of the container of an service. **/ public Container state(ContainerState state) { this.state = state; return this; } - @ApiModelProperty(example = "null", value = "State of the container of an application.") + @ApiModelProperty(example = "null", value = "State of the container of an service.") @JsonProperty("state") public ContainerState getState() { return state; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ContainerState.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ContainerState.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ContainerState.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ContainerState.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Error.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Error.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Error.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Error.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/PlacementPolicy.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/PlacementPolicy.java similarity index 75% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/PlacementPolicy.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/PlacementPolicy.java index 7d1b889818..6f6fe6fc82 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/PlacementPolicy.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/PlacementPolicy.java @@ -28,12 +28,12 @@ import org.apache.hadoop.classification.InterfaceStability; /** - * Placement policy of an instance of an application. This feature is in the + * Placement policy of an instance of an service. This feature is in the * works in YARN-4902. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "Placement policy of an instance of an application. This feature is in the works in YARN-4902.") +@ApiModel(description = "Placement policy of an instance of an service. This feature is in the works in YARN-4902.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") public class PlacementPolicy implements Serializable { private static final long serialVersionUID = 4341110649551172231L; @@ -41,10 +41,10 @@ public class PlacementPolicy implements Serializable { private String label = null; /** - * Assigns an app to a named partition of the cluster where the application - * desires to run (optional). If not specified all apps are submitted to a - * default label of the app owner. One or more labels can be setup for each - * application owner account with required constraints like no-preemption, + * Assigns a service to a named partition of the cluster where the service + * desires to run (optional). If not specified all services are submitted to + * a default label of the service owner. One or more labels can be setup for + * each service owner account with required constraints like no-preemption, * sla-99999, preemption-ok, etc. **/ public PlacementPolicy label(String label) { @@ -52,7 +52,7 @@ public PlacementPolicy label(String label) { return this; } - @ApiModelProperty(example = "null", value = "Assigns an app to a named partition of the cluster where the application desires to run (optional). If not specified all apps are submitted to a default label of the app owner. One or more labels can be setup for each application owner account with required constraints like no-preemption, sla-99999, preemption-ok, etc.") + @ApiModelProperty(example = "null", value = "Assigns a service to a named partition of the cluster where the service desires to run (optional). If not specified all services are submitted to a default label of the service owner. One or more labels can be setup for each service owner account with required constraints like no-preemption, sla-99999, preemption-ok, etc.") @JsonProperty("label") public String getLabel() { return label; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ReadinessCheck.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ReadinessCheck.java similarity index 92% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ReadinessCheck.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ReadinessCheck.java index eadbb484ab..1a25a4c40f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ReadinessCheck.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ReadinessCheck.java @@ -32,13 +32,13 @@ /** * A custom command or a pluggable helper container to determine the readiness - * of a container of a component. Readiness for every application is different. + * of a container of a component. Readiness for every service is different. * Hence the need for a simple interface, with scope to support advanced * usecases. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "A custom command or a pluggable helper container to determine the readiness of a container of a component. Readiness for every application is different. Hence the need for a simple interface, with scope to support advanced usecases.") +@ApiModel(description = "A custom command or a pluggable helper container to determine the readiness of a container of a component. Readiness for every service is different. Hence the need for a simple interface, with scope to support advanced usecases.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") public class ReadinessCheck implements Serializable { private static final long serialVersionUID = -3836839816887186801L; @@ -111,8 +111,8 @@ public void setProps(Map props) { * specified, this helper container typically hosts the http uri and * encapsulates the complex scripts required to perform actual container * readiness check. At the end it is expected to respond a 204 No content just - * like the simplified use case. This pluggable framework benefits application - * owners who can run applications without any packaging modifications. Note, + * like the simplified use case. This pluggable framework benefits service + * owners who can run services without any packaging modifications. Note, * artifacts of type docker only is supported for now. **/ public ReadinessCheck artifact(Artifact artifact) { @@ -120,7 +120,7 @@ public ReadinessCheck artifact(Artifact artifact) { return this; } - @ApiModelProperty(example = "null", value = "Artifact of the pluggable readiness check helper container (optional). If specified, this helper container typically hosts the http uri and encapsulates the complex scripts required to perform actual container readiness check. At the end it is expected to respond a 204 No content just like the simplified use case. This pluggable framework benefits application owners who can run applications without any packaging modifications. Note, artifacts of type docker only is supported for now.") + @ApiModelProperty(example = "null", value = "Artifact of the pluggable readiness check helper container (optional). If specified, this helper container typically hosts the http uri and encapsulates the complex scripts required to perform actual container readiness check. At the end it is expected to respond a 204 No content just like the simplified use case. This pluggable framework benefits service owners who can run services without any packaging modifications. Note, artifacts of type docker only is supported for now.") @JsonProperty("artifact") public Artifact getArtifact() { return artifact; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Resource.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Resource.java similarity index 91% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Resource.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Resource.java index bda79c90f6..cec9de9a65 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Resource.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Resource.java @@ -29,14 +29,14 @@ /** * Resource determines the amount of resources (vcores, memory, network, etc.) * usable by a container. This field determines the resource to be applied for - * all the containers of a component or application. The resource specified at - * the app (or global) level can be overriden at the component level. Only one - * of profile OR cpu & memory are exepected. It raises a validation + * all the containers of a component or service. The resource specified at + * the service (or global) level can be overriden at the component level. Only one + * of profile OR cpu & memory are expected. It raises a validation * exception otherwise. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "Resource determines the amount of resources (vcores, memory, network, etc.) usable by a container. This field determines the resource to be applied for all the containers of a component or application. The resource specified at the app (or global) level can be overriden at the component level. Only one of profile OR cpu & memory are exepected. It raises a validation exception otherwise.") +@ApiModel(description = "Resource determines the amount of resources (vcores, memory, network, etc.) usable by a container. This field determines the resource to be applied for all the containers of a component or service. The resource specified at the service (or global) level can be overriden at the component level. Only one of profile OR cpu & memory are expected. It raises a validation exception otherwise.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") public class Resource extends BaseResource implements Cloneable { private static final long serialVersionUID = -6431667797380250037L; @@ -107,7 +107,7 @@ public long getMemoryMB() { if (this.memory == null) { return 0; } - return Long.valueOf(memory); + return Long.parseLong(memory); } @Override diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Application.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Service.java similarity index 68% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Application.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Service.java index f9e5154286..f3bbaa002e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Application.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/Service.java @@ -36,17 +36,17 @@ import java.util.Objects; /** - * An Application resource has the following attributes. + * An Service resource has the following attributes. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "An Application resource has the following attributes.") +@ApiModel(description = "An Service resource has the following attributes.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") @XmlRootElement @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "name", "state", "resource", "number_of_containers", "lifetime", "containers" }) -public class Application extends BaseResource { +public class Service extends BaseResource { private static final long serialVersionUID = -4491694636566094885L; private String name = null; @@ -62,19 +62,19 @@ public class Application extends BaseResource { private List components = new ArrayList<>(); private Configuration configuration = new Configuration(); private List containers = new ArrayList<>(); - private ApplicationState state = null; + private ServiceState state = null; private Map quicklinks = new HashMap<>(); private String queue = null; /** - * A unique application name. + * A unique service name. **/ - public Application name(String name) { + public Service name(String name) { this.name = name; return this; } - @ApiModelProperty(example = "null", required = true, value = "A unique application name.") + @ApiModelProperty(example = "null", required = true, value = "A unique service name.") @JsonProperty("name") public String getName() { return name; @@ -85,14 +85,14 @@ public void setName(String name) { } /** - * A unique application id. + * A unique service id. **/ - public Application id(String id) { + public Service id(String id) { this.id = id; return this; } - @ApiModelProperty(example = "null", value = "A unique application id.") + @ApiModelProperty(example = "null", value = "A unique service id.") @JsonProperty("id") public String getId() { return id; @@ -103,15 +103,15 @@ public void setId(String id) { } /** - * Artifact of single-component applications. Mandatory if components + * Artifact of single-component services. Mandatory if components * attribute is not specified. **/ - public Application artifact(Artifact artifact) { + public Service artifact(Artifact artifact) { this.artifact = artifact; return this; } - @ApiModelProperty(example = "null", value = "Artifact of single-component applications. Mandatory if components attribute is not specified.") + @ApiModelProperty(example = "null", value = "Artifact of single-component services. Mandatory if components attribute is not specified.") @JsonProperty("artifact") public Artifact getArtifact() { return artifact; @@ -122,17 +122,17 @@ public void setArtifact(Artifact artifact) { } /** - * Resource of single-component applications or the global default for - * multi-component applications. Mandatory if it is a single-component - * application and if cpus and memory are not specified at the Application + * Resource of single-component services or the global default for + * multi-component services. Mandatory if it is a single-component + * service and if cpus and memory are not specified at the Service * level. **/ - public Application resource(Resource resource) { + public Service resource(Resource resource) { this.resource = resource; return this; } - @ApiModelProperty(example = "null", value = "Resource of single-component applications or the global default for multi-component applications. Mandatory if it is a single-component application and if cpus and memory are not specified at the Application level.") + @ApiModelProperty(example = "null", value = "Resource of single-component services or the global default for multi-component services. Mandatory if it is a single-component service and if cpus and memory are not specified at the Service level.") @JsonProperty("resource") public Resource getResource() { return resource; @@ -143,18 +143,18 @@ public void setResource(Resource resource) { } /** - * The custom launch command of an application component (optional). If not - * specified for applications with docker images say, it will default to the + * The custom launch command of an service component (optional). If not + * specified for services with docker images say, it will default to the * default start command of the image. If there is a single component in this - * application, you can specify this without the need to have a 'components' + * service, you can specify this without the need to have a 'components' * section. **/ - public Application launchCommand(String launchCommand) { + public Service launchCommand(String launchCommand) { this.launchCommand = launchCommand; return this; } - @ApiModelProperty(example = "null", value = "The custom launch command of an application component (optional). If not specified for applications with docker images say, it will default to the default start command of the image. If there is a single component in this application, you can specify this without the need to have a 'components' section.") + @ApiModelProperty(example = "null", value = "The custom launch command of an service component (optional). If not specified for services with docker images say, it will default to the default start command of the image. If there is a single component in this service, you can specify this without the need to have a 'components' section.") @JsonProperty("launch_command") public String getLaunchCommand() { return launchCommand; @@ -166,14 +166,14 @@ public void setLaunchCommand(String launchCommand) { } /** - * The time when the application was created, e.g. 2016-03-16T01:01:49.000Z. + * The time when the service was created, e.g. 2016-03-16T01:01:49.000Z. **/ - public Application launchTime(Date launchTime) { + public Service launchTime(Date launchTime) { this.launchTime = launchTime == null ? null : (Date) launchTime.clone(); return this; } - @ApiModelProperty(example = "null", value = "The time when the application was created, e.g. 2016-03-16T01:01:49.000Z.") + @ApiModelProperty(example = "null", value = "The time when the service was created, e.g. 2016-03-16T01:01:49.000Z.") @JsonProperty("launch_time") public Date getLaunchTime() { return launchTime == null ? null : (Date) launchTime.clone(); @@ -185,15 +185,15 @@ public void setLaunchTime(Date launchTime) { } /** - * Number of containers for each app-component in the application. Each - * app-component can further override this app-level global default. + * Number of containers for each component in the service. Each + * component can further override this service-level global default. **/ - public Application numberOfContainers(Long numberOfContainers) { + public Service numberOfContainers(Long numberOfContainers) { this.numberOfContainers = numberOfContainers; return this; } - @ApiModelProperty(example = "null", value = "Number of containers for each app-component in the application. Each app-component can further override this app-level global default.") + @ApiModelProperty(example = "null", value = "Number of containers for each component in the service. Each component can further override this service-level global default.") @JsonProperty("number_of_containers") public Long getNumberOfContainers() { return numberOfContainers; @@ -206,17 +206,17 @@ public void setNumberOfContainers(Long numberOfContainers) { /** * In get response this provides the total number of running containers for - * this application (across all components) at the time of request. Note, a + * this service (across all components) at the time of request. Note, a * subsequent request can return a different number as and when more * containers get allocated until it reaches the total number of containers or * if a flex request has been made between the two requests. **/ - public Application numberOfRunningContainers(Long numberOfRunningContainers) { + public Service numberOfRunningContainers(Long numberOfRunningContainers) { this.numberOfRunningContainers = numberOfRunningContainers; return this; } - @ApiModelProperty(example = "null", value = "In get response this provides the total number of running containers for this application (across all components) at the time of request. Note, a subsequent request can return a different number as and when more containers get allocated until it reaches the total number of containers or if a flex request has been made between the two requests.") + @ApiModelProperty(example = "null", value = "In get response this provides the total number of running containers for this service (across all components) at the time of request. Note, a subsequent request can return a different number as and when more containers get allocated until it reaches the total number of containers or if a flex request has been made between the two requests.") @JsonProperty("number_of_running_containers") public Long getNumberOfRunningContainers() { return numberOfRunningContainers; @@ -228,16 +228,16 @@ public void setNumberOfRunningContainers(Long numberOfRunningContainers) { } /** - * Life time (in seconds) of the application from the time it reaches the + * Life time (in seconds) of the service from the time it reaches the * RUNNING_BUT_UNREADY state (after which it is automatically destroyed by YARN). For * unlimited lifetime do not set a lifetime value. **/ - public Application lifetime(Long lifetime) { + public Service lifetime(Long lifetime) { this.lifetime = lifetime; return this; } - @ApiModelProperty(example = "null", value = "Life time (in seconds) of the application from the time it reaches the RUNNING_BUT_UNREADY state (after which it is automatically destroyed by YARN). For unlimited lifetime do not set a lifetime value.") + @ApiModelProperty(example = "null", value = "Life time (in seconds) of the service from the time it reaches the RUNNING_BUT_UNREADY state (after which it is automatically destroyed by YARN). For unlimited lifetime do not set a lifetime value.") @JsonProperty("lifetime") public Long getLifetime() { return lifetime; @@ -249,18 +249,18 @@ public void setLifetime(Long lifetime) { /** * Advanced scheduling and placement policies (optional). If not specified, it - * defaults to the default placement policy of the app owner. The design of + * defaults to the default placement policy of the service owner. The design of * placement policies are in the works. It is not very clear at this point, - * how policies in conjunction with labels be exposed to application owners. + * how policies in conjunction with labels be exposed to service owners. * This is a placeholder for now. The advanced structure of this attribute * will be determined by YARN-4902. **/ - public Application placementPolicy(PlacementPolicy placementPolicy) { + public Service placementPolicy(PlacementPolicy placementPolicy) { this.placementPolicy = placementPolicy; return this; } - @ApiModelProperty(example = "null", value = "Advanced scheduling and placement policies (optional). If not specified, it defaults to the default placement policy of the app owner. The design of placement policies are in the works. It is not very clear at this point, how policies in conjunction with labels be exposed to application owners. This is a placeholder for now. The advanced structure of this attribute will be determined by YARN-4902.") + @ApiModelProperty(example = "null", value = "Advanced scheduling and placement policies (optional). If not specified, it defaults to the default placement policy of the service owner. The design of placement policies are in the works. It is not very clear at this point, how policies in conjunction with labels be exposed to service owners. This is a placeholder for now. The advanced structure of this attribute will be determined by YARN-4902.") @JsonProperty("placement_policy") public PlacementPolicy getPlacementPolicy() { return placementPolicy; @@ -272,14 +272,14 @@ public void setPlacementPolicy(PlacementPolicy placementPolicy) { } /** - * Components of an application. + * Components of an service. **/ - public Application components(List components) { + public Service components(List components) { this.components = components; return this; } - @ApiModelProperty(example = "null", value = "Components of an application.") + @ApiModelProperty(example = "null", value = "Components of an service.") @JsonProperty("components") public List getComponents() { return components; @@ -303,16 +303,16 @@ public Component getComponent(String name) { } /** - * Config properties of an application. Configurations provided at the - * application/global level are available to all the components. Specific + * Config properties of an service. Configurations provided at the + * service/global level are available to all the components. Specific * properties can be overridden at the component level. **/ - public Application configuration(Configuration configuration) { + public Service configuration(Configuration configuration) { this.configuration = configuration; return this; } - @ApiModelProperty(example = "null", value = "Config properties of an application. Configurations provided at the application/global level are available to all the components. Specific properties can be overridden at the component level.") + @ApiModelProperty(example = "null", value = "Config properties of an service. Configurations provided at the service/global level are available to all the components. Specific properties can be overridden at the component level.") @JsonProperty("configuration") public Configuration getConfiguration() { return configuration; @@ -323,16 +323,16 @@ public void setConfiguration(Configuration configuration) { } /** - * Containers of a started application. Specifying a value for this attribute + * Containers of a started service. Specifying a value for this attribute * for the POST payload raises a validation error. This blob is available only - * in the GET response of a started application. + * in the GET response of a started service. **/ - public Application containers(List containers) { + public Service containers(List containers) { this.containers = containers; return this; } - @ApiModelProperty(example = "null", value = "Containers of a started application. Specifying a value for this attribute for the POST payload raises a validation error. This blob is available only in the GET response of a started application.") + @ApiModelProperty(example = "null", value = "Containers of a started service. Specifying a value for this attribute for the POST payload raises a validation error. This blob is available only in the GET response of a started service.") @JsonProperty("containers") public List getContainers() { return containers; @@ -347,34 +347,34 @@ public void addContainer(Container container) { } /** - * State of the application. Specifying a value for this attribute for the + * State of the service. Specifying a value for this attribute for the * POST payload raises a validation error. This attribute is available only in - * the GET response of a started application. + * the GET response of a started service. **/ - public Application state(ApplicationState state) { + public Service state(ServiceState state) { this.state = state; return this; } - @ApiModelProperty(example = "null", value = "State of the application. Specifying a value for this attribute for the POST payload raises a validation error. This attribute is available only in the GET response of a started application.") + @ApiModelProperty(example = "null", value = "State of the service. Specifying a value for this attribute for the POST payload raises a validation error. This attribute is available only in the GET response of a started service.") @JsonProperty("state") - public ApplicationState getState() { + public ServiceState getState() { return state; } - public void setState(ApplicationState state) { + public void setState(ServiceState state) { this.state = state; } /** - * A blob of key-value pairs of quicklinks to be exported for an application. + * A blob of key-value pairs of quicklinks to be exported for an service. **/ - public Application quicklinks(Map quicklinks) { + public Service quicklinks(Map quicklinks) { this.quicklinks = quicklinks; return this; } - @ApiModelProperty(example = "null", value = "A blob of key-value pairs of quicklinks to be exported for an application.") + @ApiModelProperty(example = "null", value = "A blob of key-value pairs of quicklinks to be exported for an service.") @JsonProperty("quicklinks") public Map getQuicklinks() { return quicklinks; @@ -385,14 +385,14 @@ public void setQuicklinks(Map quicklinks) { } /** - * The YARN queue that this application should be submitted to. + * The YARN queue that this service should be submitted to. **/ - public Application queue(String queue) { + public Service queue(String queue) { this.queue = queue; return this; } - @ApiModelProperty(example = "null", value = "The YARN queue that this application should be submitted to.") + @ApiModelProperty(example = "null", value = "The YARN queue that this service should be submitted to.") @JsonProperty("queue") public String getQueue() { return queue; @@ -410,8 +410,8 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Application application = (Application) o; - return Objects.equals(this.name, application.name); + Service service = (Service) o; + return Objects.equals(this.name, service.name); } @Override @@ -422,7 +422,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Application {\n"); + sb.append("class Service {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ApplicationState.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ServiceState.java similarity index 90% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ApplicationState.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ServiceState.java index acef562a20..a4509bd71d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ApplicationState.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ServiceState.java @@ -22,12 +22,12 @@ import org.apache.hadoop.classification.InterfaceStability; /** - * The current state of an application. + * The current state of an service. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "The current state of an application.") +@ApiModel(description = "The current state of an service.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") -public enum ApplicationState { +public enum ServiceState { ACCEPTED, STARTED, READY, STOPPED, FAILED; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ApplicationStatus.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ServiceStatus.java similarity index 71% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ApplicationStatus.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ServiceStatus.java index b57225aa50..2cee23c8e9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ApplicationStatus.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ServiceStatus.java @@ -30,33 +30,33 @@ import org.apache.hadoop.classification.InterfaceStability; /** - * The current status of a submitted application, returned as a response to the + * The current status of a submitted service, returned as a response to the * GET API. **/ @InterfaceAudience.Public @InterfaceStability.Unstable -@ApiModel(description = "The current status of a submitted application, returned as a response to the GET API.") +@ApiModel(description = "The current status of a submitted service, returned as a response to the GET API.") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-06-02T08:15:05.615-07:00") @XmlRootElement @JsonInclude(JsonInclude.Include.NON_NULL) -public class ApplicationStatus extends BaseResource { +public class ServiceStatus extends BaseResource { private static final long serialVersionUID = -3469885905347851034L; private String diagnostics = null; - private ApplicationState state = null; + private ServiceState state = null; private Integer code = null; /** * Diagnostic information (if any) for the reason of the current state of the - * application. It typically has a non-null value, if the application is in a + * service. It typically has a non-null value, if the service is in a * non-running state. **/ - public ApplicationStatus diagnostics(String diagnostics) { + public ServiceStatus diagnostics(String diagnostics) { this.diagnostics = diagnostics; return this; } - @ApiModelProperty(example = "null", value = "Diagnostic information (if any) for the reason of the current state of the application. It typically has a non-null value, if the application is in a non-running state.") + @ApiModelProperty(example = "null", value = "Diagnostic information (if any) for the reason of the current state of the service. It typically has a non-null value, if the service is in a non-running state.") @JsonProperty("diagnostics") public String getDiagnostics() { return diagnostics; @@ -67,33 +67,33 @@ public void setDiagnostics(String diagnostics) { } /** - * Application state. + * Service state. **/ - public ApplicationStatus state(ApplicationState state) { + public ServiceStatus state(ServiceState state) { this.state = state; return this; } - @ApiModelProperty(example = "null", value = "Application state.") + @ApiModelProperty(example = "null", value = "Service state.") @JsonProperty("state") - public ApplicationState getState() { + public ServiceState getState() { return state; } - public void setState(ApplicationState state) { + public void setState(ServiceState state) { this.state = state; } /** - * An error code specific to a scenario which app owners should be able to use + * An error code specific to a scenario which service owners should be able to use * to understand the failure in addition to the diagnostic information. **/ - public ApplicationStatus code(Integer code) { + public ServiceStatus code(Integer code) { this.code = code; return this; } - @ApiModelProperty(example = "null", value = "An error code specific to a scenario which app owners should be able to use to understand the failure in addition to the diagnostic information.") + @ApiModelProperty(example = "null", value = "An error code specific to a scenario which service owners should be able to use to understand the failure in addition to the diagnostic information.") @JsonProperty("code") public Integer getCode() { return code; @@ -111,10 +111,10 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ApplicationStatus applicationStatus = (ApplicationStatus) o; - return Objects.equals(this.diagnostics, applicationStatus.diagnostics) - && Objects.equals(this.state, applicationStatus.state) - && Objects.equals(this.code, applicationStatus.code); + ServiceStatus serviceStatus = (ServiceStatus) o; + return Objects.equals(this.diagnostics, serviceStatus.diagnostics) + && Objects.equals(this.state, serviceStatus.state) + && Objects.equals(this.code, serviceStatus.code); } @Override @@ -125,7 +125,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ApplicationStatus {\n"); + sb.append("class ServiceStatus {\n"); sb.append(" diagnostics: ").append(toIndentedString(diagnostics)) .append("\n"); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ClientAMProxy.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ClientAMProxy.java similarity index 79% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ClientAMProxy.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ClientAMProxy.java index 0749077f63..e17c0c4ac2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ClientAMProxy.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ClientAMProxy.java @@ -28,21 +28,29 @@ import java.net.InetSocketAddress; +import static org.apache.hadoop.io.retry.RetryPolicies.TRY_ONCE_THEN_FAIL; + public class ClientAMProxy extends ServerProxy{ public static T createProxy(final Configuration conf, final Class protocol, final UserGroupInformation ugi, final YarnRPC rpc, final InetSocketAddress serverAddress) { - - RetryPolicy retryPolicy = - createRetryPolicy(conf, YarnServiceConf.CLIENT_AM_RETRY_MAX_WAIT_MS, - 15 * 60 * 1000, YarnServiceConf.CLIENT_AM_RETRY_MAX_INTERVAL_MS, - 2 * 1000); Configuration confClone = new Configuration(conf); confClone.setInt( CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, 0); confClone.setInt(CommonConfigurationKeysPublic. IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_KEY, 0); + RetryPolicy retryPolicy; + + if (conf.getLong(YarnServiceConf.CLIENT_AM_RETRY_MAX_WAIT_MS, 0) == 0) { + // by default no retry + retryPolicy = TRY_ONCE_THEN_FAIL; + } else { + retryPolicy = + createRetryPolicy(conf, YarnServiceConf.CLIENT_AM_RETRY_MAX_WAIT_MS, + 15 * 60 * 1000, YarnServiceConf.CLIENT_AM_RETRY_MAX_INTERVAL_MS, + 2 * 1000); + } return createRetriableProxy(confClone, protocol, ugi, rpc, serverAddress, retryPolicy); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceCLI.java similarity index 89% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceCLI.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceCLI.java index c7421ff8f2..cb270219d6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceCLI.java @@ -20,12 +20,14 @@ import org.apache.commons.lang.StringUtils; import org.apache.hadoop.yarn.conf.YarnConfiguration; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.client.params.ClientArgs; import org.apache.hadoop.yarn.service.exceptions.BadCommandArgumentsException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.FileNotFoundException; + import static org.apache.hadoop.yarn.service.client.params.SliderActions.*; public class ServiceCLI { @@ -49,11 +51,17 @@ int exec(ClientArgs args) throws Throwable { client.actionCreate(args.getActionCreateArgs()); break; case ACTION_STATUS: - Application app = client.getStatus(args.getClusterName()); + Service app = client.getStatus(args.getClusterName()); System.out.println(app); break; case ACTION_FLEX: - client.actionFlexByCLI(args); + try { + client.actionFlexByCLI(args); + } catch (FileNotFoundException e) { + System.err.println( + args.getClusterName() + " doesn't exist: " + e.getMessage()); + return -1; + } break; case ACTION_STOP: client.actionStop(args.getClusterName(), false); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java similarity index 73% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java index 1049698603..c3a2752657 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java @@ -45,6 +45,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationTimeout; import org.apache.hadoop.yarn.api.records.ApplicationTimeoutType; import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; +import org.apache.hadoop.yarn.api.records.FinalApplicationStatus; import org.apache.hadoop.yarn.api.records.LocalResource; import org.apache.hadoop.yarn.api.records.LocalResourceType; import org.apache.hadoop.yarn.api.records.Resource; @@ -61,8 +62,9 @@ import org.apache.hadoop.yarn.proto.ClientAMProtocol.StopRequestProto; import org.apache.hadoop.yarn.service.ClientAMProtocol; import org.apache.hadoop.yarn.service.ServiceMaster; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.api.records.Component; +import org.apache.hadoop.yarn.service.api.records.ServiceState; import org.apache.hadoop.yarn.service.client.params.AbstractClusterBuildingActionArgs; import org.apache.hadoop.yarn.service.client.params.ActionDependencyArgs; import org.apache.hadoop.yarn.service.client.params.ActionFlexArgs; @@ -107,6 +109,7 @@ import static org.apache.hadoop.yarn.service.client.params.SliderActions.ACTION_CREATE; import static org.apache.hadoop.yarn.service.client.params.SliderActions.ACTION_FLEX; import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.YARN_QUEUE; +import static org.apache.hadoop.yarn.service.utils.ServiceApiUtil.jsonSerDeser; import static org.apache.hadoop.yarn.service.utils.SliderUtils.*; @InterfaceAudience.Public @@ -116,10 +119,10 @@ public class ServiceClient extends CompositeService private static final Logger LOG = LoggerFactory.getLogger(ServiceClient.class); private SliderFileSystem fs; - private YarnClient yarnClient; + //TODO disable retry so that client / rest API doesn't block? + protected YarnClient yarnClient; // Avoid looking up applicationId from fs all the time. private Map cachedAppIds = new ConcurrentHashMap<>(); - private Map cachedAMProxies = new ConcurrentHashMap<>(); private RegistryOperations registryClient; private CuratorFramework curatorClient; @@ -128,7 +131,9 @@ public class ServiceClient extends CompositeService private static EnumSet terminatedStates = EnumSet.of(FINISHED, FAILED, KILLED); private static EnumSet liveStates = - EnumSet.of(NEW, NEW_SAVING, SUBMITTED, RUNNING); + EnumSet.of(NEW, NEW_SAVING, SUBMITTED, ACCEPTED, RUNNING); + private static EnumSet preRunningStates = + EnumSet.of(NEW, NEW_SAVING, SUBMITTED, ACCEPTED); public ServiceClient() { super(ServiceClient.class.getName()); @@ -151,18 +156,18 @@ protected void serviceStop() throws Exception { super.serviceStop(); } - private Application loadAppJsonFromLocalFS( + private Service loadAppJsonFromLocalFS( AbstractClusterBuildingActionArgs args) throws IOException { File file = args.getAppDef(); Path filePath = new Path(file.getAbsolutePath()); LOG.info("Loading app json from: " + filePath); - Application application = ServiceApiUtil.jsonSerDeser + Service service = jsonSerDeser .load(FileSystem.getLocal(getConfig()), filePath); if (args.lifetime > 0) { - application.setLifetime(args.lifetime); + service.setLifetime(args.lifetime); } - application.setName(args.getClusterName()); - return application; + service.setName(args.getClusterName()); + return service; } public int actionBuild(AbstractClusterBuildingActionArgs args) @@ -170,11 +175,11 @@ public int actionBuild(AbstractClusterBuildingActionArgs args) return actionBuild(loadAppJsonFromLocalFS(args)); } - public int actionBuild(Application application) + public int actionBuild(Service service) throws YarnException, IOException { - Path appDir = checkAppNotExistOnHdfs(application); - ServiceApiUtil.validateAndResolveApplication(application, fs, getConfig()); - createDirAndPersistApp(appDir, application); + Path appDir = checkAppNotExistOnHdfs(service); + ServiceApiUtil.validateAndResolveService(service, fs, getConfig()); + createDirAndPersistApp(appDir, service); return EXIT_SUCCESS; } @@ -184,21 +189,21 @@ public int actionCreate(AbstractClusterBuildingActionArgs args) return EXIT_SUCCESS; } - public ApplicationId actionCreate(Application application) + public ApplicationId actionCreate(Service service) throws IOException, YarnException { - String appName = application.getName(); - validateClusterName(appName); - ServiceApiUtil.validateAndResolveApplication(application, fs, getConfig()); - verifyNoLiveAppInRM(appName, "create"); - Path appDir = checkAppNotExistOnHdfs(application); + String serviceName = service.getName(); + ServiceApiUtil.validateNameFormat(serviceName, getConfig()); + ServiceApiUtil.validateAndResolveService(service, fs, getConfig()); + verifyNoLiveAppInRM(serviceName, "create"); + Path appDir = checkAppNotExistOnHdfs(service); // Write the definition first and then submit - AM will read the definition - createDirAndPersistApp(appDir, application); - ApplicationId appId = submitApp(application); - cachedAppIds.put(appName, appId); - application.setId(appId.toString()); + createDirAndPersistApp(appDir, service); + ApplicationId appId = submitApp(service); + cachedAppIds.put(serviceName, appId); + service.setId(appId.toString()); // update app definition with appId - persistAppDef(appDir, application); + persistAppDef(appDir, service); return appId; } @@ -208,17 +213,21 @@ protected int actionFlexByCLI(ClientArgs args) ActionFlexArgs flexArgs = args.getActionFlexArgs(); Map componentCounts = new HashMap<>(flexArgs.getComponentMap().size()); - Application persistedApp = - ServiceApiUtil.loadApplication(fs, flexArgs.getClusterName()); - if (!StringUtils.isEmpty(persistedApp.getId())) { - cachedAppIds.put(persistedApp.getName(), - ApplicationId.fromString(persistedApp.getId())); + Service persistedService = + ServiceApiUtil.loadService(fs, flexArgs.getClusterName()); + if (!StringUtils.isEmpty(persistedService.getId())) { + cachedAppIds.put(persistedService.getName(), + ApplicationId.fromString(persistedService.getId())); + } else { + throw new YarnException(persistedService.getName() + + " appId is null, may be not submitted to YARN yet"); } + for (Map.Entry entry : flexArgs.getComponentMap() .entrySet()) { String compName = entry.getKey(); - ServiceApiUtil.validateCompName(compName); - Component component = persistedApp.getComponent(compName); + ServiceApiUtil.validateNameFormat(compName, getConfig()); + Component component = persistedService.getComponent(compName); if (component == null) { throw new IllegalArgumentException(entry.getKey() + " does not exist !"); } @@ -230,7 +239,7 @@ protected int actionFlexByCLI(ClientArgs args) if (componentCounts.size() == 0) { actionHelp(ACTION_FLEX, args); } - flexComponents(args.getClusterName(), componentCounts, persistedApp); + flexComponents(args.getClusterName(), componentCounts, persistedService); return EXIT_SUCCESS; } @@ -258,19 +267,23 @@ private long parseNumberOfContainers(Component component, String newNumber) { } // Called by Rest Service - public Map flexByRestService(String appName, + public Map flexByRestService(String serviceName, Map componentCounts) throws YarnException, IOException { // load app definition - Application persistedApp = ServiceApiUtil.loadApplication(fs, appName); - cachedAppIds.put(persistedApp.getName(), - ApplicationId.fromString(persistedApp.getId())); - return flexComponents(appName, componentCounts, persistedApp); + Service persistedService = ServiceApiUtil.loadService(fs, serviceName); + if (StringUtils.isEmpty(persistedService.getId())) { + throw new YarnException( + serviceName + " appId is null, may be not submitted to YARN yet"); + } + cachedAppIds.put(persistedService.getName(), + ApplicationId.fromString(persistedService.getId())); + return flexComponents(serviceName, componentCounts, persistedService); } - private Map flexComponents(String appName, - Map componentCounts, Application persistedApp) + private Map flexComponents(String serviceName, + Map componentCounts, Service persistedService) throws YarnException, IOException { - validateClusterName(appName); + ServiceApiUtil.validateNameFormat(serviceName, getConfig()); Map original = new HashMap<>(componentCounts.size()); @@ -278,7 +291,7 @@ private Map flexComponents(String appName, FlexComponentsRequestProto.Builder requestBuilder = FlexComponentsRequestProto.newBuilder(); - for (Component persistedComp : persistedApp.getComponents()) { + for (Component persistedComp : persistedService.getComponents()) { String name = persistedComp.getName(); if (componentCounts.containsKey(persistedComp.getName())) { original.put(name, persistedComp.getNumberOfContainers()); @@ -295,15 +308,24 @@ private Map flexComponents(String appName, throw new YarnException("Components " + componentCounts.keySet() + " do not exist in app definition."); } - ServiceApiUtil.jsonSerDeser - .save(fs.getFileSystem(), ServiceApiUtil.getAppJsonPath(fs, appName), - persistedApp, true); - ClientAMProtocol proxy = getAMProxy(appName); - if (proxy == null) { - String message = appName + " is not running"; + jsonSerDeser + .save(fs.getFileSystem(), ServiceApiUtil.getServiceJsonPath(fs, serviceName), + persistedService, true); + + ApplicationReport appReport = + yarnClient.getApplicationReport(getAppId(serviceName)); + if (appReport.getYarnApplicationState() != RUNNING) { + String message = + serviceName + " is at " + appReport.getYarnApplicationState() + + " state, flex can only be invoked when service is running"; LOG.error(message); throw new YarnException(message); } + if (StringUtils.isEmpty(appReport.getHost())) { + throw new YarnException(serviceName + " AM hostname is empty"); + } + ClientAMProtocol proxy = + createAMProxy(appReport.getHost(), appReport.getRpcPort()); proxy.flexComponents(requestBuilder.build()); for (Map.Entry entry : original.entrySet()) { LOG.info("[COMPONENT {}]: number of containers changed from {} to {}", @@ -313,31 +335,40 @@ private Map flexComponents(String appName, return original; } - public int actionStop(String appName, boolean waitForAppStopped) + public int actionStop(String serviceName, boolean waitForAppStopped) throws YarnException, IOException { - validateClusterName(appName); - getAppId(appName); - ApplicationId currentAppId = cachedAppIds.get(appName); + ServiceApiUtil.validateNameFormat(serviceName, getConfig()); + ApplicationId currentAppId = getAppId(serviceName); ApplicationReport report = yarnClient.getApplicationReport(currentAppId); if (terminatedStates.contains(report.getYarnApplicationState())) { - LOG.info("Application {} is already in a terminated state {}", appName, + LOG.info("Service {} is already in a terminated state {}", serviceName, report.getYarnApplicationState()); return EXIT_SUCCESS; } - LOG.info("Stopping application {}, with appId = {}", appName, currentAppId); + if (preRunningStates.contains(report.getYarnApplicationState())) { + String msg = serviceName + " is at " + report.getYarnApplicationState() + + ", forcefully killed by user!"; + yarnClient.killApplication(currentAppId, msg); + LOG.info(msg); + return EXIT_SUCCESS; + } + if (StringUtils.isEmpty(report.getHost())) { + throw new YarnException(serviceName + " AM hostname is empty"); + } + LOG.info("Stopping service {}, with appId = {}", serviceName, currentAppId); try { - ClientAMProtocol proxy = getAMProxy(appName, report); - cachedAppIds.remove(appName); - cachedAMProxies.remove(appName); + ClientAMProtocol proxy = + createAMProxy(report.getHost(), report.getRpcPort()); + cachedAppIds.remove(serviceName); if (proxy != null) { // try to stop the app gracefully. StopRequestProto request = StopRequestProto.newBuilder().build(); proxy.stop(request); - LOG.info("Application " + appName + " is being gracefully stopped..."); + LOG.info("Service " + serviceName + " is being gracefully stopped..."); } else { yarnClient.killApplication(currentAppId, - appName + " is forcefully killed by user!"); - LOG.info("Forcefully kill the application: " + appName); + serviceName + " is forcefully killed by user!"); + LOG.info("Forcefully kill the service: " + serviceName); return EXIT_SUCCESS; } @@ -351,56 +382,55 @@ public int actionStop(String appName, boolean waitForAppStopped) Thread.sleep(2000); report = yarnClient.getApplicationReport(currentAppId); if (terminatedStates.contains(report.getYarnApplicationState())) { - LOG.info("Application " + appName + " is stopped."); + LOG.info("Service " + serviceName + " is stopped."); break; } // Forcefully kill after 10 seconds. if ((System.currentTimeMillis() - startTime) > 10000) { LOG.info("Stop operation timeout stopping, forcefully kill the app " - + appName); + + serviceName); yarnClient.killApplication(currentAppId, "Forcefully kill the app by user"); break; } if (++pollCount % 10 == 0) { - LOG.info("Waiting for application " + appName + " to be stopped."); + LOG.info("Waiting for service " + serviceName + " to be stopped."); } } } catch (IOException | YarnException | InterruptedException e) { - LOG.info("Failed to stop " + appName + LOG.info("Failed to stop " + serviceName + " gracefully, forcefully kill the app."); yarnClient.killApplication(currentAppId, "Forcefully kill the app"); } return EXIT_SUCCESS; } - public int actionDestroy(String appName) throws Exception { - validateClusterName(appName); - verifyNoLiveAppInRM(appName, "Destroy"); - Path appDir = fs.buildClusterDirPath(appName); + public int actionDestroy(String serviceName) throws Exception { + ServiceApiUtil.validateNameFormat(serviceName, getConfig()); + verifyNoLiveAppInRM(serviceName, "Destroy"); + Path appDir = fs.buildClusterDirPath(serviceName); FileSystem fileSystem = fs.getFileSystem(); // remove from the appId cache - cachedAppIds.remove(appName); - cachedAMProxies.remove(appName); + cachedAppIds.remove(serviceName); if (fileSystem.exists(appDir)) { if (fileSystem.delete(appDir, true)) { - LOG.info("Successfully deleted application dir for " + appName + ": " + LOG.info("Successfully deleted service dir for " + serviceName + ": " + appDir); } else { String message = - "Failed to delete application + " + appName + " at: " + appDir; + "Failed to delete service + " + serviceName + " at: " + appDir; LOG.info(message); throw new YarnException(message); } } - deleteZKNode(appName); - String registryPath = ServiceRegistryUtils.registryPathForInstance(appName); + deleteZKNode(serviceName); + String registryPath = ServiceRegistryUtils.registryPathForInstance(serviceName); try { getRegistryClient().delete(registryPath, true); } catch (IOException e) { LOG.warn("Error deleting registry entry {}", registryPath, e); } - LOG.info("Destroyed cluster {}", appName); + LOG.info("Destroyed cluster {}", serviceName); return EXIT_SUCCESS; } @@ -454,13 +484,13 @@ private int actionHelp(String actionName, CommonArgs args) throw new UsageException(CommonArgs.usage(args, actionName)); } - private void verifyNoLiveAppInRM(String appname, String action) + private void verifyNoLiveAppInRM(String serviceName, String action) throws IOException, YarnException { Set types = new HashSet<>(1); types.add(YarnServiceConstants.APP_TYPE); Set tags = null; - if (appname != null) { - tags = Collections.singleton(SliderUtils.createNameTag(appname)); + if (serviceName != null) { + tags = Collections.singleton(SliderUtils.createNameTag(serviceName)); } GetApplicationsRequest request = GetApplicationsRequest.newInstance(); request.setApplicationTypes(types); @@ -469,14 +499,14 @@ private void verifyNoLiveAppInRM(String appname, String action) List reports = yarnClient.getApplications(request); if (!reports.isEmpty()) { throw new YarnException( - "Failed to " + action + " application, as " + appname + "Failed to " + action + " service, as " + serviceName + " already exists."); } } - private ApplicationId submitApp(Application app) + private ApplicationId submitApp(Service app) throws IOException, YarnException { - String appName = app.getName(); + String serviceName = app.getName(); Configuration conf = getConfig(); Path appRootDir = fs.buildClusterDirPath(app.getName()); @@ -500,11 +530,11 @@ private ApplicationId submitApp(Application app) // copy local slideram-log4j.properties to hdfs and add to localResources boolean hasAMLog4j = - addAMLog4jResource(appName, conf, localResources); + addAMLog4jResource(serviceName, conf, localResources); // copy jars to hdfs and add to localResources - addJarResource(appName, localResources); + addJarResource(serviceName, localResources); // add keytab if in secure env - addKeytabResourceIfSecure(fs, localResources, conf, appName); + addKeytabResourceIfSecure(fs, localResources, conf, serviceName); if (LOG.isDebugEnabled()) { printLocalResources(localResources); } @@ -512,7 +542,7 @@ private ApplicationId submitApp(Application app) // create AM CLI String cmdStr = - buildCommandLine(appName, conf, appRootDir, hasAMLog4j); + buildCommandLine(serviceName, conf, appRootDir, hasAMLog4j); submissionContext.setResource(Resource.newInstance(YarnServiceConf .getLong(YarnServiceConf.AM_RESOURCE_MEM, YarnServiceConf.DEFAULT_KEY_AM_RESOURCE_MEM, app.getConfiguration(), conf), 1)); @@ -521,10 +551,10 @@ private ApplicationId submitApp(Application app) queue = conf.get(YARN_QUEUE, "default"); } submissionContext.setQueue(queue); - submissionContext.setApplicationName(appName); + submissionContext.setApplicationName(serviceName); submissionContext.setApplicationType(YarnServiceConstants.APP_TYPE); Set appTags = - AbstractClientProvider.createApplicationTags(appName, null, null); + AbstractClientProvider.createApplicationTags(serviceName, null, null); if (!appTags.isEmpty()) { submissionContext.setApplicationTags(appTags); } @@ -549,7 +579,7 @@ private void printLocalResources(Map map) { LOG.debug(builder.toString()); } - private String buildCommandLine(String appName, Configuration conf, + private String buildCommandLine(String serviceName, Configuration conf, Path appRootDir, boolean hasSliderAMLog4j) throws BadConfigException { JavaCommandLineBuilder CLI = new JavaCommandLineBuilder(); CLI.forceIPv4().headless(); @@ -560,9 +590,9 @@ private String buildCommandLine(String appName, Configuration conf, CLI.sysprop(SYSPROP_LOG_DIR, ApplicationConstants.LOG_DIR_EXPANSION_VAR); } CLI.add(ServiceMaster.class.getCanonicalName()); - CLI.add(ACTION_CREATE, appName); + CLI.add(ACTION_CREATE, serviceName); //TODO debugAM CLI.add(Arguments.ARG_DEBUG) - CLI.add(Arguments.ARG_CLUSTER_URI, new Path(appRootDir, appName + ".json")); + CLI.add(Arguments.ARG_CLUSTER_URI, new Path(appRootDir, serviceName + ".json")); // pass the registry binding CLI.addConfOptionToCLI(conf, RegistryConstants.KEY_REGISTRY_ZK_ROOT, RegistryConstants.DEFAULT_ZK_REGISTRY_ROOT); @@ -599,10 +629,10 @@ private Map addAMEnv(Configuration conf) throws IOException { return env; } - protected Path addJarResource(String appName, + protected Path addJarResource(String serviceName, Map localResources) throws IOException, SliderException { - Path libPath = fs.buildClusterDirPath(appName); + Path libPath = fs.buildClusterDirPath(serviceName); ProviderUtils .addProviderJar(localResources, ServiceMaster.class, SERVICE_CORE_JAR, fs, libPath, "lib", false); @@ -621,7 +651,7 @@ protected Path addJarResource(String appName, return libPath; } - private boolean addAMLog4jResource(String appName, Configuration conf, + private boolean addAMLog4jResource(String serviceName, Configuration conf, Map localResources) throws IOException, BadClusterStateException { boolean hasAMLog4j = false; @@ -632,7 +662,7 @@ private boolean addAMLog4jResource(String appName, Configuration conf, new File(hadoopConfDir, YarnServiceConstants.YARN_SERVICE_LOG4J_FILENAME); if (localFile.exists()) { Path localFilePath = createLocalPath(localFile); - Path appDirPath = fs.buildClusterDirPath(appName); + Path appDirPath = fs.buildClusterDirPath(serviceName); Path remoteConfPath = new Path(appDirPath, YarnServiceConstants.SUBMITTED_CONF_DIR); Path remoteFilePath = @@ -649,54 +679,54 @@ private boolean addAMLog4jResource(String appName, Configuration conf, return hasAMLog4j; } - public int actionStart(String appName) throws YarnException, IOException { - validateClusterName(appName); - Path appDir = checkAppExistOnHdfs(appName); - Application application = ServiceApiUtil.loadApplication(fs, appName); - ServiceApiUtil.validateAndResolveApplication(application, fs, getConfig()); + public int actionStart(String serviceName) throws YarnException, IOException { + ServiceApiUtil.validateNameFormat(serviceName, getConfig()); + Path appDir = checkAppExistOnHdfs(serviceName); + Service service = ServiceApiUtil.loadService(fs, serviceName); + ServiceApiUtil.validateAndResolveService(service, fs, getConfig()); // see if it is actually running and bail out; - verifyNoLiveAppInRM(appName, "thaw"); - ApplicationId appId = submitApp(application); - application.setId(appId.toString()); + verifyNoLiveAppInRM(serviceName, "thaw"); + ApplicationId appId = submitApp(service); + service.setId(appId.toString()); // write app definition on to hdfs - createDirAndPersistApp(appDir, application); + createDirAndPersistApp(appDir, service); return 0; } - private Path checkAppNotExistOnHdfs(Application application) + private Path checkAppNotExistOnHdfs(Service service) throws IOException, SliderException { - Path appDir = fs.buildClusterDirPath(application.getName()); + Path appDir = fs.buildClusterDirPath(service.getName()); fs.verifyDirectoryNonexistent( - new Path(appDir, application.getName() + ".json")); + new Path(appDir, service.getName() + ".json")); return appDir; } - private Path checkAppExistOnHdfs(String appName) + private Path checkAppExistOnHdfs(String serviceName) throws IOException, SliderException { - Path appDir = fs.buildClusterDirPath(appName); - fs.verifyPathExists(new Path(appDir, appName + ".json")); + Path appDir = fs.buildClusterDirPath(serviceName); + fs.verifyPathExists(new Path(appDir, serviceName + ".json")); return appDir; } - private void createDirAndPersistApp(Path appDir, Application application) + private void createDirAndPersistApp(Path appDir, Service service) throws IOException, SliderException { FsPermission appDirPermission = new FsPermission("750"); fs.createWithPermissions(appDir, appDirPermission); - persistAppDef(appDir, application); + persistAppDef(appDir, service); } - private void persistAppDef(Path appDir, Application application) + private void persistAppDef(Path appDir, Service service) throws IOException { - Path appJson = new Path(appDir, application.getName() + ".json"); - ServiceApiUtil.jsonSerDeser - .save(fs.getFileSystem(), appJson, application, true); + Path appJson = new Path(appDir, service.getName() + ".json"); + jsonSerDeser + .save(fs.getFileSystem(), appJson, service, true); LOG.info( - "Persisted application " + application.getName() + " at " + appJson); + "Persisted service " + service.getName() + " at " + appJson); } private void addKeytabResourceIfSecure(SliderFileSystem fileSystem, Map localResource, Configuration conf, - String appName) throws IOException, BadConfigException { + String serviceName) throws IOException, BadConfigException { if (!UserGroupInformation.isSecurityEnabled()) { return; } @@ -707,7 +737,7 @@ private void addKeytabResourceIfSecure(SliderFileSystem fileSystem, conf.get(YarnServiceConf.KEY_AM_LOGIN_KEYTAB_NAME); String keytabDir = conf.get(YarnServiceConf.KEY_HDFS_KEYTAB_DIR); Path keytabPath = - fileSystem.buildKeytabPath(keytabDir, amKeytabName, appName); + fileSystem.buildKeytabPath(keytabDir, amKeytabName, serviceName); if (fileSystem.getFileSystem().exists(keytabPath)) { LocalResource keytabRes = fileSystem.createAmResource(keytabPath, LocalResourceType.FILE); @@ -722,23 +752,22 @@ private void addKeytabResourceIfSecure(SliderFileSystem fileSystem, } else { LOG.warn("The AM will be " + "started without a kerberos authenticated identity. " - + "The application is therefore not guaranteed to remain " + + "The service is therefore not guaranteed to remain " + "operational beyond 24 hours."); } } } } - public String updateLifetime(String appName, long lifetime) + public String updateLifetime(String serviceName, long lifetime) throws YarnException, IOException { - getAppId(appName); - ApplicationId currentAppId = cachedAppIds.get(appName); + ApplicationId currentAppId = getAppId(serviceName); ApplicationReport report = yarnClient.getApplicationReport(currentAppId); if (report == null) { - throw new YarnException("Application not found for " + appName); + throw new YarnException("Service not found for " + serviceName); } ApplicationId appId = report.getApplicationId(); - LOG.info("Updating lifetime of an application: appName = " + appName + LOG.info("Updating lifetime of an service: serviceName = " + serviceName + ", appId = " + appId + ", lifetime = " + lifetime); Map map = new HashMap<>(); String newTimeout = @@ -748,32 +777,55 @@ public String updateLifetime(String appName, long lifetime) UpdateApplicationTimeoutsRequest.newInstance(appId, map); yarnClient.updateApplicationTimeouts(request); LOG.info( - "Successfully updated lifetime for an application: appName = " + appName + "Successfully updated lifetime for an service: serviceName = " + serviceName + ", appId = " + appId + ". New expiry time in ISO8601 format is " + newTimeout); return newTimeout; } - public Application getStatus(String appName) - throws IOException, YarnException { - validateClusterName(appName); - ApplicationId currentAppId = getAppId(appName); - ApplicationReport appReport = yarnClient.getApplicationReport(currentAppId); - ClientAMProtocol amProxy = getAMProxy(appName, appReport); - Application appSpec; - if (amProxy != null) { - GetStatusResponseProto response = - amProxy.getStatus(GetStatusRequestProto.newBuilder().build()); - appSpec = ServiceApiUtil.jsonSerDeser.fromJson(response.getStatus()); - } else { - appSpec = new Application(); - appSpec.setName(appName); + public ServiceState convertState(FinalApplicationStatus status) { + switch (status) { + case UNDEFINED: + return ServiceState.ACCEPTED; + case FAILED: + case KILLED: + return ServiceState.FAILED; + case ENDED: + case SUCCEEDED: + return ServiceState.STOPPED; } + return ServiceState.ACCEPTED; + } + + public Service getStatus(String serviceName) + throws IOException, YarnException { + ServiceApiUtil.validateNameFormat(serviceName, getConfig()); + ApplicationId currentAppId = getAppId(serviceName); + ApplicationReport appReport = yarnClient.getApplicationReport(currentAppId); + Service appSpec = new Service(); + appSpec.setName(serviceName); + appSpec.setState(convertState(appReport.getFinalApplicationStatus())); ApplicationTimeout lifetime = appReport.getApplicationTimeouts().get(ApplicationTimeoutType.LIFETIME); if (lifetime != null) { appSpec.setLifetime(lifetime.getRemainingTime()); } + + if (appReport.getYarnApplicationState() != RUNNING) { + LOG.info("Service {} is at {} state", serviceName, + appReport.getYarnApplicationState()); + return appSpec; + } + if (StringUtils.isEmpty(appReport.getHost())) { + LOG.warn(serviceName + " AM hostname is empty"); + return appSpec; + } + ClientAMProtocol amProxy = + createAMProxy(appReport.getHost(), appReport.getRpcPort()); + GetStatusResponseProto response = + amProxy.getStatus(GetStatusRequestProto.newBuilder().build()); + appSpec = jsonSerDeser.fromJson(response.getStatus()); + return appSpec; } @@ -815,58 +867,26 @@ public int actionDependency(ActionDependencyArgs args) } } - // Get AMProxy with the appReport provided - protected ClientAMProtocol getAMProxy(String appName, ApplicationReport report) - throws IOException { - if (!cachedAMProxies.containsKey(appName) && !StringUtils - .isEmpty(report.getHost())) { - insertAMProxy(appName, report.getHost(), report.getRpcPort()); - } - return cachedAMProxies.get(appName); - } - - // Get AMProxy without appReport provided - it'll getAppReport from RM - protected ClientAMProtocol getAMProxy(String appName) - throws IOException, YarnException { - ApplicationId currentAppId = getAppId(appName); - - if (cachedAMProxies.containsKey(appName)) { - return cachedAMProxies.get(appName); - } else { - ApplicationReport appReport = - yarnClient.getApplicationReport(currentAppId); - String host = appReport.getHost(); - int port = appReport.getRpcPort(); - if (!StringUtils.isEmpty(host)) { - return insertAMProxy(appName, host, port); - } - return null; - } - } - - private ClientAMProtocol insertAMProxy(String appName, String host, int port) + protected ClientAMProtocol createAMProxy(String host, int port) throws IOException { InetSocketAddress address = NetUtils.createSocketAddrForHost(host, port); - ClientAMProtocol amProxy = - ClientAMProxy.createProxy(getConfig(), ClientAMProtocol.class, + return ClientAMProxy.createProxy(getConfig(), ClientAMProtocol.class, UserGroupInformation.getCurrentUser(), rpc, address); - cachedAMProxies.put(appName, amProxy); - return amProxy; } - private synchronized ApplicationId getAppId(String appName) + private synchronized ApplicationId getAppId(String serviceName) throws IOException, YarnException { - if (cachedAppIds.containsKey(appName)) { - return cachedAppIds.get(appName); + if (cachedAppIds.containsKey(serviceName)) { + return cachedAppIds.get(serviceName); } - Application persistedApp = ServiceApiUtil.loadApplication(fs, appName); - if (persistedApp == null) { - throw new YarnException("Application " + appName + Service persistedService = ServiceApiUtil.loadService(fs, serviceName); + if (persistedService == null) { + throw new YarnException("Service " + serviceName + " doesn't exist on hdfs. Please check if the app exists in RM"); } - ApplicationId currentAppId = ApplicationId.fromString(persistedApp.getId()); - cachedAppIds.put(appName, currentAppId); + ApplicationId currentAppId = ApplicationId.fromString(persistedService.getId()); + cachedAppIds.put(serviceName, currentAppId); return currentAppId; } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractActionArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractActionArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractActionArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractActionArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractArgsDelegate.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractArgsDelegate.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractArgsDelegate.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractClusterBuildingActionArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractClusterBuildingActionArgs.java similarity index 88% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractClusterBuildingActionArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractClusterBuildingActionArgs.java index 017286f539..3a3a19a301 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractClusterBuildingActionArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/AbstractClusterBuildingActionArgs.java @@ -34,7 +34,7 @@ public abstract class AbstractClusterBuildingActionArgs extends AbstractActionArgs { @Parameter(names = {ARG_APPDEF}, - description = "Template application definition file in JSON format.") + description = "Template service definition file in JSON format.") public File appDef; public File getAppDef() { @@ -42,11 +42,11 @@ public File getAppDef() { } @Parameter(names = { - ARG_QUEUE }, description = "Queue to submit the application") + ARG_QUEUE }, description = "Queue to submit the service") public String queue; @Parameter(names = { - ARG_LIFETIME }, description = "Lifetime of the application from the time of request") + ARG_LIFETIME }, description = "Lifetime of the service from the time of request") public long lifetime; @ParametersDelegate diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionBuildArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionBuildArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionBuildArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionBuildArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionClientArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionClientArgs.java similarity index 97% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionClientArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionClientArgs.java index 0097b4e78b..c43d61a85a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionClientArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionClientArgs.java @@ -40,7 +40,7 @@ public String getActionName() { public boolean install; @Parameter(names = {ARG_NAME}, - description = "The name of the application") + description = "The name of the service") public String name; @Parameter(names = {ARG_PACKAGE}, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionCreateArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionCreateArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionCreateArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionCreateArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDependencyArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDependencyArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDependencyArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDependencyArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDestroyArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDestroyArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDestroyArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionDestroyArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionExistsArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionExistsArgs.java similarity index 87% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionExistsArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionExistsArgs.java index ba3c5a9c2c..088ad47e30 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionExistsArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionExistsArgs.java @@ -36,14 +36,14 @@ public String getActionName() { } @Parameter(names = {ARG_LIVE}, - description = "verify that the application is running") + description = "verify that the service is running") public boolean live; @Parameter(names = {ARG_STATE}, - description = "verify that the application is in the specific YARN state") + description = "verify that the service is in the specific YARN state") public String state = ""; @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT}, - description = "output file for any application report") + description = "output file for any service report") public File out; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFlexArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFlexArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFlexArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFlexArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFreezeArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFreezeArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFreezeArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionFreezeArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionHelpArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionHelpArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionHelpArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionHelpArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKDiagArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKDiagArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKDiagArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKDiagArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKeytabArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKeytabArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKeytabArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionKeytabArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionListArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionListArgs.java similarity index 94% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionListArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionListArgs.java index 005c172291..c05e602398 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionListArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionListArgs.java @@ -36,7 +36,7 @@ public String getActionName() { } @Parameter(names = {ARG_LIVE}, - description = "List only live application instances") + description = "List only live service instances") public boolean live; @Parameter(names = {ARG_STATE}, @@ -48,7 +48,7 @@ public String getActionName() { public boolean verbose = false; @Parameter(names = {ARG_CONTAINERS}, - description = "List containers of an application instance") + description = "List containers of a service instance") public boolean containers; @Parameter(names = {ARG_VERSION}, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionRegistryArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionRegistryArgs.java similarity index 98% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionRegistryArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionRegistryArgs.java index c2866cf3a2..3e53418093 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionRegistryArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionRegistryArgs.java @@ -136,7 +136,7 @@ public int getMinParams() { public boolean internal; @Parameter(names = {ARG_USER}, - description = "the name of the user whose application is being resolved") + description = "the name of the user whose service is being resolved") public String user; /** diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResolveArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionResourceArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java similarity index 95% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java index 622e77d6c8..31f25efcb8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionStatusArgs.java @@ -38,7 +38,7 @@ public String getActionName() { public String output; @Parameter(names = {ARG_LIFETIME}, - description = "Lifetime of the application from the time of request") + description = "Lifetime of the service from the time of request") public boolean lifetime; public String getOutput() { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java index 2b90479518..175e367d2e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionThawArgs.java @@ -45,7 +45,7 @@ public int getWaittime() { LaunchArgsDelegate launchArgs = new LaunchArgsDelegate(); @Parameter(names = {ARG_LIFETIME}, - description = "Life time of the application since application started at" + description = "Life time of the service since service started at" + " running state") public long lifetime; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionTokensArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ActionUpdateArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ArgOps.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/Arguments.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ClientArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java similarity index 99% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java index d44412aac8..e1197ea8c7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/CommonArgs.java @@ -124,7 +124,7 @@ public static String usage(CommonArgs serviceArgs, String commandOfInterest) { result = helperMessage.toString(); } else { helperMessage.append("\nUsage: service ").append(commandOfInterest); - helperMessage.append(serviceArgs.coreAction.getMinParams() > 0 ? " " : ""); + helperMessage.append(serviceArgs.coreAction.getMinParams() > 0 ? " " : ""); helperMessage.append("\n"); for (ParameterDescription paramDesc : serviceArgs.commander.getCommands() .get(commandOfInterest).getParameters()) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/ComponentArgsDelegate.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/DontSplitArguments.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsAccessor.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java index 157fb61267..d42510caee 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/LaunchArgsDelegate.java @@ -41,7 +41,7 @@ public String getRmAddress() { } @Parameter(names = {ARG_OUTPUT, ARG_OUTPUT_SHORT}, - description = "output file for any application report") + description = "output file for any service report") public File outputFile; @Override diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/OptionArgsDelegate.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/PathArgumentConverter.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMArgs.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMArgs.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMArgs.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMArgs.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderAMCreateAction.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java similarity index 94% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java index fc3c5a1fb8..1b2a92ddcd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/SliderActions.java @@ -60,7 +60,7 @@ public interface SliderActions { String DESCRIBE_ACTION_DESTROY = "Destroy a stopped service, service must be stopped first before destroying."; String DESCRIBE_ACTION_EXISTS = - "Probe for an application running"; + "Probe for a service running"; String DESCRIBE_ACTION_FLEX = "Flex a service's component by increasing or decreasing the number of containers."; String DESCRIBE_ACTION_FREEZE = "Stop a running service"; @@ -74,7 +74,7 @@ public interface SliderActions { "Get the status of a service"; String DESCRIBE_ACTION_THAW = "Start a service with pre-built specification or a previously stopped service"; - String DESCRIBE_ACTION_CLIENT = "Install the application client in the specified directory or obtain a client keystore or truststore"; + String DESCRIBE_ACTION_CLIENT = "Install the service client in the specified directory or obtain a client keystore or truststore"; String DESCRIBE_ACTION_KEYTAB = "Manage a Kerberos keytab file (install, delete, list) in the sub-folder 'keytabs' of the user's Slider base directory"; String DESCRIBE_ACTION_RESOURCE = "Manage a file (install, delete, list) in the 'resources' sub-folder of the user's Slider base directory"; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitArgsDelegate.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/params/WaitTimeAccessor.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java similarity index 95% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java index 331871a63b..cb7131e6f9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java @@ -26,13 +26,13 @@ import org.apache.hadoop.yarn.client.api.async.AMRMClientAsync; import org.apache.hadoop.yarn.event.AsyncDispatcher; import org.apache.hadoop.yarn.event.EventHandler; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstanceId; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstanceId; import org.apache.hadoop.yarn.service.ContainerFailureTracker; import org.apache.hadoop.yarn.service.ServiceContext; import org.apache.hadoop.yarn.service.ServiceScheduler; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEvent; -import org.apache.hadoop.yarn.service.metrics.ServiceMetrics; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEvent; +import org.apache.hadoop.yarn.service.ServiceMetrics; import org.apache.hadoop.yarn.state.InvalidStateTransitionException; import org.apache.hadoop.yarn.state.MultipleArcTransition; import org.apache.hadoop.yarn.state.SingleArcTransition; @@ -40,8 +40,8 @@ import org.apache.hadoop.yarn.state.StateMachineFactory; import org.apache.hadoop.yarn.util.Apps; import org.apache.hadoop.yarn.service.utils.SliderUtils; -import org.apache.hadoop.yarn.service.servicemonitor.probe.MonitorUtils; -import org.apache.hadoop.yarn.service.servicemonitor.probe.Probe; +import org.apache.hadoop.yarn.service.monitor.probe.MonitorUtils; +import org.apache.hadoop.yarn.service.monitor.probe.Probe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,13 +53,14 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.ReentrantReadWriteLock; import static org.apache.hadoop.yarn.api.records.ContainerExitStatus.*; import static org.apache.hadoop.yarn.service.component.ComponentEventType.*; -import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEventType.STARTED; -import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEventType.STOP; +import static org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEventType.START; +import static org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEventType.STOP; import static org.apache.hadoop.yarn.service.component.ComponentState.*; import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.CONTAINER_FAILURE_THRESHOLD; @@ -85,7 +86,7 @@ public class Component implements EventHandler { public int maxContainerFailurePerComp; // The number of containers failed since last reset. This excludes preempted, // disk_failed containers etc. This will be reset to 0 periodically. - public volatile int currentContainerFailure; + public AtomicInteger currentContainerFailure = new AtomicInteger(0); private StateMachine stateMachine; @@ -239,7 +240,7 @@ private static class ContainerStartedTransition implements ComponentEvent event) { component.compInstanceDispatcher.getEventHandler().handle( new ComponentInstanceEvent(event.getInstance().getContainerId(), - STARTED)); + START)); component.incRunningContainers(); return checkIfStable(component); } @@ -356,7 +357,7 @@ private void updateMetrics(ContainerStatus status) { String host = scheduler.getLiveInstances().get(status.getContainerId()) .getNodeId().getHost(); failureTracker.incNodeFailure(host); - currentContainerFailure++ ; + currentContainerFailure.getAndIncrement() ; } } @@ -425,8 +426,8 @@ public org.apache.hadoop.yarn.service.api.records.Component getComponentSpec() { public void resetCompFailureCount() { LOG.info("[COMPONENT {}]: Reset container failure count from {} to 0.", - getName(), currentContainerFailure); - currentContainerFailure = 0; + getName(), currentContainerFailure.get()); + currentContainerFailure.set(0); failureTracker.resetContainerFailures(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEvent.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEvent.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEvent.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEvent.java index ed892dd607..d93dcf153a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEvent.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEvent.java @@ -21,7 +21,7 @@ import org.apache.hadoop.yarn.api.records.Container; import org.apache.hadoop.yarn.api.records.ContainerStatus; import org.apache.hadoop.yarn.event.AbstractEvent; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; public class ComponentEvent extends AbstractEvent { private long desired; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEventType.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEventType.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEventType.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentEventType.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentState.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentState.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentState.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/ComponentState.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstance.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstance.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstance.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstance.java index 982a114da7..7d6525b567 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstance.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstance.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.compinstance; +package org.apache.hadoop.yarn.service.component.instance; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -45,7 +45,7 @@ import org.apache.hadoop.yarn.util.BoundedAppender; import org.apache.hadoop.yarn.service.utils.SliderUtils; import org.apache.hadoop.yarn.service.timelineservice.ServiceTimelinePublisher; -import org.apache.hadoop.yarn.service.servicemonitor.probe.ProbeStatus; +import org.apache.hadoop.yarn.service.monitor.probe.ProbeStatus; import org.apache.hadoop.yarn.service.registry.YarnRegistryViewForProviders; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,8 +61,8 @@ import static org.apache.hadoop.yarn.api.records.ContainerExitStatus.KILLED_BY_APPMASTER; import static org.apache.hadoop.yarn.api.records.ContainerState.COMPLETE; -import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEventType.*; -import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceState.*; +import static org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEventType.*; +import static org.apache.hadoop.yarn.service.component.instance.ComponentInstanceState.*; public class ComponentInstance implements EventHandler, Comparable { @@ -95,17 +95,17 @@ public class ComponentInstance implements EventHandler, stateMachineFactory = new StateMachineFactory(INIT) - .addTransition(INIT, RUNNING_BUT_UNREADY, STARTED, + .addTransition(INIT, STARTED, START, new ContainerStartedTransition()) //From Running - .addTransition(RUNNING_BUT_UNREADY, INIT, STOP, + .addTransition(STARTED, INIT, STOP, new ContainerStoppedTransition()) - .addTransition(RUNNING_BUT_UNREADY, READY, BECOME_READY, + .addTransition(STARTED, READY, BECOME_READY, new ContainerBecomeReadyTransition()) // FROM READY - .addTransition(READY, RUNNING_BUT_UNREADY, BECOME_NOT_READY, + .addTransition(READY, STARTED, BECOME_NOT_READY, new ContainerBecomeNotReadyTransition()) .addTransition(READY, INIT, STOP, new ContainerStoppedTransition()) .installTopology(); @@ -201,11 +201,11 @@ public void transition(ComponentInstance compInstance, boolean shouldExit = false; // check if it exceeds the failure threshold - if (comp.currentContainerFailure > comp.maxContainerFailurePerComp) { + if (comp.currentContainerFailure.get() > comp.maxContainerFailurePerComp) { String exitDiag = MessageFormat.format( "[COMPONENT {0}]: Failed {1} times, exceeded the limit - {2}. Shutting down now... " + System.lineSeparator(), - comp.getName(), comp.currentContainerFailure, comp.maxContainerFailurePerComp); + comp.getName(), comp.currentContainerFailure.get(), comp.maxContainerFailurePerComp); compInstance.diagnostics.append(exitDiag); // append to global diagnostics that will be reported to RM. comp.getScheduler().getDiagnostics().append(containerDiag); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceEvent.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceEvent.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceEvent.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceEvent.java index 14a9e09fd3..707b034965 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceEvent.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceEvent.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.compinstance; +package org.apache.hadoop.yarn.service.component.instance; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.ContainerStatus; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceEventType.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceEventType.java similarity index 92% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceEventType.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceEventType.java index b3fe1e641a..1a880ba442 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceEventType.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceEventType.java @@ -16,11 +16,10 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.compinstance; +package org.apache.hadoop.yarn.service.component.instance; public enum ComponentInstanceEventType { - - STARTED, + START, STOP, BECOME_READY, BECOME_NOT_READY diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceId.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceId.java similarity index 97% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceId.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceId.java index c3c55d9066..14387ba083 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceId.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceId.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.compinstance; +package org.apache.hadoop.yarn.service.component.instance; import org.apache.hadoop.yarn.api.records.ContainerId; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceState.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceState.java similarity index 92% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceState.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceState.java index f2d8cea74e..f5de5cb301 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/compinstance/ComponentInstanceState.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/instance/ComponentInstanceState.java @@ -16,11 +16,11 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.compinstance; +package org.apache.hadoop.yarn.service.component.instance; public enum ComponentInstanceState { INIT, - RUNNING_BUT_UNREADY, + STARTED, READY, UPGRADING } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java similarity index 83% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java index cbbb2062c2..6de2dc0591 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/RestApiConstants.java @@ -20,14 +20,14 @@ public interface RestApiConstants { // Rest endpoints - String CONTEXT_ROOT = "/services/v1"; - String VERSION = "/version"; - String APP_ROOT_PATH = "/applications"; - String APP_PATH = "/applications/{app_name}"; - String COMPONENT_PATH = "/applications/{app_name}/components/{component_name}"; + String CONTEXT_ROOT = "/ws/v1"; + String VERSION = "/services/version"; + String SERVICE_ROOT_PATH = "/services"; + String SERVICE_PATH = "/services/{service_name}"; + String COMPONENT_PATH = "/services/{service_name}/components/{component_name}"; // Query param - String APP_NAME = "app_name"; + String SERVICE_NAME = "service_name"; String COMPONENT_NAME = "component_name"; String DEFAULT_COMPONENT_NAME = "default"; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java similarity index 89% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java index bdef60094b..ee270cb90d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/SliderExitCodes.java @@ -48,12 +48,12 @@ public interface SliderExitCodes extends LauncherExitCodes { int EXIT_YARN_SERVICE_FINISHED_WITH_ERROR = 68; /** - * the application instance is unknown: {@value} + * the service instance is unknown: {@value} */ int EXIT_UNKNOWN_INSTANCE = 69; /** - * the application instance is in the wrong state for that operation: {@value} + * the service instance is in the wrong state for that operation: {@value} */ int EXIT_BAD_STATE = 70; @@ -69,13 +69,13 @@ public interface SliderExitCodes extends LauncherExitCodes { int EXIT_DEPLOYMENT_FAILED = 72; /** - * The application is live -and the requested operation + * The service is live -and the requested operation * does not work if the cluster is running */ int EXIT_APPLICATION_IN_USE = 73; /** - * There already is an application instance of that name + * There already is an service instance of that name * when an attempt is made to create a new instance */ int EXIT_INSTANCE_EXISTS = 75; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java similarity index 95% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java index 33fc671017..1968e95153 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConf.java @@ -36,6 +36,10 @@ public class YarnServiceConf { public static final String YARN_QUEUE = "yarn.service.queue"; + public static final String API_SERVER_ADDRESS = "yarn.service.api-server.address"; + public static final String DEFAULT_API_SERVER_ADDRESS = "0.0.0.0:"; + public static final int DEFAULT_API_SERVER_PORT = 9191; + /** * The yarn service base path: * Defaults to HomeDir/.yarn/ diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java similarity index 98% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java index cbcba82d37..e5ed703001 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/conf/YarnServiceConstants.java @@ -35,7 +35,7 @@ public interface YarnServiceConstants { String DEPENDENCY_DIR_PERMISSIONS = "755"; /** - * Application type for YARN service + * Service type for YARN service */ String APP_TYPE = "yarn-service"; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/AbstractLauncher.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/AbstractLauncher.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/AbstractLauncher.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/AbstractLauncher.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ClasspathConstructor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ClasspathConstructor.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ClasspathConstructor.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ClasspathConstructor.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CommandLineBuilder.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CommandLineBuilder.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CommandLineBuilder.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CommandLineBuilder.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ContainerLaunchService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ContainerLaunchService.java similarity index 87% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ContainerLaunchService.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ContainerLaunchService.java index fcbb69b0e6..0e51a6228c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ContainerLaunchService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/ContainerLaunchService.java @@ -22,10 +22,10 @@ import org.apache.hadoop.service.AbstractService; import org.apache.hadoop.yarn.api.records.Container; import org.apache.hadoop.yarn.service.api.records.Component; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.provider.ProviderService; import org.apache.hadoop.yarn.service.provider.ProviderFactory; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,23 +60,23 @@ protected void serviceStop() throws Exception { super.serviceStop(); } - public void launchCompInstance(Application application, + public void launchCompInstance(Service service, ComponentInstance instance, Container container) { ContainerLauncher launcher = - new ContainerLauncher(application, instance, container); + new ContainerLauncher(service, instance, container); executorService.execute(launcher); } private class ContainerLauncher implements Runnable { public final Container container; - public final Application application; + public final Service service; public ComponentInstance instance; public ContainerLauncher( - Application application, + Service service, ComponentInstance instance, Container container) { this.container = container; - this.application = application; + this.service = service; this.instance = instance; } @@ -86,7 +86,7 @@ public ContainerLauncher( compSpec.getArtifact()); AbstractLauncher launcher = new AbstractLauncher(fs, null); try { - provider.buildContainerLaunchContext(launcher, application, + provider.buildContainerLaunchContext(launcher, service, instance, fs, getConfig()); instance.getComponent().getScheduler().getNmClient() .startContainerAsync(container, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CredentialUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CredentialUtils.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CredentialUtils.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/CredentialUtils.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/JavaCommandLineBuilder.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/JavaCommandLineBuilder.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/JavaCommandLineBuilder.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/containerlaunch/JavaCommandLineBuilder.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadClusterStateException.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadClusterStateException.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadClusterStateException.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadClusterStateException.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadCommandArgumentsException.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadCommandArgumentsException.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadCommandArgumentsException.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadCommandArgumentsException.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadConfigException.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadConfigException.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadConfigException.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/BadConfigException.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ErrorStrings.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ErrorStrings.java similarity index 53% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ErrorStrings.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ErrorStrings.java index 3577b593ad..83658c89ea 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ErrorStrings.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ErrorStrings.java @@ -19,18 +19,10 @@ package org.apache.hadoop.yarn.service.exceptions; public interface ErrorStrings { - String E_UNSTABLE_CLUSTER = "Unstable Application Instance :"; - String E_CLUSTER_RUNNING = "Application Instance running"; - String E_ALREADY_EXISTS = "already exists"; - String PRINTF_E_INSTANCE_ALREADY_EXISTS = "Application Instance \"%s\" already exists and is defined in %s"; - String PRINTF_E_INSTANCE_DIR_ALREADY_EXISTS = "Application Instance dir already exists: %s"; - String E_MISSING_PATH = "Missing path "; - String E_INCOMPLETE_CLUSTER_SPEC = - "Cluster specification is marked as incomplete: "; - String E_UNKNOWN_INSTANCE = "Unknown application instance "; - String E_DESTROY_CREATE_RACE_CONDITION = - "created while it was being destroyed"; - String E_UNKNOWN_ROLE = "Unknown role "; + + String PRINTF_E_INSTANCE_ALREADY_EXISTS = "Service Instance \"%s\" already exists and is defined in %s"; + String PRINTF_E_INSTANCE_DIR_ALREADY_EXISTS = "Service Instance dir already exists: %s"; + /** * ERROR Strings */ @@ -46,12 +38,5 @@ public interface ErrorStrings { String ERROR_TOO_MANY_ARGUMENTS = "Too many arguments"; String ERROR_DUPLICATE_ENTRY = "Duplicate entry for "; - String E_APPLICATION_NOT_RUNNING = "Application not running"; - String E_FINISHED_APPLICATION = E_APPLICATION_NOT_RUNNING + ": %s state=%s "; - String E_NO_IMAGE_OR_HOME_DIR_SPECIFIED = - "Neither an image path nor binary home directory were specified"; - String E_BOTH_IMAGE_AND_HOME_DIR_SPECIFIED = - "Both application image path and home dir have been provided"; - String E_CONFIGURATION_DIRECTORY_NOT_FOUND = - "Configuration directory \"%s\" not found"; + } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ExitCodeProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ExitCodeProvider.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ExitCodeProvider.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ExitCodeProvider.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/LauncherExitCodes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/LauncherExitCodes.java similarity index 95% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/LauncherExitCodes.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/LauncherExitCodes.java index 9657536d98..483fb48d46 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/LauncherExitCodes.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/LauncherExitCodes.java @@ -21,7 +21,7 @@ /* * Common Exit codes *

- * Exit codes from 64 up are application specific. + * Exit codes from 64 up are service specific. *

* Many of the exit codes are designed to resemble HTTP error codes, * squashed into a single byte. e.g 44 , "not found" is the equivalent @@ -29,10 +29,10 @@ *

  *    0-10: general command issues
  *   30-39: equivalent to the 3XX responses, where those responses are
- *          considered errors by the application.
+ *          considered errors by the service.
  *   40-49: request-related errors
  *   50-59: server-side problems. These may be triggered by the request.
- *   64-  : application specific error codes
+ *   64-  : service specific error codes
  * 
*/ public interface LauncherExitCodes { @@ -178,7 +178,7 @@ public interface LauncherExitCodes { int EXIT_SERVICE_UNAVAILABLE = 53; /** - * The application does not support, or refuses to support this version: {@value}. + * The service does not support, or refuses to support this version: {@value}. * If raised, this is expected to be raised server-side and likely due * to client/server version incompatibilities. *

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/RestApiErrorMessages.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/RestApiErrorMessages.java similarity index 84% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/RestApiErrorMessages.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/RestApiErrorMessages.java index 7be23f350d..ef22b57805 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/RestApiErrorMessages.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/RestApiErrorMessages.java @@ -19,21 +19,21 @@ public interface RestApiErrorMessages { String ERROR_APPLICATION_NAME_INVALID = - "Application name is either empty or not provided"; + "Service name is either empty or not provided"; String ERROR_APPLICATION_NAME_INVALID_FORMAT = - "Application name %s is not valid - only lower case letters, digits, " + - "underscore and hyphen are allowed, and the name must be no more " + + "Service name %s is not valid - only lower case letters, digits, " + + "and hyphen are allowed, and the name must be no more " + "than 63 characters"; String ERROR_COMPONENT_NAME_INVALID = "Component name must be no more than %s characters: %s"; String ERROR_USER_NAME_INVALID = "User name must be no more than 63 characters"; - String ERROR_APPLICATION_NOT_RUNNING = "Application not running"; - String ERROR_APPLICATION_DOES_NOT_EXIST = "Application not found"; - String ERROR_APPLICATION_IN_USE = "Application already exists in started" + String ERROR_APPLICATION_NOT_RUNNING = "Service not running"; + String ERROR_APPLICATION_DOES_NOT_EXIST = "Service not found"; + String ERROR_APPLICATION_IN_USE = "Service already exists in started" + " state"; - String ERROR_APPLICATION_INSTANCE_EXISTS = "Application already exists in" + String ERROR_APPLICATION_INSTANCE_EXISTS = "Service already exists in" + " stopped/failed state (either restart with PUT or destroy with DELETE" + " before creating a new one)"; @@ -51,9 +51,9 @@ public interface RestApiErrorMessages { String ERROR_RESOURCE_FOR_COMP_INVALID = ERROR_RESOURCE_INVALID + ERROR_SUFFIX_FOR_COMPONENT; String ERROR_RESOURCE_MEMORY_INVALID = - "Application resource or memory not provided"; + "Service resource or memory not provided"; String ERROR_RESOURCE_CPUS_INVALID = - "Application resource or cpus not provided"; + "Service resource or cpus not provided"; String ERROR_RESOURCE_CPUS_INVALID_RANGE = "Unacceptable no of cpus specified, either zero or negative"; String ERROR_RESOURCE_MEMORY_FOR_COMP_INVALID = @@ -88,5 +88,5 @@ public interface RestApiErrorMessages { "Launch_command is required when type is not DOCKER"; String ERROR_QUICKLINKS_FOR_COMP_INVALID = "Quicklinks specified at" - + " component level, needs corresponding values set at application level"; + + " component level, needs corresponding values set at service level"; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ServiceLaunchException.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ServiceLaunchException.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ServiceLaunchException.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/ServiceLaunchException.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/SliderException.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/SliderException.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/SliderException.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/SliderException.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/UsageException.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/UsageException.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/UsageException.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/exceptions/UsageException.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/client/ClientAMProtocolPBClientImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/client/ClientAMProtocolPBClientImpl.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/client/ClientAMProtocolPBClientImpl.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/client/ClientAMProtocolPBClientImpl.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPB.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPB.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPB.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPB.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPBServiceImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPBServiceImpl.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPBServiceImpl.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/impl/pb/service/ClientAMProtocolPBServiceImpl.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/ServiceMonitor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/ServiceMonitor.java similarity index 84% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/ServiceMonitor.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/ServiceMonitor.java index 98a76ea770..982448ad71 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/ServiceMonitor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/ServiceMonitor.java @@ -16,20 +16,19 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.servicemonitor; +package org.apache.hadoop.yarn.service.monitor; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.service.AbstractService; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.service.ServiceContext; import org.apache.hadoop.yarn.service.component.Component; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.conf.YarnServiceConf; import org.apache.hadoop.yarn.service.component.ComponentEvent; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEvent; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEvent; import org.apache.hadoop.yarn.service.component.ComponentState; -import org.apache.hadoop.yarn.service.servicemonitor.probe.ProbeStatus; -import org.apache.hadoop.yarn.service.utils.SliderUtils; +import org.apache.hadoop.yarn.service.monitor.probe.ProbeStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,11 +37,11 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceState.RUNNING_BUT_UNREADY; +import static org.apache.hadoop.yarn.service.component.instance.ComponentInstanceState.STARTED; import static org.apache.hadoop.yarn.service.component.ComponentEventType.FLEX; -import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEventType.BECOME_NOT_READY; -import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceEventType.BECOME_READY; -import static org.apache.hadoop.yarn.service.compinstance.ComponentInstanceState.READY; +import static org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEventType.BECOME_NOT_READY; +import static org.apache.hadoop.yarn.service.component.instance.ComponentInstanceEventType.BECOME_READY; +import static org.apache.hadoop.yarn.service.component.instance.ComponentInstanceState.READY; import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.CONTAINER_FAILURE_WINDOW; import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.DEFAULT_READINESS_CHECK_INTERVAL; import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.READINESS_CHECK_INTERVAL; @@ -74,7 +73,7 @@ public void serviceInit(Configuration conf) throws Exception { public void serviceStart() throws Exception { long readinessCheckInterval = YarnServiceConf .getLong(READINESS_CHECK_INTERVAL, DEFAULT_READINESS_CHECK_INTERVAL, - context.application.getConfiguration(), conf); + context.service.getConfiguration(), conf); executorService .scheduleAtFixedRate(new ReadinessChecker(), readinessCheckInterval, @@ -83,7 +82,7 @@ public void serviceStart() throws Exception { // Default 6 hours. long failureResetInterval = YarnServiceConf .getLong(CONTAINER_FAILURE_WINDOW, 21600, - context.application.getConfiguration(), conf); + context.service.getConfiguration(), conf); executorService .scheduleAtFixedRate(new ContainerFailureReset(), failureResetInterval, @@ -109,7 +108,7 @@ public void run() { ProbeStatus status = instance.ping(); if (status.isSuccess()) { - if (instance.getState() == RUNNING_BUT_UNREADY) { + if (instance.getState() == STARTED) { // synchronously update the state. instance.handle( new ComponentInstanceEvent(entry.getKey(), BECOME_READY)); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/HttpProbe.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/HttpProbe.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/HttpProbe.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/HttpProbe.java index 10c116021c..19230867cc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/HttpProbe.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/HttpProbe.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.servicemonitor.probe; +package org.apache.hadoop.yarn.service.monitor.probe; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.api.records.ContainerStatus; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.utils.SliderUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/LogEntryBuilder.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/LogEntryBuilder.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/LogEntryBuilder.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/LogEntryBuilder.java index b575d69334..9ad86fe61b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/LogEntryBuilder.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/LogEntryBuilder.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.servicemonitor.probe; +package org.apache.hadoop.yarn.service.monitor.probe; /** * Build up log entries for ease of splunk diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/MonitorKeys.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/MonitorKeys.java similarity index 97% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/MonitorKeys.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/MonitorKeys.java index f5f3d99788..55b55f68ee 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/MonitorKeys.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/MonitorKeys.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.servicemonitor.probe; +package org.apache.hadoop.yarn.service.monitor.probe; /** * Config keys for monitoring diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/MonitorUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/MonitorUtils.java similarity index 97% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/MonitorUtils.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/MonitorUtils.java index 46d1fdb886..684f655cf2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/MonitorUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/MonitorUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.servicemonitor.probe; +package org.apache.hadoop.yarn.service.monitor.probe; import org.apache.hadoop.yarn.service.api.records.ReadinessCheck; import org.slf4j.Logger; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/PortProbe.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/PortProbe.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/PortProbe.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/PortProbe.java index f6cf3aebe3..aba585952f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/PortProbe.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/PortProbe.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.servicemonitor.probe; +package org.apache.hadoop.yarn.service.monitor.probe; import org.apache.hadoop.io.IOUtils; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.utils.SliderUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/Probe.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/Probe.java similarity index 95% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/Probe.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/Probe.java index b851fb7275..3237a2bd49 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/Probe.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/Probe.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.servicemonitor.probe; +package org.apache.hadoop.yarn.service.monitor.probe; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import java.io.IOException; import java.util.Map; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/ProbeStatus.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/ProbeStatus.java similarity index 98% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/ProbeStatus.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/ProbeStatus.java index 7cd761cee9..bc62dcd0c1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/servicemonitor/probe/ProbeStatus.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/ProbeStatus.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.hadoop.yarn.service.servicemonitor.probe; +package org.apache.hadoop.yarn.service.monitor.probe; import java.io.Serializable; import java.util.Date; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractClientProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractClientProvider.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractClientProvider.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractClientProvider.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractProviderService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractProviderService.java similarity index 91% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractProviderService.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractProviderService.java index 504680de10..8d607abf62 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractProviderService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/AbstractProviderService.java @@ -19,8 +19,8 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.api.ApplicationConstants; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.conf.YarnServiceConf; -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.YarnServiceConstants; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; @@ -28,7 +28,7 @@ import org.apache.hadoop.yarn.service.exceptions.SliderException; import org.apache.hadoop.yarn.service.containerlaunch.AbstractLauncher; import org.apache.hadoop.yarn.service.containerlaunch.CommandLineBuilder; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.ServiceContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,15 +49,15 @@ public abstract class AbstractProviderService implements ProviderService, public abstract void processArtifact(AbstractLauncher launcher, ComponentInstance compInstance, SliderFileSystem fileSystem, - Application application) + Service service) throws IOException; public void buildContainerLaunchContext(AbstractLauncher launcher, - Application application, ComponentInstance instance, + Service service, ComponentInstance instance, SliderFileSystem fileSystem, Configuration yarnConf) throws IOException, SliderException { Component component = instance.getComponent().getComponentSpec();; - processArtifact(launcher, instance, fileSystem, application); + processArtifact(launcher, instance, fileSystem, service); ServiceContext context = instance.getComponent().getScheduler().getContext(); @@ -101,9 +101,9 @@ public void buildContainerLaunchContext(AbstractLauncher launcher, // By default retry forever every 30 seconds launcher.setRetryContext(YarnServiceConf - .getInt(CONTAINER_RETRY_MAX, -1, application.getConfiguration(), + .getInt(CONTAINER_RETRY_MAX, -1, service.getConfiguration(), yarnConf), YarnServiceConf - .getInt(CONTAINER_RETRY_INTERVAL, 30000, application.getConfiguration(), + .getInt(CONTAINER_RETRY_INTERVAL, 30000, service.getConfiguration(), yarnConf)); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderFactory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderFactory.java similarity index 86% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderFactory.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderFactory.java index 83c9961219..0f949e0bac 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderFactory.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderFactory.java @@ -40,20 +40,20 @@ protected ProviderFactory() {} public static synchronized ProviderService getProviderService(Artifact artifact) { - return createSliderProviderFactory(artifact).createServerProvider(); + return createServiceProviderFactory(artifact).createServerProvider(); } public static synchronized AbstractClientProvider getClientProvider(Artifact artifact) { - return createSliderProviderFactory(artifact).createClientProvider(); + return createServiceProviderFactory(artifact).createClientProvider(); } /** - * Create a provider for a specific application + * Create a provider for a specific service * @param artifact artifact * @return provider factory */ - public static synchronized ProviderFactory createSliderProviderFactory( + public static synchronized ProviderFactory createServiceProviderFactory( Artifact artifact) { if (artifact == null || artifact.getType() == null) { LOG.debug("Loading service provider type default"); @@ -62,14 +62,14 @@ public static synchronized ProviderFactory createSliderProviderFactory( LOG.debug("Loading service provider type {}", artifact.getType()); switch (artifact.getType()) { // TODO add handling for custom types? - // TODO handle application + // TODO handle service case DOCKER: return DockerProviderFactory.getInstance(); case TARBALL: return TarballProviderFactory.getInstance(); default: throw new IllegalArgumentException(String.format("Resolution error, " + - "%s should not be passed to createSliderProviderFactory", + "%s should not be passed to createServiceProviderFactory", artifact.getType())); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderService.java similarity index 88% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderService.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderService.java index 9ef01765cc..eb721b4a4f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderService.java @@ -19,11 +19,11 @@ package org.apache.hadoop.yarn.service.provider; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; import org.apache.hadoop.yarn.service.exceptions.SliderException; import org.apache.hadoop.yarn.service.containerlaunch.AbstractLauncher; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import java.io.IOException; @@ -33,7 +33,7 @@ public interface ProviderService { * Set up the entire container launch context */ void buildContainerLaunchContext(AbstractLauncher containerLauncher, - Application application, ComponentInstance instance, + Service service, ComponentInstance instance, SliderFileSystem sliderFileSystem, Configuration yarnConf) throws IOException, SliderException; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java index a04483813f..ec0c2ca00d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/ProviderUtils.java @@ -27,12 +27,12 @@ import org.apache.hadoop.yarn.api.records.LocalResource; import org.apache.hadoop.yarn.api.records.LocalResourceType; import org.apache.hadoop.yarn.service.ServiceContext; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.api.records.Component; import org.apache.hadoop.yarn.service.api.records.ConfigFile; import org.apache.hadoop.yarn.service.api.records.ConfigFormat; import org.apache.hadoop.yarn.service.api.records.Configuration; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.conf.YarnServiceConstants; import org.apache.hadoop.yarn.service.conf.YarnServiceConf; import org.apache.hadoop.yarn.service.containerlaunch.AbstractLauncher; @@ -54,7 +54,7 @@ import java.util.concurrent.ExecutionException; import java.util.regex.Pattern; -import static org.apache.hadoop.yarn.service.api.constants.ServiceApiConstants.*; +import static org.apache.hadoop.yarn.service.api.ServiceApiConstants.*; /** * This is a factoring out of methods handy for providers. It's bonded to a log @@ -163,15 +163,15 @@ public static void substituteMapWithTokens(Map configs, } /** - * Localize the service keytabs for the application. + * Localize the service keytabs for the service. * @param launcher container launcher * @param fileSystem file system * @throws IOException trouble uploading to HDFS */ public void localizeServiceKeytabs(AbstractLauncher launcher, - SliderFileSystem fileSystem, Application application) throws IOException { + SliderFileSystem fileSystem, Service service) throws IOException { - Configuration conf = application.getConfiguration(); + Configuration conf = service.getConfiguration(); String keytabPathOnHost = conf.getProperty(YarnServiceConf.KEY_AM_KEYTAB_LOCAL_PATH); if (SliderUtils.isUnset(keytabPathOnHost)) { @@ -181,7 +181,7 @@ public void localizeServiceKeytabs(AbstractLauncher launcher, conf.getProperty(YarnServiceConf.KEY_HDFS_KEYTAB_DIR); // we need to localize the keytab files in the directory Path keytabDirPath = fileSystem.buildKeytabPath(keytabDir, null, - application.getName()); + service.getName()); boolean serviceKeytabsDeployed = false; if (fileSystem.getFileSystem().exists(keytabDirPath)) { FileStatus[] keytabs = fileSystem.getFileSystem().listStatus( @@ -201,8 +201,8 @@ public void localizeServiceKeytabs(AbstractLauncher launcher, } } if (!serviceKeytabsDeployed) { - log.warn("No service keytabs for the application have been localized. " - + "If the application requires keytabs for secure operation, " + log.warn("No service keytabs for the service have been localized. " + + "If the service requires keytabs for secure operation, " + "please ensure that the required keytabs have been uploaded " + "to the folder {}", keytabDirPath); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultClientProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultClientProvider.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultClientProvider.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultClientProvider.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderFactory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderFactory.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderFactory.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderFactory.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderService.java similarity index 89% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderService.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderService.java index 33f8278a5e..a3a0c1f96e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/defaultImpl/DefaultProviderService.java @@ -17,9 +17,9 @@ */ package org.apache.hadoop.yarn.service.provider.defaultImpl; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.api.records.Service; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.provider.AbstractProviderService; -import org.apache.hadoop.yarn.service.api.records.Application; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; import org.apache.hadoop.yarn.service.containerlaunch.AbstractLauncher; @@ -30,7 +30,7 @@ public class DefaultProviderService extends AbstractProviderService { @Override public void processArtifact(AbstractLauncher launcher, ComponentInstance compInstance, SliderFileSystem fileSystem, - Application application) + Service service) throws IOException { } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerClientProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerClientProvider.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerClientProvider.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerClientProvider.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerKeys.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerKeys.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerKeys.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerKeys.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderFactory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderFactory.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderFactory.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderFactory.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderService.java similarity index 87% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderService.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderService.java index 236ddd913e..0741947d4a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/docker/DockerProviderService.java @@ -19,9 +19,9 @@ import org.apache.hadoop.registry.client.api.RegistryConstants; import org.apache.hadoop.registry.client.binding.RegistryUtils; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.provider.AbstractProviderService; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; import org.apache.hadoop.yarn.service.containerlaunch.AbstractLauncher; @@ -33,7 +33,7 @@ public class DockerProviderService extends AbstractProviderService public void processArtifact(AbstractLauncher launcher, ComponentInstance compInstance, SliderFileSystem fileSystem, - Application application) throws IOException{ + Service service) throws IOException{ launcher.setYarnDockerMode(true); launcher.setDockerImage(compInstance.getCompSpec().getArtifact().getId()); launcher.setDockerNetwork(compInstance.getCompSpec().getConfiguration() @@ -44,11 +44,11 @@ public void processArtifact(AbstractLauncher launcher, if (domain == null || domain.isEmpty()) { hostname = MessageFormat .format("{0}.{1}.{2}", compInstance.getCompInstanceName(), - application.getName(), RegistryUtils.currentUser()); + service.getName(), RegistryUtils.currentUser()); } else { hostname = MessageFormat .format("{0}.{1}.{2}.{3}", compInstance.getCompInstanceName(), - application.getName(), RegistryUtils.currentUser(), domain); + service.getName(), RegistryUtils.currentUser(), domain); } launcher.setDockerHostname(hostname); launcher.setRunPrivilegedContainer( diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballClientProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballClientProvider.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballClientProvider.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballClientProvider.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderFactory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderFactory.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderFactory.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderFactory.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderService.java similarity index 92% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderService.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderService.java index 2403255c8f..9f29c8be31 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/provider/tarball/TarballProviderService.java @@ -20,9 +20,9 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.yarn.api.records.LocalResource; import org.apache.hadoop.yarn.api.records.LocalResourceType; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.api.records.Service; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.service.provider.AbstractProviderService; -import org.apache.hadoop.yarn.service.api.records.Application; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; import org.apache.hadoop.yarn.service.containerlaunch.AbstractLauncher; @@ -33,7 +33,7 @@ public class TarballProviderService extends AbstractProviderService { @Override public void processArtifact(AbstractLauncher launcher, ComponentInstance instance, SliderFileSystem fileSystem, - Application application) + Service service) throws IOException { Path artifact = new Path(instance.getCompSpec().getArtifact().getId()); if (!fileSystem.isFile(artifact)) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/registry/CustomRegistryConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/registry/CustomRegistryConstants.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/registry/CustomRegistryConstants.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/registry/CustomRegistryConstants.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/registry/YarnRegistryViewForProviders.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/registry/YarnRegistryViewForProviders.java similarity index 98% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/registry/YarnRegistryViewForProviders.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/registry/YarnRegistryViewForProviders.java index ef5ed910b4..add2475c38 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/registry/YarnRegistryViewForProviders.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/registry/YarnRegistryViewForProviders.java @@ -30,7 +30,7 @@ import org.apache.hadoop.registry.client.binding.RegistryPathUtils; import org.apache.hadoop.registry.client.types.ServiceRecord; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstanceId; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstanceId; import org.apache.hadoop.yarn.service.utils.SliderUtils; import java.io.IOException; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceMetricsSink.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceMetricsSink.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceMetricsSink.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceMetricsSink.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEntityType.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEntityType.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEntityType.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEntityType.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEvent.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEvent.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEvent.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineEvent.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineMetricsConstants.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineMetricsConstants.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineMetricsConstants.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelineMetricsConstants.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelinePublisher.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelinePublisher.java similarity index 93% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelinePublisher.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelinePublisher.java index 243baeaab8..5e65ad9842 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelinePublisher.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelinePublisher.java @@ -27,12 +27,12 @@ import org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric; import org.apache.hadoop.yarn.client.api.TimelineV2Client; import org.apache.hadoop.yarn.service.ServiceContext; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.api.records.Component; import org.apache.hadoop.yarn.service.api.records.ConfigFile; import org.apache.hadoop.yarn.service.api.records.Configuration; import org.apache.hadoop.yarn.service.api.records.Container; -import org.apache.hadoop.yarn.service.compinstance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstance; import org.apache.hadoop.yarn.util.timeline.TimelineUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -84,23 +84,23 @@ public ServiceTimelinePublisher(TimelineV2Client client) { timelineClient = client; } - public void serviceAttemptRegistered(Application application, + public void serviceAttemptRegistered(Service service, org.apache.hadoop.conf.Configuration systemConf) { - long currentTimeMillis = application.getLaunchTime() == null - ? System.currentTimeMillis() : application.getLaunchTime().getTime(); + long currentTimeMillis = service.getLaunchTime() == null + ? System.currentTimeMillis() : service.getLaunchTime().getTime(); - TimelineEntity entity = createServiceAttemptEntity(application.getId()); + TimelineEntity entity = createServiceAttemptEntity(service.getId()); entity.setCreatedTime(currentTimeMillis); // create info keys Map entityInfos = new HashMap(); - entityInfos.put(ServiceTimelineMetricsConstants.NAME, application.getName()); + entityInfos.put(ServiceTimelineMetricsConstants.NAME, service.getName()); entityInfos.put(ServiceTimelineMetricsConstants.STATE, - application.getState().toString()); + service.getState().toString()); entityInfos.put(ServiceTimelineMetricsConstants.LAUNCH_TIME, currentTimeMillis); entity.addInfo(ServiceTimelineMetricsConstants.QUICK_LINKS, - application.getQuicklinks()); + service.getQuicklinks()); entity.addInfo(entityInfos); // add an event @@ -113,20 +113,20 @@ public void serviceAttemptRegistered(Application application, putEntity(entity); // publish system config - YarnConfiguration - populateTimelineEntity(systemConf.iterator(), application.getId(), + populateTimelineEntity(systemConf.iterator(), service.getId(), ServiceTimelineEntityType.SERVICE_ATTEMPT.toString()); // publish user conf - publishUserConf(application.getConfiguration(), application.getId(), + publishUserConf(service.getConfiguration(), service.getId(), ServiceTimelineEntityType.SERVICE_ATTEMPT.toString()); // publish component as separate entity. - publishComponents(application.getComponents()); + publishComponents(service.getComponents()); } - public void serviceAttemptUpdated(Application application) { - TimelineEntity entity = createServiceAttemptEntity(application.getId()); + public void serviceAttemptUpdated(Service service) { + TimelineEntity entity = createServiceAttemptEntity(service.getId()); entity.addInfo(ServiceTimelineMetricsConstants.QUICK_LINKS, - application.getQuicklinks()); + service.getQuicklinks()); putEntity(entity); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/package-info.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/package-info.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/package-info.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/package-info.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ApplicationReportSerDeser.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ApplicationReportSerDeser.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ApplicationReportSerDeser.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ApplicationReportSerDeser.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ClientRegistryBinder.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ClientRegistryBinder.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ClientRegistryBinder.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ClientRegistryBinder.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/Comparators.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/Comparators.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/Comparators.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/Comparators.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigHelper.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigHelper.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigHelper.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigHelper.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigUtils.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigUtils.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ConfigUtils.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/CoreFileSystem.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/CoreFileSystem.java similarity index 99% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/CoreFileSystem.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/CoreFileSystem.java index fa3b402e81..281e1dfe41 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/CoreFileSystem.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/CoreFileSystem.java @@ -368,7 +368,7 @@ public LocalResource createAmResource(Path destPath, LocalResourceType resourceT // Set timestamp and length of file so that the framework // can do basic sanity checks for the local resource // after it has been copied over to ensure it is the same - // resource the client intended to use with the application + // resource the client intended to use with the service amResource.setTimestamp(destStatus.getModificationTime()); amResource.setSize(destStatus.getLen()); return amResource; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/Duration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/Duration.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/Duration.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/Duration.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/JsonSerDeser.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/JsonSerDeser.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/JsonSerDeser.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/JsonSerDeser.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/KerberosDiags.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/KerberosDiags.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/KerberosDiags.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/KerberosDiags.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PatternValidator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PatternValidator.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PatternValidator.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PatternValidator.java index 6efa880f4a..108ca22def 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PatternValidator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PatternValidator.java @@ -26,7 +26,7 @@ public class PatternValidator { public static final String E_INVALID_NAME = - "Invalid name %s does not match the pattern pattern %s "; + "Invalid name %s does not match the pattern %s "; private final Pattern valid; private final String pattern; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PortScanner.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PortScanner.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PortScanner.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PortScanner.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfiguration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfiguration.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfiguration.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfiguration.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfigurationOutputter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfigurationOutputter.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfigurationOutputter.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/PublishedConfigurationOutputter.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/SerializedApplicationReport.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SerializedApplicationReport.java similarity index 97% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/SerializedApplicationReport.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SerializedApplicationReport.java index 405f690e7a..140204af01 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/SerializedApplicationReport.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SerializedApplicationReport.java @@ -28,9 +28,9 @@ import java.io.IOException; /** - * Serialized form of an application report which can be persisted + * Serialized form of an service report which can be persisted * and then parsed. It can not be converted back into a - * real YARN application report + * real YARN service report * * Useful for testing */ diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java similarity index 70% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java index 21cb049efd..de825809a4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java @@ -25,14 +25,14 @@ import org.apache.hadoop.registry.client.api.RegistryConstants; import org.apache.hadoop.registry.client.binding.RegistryUtils; import org.apache.hadoop.yarn.exceptions.YarnException; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; 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.Configuration; import org.apache.hadoop.yarn.service.api.records.Resource; import org.apache.hadoop.yarn.service.provider.AbstractClientProvider; import org.apache.hadoop.yarn.service.provider.ProviderFactory; -import org.apache.hadoop.yarn.service.servicemonitor.probe.MonitorUtils; +import org.apache.hadoop.yarn.service.monitor.probe.MonitorUtils; import org.apache.hadoop.yarn.service.conf.RestApiConstants; import org.apache.hadoop.yarn.service.exceptions.RestApiErrorMessages; import org.codehaus.jackson.map.PropertyNamingStrategy; @@ -51,10 +51,10 @@ public class ServiceApiUtil { private static final Logger LOG = LoggerFactory.getLogger(ServiceApiUtil.class); - public static JsonSerDeser jsonSerDeser = - new JsonSerDeser<>(Application.class, + public static JsonSerDeser jsonSerDeser = + new JsonSerDeser<>(Service.class, PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES); - private static final PatternValidator compNamePattern + private static final PatternValidator namePattern = new PatternValidator("[a-z][a-z0-9-]*"); @VisibleForTesting @@ -63,7 +63,7 @@ public static void setJsonSerDeser(JsonSerDeser jsd) { } @VisibleForTesting - public static void validateAndResolveApplication(Application application, + public static void validateAndResolveService(Service service, SliderFileSystem fs, org.apache.hadoop.conf.Configuration conf) throws IOException { boolean dnsEnabled = conf.getBoolean(RegistryConstants.KEY_DNS_ENABLED, @@ -73,55 +73,50 @@ public static void validateAndResolveApplication(Application application, throw new IllegalArgumentException(RestApiErrorMessages .ERROR_USER_NAME_INVALID); } - if (StringUtils.isEmpty(application.getName())) { + if (StringUtils.isEmpty(service.getName())) { throw new IllegalArgumentException( RestApiErrorMessages.ERROR_APPLICATION_NAME_INVALID); } - if (!SliderUtils.isClusternameValid(application.getName()) || (dnsEnabled - && application.getName().length() > RegistryConstants - .MAX_FQDN_LABEL_LENGTH)) { - throw new IllegalArgumentException(String.format( - RestApiErrorMessages.ERROR_APPLICATION_NAME_INVALID_FORMAT, - application.getName())); - } - // If the application has no components do top-level checks - if (!hasComponent(application)) { - // If artifact is of type APPLICATION, read other application components - if (application.getArtifact() != null && application.getArtifact() - .getType() == Artifact.TypeEnum.APPLICATION) { - if (StringUtils.isEmpty(application.getArtifact().getId())) { + validateNameFormat(service.getName(), conf); + + // If the service has no components do top-level checks + if (!hasComponent(service)) { + // If artifact is of type SERVICE, read other service components + if (service.getArtifact() != null && service.getArtifact() + .getType() == Artifact.TypeEnum.SERVICE) { + if (StringUtils.isEmpty(service.getArtifact().getId())) { throw new IllegalArgumentException( RestApiErrorMessages.ERROR_ARTIFACT_ID_INVALID); } - Application otherApplication = loadApplication(fs, - application.getArtifact().getId()); - application.setComponents(otherApplication.getComponents()); - application.setArtifact(null); - SliderUtils.mergeMapsIgnoreDuplicateKeys(application.getQuicklinks(), - otherApplication.getQuicklinks()); + Service otherService = loadService(fs, + service.getArtifact().getId()); + service.setComponents(otherService.getComponents()); + service.setArtifact(null); + SliderUtils.mergeMapsIgnoreDuplicateKeys(service.getQuicklinks(), + otherService.getQuicklinks()); } else { - // Since it is a simple app with no components, create a default + // Since it is a simple service with no components, create a default // component - Component comp = createDefaultComponent(application); - validateComponent(comp, fs.getFileSystem()); - application.getComponents().add(comp); - if (application.getLifetime() == null) { - application.setLifetime(RestApiConstants.DEFAULT_UNLIMITED_LIFETIME); + Component comp = createDefaultComponent(service); + validateComponent(comp, fs.getFileSystem(), conf); + service.getComponents().add(comp); + if (service.getLifetime() == null) { + service.setLifetime(RestApiConstants.DEFAULT_UNLIMITED_LIFETIME); } return; } } // Validate there are no component name collisions (collisions are not - // currently supported) and add any components from external applications + // currently supported) and add any components from external services // TODO allow name collisions? see AppState#roles // TODO or add prefix to external component names? - Configuration globalConf = application.getConfiguration(); + Configuration globalConf = service.getConfiguration(); Set componentNames = new HashSet<>(); List componentsToRemove = new ArrayList<>(); List componentsToAdd = new ArrayList<>(); - for (Component comp : application.getComponents()) { + for (Component comp : service.getComponents()) { int maxCompLength = RegistryConstants.MAX_FQDN_LABEL_LENGTH; maxCompLength = maxCompLength - Long.toString(Long.MAX_VALUE).length(); if (dnsEnabled && comp.getName().length() > maxCompLength) { @@ -132,21 +127,21 @@ public static void validateAndResolveApplication(Application application, throw new IllegalArgumentException("Component name collision: " + comp.getName()); } - // If artifact is of type APPLICATION (which cannot be filled from - // global), read external application and add its components to this - // application + // If artifact is of type SERVICE (which cannot be filled from + // global), read external service and add its components to this + // service if (comp.getArtifact() != null && comp.getArtifact().getType() == - Artifact.TypeEnum.APPLICATION) { + Artifact.TypeEnum.SERVICE) { if (StringUtils.isEmpty(comp.getArtifact().getId())) { throw new IllegalArgumentException( RestApiErrorMessages.ERROR_ARTIFACT_ID_INVALID); } LOG.info("Marking {} for removal", comp.getName()); componentsToRemove.add(comp); - List externalComponents = getApplicationComponents(fs, + List externalComponents = getComponents(fs, comp.getArtifact().getId()); for (Component c : externalComponents) { - Component override = application.getComponent(c.getName()); + Component override = service.getComponent(c.getName()); if (override != null && override.getArtifact() == null) { // allow properties from external components to be overridden / // augmented by properties in this component, except for artifact @@ -172,20 +167,20 @@ public static void validateAndResolveApplication(Application application, comp.getConfiguration().mergeFrom(globalConf); } } - application.getComponents().removeAll(componentsToRemove); - application.getComponents().addAll(componentsToAdd); + service.getComponents().removeAll(componentsToRemove); + service.getComponents().addAll(componentsToAdd); // Validate components and let global values take effect if component level // values are not provided - Artifact globalArtifact = application.getArtifact(); - Resource globalResource = application.getResource(); - Long globalNumberOfContainers = application.getNumberOfContainers(); - String globalLaunchCommand = application.getLaunchCommand(); - for (Component comp : application.getComponents()) { - // fill in global artifact unless it is type APPLICATION - if (comp.getArtifact() == null && application.getArtifact() != null - && application.getArtifact().getType() != Artifact.TypeEnum - .APPLICATION) { + Artifact globalArtifact = service.getArtifact(); + Resource globalResource = service.getResource(); + Long globalNumberOfContainers = service.getNumberOfContainers(); + String globalLaunchCommand = service.getLaunchCommand(); + for (Component comp : service.getComponents()) { + // fill in global artifact unless it is type SERVICE + if (comp.getArtifact() == null && service.getArtifact() != null + && service.getArtifact().getType() != Artifact.TypeEnum + .SERVICE) { comp.setArtifact(globalArtifact); } // fill in global resource @@ -210,21 +205,22 @@ public static void validateAndResolveApplication(Application application, } } } - validateComponent(comp, fs.getFileSystem()); + validateComponent(comp, fs.getFileSystem(), conf); } // validate dependency tree - sortByDependencies(application.getComponents()); + sortByDependencies(service.getComponents()); - // Application lifetime if not specified, is set to unlimited lifetime - if (application.getLifetime() == null) { - application.setLifetime(RestApiConstants.DEFAULT_UNLIMITED_LIFETIME); + // Service lifetime if not specified, is set to unlimited lifetime + if (service.getLifetime() == null) { + service.setLifetime(RestApiConstants.DEFAULT_UNLIMITED_LIFETIME); } } - public static void validateComponent(Component comp, FileSystem fs) + private static void validateComponent(Component comp, FileSystem fs, + org.apache.hadoop.conf.Configuration conf) throws IOException { - validateCompName(comp.getName()); + validateNameFormat(comp.getName(), conf); AbstractClientProvider compClientProvider = ProviderFactory .getClientProvider(comp.getArtifact()); @@ -236,7 +232,7 @@ public static void validateComponent(Component comp, FileSystem fs) .ERROR_ABSENT_LAUNCH_COMMAND); } - validateApplicationResource(comp.getResource(), comp); + validateServiceResource(comp.getResource(), comp); if (comp.getNumberOfContainers() == null || comp.getNumberOfContainers() < 0) { @@ -250,48 +246,55 @@ public static void validateComponent(Component comp, FileSystem fs) MonitorUtils.getProbe(comp.getReadinessCheck()); } - // Check component name format and transform to lower case. - public static void validateCompName(String compName) { - if (StringUtils.isEmpty(compName)) { - throw new IllegalArgumentException("Component name can not be empty"); + // Check component or service name format and transform to lower case. + public static void validateNameFormat(String name, + org.apache.hadoop.conf.Configuration conf) { + if (StringUtils.isEmpty(name)) { + throw new IllegalArgumentException("Name can not be empty!"); } // validate component name - if (compName.contains("_")) { + if (name.contains("_")) { throw new IllegalArgumentException( - "Invalid format for component name: " + compName - + ", can not use '_' as DNS hostname does not allow underscore. Use '-' Instead. "); + "Invalid format: " + name + + ", can not use '_', as DNS hostname does not allow '_'. Use '-' Instead. "); } - compNamePattern.validate(compName); + boolean dnsEnabled = conf.getBoolean(RegistryConstants.KEY_DNS_ENABLED, + RegistryConstants.DEFAULT_DNS_ENABLED); + if (dnsEnabled && name.length() > RegistryConstants.MAX_FQDN_LABEL_LENGTH) { + throw new IllegalArgumentException(String + .format("Invalid format %s, must be no more than 63 characters ", + name)); + } + namePattern.validate(name); } @VisibleForTesting - public static List getApplicationComponents(SliderFileSystem - fs, String appName) throws IOException { - return loadApplication(fs, appName).getComponents(); + public static List getComponents(SliderFileSystem + fs, String serviceName) throws IOException { + return loadService(fs, serviceName).getComponents(); } - public static Application loadApplication(SliderFileSystem fs, String - appName) throws IOException { - Path appJson = getAppJsonPath(fs, appName); - LOG.info("Loading application definition from " + appJson); - return jsonSerDeser.load(fs.getFileSystem(), appJson); + public static Service loadService(SliderFileSystem fs, String + serviceName) throws IOException { + Path serviceJson = getServiceJsonPath(fs, serviceName); + LOG.info("Loading service definition from " + serviceJson); + return jsonSerDeser.load(fs.getFileSystem(), serviceJson); } - public static Application loadApplicationFrom(SliderFileSystem fs, + public static Service loadServiceFrom(SliderFileSystem fs, Path appDefPath) throws IOException { - LOG.info("Loading application definition from " + appDefPath); + LOG.info("Loading service definition from " + appDefPath); return jsonSerDeser.load(fs.getFileSystem(), appDefPath); } - public static Path getAppJsonPath(SliderFileSystem fs, String appName) { - Path appDir = fs.buildClusterDirPath(appName); - Path appJson = new Path(appDir, appName + ".json"); - return appJson; + public static Path getServiceJsonPath(SliderFileSystem fs, String serviceName) { + Path serviceDir = fs.buildClusterDirPath(serviceName); + return new Path(serviceDir, serviceName + ".json"); } - private static void validateApplicationResource(Resource resource, + private static void validateServiceResource(Resource resource, Component comp) { - // Only apps/components of type APPLICATION can skip resource requirement + // Only services/components of type SERVICE can skip resource requirement if (resource == null) { throw new IllegalArgumentException( comp == null ? RestApiErrorMessages.ERROR_RESOURCE_INVALID : String @@ -344,8 +347,8 @@ private static void validateApplicationResource(Resource resource, // check if comp mem size exceeds cluster limit public static void validateCompResourceSize( org.apache.hadoop.yarn.api.records.Resource maxResource, - Application application) throws YarnException { - for (Component component : application.getComponents()) { + Service service) throws YarnException { + for (Component component : service.getComponents()) { // only handle mem now. long mem = Long.parseLong(component.getResource().getMemory()); if (mem > maxResource.getMemorySize()) { @@ -357,22 +360,22 @@ public static void validateCompResourceSize( } } - public static boolean hasComponent(Application application) { - if (application.getComponents() == null || application.getComponents() + public static boolean hasComponent(Service service) { + if (service.getComponents() == null || service.getComponents() .isEmpty()) { return false; } return true; } - public static Component createDefaultComponent(Application app) { + public static Component createDefaultComponent(Service service) { Component comp = new Component(); comp.setName(RestApiConstants.DEFAULT_COMPONENT_NAME); - comp.setArtifact(app.getArtifact()); - comp.setResource(app.getResource()); - comp.setNumberOfContainers(app.getNumberOfContainers()); - comp.setLaunchCommand(app.getLaunchCommand()); - comp.setConfiguration(app.getConfiguration()); + comp.setArtifact(service.getArtifact()); + comp.setResource(service.getResource()); + comp.setNumberOfContainers(service.getNumberOfContainers()); + comp.setLaunchCommand(service.getLaunchCommand()); + comp.setConfiguration(service.getConfiguration()); return comp; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceRegistryUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceRegistryUtils.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceRegistryUtils.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceRegistryUtils.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderFileSystem.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderFileSystem.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderFileSystem.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderFileSystem.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java similarity index 96% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java index 415392a426..6e6f4dd394 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/SliderUtils.java @@ -122,11 +122,11 @@ public final class SliderUtils { public static final String PYTHON = "python"; /** - * type of docker standalone application + * type of docker standalone service */ public static final String DOCKER = "docker"; /** - * type of docker on yarn application + * type of docker on yarn service */ public static final String DOCKER_YARN = "yarn_docker"; @@ -350,13 +350,6 @@ public static File requiredFile(String filename, String role) throws private static final PatternValidator clusternamePattern = new PatternValidator("[a-z][a-z0-9_-]*"); - private static final PatternValidator compNamePattern - = new PatternValidator("[a-z][a-z0-9-]*"); - - public static void validateCompName(String compName) { - compNamePattern.validate(compName); - } - /** * Normalize a cluster name then verify that it is valid * @param name proposed cluster name @@ -366,31 +359,6 @@ public static boolean isClusternameValid(String name) { return name != null && clusternamePattern.matches(name); } - public static boolean oldIsClusternameValid(String name) { - if (name == null || name.isEmpty()) { - return false; - } - int first = name.charAt(0); - if (0 == (Character.getType(first) & Character.LOWERCASE_LETTER)) { - return false; - } - - for (int i = 0; i < name.length(); i++) { - int elt = (int) name.charAt(i); - int t = Character.getType(elt); - if (0 == (t & Character.LOWERCASE_LETTER) - && 0 == (t & Character.DECIMAL_DIGIT_NUMBER) - && elt != '-' - && elt != '_') { - return false; - } - if (!Character.isLetterOrDigit(elt) && elt != '-' && elt != '_') { - return false; - } - } - return true; - } - /** * Copy a directory to a new FS -both paths must be qualified. If * a directory needs to be created, supplied permissions can override @@ -595,7 +563,7 @@ public static String mandatoryEnvVariable(String key) throws public static String appReportToString(ApplicationReport r, String separator) { StringBuilder builder = new StringBuilder(512); - builder.append("application ") + builder.append("service ") .append( r.getName()) .append("/") @@ -667,7 +635,7 @@ public static boolean filter(String value, Set filters) { } /** - * Sorts the given list of application reports, most recently started + * Sorts the given list of service reports, most recently started * or finished instance first. * * @param instances list of instances @@ -677,7 +645,7 @@ public static void sortApplicationsByMostRecent(List instance } /** - * Sorts the given list of application reports + * Sorts the given list of service reports * Finished instances are ordered by finished time and running/accepted instances are * ordered by start time * Finally Instance are order by finished instances coming after running instances @@ -902,7 +870,7 @@ public static String containerToString(Container container) { */ public static String reportToString(ApplicationReport report) { if (report == null) { - return "Null application report"; + return "Null service report"; } return "App " + report.getName() + "/" + report.getApplicationType() + @@ -1004,19 +972,6 @@ public static void applyCommandLineRoleOptsToRoleMap( } } - /** - * verify that the supplied cluster name is valid - * @param clustername cluster name - * @throws BadCommandArgumentsException if it is invalid - */ - public static void validateClusterName(String clustername) - throws BadCommandArgumentsException { - if (!isClusternameValid(clustername)) { - throw new BadCommandArgumentsException( - "Illegal cluster name: " + clustername); - } - } - /** * Verify that a Kerberos principal has been set -if not fail * with an error message that actually tells you what is missing @@ -1098,7 +1053,7 @@ public static boolean initProcessSecurity(Configuration conf) throws if (!UserGroupInformation.isSecurityEnabled()) { throw new SliderException(LauncherExitCodes.EXIT_UNAUTHORIZED, "Although secure mode is enabled," + - "the application has already set up its user as an insecure entity %s", + "the service has already set up its user as an insecure entity %s", authUser); } if (authUser.getAuthenticationMethod() == diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ZookeeperUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ZookeeperUtils.java similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/utils/ZookeeperUtils.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ZookeeperUtils.java diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/proto/ClientAMProtocol.proto b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/proto/ClientAMProtocol.proto similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/proto/ClientAMProtocol.proto rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/proto/ClientAMProtocol.proto 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/MockServiceAM.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/MockServiceAM.java similarity index 92% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/MockServiceAM.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/MockServiceAM.java index 4fa81eeb15..d343a03dfc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/MockServiceAM.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/MockServiceAM.java @@ -39,7 +39,7 @@ import org.apache.hadoop.yarn.client.api.impl.AMRMClientImpl; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.proto.ClientAMProtocol; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.component.Component; import org.apache.hadoop.yarn.service.component.ComponentState; import org.apache.hadoop.yarn.service.exceptions.BadClusterStateException; @@ -57,15 +57,15 @@ public class MockServiceAM extends ServiceMaster { - Application application; + Service service; // The list of containers fed by tests to be returned on // AMRMClientCallBackHandler#onContainersAllocated final List feedContainers = Collections.synchronizedList(new LinkedList<>()); - public MockServiceAM(Application application) { - super(application.getName()); - this.application = application; + public MockServiceAM(Service service) { + super(service.getName()); + this.service = service; } @@ -73,13 +73,13 @@ public MockServiceAM(Application application) { protected ContainerId getAMContainerId() throws BadClusterStateException { return ContainerId.newContainerId(ApplicationAttemptId - .newInstance(ApplicationId.fromString(application.getId()), 1), 1); + .newInstance(ApplicationId.fromString(service.getId()), 1), 1); } @Override protected Path getAppDir() { - Path path = new Path(new Path("target", "apps"), application.getName()); - System.out.println("Application path: " + path); + Path path = new Path(new Path("target", "apps"), service.getName()); + System.out.println("Service path: " + path); return path; } @@ -155,19 +155,19 @@ public NMClientAsync createNMClient() { @Override protected void loadApplicationJson(ServiceContext context, SliderFileSystem fs) throws IOException { - context.application = application; + context.service = service; } /** * - * @param application The application for the component + * @param service The service for the component * @param id The id for the container * @param compName The component to which the container is fed * @return */ - public Container feedContainerToComp(Application application, int id, + public Container feedContainerToComp(Service service, int id, String compName) { - ApplicationId applicationId = ApplicationId.fromString(application.getId()); + ApplicationId applicationId = ApplicationId.fromString(service.getId()); ContainerId containerId = ContainerId .newContainerId(ApplicationAttemptId.newInstance(applicationId, 1), id); NodeId nodeId = NodeId.newInstance("localhost", 1234); 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/ServiceTestUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/ServiceTestUtils.java similarity index 87% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/ServiceTestUtils.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/ServiceTestUtils.java index 73172bfecc..0f4f598562 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/ServiceTestUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/ServiceTestUtils.java @@ -18,7 +18,7 @@ package org.apache.hadoop.yarn.service; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.api.records.Component; import org.apache.hadoop.yarn.service.api.records.Resource; import org.apache.hadoop.yarn.service.utils.JsonSerDeser; @@ -26,14 +26,14 @@ public class ServiceTestUtils { - public static final JsonSerDeser JSON_SER_DESER = - new JsonSerDeser<>(Application.class, + public static final JsonSerDeser JSON_SER_DESER = + new JsonSerDeser<>(Service.class, PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES); // Example service definition // 2 components, each of which has 2 containers. - protected Application createExampleApplication() { - Application exampleApp = new Application(); + protected Service createExampleApplication() { + Service exampleApp = new Service(); exampleApp.setName("example-app"); exampleApp.addComponent(createComponent("compa")); exampleApp.addComponent(createComponent("compb")); 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/TestServiceApiUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestServiceApiUtil.java similarity index 74% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/TestServiceApiUtil.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestServiceApiUtil.java index 1a2287579d..be36335a66 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/TestServiceApiUtil.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestServiceApiUtil.java @@ -17,12 +17,13 @@ */ package org.apache.hadoop.yarn.service; +import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.registry.client.api.RegistryConstants; import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.apache.hadoop.yarn.service.api.records.Service; import org.apache.hadoop.yarn.service.exceptions.RestApiErrorMessages; -import org.apache.hadoop.yarn.service.api.records.Application; 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.Resource; @@ -46,6 +47,7 @@ import static org.easymock.EasyMock.*; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Test for ServiceApiUtil helper methods. @@ -78,12 +80,12 @@ public void testResourceValidation() throws Exception { SliderFileSystem sfs = initMock(null); - Application app = new Application(); + Service app = new Service(); // no name try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with no name"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with no name"); } catch (IllegalArgumentException e) { assertEquals(ERROR_APPLICATION_NAME_INVALID, e.getMessage()); } @@ -93,19 +95,18 @@ public void testResourceValidation() throws Exception { for (String badName : badNames) { app.setName(badName); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with bad name " + badName); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with bad name " + badName); } catch (IllegalArgumentException e) { - assertEquals(String.format( - ERROR_APPLICATION_NAME_INVALID_FORMAT, badName), e.getMessage()); + } } // launch command not specified app.setName(LEN_64_STR); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DEFAULT_DNS); - Assert.fail(EXCEPTION_PREFIX + "application with no launch command"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DEFAULT_DNS); + Assert.fail(EXCEPTION_PREFIX + "service with no launch command"); } catch (IllegalArgumentException e) { assertEquals(RestApiErrorMessages.ERROR_ABSENT_LAUNCH_COMMAND, e.getMessage()); @@ -115,8 +116,8 @@ public void testResourceValidation() throws Exception { app.setName(LEN_64_STR.substring(0, RegistryConstants .MAX_FQDN_LABEL_LENGTH)); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with no launch command"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with no launch command"); } catch (IllegalArgumentException e) { assertEquals(RestApiErrorMessages.ERROR_ABSENT_LAUNCH_COMMAND, e.getMessage()); @@ -125,8 +126,8 @@ public void testResourceValidation() throws Exception { // resource not specified app.setLaunchCommand("sleep 3600"); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with no resource"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with no resource"); } catch (IllegalArgumentException e) { assertEquals(String.format( RestApiErrorMessages.ERROR_RESOURCE_FOR_COMP_INVALID, @@ -137,8 +138,8 @@ public void testResourceValidation() throws Exception { Resource res = new Resource(); app.setResource(res); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with no memory"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with no memory"); } catch (IllegalArgumentException e) { assertEquals(String.format( RestApiErrorMessages.ERROR_RESOURCE_MEMORY_FOR_COMP_INVALID, @@ -149,9 +150,9 @@ public void testResourceValidation() throws Exception { res.setMemory("100mb"); res.setCpus(-2); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); Assert.fail( - EXCEPTION_PREFIX + "application with invalid no of cpus"); + EXCEPTION_PREFIX + "service with invalid no of cpus"); } catch (IllegalArgumentException e) { assertEquals(String.format( RestApiErrorMessages.ERROR_RESOURCE_CPUS_FOR_COMP_INVALID_RANGE, @@ -161,8 +162,8 @@ public void testResourceValidation() throws Exception { // number of containers not specified res.setCpus(2); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with no container count"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with no container count"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage() .contains(ERROR_CONTAINERS_COUNT_INVALID)); @@ -171,9 +172,9 @@ public void testResourceValidation() throws Exception { // specifying profile along with cpus/memory raises exception res.setProfile("hbase_finance_large"); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); Assert.fail(EXCEPTION_PREFIX - + "application with resource profile along with cpus/memory"); + + "service with resource profile along with cpus/memory"); } catch (IllegalArgumentException e) { assertEquals(String.format(RestApiErrorMessages .ERROR_RESOURCE_PROFILE_MULTIPLE_VALUES_FOR_COMP_NOT_SUPPORTED, @@ -186,8 +187,8 @@ public void testResourceValidation() throws Exception { res.setCpus(null); res.setMemory(null); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with resource profile only"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with resource profile only"); } catch (IllegalArgumentException e) { assertEquals(ERROR_RESOURCE_PROFILE_NOT_SUPPORTED_YET, e.getMessage()); @@ -200,7 +201,7 @@ public void testResourceValidation() throws Exception { // null number of containers try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); Assert.fail(EXCEPTION_PREFIX + "null number of containers"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage() @@ -210,7 +211,7 @@ public void testResourceValidation() throws Exception { // negative number of containers app.setNumberOfContainers(-1L); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); Assert.fail(EXCEPTION_PREFIX + "negative number of containers"); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage() @@ -220,9 +221,9 @@ public void testResourceValidation() throws Exception { // everything valid here app.setNumberOfContainers(5L); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); } catch (IllegalArgumentException e) { - LOG.error("application attributes specified should be valid here", e); + LOG.error("service attributes specified should be valid here", e); Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); } } @@ -231,7 +232,7 @@ public void testResourceValidation() throws Exception { public void testArtifacts() throws IOException { SliderFileSystem sfs = initMock(null); - Application app = new Application(); + Service app = new Service(); app.setName("name"); Resource res = new Resource(); app.setResource(res); @@ -242,17 +243,17 @@ public void testArtifacts() throws IOException { Artifact artifact = new Artifact(); app.setArtifact(artifact); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with no artifact id"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with no artifact id"); } catch (IllegalArgumentException e) { assertEquals(ERROR_ARTIFACT_ID_INVALID, e.getMessage()); } - // no artifact id fails with APPLICATION type - artifact.setType(Artifact.TypeEnum.APPLICATION); + // no artifact id fails with SERVICE type + artifact.setType(Artifact.TypeEnum.SERVICE); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with no artifact id"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with no artifact id"); } catch (IllegalArgumentException e) { assertEquals(ERROR_ARTIFACT_ID_INVALID, e.getMessage()); } @@ -260,8 +261,8 @@ public void testArtifacts() throws IOException { // no artifact id fails with TARBALL type artifact.setType(Artifact.TypeEnum.TARBALL); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with no artifact id"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with no artifact id"); } catch (IllegalArgumentException e) { assertEquals(ERROR_ARTIFACT_ID_INVALID, e.getMessage()); } @@ -270,9 +271,9 @@ public void testArtifacts() throws IOException { artifact.setType(Artifact.TypeEnum.DOCKER); artifact.setId("docker.io/centos:centos7"); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); } catch (IllegalArgumentException e) { - LOG.error("application attributes specified should be valid here", e); + LOG.error("service attributes specified should be valid here", e); Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); } @@ -296,8 +297,8 @@ private static Component createValidComponent(String compName) { return comp; } - private static Application createValidApplication(String compName) { - Application app = new Application(); + private static Service createValidApplication(String compName) { + Service app = new Service(); app.setLaunchCommand("sleep 3600"); app.setName("name"); app.setResource(createValidResource()); @@ -308,10 +309,10 @@ private static Application createValidApplication(String compName) { return app; } - private static SliderFileSystem initMock(Application ext) throws IOException { + private static SliderFileSystem initMock(Service ext) throws IOException { SliderFileSystem sfs = createNiceMock(SliderFileSystem.class); FileSystem mockFs = createNiceMock(FileSystem.class); - JsonSerDeser jsonSerDeser = createNiceMock(JsonSerDeser + JsonSerDeser jsonSerDeser = createNiceMock(JsonSerDeser .class); expect(sfs.getFileSystem()).andReturn(mockFs).anyTimes(); expect(sfs.buildClusterDirPath(anyObject())).andReturn( @@ -327,18 +328,18 @@ private static SliderFileSystem initMock(Application ext) throws IOException { @Test public void testExternalApplication() throws IOException { - Application ext = createValidApplication("comp1"); + Service ext = createValidApplication("comp1"); SliderFileSystem sfs = initMock(ext); - Application app = createValidApplication(null); + Service app = createValidApplication(null); Artifact artifact = new Artifact(); - artifact.setType(Artifact.TypeEnum.APPLICATION); + artifact.setType(Artifact.TypeEnum.SERVICE); artifact.setId("id"); app.setArtifact(artifact); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); } catch (IllegalArgumentException e) { Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); } @@ -352,13 +353,13 @@ public void testDuplicateComponents() throws IOException { SliderFileSystem sfs = initMock(null); String compName = "comp1"; - Application app = createValidApplication(compName); + Service app = createValidApplication(compName); app.addComponent(createValidComponent(compName)); // duplicate component name fails try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with component collision"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with component collision"); } catch (IllegalArgumentException e) { assertEquals("Component name collision: " + compName, e.getMessage()); } @@ -366,18 +367,18 @@ public void testDuplicateComponents() throws IOException { @Test public void testExternalDuplicateComponent() throws IOException { - Application ext = createValidApplication("comp1"); + Service ext = createValidApplication("comp1"); SliderFileSystem sfs = initMock(ext); - Application app = createValidApplication("comp1"); + Service app = createValidApplication("comp1"); Artifact artifact = new Artifact(); - artifact.setType(Artifact.TypeEnum.APPLICATION); + artifact.setType(Artifact.TypeEnum.SERVICE); artifact.setId("id"); app.getComponent("comp1").setArtifact(artifact); - // duplicate component name okay in the case of APPLICATION component + // duplicate component name okay in the case of SERVICE component try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); } catch (IllegalArgumentException e) { Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); } @@ -385,17 +386,17 @@ public void testExternalDuplicateComponent() throws IOException { @Test public void testExternalComponent() throws IOException { - Application ext = createValidApplication("comp1"); + Service ext = createValidApplication("comp1"); SliderFileSystem sfs = initMock(ext); - Application app = createValidApplication("comp2"); + Service app = createValidApplication("comp2"); Artifact artifact = new Artifact(); - artifact.setType(Artifact.TypeEnum.APPLICATION); + artifact.setType(Artifact.TypeEnum.SERVICE); artifact.setId("id"); app.setArtifact(artifact); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); } catch (IllegalArgumentException e) { Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); } @@ -404,11 +405,11 @@ public void testExternalComponent() throws IOException { // artifact ID not inherited from global assertNotNull(app.getComponent("comp2")); - // set APPLICATION artifact id on component + // set SERVICE artifact id on component app.getComponent("comp2").setArtifact(artifact); try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); } catch (IllegalArgumentException e) { Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); } @@ -454,10 +455,10 @@ public void testDependencySorting() throws IOException { } SliderFileSystem sfs = initMock(null); - Application application = createValidApplication(null); - application.setComponents(Arrays.asList(c, d, e)); + Service service = createValidApplication(null); + service.setComponents(Arrays.asList(c, d, e)); try { - ServiceApiUtil.validateAndResolveApplication(application, sfs, + ServiceApiUtil.validateAndResolveService(service, sfs, CONF_DEFAULT_DNS); Assert.fail(EXCEPTION_PREFIX + "components with bad dependencies"); } catch (IllegalArgumentException ex) { @@ -481,7 +482,7 @@ public void testValidateCompName() { }; for (String name : invalidNames) { try { - ServiceApiUtil.validateCompName(name); + ServiceApiUtil.validateNameFormat(name, new Configuration()); Assert.fail(); } catch (IllegalArgumentException ex) { ex.printStackTrace(); @@ -496,13 +497,13 @@ private static void testComponent(SliderFileSystem sfs) maxLen = maxLen - Long.toString(Long.MAX_VALUE).length(); String compName = LEN_64_STR.substring(0, maxLen + 1); - Application app = createValidApplication(null); + Service app = createValidApplication(null); app.addComponent(createValidComponent(compName)); // invalid component name fails if dns is enabled try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); - Assert.fail(EXCEPTION_PREFIX + "application with invalid component name"); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); + Assert.fail(EXCEPTION_PREFIX + "service with invalid component name"); } catch (IllegalArgumentException e) { assertEquals(String.format(RestApiErrorMessages .ERROR_COMPONENT_NAME_INVALID, maxLen, compName), e.getMessage()); @@ -510,7 +511,7 @@ private static void testComponent(SliderFileSystem sfs) // does not fail if dns is disabled try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DEFAULT_DNS); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DEFAULT_DNS); } catch (IllegalArgumentException e) { Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); } @@ -521,7 +522,7 @@ private static void testComponent(SliderFileSystem sfs) // does not fail try { - ServiceApiUtil.validateAndResolveApplication(app, sfs, CONF_DNS_ENABLED); + ServiceApiUtil.validateAndResolveService(app, sfs, CONF_DNS_ENABLED); } catch (IllegalArgumentException e) { Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage()); } 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/TestYarnNativeServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java similarity index 94% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java index a36e0b436e..63aa9c6b48 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/TestYarnNativeServices.java @@ -35,7 +35,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.server.MiniYARNCluster; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; 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; @@ -235,7 +235,7 @@ public void tearDown() throws IOException { @Test (timeout = 200000) public void testCreateFlexStopDestroyService() throws Exception { ServiceClient client = createClient(); - Application exampleApp = createExampleApplication(); + Service exampleApp = createExampleApplication(); client.actionCreate(exampleApp); SliderFileSystem fileSystem = new SliderFileSystem(conf); Path appDir = fileSystem.buildClusterDirPath(exampleApp.getName()); @@ -276,7 +276,7 @@ public void testCreateFlexStopDestroyService() throws Exception { LOG.info("Destroy the service"); //destroy the service and check the app dir is deleted from fs. client.actionDestroy(exampleApp.getName()); - // check the application dir on hdfs (in this case, local fs) are deleted. + // check the service dir on hdfs (in this case, local fs) are deleted. Assert.assertFalse(fs.exists(appDir)); } @@ -286,7 +286,7 @@ public void testCreateFlexStopDestroyService() throws Exception { @Test (timeout = 200000) public void testComponentStartOrder() throws Exception { ServiceClient client = createClient(); - Application exampleApp = new Application(); + Service exampleApp = new Service(); exampleApp.setName("teststartorder"); exampleApp.addComponent(createComponent("compa", 2, "sleep 1000")); Component compb = createComponent("compb", 2, "sleep 1000"); @@ -310,9 +310,9 @@ public void testComponentStartOrder() throws Exception { // compa-c1, compa-c2, compb-c1, compb-c2; // check that the container's launch time are align with the dependencies. private void checkContainerLaunchDependencies(ServiceClient client, - Application exampleApp, String... compOrder) + Service exampleApp, String... compOrder) throws IOException, YarnException { - Application retrievedApp = client.getStatus(exampleApp.getName()); + Service retrievedApp = client.getStatus(exampleApp.getName()); List containerList = new ArrayList<>(); for (Component component : retrievedApp.getComponents()) { containerList.addAll(component.getContainers()); @@ -337,7 +337,7 @@ private void checkContainerLaunchDependencies(ServiceClient client, private Map flexComponents(ServiceClient client, - Application exampleApp, long count) throws YarnException, IOException { + Service exampleApp, long count) throws YarnException, IOException { Map compCounts = new HashMap<>(); compCounts.put("compa", count); compCounts.put("compb", count); @@ -353,9 +353,9 @@ private Map flexComponents(ServiceClient client, // When flex up to 4 instances, it should be compA-1 , compA-2, compA-3, compA-4 // When flex down to 3 instances, it should be compA-1 , compA-2, compA-3. private void checkCompInstancesInOrder(ServiceClient client, - Application exampleApp) throws IOException, YarnException { - Application application = client.getStatus(exampleApp.getName()); - for (Component comp : application.getComponents()) { + Service exampleApp) throws IOException, YarnException { + Service service = client.getStatus(exampleApp.getName()); + for (Component comp : service.getComponents()) { checkEachCompInstancesInOrder(comp); } } @@ -380,13 +380,13 @@ private void checkEachCompInstancesInOrder(Component component) { } private void waitForOneCompToBeReady(ServiceClient client, - Application exampleApp, String readyComp) + Service exampleApp, String readyComp) throws TimeoutException, InterruptedException { long numExpectedContainers = exampleApp.getComponent(readyComp).getNumberOfContainers(); GenericTestUtils.waitFor(() -> { try { - Application retrievedApp = client.getStatus(exampleApp.getName()); + Service retrievedApp = client.getStatus(exampleApp.getName()); Component retrievedComp = retrievedApp.getComponent(readyComp); if (retrievedComp.getContainers() != null @@ -407,11 +407,11 @@ private void waitForOneCompToBeReady(ServiceClient client, // wait until all the containers for all components become ready state private void waitForAllCompToBeReady(ServiceClient client, - Application exampleApp) throws TimeoutException, InterruptedException { + Service exampleApp) throws TimeoutException, InterruptedException { int expectedTotalContainers = countTotalContainers(exampleApp); GenericTestUtils.waitFor(() -> { try { - Application retrievedApp = client.getStatus(exampleApp.getName()); + Service retrievedApp = client.getStatus(exampleApp.getName()); int totalReadyContainers = 0; LOG.info("Num Components " + retrievedApp.getComponents().size()); for (Component component : retrievedApp.getComponents()) { @@ -462,9 +462,9 @@ private ServiceClient createClient() throws Exception { } - private int countTotalContainers(Application application) { + private int countTotalContainers(Service service) { int totalContainers = 0; - for (Component component : application.getComponents()) { + for (Component component : service.getComponents()) { totalContainers += component.getNumberOfContainers(); } return totalContainers; 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/client/TestBuildExternalComponents.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java similarity index 92% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java index a22c0007f1..93a15cc8c0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestBuildExternalComponents.java @@ -40,7 +40,7 @@ import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.YARN_SERVICE_BASE_PATH; /** - * Test for building / resolving components of type APPLICATION. + * Test for building / resolving components of type SERVICE. */ public class TestBuildExternalComponents { @@ -75,7 +75,7 @@ private void buildAndCheckComponents(String appName, String appDef, // verify generated conf List components = - ServiceApiUtil.getApplicationComponents(sfs, appName); + ServiceApiUtil.getComponents(sfs, appName); checkComponentNames(components, names); } @@ -97,7 +97,7 @@ public void tearDown() throws IOException { } } - // Test applications defining external components(APPLICATION type) + // Test applications defining external components(SERVICE type) // can be resolved correctly @Test public void testExternalComponentBuild() throws Throwable { @@ -115,13 +115,13 @@ public void testExternalComponentBuild() throws Throwable { nameSet.add("other"); - // external1 has 3 components: simple(APPLICATION - app1), master and other + // external1 has 3 components: simple(SERVICE - app1), master and other buildAndCheckComponents("external-1", ExampleAppJson.EXTERNAL_JSON_1, sfs, nameSet); nameSet.add("another"); - // external2 has 2 components: ext(APPLICATION - external1), another + // external2 has 2 components: ext(SERVICE - external1), another buildAndCheckComponents("external-2", ExampleAppJson.EXTERNAL_JSON_2, sfs, nameSet); } 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/client/TestServiceCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java similarity index 74% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java index 20c06ab220..ecc529dbf8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/client/TestServiceCLI.java @@ -20,7 +20,9 @@ import org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.CommonConfigurationKeysPublic; import org.apache.hadoop.yarn.api.records.ApplicationReport; +import org.apache.hadoop.yarn.api.records.YarnApplicationState; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.service.ClientAMProtocol; @@ -29,6 +31,7 @@ import org.apache.hadoop.yarn.service.conf.ExampleAppJson; import org.apache.hadoop.yarn.service.utils.ServiceApiUtil; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; +import org.apache.hadoop.yarn.util.Records; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -38,9 +41,12 @@ import java.io.IOException; import java.util.List; +import static org.apache.hadoop.yarn.conf.YarnConfiguration.RESOURCEMANAGER_CONNECT_MAX_WAIT_MS; +import static org.apache.hadoop.yarn.conf.YarnConfiguration.RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS; import static org.apache.hadoop.yarn.service.client.params.Arguments.ARG_APPDEF; import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.YARN_SERVICE_BASE_PATH; -import static org.mockito.Mockito.mock; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.*; public class TestServiceCLI { @@ -61,6 +67,12 @@ private void buildApp(String appName, String appDef) throws Throwable { public void setup() throws Throwable { basedir = new File("target", "apps"); conf.set(YARN_SERVICE_BASE_PATH, basedir.getAbsolutePath()); + conf.setLong(RESOURCEMANAGER_CONNECT_MAX_WAIT_MS, 0); + conf.setLong(RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS, 1); + conf.setInt( + CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, 0); + conf.setInt(CommonConfigurationKeysPublic. + IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_KEY, 0); fs = new SliderFileSystem(conf); if (basedir.exists()) { FileUtils.deleteDirectory(basedir); @@ -72,12 +84,19 @@ public void setup() throws Throwable { cli = new ServiceCLI() { @Override protected void createServiceClient() { client = new ServiceClient() { - @Override protected ClientAMProtocol getAMProxy(String appName, - ApplicationReport report) throws IOException { - return mock(ClientAMProtocol.class); + @Override + protected void serviceInit(Configuration configuration) + throws Exception { + super.serviceInit(conf); + yarnClient = spy(yarnClient); + ApplicationReport report = Records.newRecord(ApplicationReport.class); + report.setYarnApplicationState(YarnApplicationState.RUNNING); + report.setHost("localhost"); + doReturn(report).when(yarnClient).getApplicationReport(anyObject()); } - @Override protected ClientAMProtocol getAMProxy(String appName) - throws IOException, YarnException { + @Override + protected ClientAMProtocol createAMProxy(String host, int port) + throws IOException { return mock(ClientAMProtocol.class); } }; @@ -106,7 +125,6 @@ public void testFlexComponents() throws Throwable { ClientArgs clientArgs = new ClientArgs(flexUpArgs); clientArgs.parse(); cli.exec(clientArgs); - checkCompCount("master", 3L); // decrease by 1 @@ -114,20 +132,18 @@ public void testFlexComponents() throws Throwable { clientArgs = new ClientArgs(flexDownArgs); clientArgs.parse(); cli.exec(clientArgs); - checkCompCount("master", 2L); String[] flexAbsoluteArgs = {"flex", "service-1", "--component", "master", "10"}; clientArgs = new ClientArgs(flexAbsoluteArgs); clientArgs.parse(); cli.exec(clientArgs); - checkCompCount("master", 10L); } private void checkCompCount(String compName, long count) throws IOException { List components = - ServiceApiUtil.getApplicationComponents(fs, "service-1"); + ServiceApiUtil.getComponents(fs, "service-1"); for (Component component : components) { if (component.getName().equals(compName)) { Assert.assertEquals(count, component.getNumberOfContainers().longValue()); 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/ExampleAppJson.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/ExampleAppJson.java similarity index 93% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/ExampleAppJson.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/ExampleAppJson.java index 9e13200cdd..5fdd2ab0c7 100644 --- 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/ExampleAppJson.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/ExampleAppJson.java @@ -19,7 +19,7 @@ package org.apache.hadoop.yarn.service.conf; -import org.apache.hadoop.yarn.service.api.records.Application; +import org.apache.hadoop.yarn.service.api.records.Service; import java.io.IOException; import java.util.ArrayList; @@ -55,7 +55,7 @@ public final class ExampleAppJson { private ExampleAppJson() { } - public static Application loadResource(String name) throws IOException { + public static Service loadResource(String name) throws IOException { return JSON_SER_DESER.fromResource(PACKAGE + name); } 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/TestAppJsonResolve.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestAppJsonResolve.java similarity index 92% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestAppJsonResolve.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestAppJsonResolve.java index 954d117428..04ec52687b 100644 --- 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/TestAppJsonResolve.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestAppJsonResolve.java @@ -21,13 +21,12 @@ 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.api.records.Service; import org.apache.hadoop.yarn.service.api.records.ConfigFile; import org.apache.hadoop.yarn.service.api.records.Configuration; import org.apache.hadoop.yarn.service.utils.JsonSerDeser; import org.apache.hadoop.yarn.service.utils.ServiceApiUtil; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; -import org.apache.hadoop.yarn.service.utils.SliderUtils; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; @@ -41,7 +40,6 @@ import java.util.Set; import static org.apache.hadoop.yarn.service.conf.ExampleAppJson.*; -import static org.apache.hadoop.yarn.service.conf.YarnServiceConf.*; import static org.easymock.EasyMock.*; /** @@ -53,7 +51,7 @@ public class TestAppJsonResolve extends Assert { @Test public void testOverride() throws Throwable { - Application orig = ExampleAppJson.loadResource(OVERRIDE_JSON); + Service orig = ExampleAppJson.loadResource(OVERRIDE_JSON); Configuration global = orig.getConfiguration(); assertEquals("a", global.getProperty("g1")); @@ -86,7 +84,7 @@ public void testOverride() throws Throwable { expect(sfs.buildClusterDirPath(anyObject())).andReturn( new Path("cluster_dir_path")).anyTimes(); replay(sfs, mockFs); - ServiceApiUtil.validateAndResolveApplication(orig, sfs, new + ServiceApiUtil.validateAndResolveService(orig, sfs, new YarnConfiguration()); global = orig.getConfiguration(); @@ -146,7 +144,7 @@ public void testOverride() throws Throwable { @Test public void testOverrideExternalConfiguration() throws IOException { - Application orig = ExampleAppJson.loadResource(EXTERNAL_JSON_1); + Service orig = ExampleAppJson.loadResource(EXTERNAL_JSON_1); Configuration global = orig.getConfiguration(); assertEquals(0, global.getProperties().size()); @@ -163,20 +161,20 @@ public void testOverrideExternalConfiguration() throws IOException { Configuration other = orig.getComponent("other").getConfiguration(); assertEquals(0, other.getProperties().size()); - // load the external application + // load the external service 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); - Application ext = ExampleAppJson.loadResource(APP_JSON); - ServiceApiUtil.validateAndResolveApplication(ext, sfs, new + Service ext = ExampleAppJson.loadResource(APP_JSON); + ServiceApiUtil.validateAndResolveService(ext, sfs, new YarnConfiguration()); reset(sfs, mockFs); - // perform the resolution on original application - JsonSerDeser jsonSerDeser = createNiceMock(JsonSerDeser + // perform the resolution on original service + JsonSerDeser jsonSerDeser = createNiceMock(JsonSerDeser .class); expect(sfs.getFileSystem()).andReturn(mockFs).anyTimes(); expect(sfs.buildClusterDirPath(anyObject())).andReturn( @@ -185,7 +183,7 @@ public void testOverrideExternalConfiguration() throws IOException { .anyTimes(); replay(sfs, mockFs, jsonSerDeser); ServiceApiUtil.setJsonSerDeser(jsonSerDeser); - ServiceApiUtil.validateAndResolveApplication(orig, sfs, new + ServiceApiUtil.validateAndResolveService(orig, sfs, new YarnConfiguration()); global = orig.getConfiguration(); 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestLoadExampleAppJson.java similarity index 92% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestLoadExampleAppJson.java index 83105300a5..83e9502fd8 100644 --- 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestLoadExampleAppJson.java @@ -21,7 +21,7 @@ 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.api.records.Service; import org.apache.hadoop.yarn.service.utils.ServiceApiUtil; import org.apache.hadoop.yarn.service.utils.SliderFileSystem; import org.junit.Assert; @@ -60,7 +60,7 @@ public static Collection filenames() { @Test public void testLoadResource() throws Throwable { try { - Application application = JSON_SER_DESER.fromResource(resource); + Service service = JSON_SER_DESER.fromResource(resource); SliderFileSystem sfs = createNiceMock(SliderFileSystem.class); FileSystem mockFs = createNiceMock(FileSystem.class); @@ -69,7 +69,7 @@ public void testLoadResource() throws Throwable { new Path("cluster_dir_path")).anyTimes(); replay(sfs, mockFs); - ServiceApiUtil.validateAndResolveApplication(application, sfs, + ServiceApiUtil.validateAndResolveService(service, sfs, new YarnConfiguration()); } catch (Exception e) { throw new Exception("exception loading " + resource + ":" + e.toString()); 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestValidateServiceNames.java similarity index 88% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestValidateServiceNames.java index 98c78d3d63..6159215394 100644 --- 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/conf/TestValidateServiceNames.java @@ -18,6 +18,8 @@ package org.apache.hadoop.yarn.service.conf; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.yarn.service.utils.ServiceApiUtil; import org.apache.hadoop.yarn.service.utils.SliderUtils; import org.junit.Assert; import org.junit.Test; @@ -31,15 +33,16 @@ public class TestValidateServiceNames { void assertValidName(String name) { - boolean valid = SliderUtils.isClusternameValid(name); - Assert.assertTrue("Clustername '" + name + "' mistakenly declared invalid", - valid); + ServiceApiUtil.validateNameFormat(name, new Configuration()); } void assertInvalidName(String name) { - boolean valid = SliderUtils.isClusternameValid(name); - Assert.assertFalse("Clustername '\" + name + \"' mistakenly declared valid", - valid); + try { + ServiceApiUtil.validateNameFormat(name, new Configuration()); + Assert.fail(); + } catch (IllegalArgumentException e) { + // + } } void assertInvalid(List names) { 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/monitor/TestServiceMonitor.java similarity index 95% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/monitor/TestServiceMonitor.java index 6f5653f902..0e03a2c1b6 100644 --- 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/monitor/TestServiceMonitor.java @@ -17,7 +17,7 @@ */ -package org.apache.hadoop.yarn.service.servicemonitor; +package org.apache.hadoop.yarn.service.monitor; import org.apache.commons.io.FileUtils; import org.apache.hadoop.yarn.api.records.ApplicationId; @@ -25,7 +25,7 @@ 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.Service; import org.apache.hadoop.yarn.service.api.records.Component; import org.apache.hadoop.yarn.service.conf.YarnServiceConf; import org.junit.After; @@ -68,7 +68,7 @@ public void tearDown() throws IOException { @Test public void testComponentDependency() throws Exception{ ApplicationId applicationId = ApplicationId.newInstance(123456, 1); - Application exampleApp = new Application(); + Service exampleApp = new Service(); exampleApp.setId(applicationId.toString()); exampleApp.setName("testComponentDependency"); exampleApp.addComponent(createComponent("compa", 1, "sleep 1000")); 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestAbstractClientProvider.java similarity index 100% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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/TestProviderFactory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestProviderFactory.java similarity index 94% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestProviderFactory.java index 489578dfa3..56f4555b16 100644 --- 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/providers/TestProviderFactory.java @@ -42,7 +42,7 @@ public class TestProviderFactory { @Test public void testDockerFactory() throws Throwable { ProviderFactory factory = ProviderFactory - .createSliderProviderFactory(new Artifact().type(TypeEnum.DOCKER)); + .createServiceProviderFactory(new Artifact().type(TypeEnum.DOCKER)); assertTrue(factory instanceof DockerProviderFactory); assertTrue(factory.createClientProvider() instanceof DockerClientProvider); assertTrue(factory.createServerProvider() instanceof DockerProviderService); @@ -53,7 +53,7 @@ public void testDockerFactory() throws Throwable { @Test public void testTarballFactory() throws Throwable { ProviderFactory factory = ProviderFactory - .createSliderProviderFactory(new Artifact().type(TypeEnum.TARBALL)); + .createServiceProviderFactory(new Artifact().type(TypeEnum.TARBALL)); assertTrue(factory instanceof TarballProviderFactory); assertTrue(factory.createClientProvider() instanceof TarballClientProvider); assertTrue(factory.createServerProvider() instanceof @@ -65,7 +65,7 @@ public void testTarballFactory() throws Throwable { @Test public void testDefaultFactory() throws Throwable { ProviderFactory factory = ProviderFactory - .createSliderProviderFactory(null); + .createServiceProviderFactory(null); assertTrue(factory instanceof DefaultProviderFactory); assertTrue(factory.createClientProvider() instanceof DefaultClientProvider); assertTrue(factory.createServerProvider() instanceof DefaultProviderService); 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java similarity index 91% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java index a891df89a3..b742553a5a 100644 --- 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-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java @@ -28,16 +28,16 @@ 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.Service; +import org.apache.hadoop.yarn.service.api.records.ServiceState; 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.apache.hadoop.yarn.service.component.instance.ComponentInstance; +import org.apache.hadoop.yarn.service.component.instance.ComponentInstanceId; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -100,9 +100,9 @@ public void tearDown() throws Exception { @Test public void testServiceAttemptEntity() { - Application application = createMockApplication(); + Service service = createMockApplication(); serviceTimelinePublisher - .serviceAttemptRegistered(application, new YarnConfiguration()); + .serviceAttemptRegistered(service, new YarnConfiguration()); Collection lastPublishedEntities = ((DummyTimelineClient) timelineClient).getLastPublishedEntities(); @@ -119,7 +119,7 @@ public void testServiceAttemptEntity() { ServiceContext context = new ServiceContext(); context.attemptId = ApplicationAttemptId - .newInstance(ApplicationId.fromString(application.getId()), 1); + .newInstance(ApplicationId.fromString(service.getId()), 1); String exitDiags = "service killed"; serviceTimelinePublisher.serviceAttemptUnregistered(context, exitDiags); lastPublishedEntities = @@ -179,7 +179,7 @@ private void verifyServiceAttemptTimelineEntity(TimelineEntity timelineEntity, assertEquals(SERVICE_NAME, timelineEntity.getInfo().get(ServiceTimelineMetricsConstants.NAME)); if (isRegistedEntity) { - assertEquals(ApplicationState.STARTED.toString(), + assertEquals(ServiceState.STARTED.toString(), timelineEntity.getInfo().get(ServiceTimelineMetricsConstants.STATE)); assertEquals(ServiceTimelineEvent.SERVICE_ATTEMPT_REGISTERED.toString(), timelineEntity.getEvents().iterator().next().getId()); @@ -214,14 +214,14 @@ private void verifyComponentTimelineEntity(TimelineEntity entity) { info.get(ServiceTimelineMetricsConstants.PLACEMENT_POLICY)); } - private static Application createMockApplication() { - Application application = mock(Application.class); + private static Service createMockApplication() { + Service service = mock(Service.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( + when(service.getId()).thenReturn(SERVICEID); + when(service.getLaunchTime()).thenReturn(new Date()); + when(service.getState()).thenReturn(ServiceState.STARTED); + when(service.getName()).thenReturn(SERVICE_NAME); + when(service.getConfiguration()).thenReturn( new org.apache.hadoop.yarn.service.api.records.Configuration()); Component component = mock(Component.class); @@ -243,8 +243,8 @@ private static Application createMockApplication() { List components = new ArrayList(); components.add(component); - when(application.getComponents()).thenReturn(components); - return application; + when(service.getComponents()).thenReturn(components); + return service; } protected static class DummyTimelineClient extends TimelineV2ClientImpl { 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-services/hadoop-yarn-services-core/src/test/resources/example-app.json similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/example-app.json rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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/org/apache/hadoop/yarn/service/conf/examples/app-override.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app-override.json similarity index 100% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app.json similarity index 92% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app.json index a163b3373f..12b51e48f2 100644 --- 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-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/app.json @@ -1,5 +1,6 @@ { - "name": "app-1", + "name": "service-1", + "id" : "application_1503358878042_0011", "lifetime": "3600", "launch_command": "sleep 3600", "configuration": { 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-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/default.json similarity index 100% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-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/external0.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external0.json similarity index 76% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external0.json index 1f9dfeb4b5..0857f62cec 100644 --- 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-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external0.json @@ -2,7 +2,7 @@ "name": "external-0", "lifetime": "3600", "artifact": { - "type": "APPLICATION", + "type": "SERVICE", "id": "app-1" } } 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-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external1.json similarity index 93% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external1.json index 03ebce5140..4afdb8b23a 100644 --- 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-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external1.json @@ -5,7 +5,7 @@ { "name": "simple", "artifact": { - "type": "APPLICATION", + "type": "SERVICE", "id": "app-1" } }, 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-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external2.json similarity index 91% rename from 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 rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external2.json index 9e61fba387..0df8e0aac7 100644 --- 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-services/hadoop-yarn-services-core/src/test/resources/org/apache/hadoop/yarn/service/conf/examples/external2.json @@ -5,7 +5,7 @@ { "name": "ext", "artifact": { - "type": "APPLICATION", + "type": "SERVICE", "id": "external-1" } }, 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-services/hadoop-yarn-services-core/src/test/resources/yarn-site.xml similarity index 100% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/test/resources/yarn-site.xml rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/resources/yarn-site.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-services/pom.xml similarity index 88% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/pom.xml rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/pom.xml index 6a208d8bd4..1233804709 100644 --- 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-services/pom.xml @@ -22,9 +22,8 @@ 3.0.0-beta1-SNAPSHOT 4.0.0 - org.apache.hadoop - hadoop-yarn-slider - Apache Hadoop YARN Slider + hadoop-yarn-services + Apache Hadoop YARN Services pom @@ -34,6 +33,6 @@ - hadoop-yarn-slider-core + hadoop-yarn-services-core diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/assembly/executable-jar.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/assembly/executable-jar.xml deleted file mode 100644 index 23383c852e..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/assembly/executable-jar.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - distribution - - zip - - true - - - ${project.build.directory} - / - - *.jar - - - - - - runtime - /lib - - false - - false - - - \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/BaseRestClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/BaseRestClient.java deleted file mode 100644 index 2d01befc35..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/BaseRestClient.java +++ /dev/null @@ -1,149 +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.rest; - -import com.google.common.base.Preconditions; -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientHandlerException; -import com.sun.jersey.api.client.GenericType; -import com.sun.jersey.api.client.UniformInterfaceException; -import com.sun.jersey.api.client.WebResource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.ws.rs.core.MediaType; -import java.io.IOException; -import java.net.URI; - - -/** - * This is a base class for Jersey REST clients in Slider. - * It supports the execution of operations —with - * exceptions uprated to IOExceptions when needed. - *

- * Subclasses can use these operations to provide an API-like view - * of the REST model - */ -public class BaseRestClient { - private static final Logger log = - LoggerFactory.getLogger(BaseRestClient.class); - private final Client client; - - public BaseRestClient( - Client client) { - Preconditions.checkNotNull(client, "null jersey client"); - this.client = client; - } - - /** - * Get the jersey client - * @return jersey client - */ - public Client getClient() { - return client; - } - - /** - * Execute the operation. Failures are raised as IOException subclasses - * @param method method to execute - * @param resource resource to work against - * @param c class to build - * @param type expected - * @return an instance of the type T - * @throws IOException on any failure - */ - public T exec(HttpVerb method, WebResource resource, Class c) - throws IOException { - try { - Preconditions.checkArgument(c != null); - log.debug("{}} {}", method, resource.getURI()); - return resource.accept(MediaType.APPLICATION_JSON_TYPE) - .method(method.getVerb(), c); - } catch (ClientHandlerException ex) { - throw ExceptionConverter.convertJerseyException(method.getVerb(), - resource.getURI().toString(), - ex); - } catch (UniformInterfaceException ex) { - throw UgiJerseyBinding.uprateFaults(method, - resource.getURI().toString(), - ex); - } - } - - /** - * Execute the operation. Failures are raised as IOException subclasses - * @param method method to execute - * @param resource resource to work against - * @param t type to work with - * @param type expected - * @return an instance of the type T - * @throws IOException on any failure - */ - public T exec(HttpVerb method, WebResource resource, GenericType t) - throws IOException { - try { - Preconditions.checkArgument(t != null); - log.debug("{}} {}", method, resource.getURI()); - resource.accept(MediaType.APPLICATION_JSON_TYPE); - return resource.method(method.getVerb(), t); - } catch (ClientHandlerException ex) { - throw ExceptionConverter.convertJerseyException(method.getVerb(), - resource.getURI().toString(), - ex); - } catch (UniformInterfaceException ex) { - throw UgiJerseyBinding.uprateFaults(method, resource.getURI().toString(), - ex); - } - } - - - /** - * Execute the GET operation. Failures are raised as IOException subclasses - * @param resource resource to work against - * @param c class to build - * @param type expected - * @return an instance of the type T - * @throws IOException on any failure - */ - public T get(WebResource resource, Class c) throws IOException { - return exec(HttpVerb.GET, resource, c); - } - - /** - * Create a Web resource from the client. - * - * @param u the URI of the resource. - * @return the Web resource. - */ - public WebResource resource(URI u) { - return client.resource(u); - } - - /** - * Create a Web resource from the client. - * - * @param url the URI of the resource. - * @return the Web resource. - */ - - public WebResource resource(String url) { - return client.resource(url); - } - -} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/ExceptionConverter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/ExceptionConverter.java deleted file mode 100644 index 12fdc7942c..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/ExceptionConverter.java +++ /dev/null @@ -1,128 +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.rest; - -import com.sun.jersey.api.client.ClientHandlerException; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.UniformInterfaceException; -import org.apache.hadoop.fs.InvalidRequestException; -import org.apache.hadoop.fs.PathAccessDeniedException; -import org.apache.hadoop.fs.PathIOException; -import org.apache.hadoop.yarn.webapp.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.servlet.http.HttpServletResponse; -import java.io.FileNotFoundException; -import java.io.IOException; - -/** - * static methods to convert exceptions into different types, including - * extraction of details and finer-grained conversions. - */ -public class ExceptionConverter { - private static final Logger - log = LoggerFactory.getLogger(ExceptionConverter.class); - - /** - * Uprate error codes 400 and up into faults; - * 404 is converted to a {@link FileNotFoundException}, - * 401 to {@link ForbiddenException} - * FileNotFoundException for an unknown resource - * PathAccessDeniedException for access denied - * PathIOException for anything else - * @param verb HTTP Verb used - * @param targetURL URL being targeted - * @param exception original exception - * @return a new exception, the original one nested as a cause - */ - public static IOException convertJerseyException(String verb, - String targetURL, - UniformInterfaceException exception) { - - IOException ioe = null; - ClientResponse response = exception.getResponse(); - if (response != null) { - int status = response.getStatus(); - String body = ""; - try { - if (response.hasEntity()) { - body = response.getEntity(String.class); - log.error("{} {} returned status {} and body\n{}", - verb, targetURL, status, body); - } else { - log.error("{} {} returned status {} and empty body", - verb, targetURL, status); - } - } catch (Exception e) { - log.warn("Failed to extract body from client response", e); - } - - if (status == HttpServletResponse.SC_UNAUTHORIZED - || status == HttpServletResponse.SC_FORBIDDEN) { - ioe = new PathAccessDeniedException(targetURL); - } else if (status == HttpServletResponse.SC_BAD_REQUEST - || status == HttpServletResponse.SC_NOT_ACCEPTABLE - || status == HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE) { - // bad request - ioe = new InvalidRequestException( - String.format("Bad %s request: status code %d against %s", - verb, status, targetURL)); - } else if (status > 400 && status < 500) { - ioe = new FileNotFoundException(targetURL); - } - if (ioe == null) { - ioe = new PathIOException(targetURL, - verb + " " + targetURL - + " failed with status code : " + status - + ":" + exception); - } - } else { - ioe = new PathIOException(targetURL, - verb + " " + targetURL + " failed: " + exception); - } - ioe.initCause(exception); - return ioe; - } - - /** - * Handle a client-side Jersey exception. - *

- * If there's an inner IOException, return that. - *

- * Otherwise: create a new wrapper IOE including verb and target details - * @param verb HTTP Verb used - * @param targetURL URL being targeted - * @param exception original exception - * @return an exception to throw - */ - public static IOException convertJerseyException(String verb, - String targetURL, - ClientHandlerException exception) { - if (exception.getCause() instanceof IOException) { - return (IOException)exception.getCause(); - } else { - IOException ioe = new IOException( - verb + " " + targetURL + " failed: " + exception); - ioe.initCause(exception); - return ioe; - } - } - -} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/HttpVerb.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/HttpVerb.java deleted file mode 100644 index 93f9082bb7..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/HttpVerb.java +++ /dev/null @@ -1,57 +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.rest; - -/** - * Http verbs with details on what they support in terms of submit and - * response bodies. - *

- * Those verbs which do support bodies in the response MAY NOT return it; - * if the response code is 204 then the answer is "no body", but the operation - * is considered a success. - */ -public enum HttpVerb { - GET("GET", false, true), - POST("POST", true, true), - PUT("PUT", true, true), - DELETE("DELETE", false, true), - HEAD("HEAD", false, false); - - private final String verb; - private final boolean hasUploadBody; - private final boolean hasResponseBody; - - HttpVerb(String verb, boolean hasUploadBody, boolean hasResponseBody) { - this.verb = verb; - this.hasUploadBody = hasUploadBody; - this.hasResponseBody = hasResponseBody; - } - - public String getVerb() { - return verb; - } - - public boolean hasUploadBody() { - return hasUploadBody; - } - - public boolean hasResponseBody() { - return hasResponseBody; - } -} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/SliderURLConnectionFactory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/SliderURLConnectionFactory.java deleted file mode 100644 index fcd7f553b5..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/SliderURLConnectionFactory.java +++ /dev/null @@ -1,176 +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.rest; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hdfs.web.KerberosUgiAuthenticator; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.security.authentication.client.AuthenticatedURL; -import org.apache.hadoop.security.authentication.client.AuthenticationException; -import org.apache.hadoop.security.authentication.client.ConnectionConfigurator; -import org.apache.hadoop.security.ssl.SSLFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSocketFactory; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLConnection; -import java.security.GeneralSecurityException; - -/** - * Factory for URL connections; used behind the scenes in the Jersey integration. - *

- * Derived from the WebHDFS implementation. - */ -public class SliderURLConnectionFactory { - private static final Logger log = - LoggerFactory.getLogger(SliderURLConnectionFactory.class); - - /** - * Timeout for socket connects and reads - */ - public final static int DEFAULT_SOCKET_TIMEOUT = 60 * 1000; // 1 minute - private final ConnectionConfigurator connConfigurator; - - private static final ConnectionConfigurator DEFAULT_CONFIGURATOR = new BasicConfigurator(); - - /** - * Construct a new URLConnectionFactory based on the configuration. It will - * try to load SSL certificates when it is specified. - */ - public static SliderURLConnectionFactory newInstance(Configuration conf) { - ConnectionConfigurator conn; - try { - conn = newSslConnConfigurator(DEFAULT_SOCKET_TIMEOUT, conf); - } catch (Exception e) { - log.debug("Cannot load customized SSL configuration.", e); - conn = DEFAULT_CONFIGURATOR; - } - return new SliderURLConnectionFactory(conn); - } - - private SliderURLConnectionFactory(ConnectionConfigurator connConfigurator) { - this.connConfigurator = connConfigurator; - } - - /** - * Create a new ConnectionConfigurator for SSL connections - */ - private static ConnectionConfigurator newSslConnConfigurator(final int timeout, - Configuration conf) throws IOException, GeneralSecurityException { - final SSLFactory factory; - final SSLSocketFactory sf; - final HostnameVerifier hv; - - factory = new SSLFactory(SSLFactory.Mode.CLIENT, conf); - factory.init(); - sf = factory.createSSLSocketFactory(); - hv = factory.getHostnameVerifier(); - - return new ConnectionConfigurator() { - @Override - public HttpURLConnection configure(HttpURLConnection conn) - throws IOException { - if (conn instanceof HttpsURLConnection) { - HttpsURLConnection c = (HttpsURLConnection) conn; - c.setSSLSocketFactory(sf); - c.setHostnameVerifier(hv); - } - SliderURLConnectionFactory.setupConnection(conn, timeout); - return conn; - } - }; - } - - /** - * Opens a url with read and connect timeouts - * - * @param url - * to open - * @return URLConnection - * @throws IOException - */ - public URLConnection openConnection(URL url) throws IOException { - try { - return openConnection(url, false); - } catch (AuthenticationException e) { - // Unreachable - return null; - } - } - - /** - * Opens a url with read and connect timeouts - * - * @param url - * URL to open - * @param isSpnego - * whether the url should be authenticated via SPNEGO - * @return URLConnection - * @throws IOException - * @throws AuthenticationException - */ - public URLConnection openConnection(URL url, boolean isSpnego) - throws IOException, AuthenticationException { - if (isSpnego) { - log.debug("open AuthenticatedURL connection {}", url); - UserGroupInformation.getCurrentUser().checkTGTAndReloginFromKeytab(); - final AuthenticatedURL.Token authToken = new AuthenticatedURL.Token(); - return new AuthenticatedURL(new KerberosUgiAuthenticator(), - connConfigurator).openConnection(url, authToken); - } else { - log.debug("open URL connection {}", url); - URLConnection connection = url.openConnection(); - if (connection instanceof HttpURLConnection) { - connConfigurator.configure((HttpURLConnection) connection); - } - return connection; - } - } - - /** - * Sets connection parameters on the given URLConnection - * - * @param connection - * URLConnection to set - * @param socketTimeout - * the connection and read timeout of the connection. - */ - private static void setupConnection(URLConnection connection, int socketTimeout) { - connection.setConnectTimeout(socketTimeout); - connection.setReadTimeout(socketTimeout); - connection.setUseCaches(false); - if (connection instanceof HttpURLConnection) { - ((HttpURLConnection) connection).setInstanceFollowRedirects(true); - } - } - - private static class BasicConfigurator implements ConnectionConfigurator { - @Override - public HttpURLConnection configure(HttpURLConnection conn) - throws IOException { - SliderURLConnectionFactory.setupConnection(conn, DEFAULT_SOCKET_TIMEOUT); - return conn; - } - } -} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/UgiJerseyBinding.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/UgiJerseyBinding.java deleted file mode 100644 index b3fdef93fc..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/UgiJerseyBinding.java +++ /dev/null @@ -1,153 +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.rest; - -import com.google.common.base.Preconditions; -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.UniformInterfaceException; -import com.sun.jersey.api.client.config.ClientConfig; -import com.sun.jersey.api.client.config.DefaultClientConfig; -import com.sun.jersey.api.json.JSONConfiguration; -import com.sun.jersey.client.urlconnection.HttpURLConnectionFactory; -import com.sun.jersey.client.urlconnection.URLConnectionClientHandler; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.security.authentication.client.AuthenticationException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; - -/** - * Class to bond to a Jersey client, for UGI integration and SPNEGO. - *

- * Usage: create an instance, then when creating a Jersey Client - * pass in to the constructor the handler provided by {@link #getHandler()} - * - * see Jersey docs - */ -public class UgiJerseyBinding implements - HttpURLConnectionFactory { - private static final Logger log = - LoggerFactory.getLogger(UgiJerseyBinding.class); - - private final UrlConnectionOperations operations; - private final URLConnectionClientHandler handler; - - /** - * Construct an instance - * @param operations operations instance - */ - @SuppressWarnings("ThisEscapedInObjectConstruction") - public UgiJerseyBinding(UrlConnectionOperations operations) { - Preconditions.checkArgument(operations != null, "Null operations"); - this.operations = operations; - handler = new URLConnectionClientHandler(this); - } - - /** - * Create an instance off the configuration. The SPNEGO policy - * is derived from the current UGI settings. - * @param conf config - */ - public UgiJerseyBinding(Configuration conf) { - this(new UrlConnectionOperations(conf)); - } - - /** - * Get a URL connection. - * @param url URL to connect to - * @return the connection - * @throws IOException any problem. {@link AuthenticationException} - * errors are wrapped - */ - @Override - public HttpURLConnection getHttpURLConnection(URL url) throws IOException { - try { - // open a connection handling status codes and so redirections - // but as it opens a connection, it's less useful than you think. - - return operations.openConnection(url); - } catch (AuthenticationException e) { - throw new IOException(e); - } - } - - public UrlConnectionOperations getOperations() { - return operations; - } - - public URLConnectionClientHandler getHandler() { - return handler; - } - - /** - * Get the SPNEGO flag (as found in the operations instance - * @return the spnego policy - */ - public boolean isUseSpnego() { - return operations.isUseSpnego(); - } - - - /** - * Uprate error codes 400 and up into faults; - *

- * see {@link ExceptionConverter#convertJerseyException(String, String, UniformInterfaceException)} - */ - public static IOException uprateFaults(HttpVerb verb, String url, - UniformInterfaceException ex) - throws IOException { - return ExceptionConverter.convertJerseyException(verb.getVerb(), - url, ex); - } - - /** - * Create the standard Jersey client Config - * @return the recommended Jersey Client config - */ - public ClientConfig createJerseyClientConfig() { - ClientConfig clientConfig = new DefaultClientConfig(); - clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, true); - return clientConfig; - } - - /** - * Create a jersey client bonded to this handler, using the - * supplied client config - * @param clientConfig client configuratin - * @return a new client instance to use - */ - public Client createJerseyClient(ClientConfig clientConfig) { - return new Client(getHandler(), clientConfig); - } - - /** - * Create a jersey client bonded to this handler, using the - * client config created with {@link #createJerseyClientConfig()} - * @return a new client instance to use - */ - public Client createJerseyClient() { - return createJerseyClient(createJerseyClientConfig()); - } - -} - - diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/UrlConnectionOperations.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/UrlConnectionOperations.java deleted file mode 100644 index d7f768e88b..0000000000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/hadoop/yarn/service/rest/UrlConnectionOperations.java +++ /dev/null @@ -1,83 +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.rest; - -import com.google.common.base.Preconditions; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.conf.Configured; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.security.authentication.client.AuthenticationException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; - -/** - * Operations on the JDK UrlConnection class. - * - */ -public class UrlConnectionOperations extends Configured { - private static final Logger log = - LoggerFactory.getLogger(UrlConnectionOperations.class); - - private SliderURLConnectionFactory connectionFactory; - - private boolean useSpnego = false; - - /** - * Create an instance off the configuration. The SPNEGO policy - * is derived from the current UGI settings. - * @param conf config - */ - public UrlConnectionOperations(Configuration conf) { - super(conf); - connectionFactory = SliderURLConnectionFactory.newInstance(conf); - if (UserGroupInformation.isSecurityEnabled()) { - log.debug("SPNEGO is enabled"); - setUseSpnego(true); - } - } - - - public boolean isUseSpnego() { - return useSpnego; - } - - public void setUseSpnego(boolean useSpnego) { - this.useSpnego = useSpnego; - } - - /** - * Opens a url with cache disabled, redirect handled in - * (JDK) implementation. - * - * @param url to open - * @return URLConnection - * @throws IOException - * @throws AuthenticationException authentication failure - */ - public HttpURLConnection openConnection(URL url) throws - IOException, - AuthenticationException { - Preconditions.checkArgument(url.getPort() != 0, "no port"); - return (HttpURLConnection) connectionFactory.openConnection(url, useSpnego); - } -} 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 3adbaa4969..0000000000 --- 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 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 c87f77cfba..0000000000 --- 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 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 1b06224b2f..0000000000 --- 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" - } - } -} 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 2922655ade..0000000000 --- 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 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 0fc5ceb2c7..4fb579c02f 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 @@ hadoop-yarn-applications-distributedshell hadoop-yarn-applications-unmanaged-am-launcher - hadoop-yarn-slider + hadoop-yarn-services hadoop-yarn-services-api 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 4a048afeb7..fa54a0992b 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 @@ + + # YARN DNS Server ## Introduction 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 e69de29bb2..89fefe9e5b 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 @@ + \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/pom.xml b/hadoop-yarn-project/hadoop-yarn/pom.xml index 5440738849..e4e611b6be 100644 --- a/hadoop-yarn-project/hadoop-yarn/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/pom.xml @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-javadoc-plugin - org.apache.hadoop.yarn.proto:org.apache.hadoop.yarn.federation.proto:org.apache.slider + org.apache.hadoop.yarn.proto:org.apache.hadoop.yarn.federation.proto:org.apache.hadoop.yarn.service