hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jia...@apache.org
Subject [44/84] [abbrv] hadoop git commit: YARN-7050. Post cleanup after YARN-6903, removal of org.apache.slider package. Contributed by Jian He
Date Tue, 12 Sep 2017 00:35:46 GMT
YARN-7050. Post cleanup after YARN-6903, removal of org.apache.slider package. Contributed by Jian He


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d44876af
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d44876af
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d44876af

Branch: refs/heads/yarn-native-services
Commit: d44876affa6a68a01d2354263b84384699bed8b1
Parents: f3241f1
Author: Billie Rinaldi <billie@apache.org>
Authored: Wed Aug 23 12:31:47 2017 -0700
Committer: Jian He <jianhe@apache.org>
Committed: Mon Sep 11 17:23:21 2017 -0700

----------------------------------------------------------------------
 .../assemblies/hadoop-yarn-services-dist.xml    |   30 +
 .../assemblies/hadoop-yarn-slider-dist.xml      |   30 -
 hadoop-yarn-project/hadoop-yarn/bin/yarn        |    8 +-
 .../service/webapp/ApplicationApiService.java   |  275 ++
 .../service/webapp/ApplicationApiWebApp.java    |  123 +
 .../yarn/services/api/ApplicationApi.java       |   36 -
 .../api/impl/ApplicationApiService.java         |  288 --
 .../services/webapp/ApplicationApiWebApp.java   |  125 -
 ...RN-Simplified-V1-API-Layer-For-Services.yaml |    3 -
 .../src/main/webapp/WEB-INF/web.xml             |    2 +-
 .../dev-support/findbugs-exclude.xml            |   93 +-
 .../conf/slideram-log4j.properties              |   68 -
 .../conf/yarnservice-log4j.properties           |   62 +
 .../hadoop-yarn-slider-core/pom.xml             |   30 +-
 .../slider/server/avro/RoleHistoryRecord.avsc   |  114 -
 .../apache/hadoop/security/KerberosDiags.java   |  677 -----
 .../yarn/service/ContainerFailureTracker.java   |    4 +-
 .../yarn/service/ContainerLaunchService.java    |  101 -
 .../hadoop/yarn/service/ServiceContext.java     |    6 +-
 .../hadoop/yarn/service/ServiceMaster.java      |    9 +-
 .../hadoop/yarn/service/ServiceMonitor.java     |  149 -
 .../hadoop/yarn/service/ServiceScheduler.java   |   44 +-
 .../api/constants/ServiceApiConstants.java      |   69 +
 .../yarn/service/api/records/Application.java   |  466 +++
 .../service/api/records/ApplicationState.java   |   33 +
 .../service/api/records/ApplicationStatus.java  |  148 +
 .../yarn/service/api/records/Artifact.java      |  160 +
 .../yarn/service/api/records/BaseResource.java  |   52 +
 .../yarn/service/api/records/Component.java     |  412 +++
 .../yarn/service/api/records/ConfigFile.java    |  225 ++
 .../yarn/service/api/records/ConfigFormat.java  |   67 +
 .../yarn/service/api/records/Configuration.java |  225 ++
 .../yarn/service/api/records/Container.java     |  297 ++
 .../service/api/records/ContainerState.java     |   30 +
 .../hadoop/yarn/service/api/records/Error.java  |  129 +
 .../service/api/records/PlacementPolicy.java    |  102 +
 .../service/api/records/ReadinessCheck.java     |  175 ++
 .../yarn/service/api/records/Resource.java      |  159 +
 .../hadoop/yarn/service/client/ServiceCLI.java  |   14 +-
 .../yarn/service/client/ServiceClient.java      |  249 +-
 .../client/params/AbstractActionArgs.java       |   34 +-
 .../client/params/AbstractArgsDelegate.java     |   28 +
 .../AbstractClusterBuildingActionArgs.java      |   58 +
 .../service/client/params/ActionBuildArgs.java  |    2 -
 .../service/client/params/ActionClientArgs.java |   71 +
 .../service/client/params/ActionCreateArgs.java |    2 -
 .../client/params/ActionDependencyArgs.java     |    4 +-
 .../service/client/params/ActionExistsArgs.java |   49 +
 .../service/client/params/ActionFlexArgs.java   |    7 +-
 .../service/client/params/ActionFreezeArgs.java |   56 +
 .../service/client/params/ActionHelpArgs.java   |   44 +
 .../service/client/params/ActionKDiagArgs.java  |   76 +
 .../service/client/params/ActionKeytabArgs.java |   76 +
 .../service/client/params/ActionListArgs.java   |   76 +
 .../client/params/ActionRegistryArgs.java       |  218 ++
 .../client/params/ActionResolveArgs.java        |  153 +
 .../client/params/ActionResourceArgs.java       |   70 +
 .../service/client/params/ActionStatusArgs.java |   51 +
 .../service/client/params/ActionThawArgs.java   |   67 +
 .../service/client/params/ActionTokensArgs.java |   78 +
 .../service/client/params/ActionUpdateArgs.java |   32 +
 .../yarn/service/client/params/ArgOps.java      |    4 +-
 .../yarn/service/client/params/Arguments.java   |   37 +-
 .../yarn/service/client/params/ClientArgs.java  |  147 +-
 .../yarn/service/client/params/CommonArgs.java  |   30 +-
 .../client/params/ComponentArgsDelegate.java    |    4 +-
 .../client/params/DontSplitArguments.java       |   34 +
 .../client/params/LaunchArgsAccessor.java       |   30 +
 .../client/params/LaunchArgsDelegate.java       |   51 +
 .../client/params/OptionArgsDelegate.java       |   66 +
 .../client/params/PathArgumentConverter.java    |   34 +
 .../client/params/SliderAMCreateAction.java     |    4 -
 .../service/client/params/SliderActions.java    |   48 +-
 .../service/client/params/WaitArgsDelegate.java |   42 +
 .../service/client/params/WaitTimeAccessor.java |   24 +
 .../service/compinstance/ComponentInstance.java |   20 +-
 .../yarn/service/component/Component.java       |   15 +-
 .../yarn/service/conf/RestApiConstants.java     |   43 +
 .../yarn/service/conf/SliderExitCodes.java      |    2 +-
 .../hadoop/yarn/service/conf/SliderKeys.java    |  195 --
 .../yarn/service/conf/SliderXmlConfKeys.java    |  191 --
 .../yarn/service/conf/YarnServiceConf.java      |   50 +-
 .../yarn/service/conf/YarnServiceConstants.java |   90 +
 .../containerlaunch/AbstractLauncher.java       |  271 ++
 .../containerlaunch/ClasspathConstructor.java   |  172 ++
 .../containerlaunch/CommandLineBuilder.java     |   86 +
 .../containerlaunch/ContainerLaunchService.java |  101 +
 .../containerlaunch/CredentialUtils.java        |  319 ++
 .../containerlaunch/JavaCommandLineBuilder.java |  181 ++
 .../exceptions/BadClusterStateException.java    |   36 +
 .../BadCommandArgumentsException.java           |   30 +
 .../service/exceptions/BadConfigException.java  |   39 +
 .../yarn/service/exceptions/ErrorStrings.java   |   57 +
 .../service/exceptions/ExitCodeProvider.java    |   32 +
 .../service/exceptions/LauncherExitCodes.java   |  196 ++
 .../exceptions/RestApiErrorMessages.java        |   92 +
 .../exceptions/ServiceLaunchException.java      |   73 +
 .../service/exceptions/SliderException.java     |   66 +
 .../yarn/service/exceptions/UsageException.java |   34 +
 .../provider/AbstractClientProvider.java        |   14 +-
 .../provider/AbstractProviderService.java       |   18 +-
 .../yarn/service/provider/ProviderFactory.java  |    3 +-
 .../yarn/service/provider/ProviderService.java  |    8 +-
 .../yarn/service/provider/ProviderUtils.java    |  111 +-
 .../defaultImpl/DefaultClientProvider.java      |    4 +-
 .../defaultImpl/DefaultProviderService.java     |    6 +-
 .../provider/docker/DockerClientProvider.java   |   10 +-
 .../provider/docker/DockerProviderService.java  |    6 +-
 .../provider/tarball/TarballClientProvider.java |   10 +-
 .../tarball/TarballProviderService.java         |    6 +-
 .../registry/CustomRegistryConstants.java       |   57 +
 .../registry/YarnRegistryViewForProviders.java  |  225 ++
 .../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 +
 .../service/servicemonitor/ServiceMonitor.java  |  148 +
 .../service/servicemonitor/probe/HttpProbe.java |  110 +
 .../servicemonitor/probe/LogEntryBuilder.java   |   76 +
 .../servicemonitor/probe/MonitorKeys.java       |   66 +
 .../servicemonitor/probe/MonitorUtils.java      |   84 +
 .../service/servicemonitor/probe/PortProbe.java |   98 +
 .../service/servicemonitor/probe/Probe.java     |  100 +
 .../servicemonitor/probe/ProbeStatus.java       |  160 +
 .../ServiceTimelineMetricsConstants.java        |    3 -
 .../ServiceTimelinePublisher.java               |  120 +-
 .../utils/ApplicationReportSerDeser.java        |   56 +
 .../service/utils/ClientRegistryBinder.java     |  201 ++
 .../hadoop/yarn/service/utils/Comparators.java  |   62 +
 .../hadoop/yarn/service/utils/ConfigHelper.java |  157 +
 .../hadoop/yarn/service/utils/ConfigUtils.java  |   97 +
 .../yarn/service/utils/CoreFileSystem.java      |  521 ++++
 .../hadoop/yarn/service/utils/Duration.java     |  109 +
 .../hadoop/yarn/service/utils/JsonSerDeser.java |  249 ++
 .../yarn/service/utils/KerberosDiags.java       |  680 +++++
 .../yarn/service/utils/PatternValidator.java    |   58 +
 .../hadoop/yarn/service/utils/PortScanner.java  |  113 +
 .../service/utils/PublishedConfiguration.java   |  196 ++
 .../utils/PublishedConfigurationOutputter.java  |  212 ++
 .../utils/SerializedApplicationReport.java      |   98 +
 .../yarn/service/utils/ServiceApiUtil.java      |   24 +-
 .../service/utils/ServiceRegistryUtils.java     |   71 +
 .../yarn/service/utils/SliderFileSystem.java    |   51 +
 .../hadoop/yarn/service/utils/SliderUtils.java  | 1699 +++++++++++
 .../yarn/service/utils/ZookeeperUtils.java      |  146 +
 .../src/main/java/org/apache/slider/Slider.java |   52 -
 .../java/org/apache/slider/api/ClusterNode.java |  220 --
 .../org/apache/slider/api/InternalKeys.java     |  210 --
 .../java/org/apache/slider/api/OptionKeys.java  |   85 -
 .../org/apache/slider/api/ResourceKeys.java     |  210 --
 .../java/org/apache/slider/api/RoleKeys.java    |  121 -
 .../apache/slider/api/ServiceApiConstants.java  |   69 -
 .../slider/api/SliderClusterProtocol.java       |  152 -
 .../java/org/apache/slider/api/StateValues.java |   63 -
 .../java/org/apache/slider/api/StatusKeys.java  |  117 -
 .../apache/slider/api/resource/Application.java |  463 ---
 .../slider/api/resource/ApplicationState.java   |   30 -
 .../slider/api/resource/ApplicationStatus.java  |  145 -
 .../apache/slider/api/resource/Artifact.java    |  157 -
 .../slider/api/resource/BaseResource.java       |   48 -
 .../apache/slider/api/resource/Component.java   |  449 ---
 .../apache/slider/api/resource/ConfigFile.java  |  222 --
 .../slider/api/resource/Configuration.java      |  222 --
 .../apache/slider/api/resource/Container.java   |  294 --
 .../slider/api/resource/ContainerState.java     |   25 -
 .../org/apache/slider/api/resource/Error.java   |  125 -
 .../slider/api/resource/PlacementPolicy.java    |   99 -
 .../slider/api/resource/ReadinessCheck.java     |  172 --
 .../apache/slider/api/resource/Resource.java    |  156 -
 .../types/ApplicationLivenessInformation.java   |   50 -
 .../slider/api/types/ComponentInformation.java  |  107 -
 .../slider/api/types/ContainerInformation.java  |   58 -
 .../slider/api/types/NodeEntryInformation.java  |   78 -
 .../slider/api/types/NodeInformation.java       |   59 -
 .../slider/api/types/NodeInformationList.java   |   41 -
 .../slider/api/types/PingInformation.java       |   47 -
 .../slider/api/types/RestTypeMarshalling.java   |  257 --
 .../apache/slider/api/types/RoleStatistics.java |   60 -
 .../api/types/SliderInstanceDescription.java    |   54 -
 .../slider/client/ClientRegistryBinder.java     |  201 --
 .../org/apache/slider/client/ClientUtils.java   |  111 -
 .../org/apache/slider/client/SliderClient.java  | 2783 ------------------
 .../apache/slider/client/SliderClientAPI.java   |  258 --
 .../slider/client/SliderYarnClientImpl.java     |  294 --
 .../apache/slider/client/TokensOperation.java   |  108 -
 .../client/ipc/SliderClusterOperations.java     |  355 ---
 .../slider/client/rest/BaseRestClient.java      |  152 -
 .../org/apache/slider/common/Constants.java     |   35 -
 .../common/SliderXMLConfKeysForTesting.java     |   83 -
 .../common/params/AbstractArgsDelegate.java     |   28 -
 .../AbstractClusterBuildingActionArgs.java      |   91 -
 .../common/params/ActionAMSuicideArgs.java      |   46 -
 .../slider/common/params/ActionClientArgs.java  |   71 -
 .../common/params/ActionDiagnosticArgs.java     |   75 -
 .../slider/common/params/ActionExistsArgs.java  |   49 -
 .../slider/common/params/ActionFreezeArgs.java  |   58 -
 .../slider/common/params/ActionHelpArgs.java    |   53 -
 .../slider/common/params/ActionKDiagArgs.java   |   88 -
 .../slider/common/params/ActionKeytabArgs.java  |   76 -
 .../common/params/ActionKillContainerArgs.java  |   39 -
 .../slider/common/params/ActionListArgs.java    |   76 -
 .../slider/common/params/ActionLookupArgs.java  |   78 -
 .../slider/common/params/ActionNodesArgs.java   |   73 -
 .../common/params/ActionRegistryArgs.java       |  221 --
 .../slider/common/params/ActionResolveArgs.java |  155 -
 .../common/params/ActionResourceArgs.java       |   70 -
 .../slider/common/params/ActionStatusArgs.java  |   51 -
 .../slider/common/params/ActionThawArgs.java    |   69 -
 .../slider/common/params/ActionTokensArgs.java  |   80 -
 .../slider/common/params/ActionUpdateArgs.java  |   33 -
 .../slider/common/params/ActionUpgradeArgs.java |   45 -
 .../slider/common/params/ActionVersionArgs.java |   48 -
 .../slider/common/params/AddonArgsDelegate.java |   54 -
 .../common/params/DontSplitArguments.java       |   34 -
 .../common/params/LaunchArgsAccessor.java       |   30 -
 .../common/params/LaunchArgsDelegate.java       |   51 -
 .../common/params/OptionArgsDelegate.java       |   66 -
 .../common/params/PathArgumentConverter.java    |   34 -
 .../common/params/URIArgumentConverter.java     |   40 -
 .../common/params/URLArgumentConverter.java     |   40 -
 .../slider/common/params/WaitArgsDelegate.java  |   42 -
 .../slider/common/params/WaitTimeAccessor.java  |   24 -
 .../apache/slider/common/tools/Comparators.java |   62 -
 .../slider/common/tools/ConfigHelper.java       |  611 ----
 .../slider/common/tools/CoreFileSystem.java     |  700 -----
 .../apache/slider/common/tools/Duration.java    |  109 -
 .../apache/slider/common/tools/PortScanner.java |  113 -
 .../slider/common/tools/SliderFileSystem.java   |   51 -
 .../apache/slider/common/tools/SliderUtils.java | 2548 ----------------
 .../slider/common/tools/SliderVersionInfo.java  |  108 -
 .../slider/core/buildutils/BuildHelper.java     |   48 -
 .../apache/slider/core/conf/MapOperations.java  |  344 ---
 .../exceptions/BadClusterStateException.java    |   35 -
 .../BadCommandArgumentsException.java           |   30 -
 .../core/exceptions/BadConfigException.java     |   39 -
 .../slider/core/exceptions/ErrorStrings.java    |   57 -
 .../core/exceptions/ExceptionConverter.java     |  128 -
 .../core/exceptions/NoSuchNodeException.java    |   32 -
 .../core/exceptions/NotFoundException.java      |   35 -
 .../exceptions/ServiceNotReadyException.java    |   43 -
 .../slider/core/exceptions/SliderException.java |   67 -
 .../SliderInternalStateException.java           |   34 -
 .../TriggerClusterTeardownException.java        |   41 -
 .../UnknownApplicationInstanceException.java    |   51 -
 .../slider/core/exceptions/UsageException.java  |   34 -
 .../core/exceptions/WaitTimeoutException.java   |   34 -
 .../slider/core/launch/AbstractLauncher.java    |  271 --
 .../core/launch/ClasspathConstructor.java       |  172 --
 .../slider/core/launch/CommandLineBuilder.java  |   89 -
 .../slider/core/launch/ContainerLauncher.java   |   48 -
 .../slider/core/launch/CredentialUtils.java     |  379 ---
 .../core/launch/JavaCommandLineBuilder.java     |  182 --
 .../launch/SerializedApplicationReport.java     |   98 -
 .../slider/core/main/ExitCodeProvider.java      |   32 -
 .../org/apache/slider/core/main/IrqHandler.java |  103 -
 .../slider/core/main/LauncherExitCodes.java     |  196 --
 .../org/apache/slider/core/main/RunService.java |   62 -
 .../core/main/ServiceLaunchException.java       |   73 -
 .../slider/core/main/ServiceLauncher.java       |  642 ----
 .../slider/core/main/ServiceShutdownHook.java   |   80 -
 .../core/persist/ApplicationReportSerDeser.java |   57 -
 .../apache/slider/core/persist/Filenames.java   |   28 -
 .../slider/core/persist/JsonSerDeser.java       |  249 --
 .../slider/core/persist/LockHeldAction.java     |   38 -
 .../apache/slider/core/persist/PersistKeys.java |   25 -
 .../core/registry/SliderRegistryUtils.java      |   62 -
 .../slider/core/registry/YarnAppListClient.java |  245 --
 .../core/registry/docstore/ConfigFormat.java    |   62 -
 .../core/registry/docstore/ConfigUtils.java     |   96 -
 .../core/registry/docstore/ExportEntry.java     |  140 -
 .../registry/docstore/PublishedConfigSet.java   |  100 -
 .../docstore/PublishedConfiguration.java        |  196 --
 .../PublishedConfigurationOutputter.java        |  212 --
 .../registry/docstore/PublishedExports.java     |  149 -
 .../docstore/PublishedExportsOutputter.java     |  104 -
 .../registry/docstore/PublishedExportsSet.java  |   98 -
 .../slider/core/registry/docstore/UriMap.java   |   38 -
 .../registry/info/CustomRegistryConstants.java  |   57 -
 .../core/registry/retrieve/AMWebClient.java     |  107 -
 .../registry/retrieve/RegistryRetriever.java    |  183 --
 .../apache/slider/core/restclient/HttpVerb.java |   57 -
 .../restclient/SliderURLConnectionFactory.java  |  176 --
 .../core/restclient/UgiJerseyBinding.java       |  154 -
 .../restclient/UrlConnectionOperations.java     |   90 -
 .../slider/core/zk/BlockingZKWatcher.java       |   67 -
 .../slider/core/zk/MiniZooKeeperCluster.java    |  402 ---
 .../org/apache/slider/core/zk/ZKCallback.java   |   31 -
 .../apache/slider/core/zk/ZKIntegration.java    |  348 ---
 .../apache/slider/core/zk/ZKPathBuilder.java    |   82 -
 .../apache/slider/core/zk/ZookeeperUtils.java   |  147 -
 .../providers/AbstractProviderService.java      |  148 -
 .../apache/slider/providers/MonitorDetail.java  |   43 -
 .../slider/providers/PlacementPolicy.java       |   64 -
 .../providers/PlacementPolicyOptions.java       |   26 -
 .../slider/providers/ProviderCompleted.java     |   29 -
 .../providers/ProviderCompletedCallable.java    |   38 -
 .../apache/slider/providers/ProviderCore.java   |   31 -
 .../apache/slider/providers/ProviderRole.java   |  140 -
 .../appmaster/AppMasterActionOperations.java    |   29 -
 .../server/appmaster/PrivilegedConnectToCM.java |   48 -
 .../appmaster/ProtobufClusterServices.java      |   36 -
 .../server/appmaster/PublishedArtifacts.java    |   31 -
 .../server/appmaster/RoleLaunchService.java     |  168 --
 .../server/appmaster/SliderAppMaster.java       | 2138 --------------
 .../appmaster/actions/ActionFlexCluster.java    |   41 -
 .../server/appmaster/actions/ActionHalt.java    |   59 -
 .../appmaster/actions/ActionKillContainer.java  |   86 -
 .../actions/ActionRegisterServiceInstance.java  |   52 -
 .../appmaster/actions/ActionStartContainer.java |   62 -
 .../appmaster/actions/ActionStopQueue.java      |   56 -
 .../appmaster/actions/ActionStopSlider.java     |  162 -
 .../actions/ActionUpgradeContainers.java        |  106 -
 .../server/appmaster/actions/AsyncAction.java   |  138 -
 .../actions/EscalateOutstandingRequests.java    |   45 -
 .../actions/MonitorComponentInstances.java      |   37 -
 .../actions/ProviderStartupCompleted.java       |   36 -
 .../server/appmaster/actions/QueueAccess.java   |   72 -
 .../server/appmaster/actions/QueueExecutor.java |   90 -
 .../server/appmaster/actions/QueueService.java  |  202 --
 .../actions/RegisterComponentInstance.java      |   57 -
 .../appmaster/actions/RenewingAction.java       |  141 -
 .../appmaster/actions/ResetFailureWindow.java   |   49 -
 .../actions/ReviewAndFlexApplicationSize.java   |   43 -
 .../actions/UnregisterComponentInstance.java    |   51 -
 .../server/appmaster/management/BoolMetric.java |   72 -
 .../management/BoolMetricPredicate.java         |   44 -
 .../server/appmaster/management/LongGauge.java  |   98 -
 .../management/LongMetricFunction.java          |   44 -
 .../appmaster/management/MeterAndCounter.java   |  109 -
 .../management/MetricsAndMonitoring.java        |  170 --
 .../management/MetricsBindingService.java       |  151 -
 .../appmaster/management/MetricsConstants.java  |   58 -
 .../appmaster/management/MetricsKeys.java       |   92 -
 .../management/PrefixedMetricsSet.java          |   53 -
 .../server/appmaster/management/Timestamp.java  |   33 -
 .../management/YarnServiceHealthCheck.java      |   38 -
 .../server/appmaster/monkey/ChaosEntry.java     |   85 -
 .../server/appmaster/monkey/ChaosKillAM.java    |   48 -
 .../appmaster/monkey/ChaosKillContainer.java    |   84 -
 .../appmaster/monkey/ChaosMonkeyService.java    |  138 -
 .../server/appmaster/monkey/ChaosTarget.java    |   24 -
 .../appmaster/monkey/MonkeyPlayAction.java      |   48 -
 .../operations/AbstractRMOperation.java         |   30 -
 .../operations/AsyncRMOperationHandler.java     |  116 -
 .../operations/CancelSingleRequest.java         |   54 -
 .../operations/ContainerReleaseOperation.java   |   47 -
 .../operations/ContainerRequestOperation.java   |   62 -
 .../operations/RMOperationHandler.java          |   32 -
 .../operations/RMOperationHandlerActions.java   |   68 -
 .../operations/UpdateBlacklistOperation.java    |   45 -
 .../slider/server/appmaster/rpc/RpcBinder.java  |  307 --
 .../appmaster/rpc/SliderAMPolicyProvider.java   |   41 -
 .../appmaster/rpc/SliderClusterProtocolPB.java  |   27 -
 .../rpc/SliderClusterProtocolPBImpl.java        |  225 --
 .../rpc/SliderClusterProtocolProxy.java         |  270 --
 .../server/appmaster/rpc/SliderIPCService.java  |  406 ---
 .../appmaster/rpc/SliderRPCSecurityInfo.java    |   87 -
 .../security/SecurityConfiguration.java         |  161 -
 .../state/AbstractClusterServices.java          |   61 -
 .../slider/server/appmaster/state/AppState.java | 2120 -------------
 .../appmaster/state/AppStateBindingInfo.java    |   60 -
 .../state/ContainerAllocationOutcome.java       |   44 -
 .../state/ContainerAllocationResults.java       |   50 -
 .../appmaster/state/ContainerAssignment.java    |   60 -
 .../appmaster/state/ContainerOutcome.java       |   61 -
 .../appmaster/state/ContainerPriority.java      |  109 -
 .../state/ContainerReleaseSelector.java         |   37 -
 .../MostRecentContainerReleaseSelector.java     |   51 -
 .../server/appmaster/state/NodeEntry.java       |  325 --
 .../server/appmaster/state/NodeInstance.java    |  419 ---
 .../slider/server/appmaster/state/NodeMap.java  |  174 --
 .../appmaster/state/OutstandingRequest.java     |  428 ---
 .../state/OutstandingRequestTracker.java        |  482 ---
 .../appmaster/state/ProviderAppState.java       |  277 --
 .../server/appmaster/state/RoleHistory.java     | 1123 -------
 .../appmaster/state/RoleHistoryUtils.java       |   50 -
 .../appmaster/state/RoleHostnamePair.java       |   75 -
 .../server/appmaster/state/RoleInstance.java    |  343 ---
 .../server/appmaster/state/RoleStatus.java      |  367 ---
 .../appmaster/state/SimpleReleaseSelector.java  |   33 -
 .../state/StateAccessForProviders.java          |  275 --
 .../server/appmaster/web/HttpCacheHeaders.java  |   35 -
 .../appmaster/web/SliderAMController.java       |   69 -
 .../server/appmaster/web/SliderAMWebApp.java    |  109 -
 .../web/SliderDefaultWrapperServlet.java        |   48 -
 .../slider/server/appmaster/web/WebAppApi.java  |   52 -
 .../server/appmaster/web/WebAppApiImpl.java     |   69 -
 .../server/appmaster/web/layout/AppLayout.java  |   32 -
 .../web/layout/ClusterSpecificationView.java    |   32 -
 .../web/layout/ContainerStatsView.java          |   33 -
 .../appmaster/web/layout/WebUILayout.java       |   43 -
 .../appmaster/web/rest/AMWadlGenerator.java     |   72 -
 .../web/rest/AMWadlGeneratorConfig.java         |   34 -
 .../appmaster/web/rest/AMWebServices.java       |   85 -
 .../web/rest/AbstractSliderResource.java        |  157 -
 .../appmaster/web/rest/InsecureAmFilter.java    |  104 -
 .../web/rest/InsecureAmFilterInitializer.java   |  102 -
 .../server/appmaster/web/rest/RestPaths.java    |  155 -
 .../web/rest/SliderJacksonJaxbJsonProvider.java |   58 -
 .../ApplicationResouceContentCacheFactory.java  |   36 -
 .../application/actions/RestActionPing.java     |   50 -
 .../application/actions/RestActionStop.java     |   67 -
 .../rest/application/actions/StopResponse.java  |   29 -
 .../web/rest/application/package-info.java      |   24 -
 .../application/resources/CachedContent.java    |  121 -
 .../application/resources/ContentCache.java     |   67 -
 .../resources/ResourceRefresher.java            |   31 -
 .../web/rest/publisher/PublisherResource.java   |  271 --
 .../web/rest/registry/PathEntryResource.java    |   45 -
 .../web/rest/registry/RegistryResource.java     |  151 -
 .../web/view/ClusterSpecificationBlock.java     |   55 -
 .../appmaster/web/view/ContainerStatsBlock.java |  275 --
 .../server/appmaster/web/view/IndexBlock.java   |  273 --
 .../server/appmaster/web/view/NavBlock.java     |   62 -
 .../appmaster/web/view/SliderHamletBlock.java   |   53 -
 .../slider/server/avro/LoadedRoleHistory.java   |   92 -
 .../slider/server/avro/NewerFilesFirst.java     |   43 -
 .../slider/server/avro/OlderFilesFirst.java     |   43 -
 .../slider/server/avro/RoleHistoryWriter.java   |  449 ---
 .../slider/server/servicemonitor/HttpProbe.java |  110 -
 .../server/servicemonitor/LogEntryBuilder.java  |   76 -
 .../server/servicemonitor/MonitorKeys.java      |   66 -
 .../server/servicemonitor/MonitorUtils.java     |   84 -
 .../slider/server/servicemonitor/PortProbe.java |   99 -
 .../slider/server/servicemonitor/Probe.java     |  101 -
 .../server/servicemonitor/ProbeStatus.java      |  160 -
 .../utility/AbstractSliderLaunchedService.java  |  118 -
 .../services/utility/EndOfServiceWaiter.java    |   87 -
 .../LaunchedWorkflowCompositeService.java       |  117 -
 .../services/utility/PatternValidator.java      |   61 -
 .../server/services/utility/WebAppService.java  |   69 -
 .../services/workflow/ClosingService.java       |   94 -
 .../services/workflow/ForkedProcessService.java |  301 --
 .../services/workflow/LongLivedProcess.java     |  599 ----
 .../LongLivedProcessLifecycleEvent.java         |   41 -
 .../server/services/workflow/ServiceParent.java |   44 -
 .../workflow/ServiceTerminatingCallable.java    |   92 -
 .../workflow/ServiceTerminatingRunnable.java    |   72 -
 .../services/workflow/ServiceThreadFactory.java |  102 -
 .../workflow/WorkflowCallbackService.java       |  113 -
 .../workflow/WorkflowCompositeService.java      |  167 --
 .../workflow/WorkflowExecutorService.java       |  113 -
 .../services/workflow/WorkflowRpcService.java   |   76 -
 .../WorkflowScheduledExecutorService.java       |   38 -
 .../workflow/WorkflowSequenceService.java       |  306 --
 .../server/services/workflow/package-info.java  |  172 --
 .../YarnRegistryViewForProviders.java           |  226 --
 .../apache/slider/util/RestApiConstants.java    |   63 -
 .../slider/util/RestApiErrorMessages.java       |   92 -
 .../src/main/proto/SliderClusterMessages.proto  |  392 ---
 .../src/main/proto/SliderClusterProtocol.proto  |  140 -
 .../org.apache.hadoop.security.SecurityInfo     |   15 -
 .../org/apache/slider/log4j.properties          |   52 -
 .../slider/providers/agent/conf/agent.txt       |   19 -
 .../slider/providers/agent/conf/command.json    |  168 --
 .../providers/agent/conf/command_template.json  |  168 --
 .../apache/slider/providers/agent/role-node.xml |   65 -
 .../providers/dynamic/application.properties    |   25 -
 .../providers/slideram/instance/appconf.json    |   19 -
 .../providers/slideram/instance/internal.json   |   17 -
 .../providers/slideram/instance/resources.json  |   18 -
 .../src/main/resources/webapps/slideram/.keep   |    0
 .../src/scripts/slider_keytabs.sh               |   67 -
 .../src/scripts/yarnservice.py                  |  383 ---
 .../hadoop-yarn-slider-core/src/site/site.xml   |   26 -
 .../hadoop/yarn/service/MockServiceAM.java      |    9 +-
 .../hadoop/yarn/service/ServiceTestUtils.java   |   12 +-
 .../hadoop/yarn/service/TestServiceApiUtil.java |   54 +-
 .../yarn/service/TestYarnNativeServices.java    |   30 +-
 .../client/TestBuildExternalComponents.java     |    8 +-
 .../yarn/service/client/TestServiceCLI.java     |   15 +-
 .../yarn/service/conf/ExampleAppJson.java       |    5 +-
 .../yarn/service/conf/TestAppJsonResolve.java   |   62 +-
 .../service/conf/TestLoadExampleAppJson.java    |   11 +-
 .../service/conf/TestValidateServiceNames.java  |    2 +-
 .../providers/TestAbstractClientProvider.java   |    9 +-
 .../service/providers/TestProviderFactory.java  |    5 +-
 .../servicemonitor/TestServiceMonitor.java      |   37 +-
 .../TestServiceTimelinePublisher.java           |   76 +-
 .../org/apache/slider/api/TestRPCBinding.java   |   50 -
 .../apache/slider/client/TestClientBadArgs.java |  229 --
 .../slider/client/TestClientBasicArgs.java      |   81 -
 .../slider/client/TestCommonArgParsing.java     |  522 ----
 .../slider/client/TestKeytabCommandOptions.java |  414 ---
 .../slider/client/TestSliderClientMethods.java  |  142 -
 .../slider/client/TestSliderTokensCommand.java  |  124 -
 .../slider/common/tools/TestConfigHelper.java   |   57 -
 .../common/tools/TestConfigHelperHDFS.java      |   57 -
 .../common/tools/TestExecutionEnvironment.java  |   67 -
 .../slider/common/tools/TestPortScan.java       |  184 --
 .../common/tools/TestSliderFileSystem.java      |   62 -
 .../common/tools/TestSliderTestUtils.java       |   97 -
 .../slider/common/tools/TestSliderUtils.java    |  134 -
 .../slider/common/tools/TestWindowsSupport.java |  177 --
 .../slider/common/tools/TestZKIntegration.java  |  187 --
 .../TestPublishedConfigurationOutputter.java    |  220 --
 .../slider/other/TestFilesystemPermissions.java |  263 --
 .../apache/slider/other/TestLocalDirStatus.java |  166 --
 .../providers/TestAbstractClientProvider.java   |  122 -
 .../slider/providers/TestProviderFactory.java   |   75 -
 .../slider/registry/TestConfigSetNaming.java    |   85 -
 .../slider/registry/TestRegistryPaths.java      |   74 -
 .../server/appmaster/actions/TestActions.java   |  246 --
 .../model/appstate/BaseMockAppStateAATest.java  |   73 -
 .../TestMockAppStateAAOvercapacity.java         |  112 -
 .../appstate/TestMockAppStateAAPlacement.java   |  380 ---
 .../TestMockAppStateContainerFailure.java       |  387 ---
 .../appstate/TestMockAppStateDependencies.java  |  163 -
 .../TestMockAppStateDynamicHistory.java         |  208 --
 .../appstate/TestMockAppStateDynamicRoles.java  |  243 --
 .../TestMockAppStateFlexDynamicRoles.java       |  157 -
 .../model/appstate/TestMockAppStateFlexing.java |  201 --
 .../appstate/TestMockAppStateRMOperations.java  |  430 ---
 .../TestMockAppStateRebuildOnAMRestart.java     |  117 -
 .../appstate/TestMockAppStateRolePlacement.java |  122 -
 .../appstate/TestMockAppStateRoleRelease.java   |   82 -
 .../appstate/TestMockAppStateUniqueNames.java   |  149 -
 .../TestMockContainerResourceAllocations.java   |  100 -
 .../appstate/TestMockLabelledAAPlacement.java   |  156 -
 .../TestOutstandingRequestValidation.java       |  110 -
 .../model/history/TestRoleHistoryAA.java        |  269 --
 .../history/TestRoleHistoryContainerEvents.java |  447 ---
 ...TestRoleHistoryFindNodesForNewInstances.java |  177 --
 .../history/TestRoleHistoryNIComparators.java   |  133 -
 ...estRoleHistoryOutstandingRequestTracker.java |  385 ---
 .../model/history/TestRoleHistoryRW.java        |  371 ---
 .../history/TestRoleHistoryRWOrdering.java      |  162 -
 .../history/TestRoleHistoryRequestTracking.java |  298 --
 .../history/TestRoleHistoryUpdateBlacklist.java |  117 -
 .../server/appmaster/model/mock/Allocator.java  |  123 -
 .../model/mock/BaseMockAppStateTest.java        |  539 ----
 .../server/appmaster/model/mock/MockAM.java     |   26 -
 .../appmaster/model/mock/MockAppState.java      |   82 -
 .../model/mock/MockApplicationAttemptId.java    |   61 -
 .../appmaster/model/mock/MockApplicationId.java |   67 -
 .../model/mock/MockClusterServices.java         |   38 -
 .../appmaster/model/mock/MockContainer.java     |  131 -
 .../appmaster/model/mock/MockContainerId.java   |  104 -
 .../appmaster/model/mock/MockFactory.java       |  273 --
 .../appmaster/model/mock/MockFileSystem.java    |   32 -
 .../server/appmaster/model/mock/MockNodeId.java |   62 -
 .../appmaster/model/mock/MockPriority.java      |   46 -
 .../model/mock/MockRMOperationHandler.java      |  120 -
 .../appmaster/model/mock/MockRecordFactory.java |   27 -
 .../model/mock/MockRegistryOperations.java      |   83 -
 .../appmaster/model/mock/MockResource.java      |   75 -
 .../appmaster/model/mock/MockRoleHistory.java   |   53 -
 .../server/appmaster/model/mock/MockRoles.java  |   30 -
 .../appmaster/model/mock/MockYarnCluster.java   |  342 ---
 .../appmaster/model/mock/MockYarnEngine.java    |  188 --
 .../appmaster/model/monkey/TestMockMonkey.java  |  208 --
 .../security/TestSecurityConfiguration.java     |  215 --
 .../web/rest/registry/PathEntryMarshalling.java |   28 -
 .../registry/TestRegistryRestMarshalling.java   |   51 -
 .../web/view/TestClusterSpecificationBlock.java |   74 -
 .../web/view/TestContainerStatsBlock.java       |  251 --
 .../appmaster/web/view/TestIndexBlock.java      |  171 --
 .../slider/server/management/TestGauges.java    |   55 -
 .../server/services/workflow/MockService.java   |   80 -
 .../workflow/ParentWorkflowTestBase.java        |   70 -
 .../workflow/ProcessCommandFactory.java         |   96 -
 .../services/workflow/SimpleRunnable.java       |   46 -
 .../workflow/TestWorkflowClosingService.java    |  116 -
 .../workflow/TestWorkflowCompositeService.java  |  113 -
 .../workflow/TestWorkflowExecutorService.java   |   66 -
 .../workflow/TestWorkflowRpcService.java        |  107 -
 .../workflow/TestWorkflowSequenceService.java   |  151 -
 .../TestWorkflowServiceTerminatingRunnable.java |   64 -
 .../workflow/WorkflowServiceTestBase.java       |  139 -
 .../apache/slider/utils/ContractTestUtils.java  |  901 ------
 .../org/apache/slider/utils/KeysForTests.java   |   38 -
 .../org/apache/slider/utils/MicroZKCluster.java |   87 -
 .../java/org/apache/slider/utils/Outcome.java   |   46 -
 .../org/apache/slider/utils/SliderTestBase.java |   60 -
 .../apache/slider/utils/SliderTestUtils.java    | 1065 -------
 .../org/apache/slider/utils/TestAssertions.java |   60 -
 .../org/apache/slider/utils/TestUtility.java    |  181 --
 .../slider/utils/YarnMiniClusterTestBase.java   |  873 ------
 .../slider/utils/YarnZKMiniClusterTestBase.java |  176 --
 .../hadoop/yarn/service/conf/examples/app.json  |    2 +-
 .../appmaster/web/rest/registry/sample.json     |    9 -
 .../slider/server/avro/history-v01-3-role.json  |    6 -
 .../slider/server/avro/history-v01-6-role.json  |    8 -
 .../slider/server/avro/history_v01b_1_role.json |   38 -
 .../src/main/webapp/app/routes/yarn-services.js |    2 +-
 587 files changed, 13825 insertions(+), 67195 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-services-dist.xml
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..5de45a9
--- /dev/null
+++ b/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-services-dist.xml
@@ -0,0 +1,30 @@
+<!--
+   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.01
+
+   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.
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>hadoop-yarn-slider-dist</id>
+  <formats>
+    <format>dir</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <dependencySets>
+    <dependencySet>
+      <useProjectArtifact>false</useProjectArtifact>
+    </dependencySet>
+  </dependencySets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-slider-dist.xml
----------------------------------------------------------------------
diff --git a/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-slider-dist.xml b/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-slider-dist.xml
deleted file mode 100644
index 5de45a9..0000000
--- a/hadoop-assemblies/src/main/resources/assemblies/hadoop-yarn-slider-dist.xml
+++ /dev/null
@@ -1,30 +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.01
-
-   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.
--->
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-  <id>hadoop-yarn-slider-dist</id>
-  <formats>
-    <format>dir</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-  <dependencySets>
-    <dependencySet>
-      <useProjectArtifact>false</useProjectArtifact>
-    </dependencySet>
-  </dependencySets>
-</assembly>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/bin/yarn
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn
index c15a906..c455b29 100755
--- a/hadoop-yarn-project/hadoop-yarn/bin/yarn
+++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn
@@ -48,7 +48,7 @@ function hadoop_usage
   hadoop_add_subcommand "rmadmin" admin "admin tools"
   hadoop_add_subcommand "router" daemon "run the Router daemon"
   hadoop_add_subcommand "scmadmin" admin "SharedCacheManager admin tools"
-  hadoop_add_subcommand "servicesapi" "run yarn-service rest server"
+  hadoop_add_subcommand "servicesapi" "run yarn-native-service rest server"
   hadoop_add_subcommand "sharedcachemanager" admin "run the SharedCacheManager daemon"
   hadoop_add_subcommand "service" "run a service"
   hadoop_add_subcommand "timelinereader" client "run the timeline reader server"
@@ -151,7 +151,7 @@ function yarncmd_case
       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-api"'/*'
-      HADOOP_CLASSNAME='org.apache.hadoop.yarn.services.webapp.ApplicationApiWebApp'
+      HADOOP_CLASSNAME='org.apache.hadoop.yarn.service.webapp.ApplicationApiWebApp'
       local sld="${HADOOP_YARN_HOME}/${YARN_DIR},\
 ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR},\
 ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider,\
@@ -160,7 +160,7 @@ ${HADOOP_HDFS_HOME}/${HDFS_LIB_JARS_DIR},\
 ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_DIR},\
 ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}"
       hadoop_translate_cygwin_path sld
-      hadoop_add_param HADOOP_OPTS slider.libdir "-Dslider.libdir=${sld}"
+      hadoop_add_param HADOOP_OPTS service.libdir "-Dservice.libdir=${sld}"
     ;;
     sharedcachemanager)
       HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true"
@@ -177,7 +177,7 @@ ${HADOOP_HDFS_HOME}/${HDFS_LIB_JARS_DIR},\
 ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_DIR},\
 ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}"
       hadoop_translate_cygwin_path sld
-      hadoop_add_param HADOOP_OPTS slider.libdir "-Dslider.libdir=${sld}"
+      hadoop_add_param HADOOP_OPTS service.libdir "-Dservice.libdir=${sld}"
     ;;
     timelinereader)
       HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true"

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiService.java
----------------------------------------------------------------------
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/ApplicationApiService.java
new file mode 100644
index 0000000..30fc5ef
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiService.java
@@ -0,0 +1,275 @@
+/*
+ * 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 com.google.inject.Singleton;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.util.VersionInfo;
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+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.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;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+
+import static org.apache.hadoop.yarn.service.conf.RestApiConstants.*;
+
+@Singleton
+@Path(CONTEXT_ROOT)
+public class ApplicationApiService {
+  private static final Logger LOG =
+      LoggerFactory.getLogger(ApplicationApiService.class);
+  private static Configuration YARN_CONFIG = new YarnConfiguration();
+  private static ServiceClient SERVICE_CLIENT;
+
+  static {
+    init();
+  }
+
+  // initialize all the common resources - order is important
+  private static void init() {
+    SERVICE_CLIENT = new ServiceClient();
+    SERVICE_CLIENT.init(YARN_CONFIG);
+    SERVICE_CLIENT.start();
+  }
+
+  @GET
+  @Path(VERSION)
+  @Consumes({ MediaType.APPLICATION_JSON })
+  @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
+  public Response getVersion() {
+    String version = VersionInfo.getBuildVersion();
+    LOG.info(version);
+    return Response.ok(version).build();
+  }
+
+  @POST
+  @Path(APP_ROOT_PATH)
+  @Consumes({ MediaType.APPLICATION_JSON })
+  @Produces({ MediaType.APPLICATION_JSON })
+  public Response createApplication(Application application) {
+    LOG.info("POST: createApplication = {}", application);
+    ApplicationStatus applicationStatus = new ApplicationStatus();
+    try {
+      ApplicationId applicationId = SERVICE_CLIENT.actionCreate(application);
+      LOG.info("Successfully created application " + application.getName()
+          + " applicationId = " + applicationId);
+      applicationStatus.setState(ApplicationState.ACCEPTED);
+      applicationStatus.setUri(
+          CONTEXT_ROOT + APP_ROOT_PATH + "/" + application
+              .getName());
+      return Response.status(Status.CREATED).entity(applicationStatus).build();
+    } catch (IllegalArgumentException e) {
+      applicationStatus.setDiagnostics(e.getMessage());
+      return Response.status(Status.BAD_REQUEST).entity(applicationStatus)
+          .build();
+    } catch (Exception e) {
+      String message = "Failed to create application " + application.getName();
+      LOG.error(message, e);
+      applicationStatus.setDiagnostics(message + ": " + e.getMessage());
+      return Response.status(Status.INTERNAL_SERVER_ERROR)
+          .entity(applicationStatus).build();
+    }
+  }
+
+  @GET
+  @Path(APP_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();
+    }
+
+    try {
+      Application app = SERVICE_CLIENT.getStatus(appName);
+      return Response.ok(app).build();
+    } catch (Exception e) {
+      LOG.error("Get application failed", e);
+      applicationStatus
+          .setDiagnostics("Failed to retrieve application: " + e.getMessage());
+      return Response.status(Status.INTERNAL_SERVER_ERROR)
+          .entity(applicationStatus).build();
+    }
+  }
+
+  @DELETE
+  @Path(APP_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);
+  }
+
+  private Response stopApplication(String appName, boolean destroy) {
+    try {
+      SERVICE_CLIENT.actionStop(appName, destroy);
+      if (destroy) {
+        SERVICE_CLIENT.actionDestroy(appName);
+        LOG.info("Successfully deleted application {}", appName);
+      } else {
+        LOG.info("Successfully stopped application {}", 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)
+          .build();
+    } catch (Exception e) {
+      ApplicationStatus applicationStatus = new ApplicationStatus();
+      applicationStatus.setDiagnostics(e.getMessage());
+      return Response.status(Status.INTERNAL_SERVER_ERROR)
+          .entity(applicationStatus).build();
+    }
+  }
+
+  @PUT
+  @Path(COMPONENT_PATH)
+  @Consumes({ MediaType.APPLICATION_JSON })
+  @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN  })
+  public Response updateComponent(@PathParam(APP_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()
+              + ": Invalid number of containers specified " + component
+              .getNumberOfContainers()).build();
+    }
+    try {
+      Map<String, Long> original = SERVICE_CLIENT.flexByRestService(appName,
+          Collections.singletonMap(component.getName(),
+              component.getNumberOfContainers()));
+      return Response.ok().entity(
+          "Updating component " + componentName + " size from " + original
+              .get(componentName) + " to " + component.getNumberOfContainers())
+          .build();
+    } catch (YarnException | IOException e) {
+      ApplicationStatus status = new ApplicationStatus();
+      status.setDiagnostics(e.getMessage());
+      return Response.status(Status.INTERNAL_SERVER_ERROR).entity(status)
+          .build();
+    }
+  }
+
+  @PUT
+  @Path(APP_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);
+
+    // Ignore the app name provided in updateAppData and always use appName
+    // path param
+    updateAppData.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 a START is requested
+    if (updateAppData.getState() != null
+        && updateAppData.getState() == ApplicationState.STARTED) {
+      return startApplication(appName);
+    }
+
+    // If new lifetime value specified then update it
+    if (updateAppData.getLifetime() != null
+        && updateAppData.getLifetime() > 0) {
+      return updateLifetime(appName, updateAppData);
+    }
+
+    // flex a single component app
+    if (updateAppData.getNumberOfContainers() != null && !ServiceApiUtil
+        .hasComponent(updateAppData)) {
+      Component defaultComp = ServiceApiUtil.createDefaultComponent(updateAppData);
+      return updateComponent(updateAppData.getName(), defaultComp.getName(),
+          defaultComp);
+    }
+
+    // If nothing happens consider it a no-op
+    return Response.status(Status.NO_CONTENT).build();
+  }
+
+  private Response updateLifetime(String appName, Application updateAppData) {
+    try {
+      String newLifeTime =
+          SERVICE_CLIENT.updateLifetime(appName, updateAppData.getLifetime());
+      return Response.ok("Application " + appName + " lifeTime is successfully updated to "
+          + updateAppData.getLifetime() + " seconds from now: " + newLifeTime).build();
+    } catch (Exception e) {
+      String message =
+          "Failed to update application (" + appName + ") lifetime ("
+              + updateAppData.getLifetime() + ")";
+      LOG.error(message, e);
+      return Response.status(Status.INTERNAL_SERVER_ERROR)
+          .entity(message + " : " + e.getMessage()).build();
+    }
+  }
+
+  private Response startApplication(String appName) {
+    try {
+      SERVICE_CLIENT.actionStart(appName);
+      LOG.info("Successfully started application " + appName);
+      return Response.ok("Application " + appName + " is successfully started").build();
+    } catch (Exception e) {
+      String message = "Failed to start application " + appName;
+      LOG.info(message, e);
+      return Response.status(Status.INTERNAL_SERVER_ERROR)
+          .entity(message + ": " + e.getMessage()).build();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiWebApp.java
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..7225209
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApplicationApiWebApp.java
@@ -0,0 +1,123 @@
+/*
+ * 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;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/ApplicationApi.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/ApplicationApi.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/ApplicationApi.java
deleted file mode 100644
index 0f4bdae..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/ApplicationApi.java
+++ /dev/null
@@ -1,36 +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.services.api;
-
-import javax.ws.rs.core.Response;
-
-import org.apache.slider.api.resource.Application;
-
-/**
- * Apache Hadoop YARN Services REST API interface.
- *
- */
-public interface ApplicationApi {
-  Response createApplication(Application application);
-
-  Response getApplications(String state);
-
-  Response deleteApplication(String appName);
-
-  Response updateApplication(String appName, Application updateAppData);
-}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java
deleted file mode 100644
index decd849..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/api/impl/ApplicationApiService.java
+++ /dev/null
@@ -1,288 +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.services.api.impl;
-
-import com.google.inject.Singleton;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.util.VersionInfo;
-import org.apache.hadoop.yarn.api.records.ApplicationId;
-import org.apache.hadoop.yarn.api.records.ApplicationReport;
-import org.apache.hadoop.yarn.api.records.ApplicationTimeoutType;
-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.client.ServiceClient;
-import org.apache.slider.api.resource.Application;
-import org.apache.slider.api.resource.ApplicationState;
-import org.apache.slider.api.resource.ApplicationStatus;
-import org.apache.slider.api.resource.Component;
-import org.apache.slider.common.tools.SliderUtils;
-import org.apache.hadoop.yarn.service.utils.ServiceApiUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Map;
-
-import static org.apache.slider.util.RestApiConstants.*;
-
-@Singleton
-@Path(APPLICATIONS_API_RESOURCE_PATH)
-@Consumes({ MediaType.APPLICATION_JSON })
-@Produces({ MediaType.APPLICATION_JSON })
-public class ApplicationApiService {
-  private static final Logger LOG =
-      LoggerFactory.getLogger(ApplicationApiService.class);
-  private static Configuration YARN_CONFIG = new YarnConfiguration();
-  private static ServiceClient SERVICE_CLIENT;
-
-  static {
-    init();
-  }
-
-  // initialize all the common resources - order is important
-  private static void init() {
-    SERVICE_CLIENT = new ServiceClient();
-    SERVICE_CLIENT.init(YARN_CONFIG);
-    SERVICE_CLIENT.start();
-  }
-
-  @GET
-  @Path("/versions/yarn-service-version")
-  @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON }) public Response getSliderVersion() {
-    String version = VersionInfo.getBuildVersion();
-    LOG.info(version);
-    return Response.ok(version).build();
-  }
-
-  @POST @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON })
-  public Response createApplication(Application application) {
-    LOG.info("POST: createApplication = {}", application);
-    ApplicationStatus applicationStatus = new ApplicationStatus();
-    try {
-      ApplicationId applicationId = SERVICE_CLIENT.actionCreate(application);
-      LOG.info("Successfully created application " + application.getName()
-          + " applicationId = " + applicationId);
-      applicationStatus.setState(ApplicationState.ACCEPTED);
-      applicationStatus.setUri(
-          CONTEXT_ROOT + APPLICATIONS_API_RESOURCE_PATH + "/" + application
-              .getName());
-      return Response.status(Status.CREATED).entity(applicationStatus).build();
-    } catch (IllegalArgumentException e) {
-      applicationStatus.setDiagnostics(e.getMessage());
-      return Response.status(Status.BAD_REQUEST).entity(applicationStatus)
-          .build();
-    } catch (Exception e) {
-      String message = "Failed to create application " + application.getName();
-      LOG.error(message, e);
-      applicationStatus.setDiagnostics(message + ": " + e.getMessage());
-      return Response.status(Status.INTERNAL_SERVER_ERROR)
-          .entity(applicationStatus).build();
-    }
-  }
-
-  @GET @Path("/{app_name}")
-  @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();
-    }
-
-    try {
-      Application app = SERVICE_CLIENT.getStatus(appName);
-      ApplicationReport report = SERVICE_CLIENT.getYarnClient()
-          .getApplicationReport(ApplicationId.fromString(app.getId()));
-      if (report != null) {
-        app.setLifetime(
-            report.getApplicationTimeouts().get(ApplicationTimeoutType.LIFETIME)
-                .getRemainingTime());
-        LOG.info("Application = {}", app);
-        return Response.ok(app).build();
-      } else {
-        String message = "Application " + appName + " does not exist.";
-        LOG.info(message);
-        applicationStatus.setCode(ERROR_CODE_APP_DOES_NOT_EXIST);
-        applicationStatus.setDiagnostics(message);
-        return Response.status(Status.NOT_FOUND).entity(applicationStatus)
-            .build();
-      }
-    } catch (Exception e) {
-      LOG.error("Get application failed", e);
-      applicationStatus
-          .setDiagnostics("Failed to retrieve application: " + e.getMessage());
-      return Response.status(Status.INTERNAL_SERVER_ERROR)
-          .entity(applicationStatus).build();
-    }
-  }
-
-  @DELETE
-  @Path("/{app_name}")
-  @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);
-  }
-
-  private Response stopApplication(String appName, boolean destroy) {
-    try {
-      SERVICE_CLIENT.actionStop(appName);
-      if (destroy) {
-        SERVICE_CLIENT.actionDestroy(appName);
-        LOG.info("Successfully deleted application {}", appName);
-      } else {
-        LOG.info("Successfully stopped application {}", 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)
-          .build();
-    } catch (Exception e) {
-      ApplicationStatus applicationStatus = new ApplicationStatus();
-      applicationStatus.setDiagnostics(e.getMessage());
-      return Response.status(Status.INTERNAL_SERVER_ERROR)
-          .entity(applicationStatus).build();
-    }
-  }
-
-  @PUT @Path("/{app_name}/components/{component_name}")
-  @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON })
-  public Response updateComponent(@PathParam("app_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()
-              + ": Invalid number of containers specified " + component
-              .getNumberOfContainers()).build();
-    }
-    try {
-      Map<String, Long> original = SERVICE_CLIENT.flexByRestService(appName,
-          Collections.singletonMap(component.getName(),
-              component.getNumberOfContainers()));
-      return Response.ok().entity("Updating " + componentName + " size from "
-          + original.get(componentName) + " to "
-          + component.getNumberOfContainers()).build();
-    } catch (YarnException | IOException e) {
-      ApplicationStatus status = new ApplicationStatus();
-      status.setDiagnostics(e.getMessage());
-      return Response.status(Status.INTERNAL_SERVER_ERROR).entity(status)
-          .build();
-    }
-  }
-
-  @PUT @Path("/{app_name}")
-  @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);
-
-    // Ignore the app name provided in updateAppData and always use appName
-    // path param
-    updateAppData.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 a START is requested
-    if (updateAppData.getState() != null
-        && updateAppData.getState() == ApplicationState.STARTED) {
-      return startApplication(appName);
-    }
-
-    // If new lifetime value specified then update it
-    if (updateAppData.getLifetime() != null
-        && updateAppData.getLifetime() > 0) {
-      return updateLifetime(appName, updateAppData);
-    }
-
-    // flex a single component app
-    if (updateAppData.getNumberOfContainers() != null && !ServiceApiUtil
-        .hasComponent(
-        updateAppData)) {
-      Component defaultComp = ServiceApiUtil.createDefaultComponent(updateAppData);
-      return updateComponent(updateAppData.getName(), defaultComp.getName(),
-          defaultComp);
-    }
-
-    // If nothing happens consider it a no-op
-    return Response.status(Status.NO_CONTENT).build();
-  }
-
-  private Response updateLifetime(String appName, Application updateAppData) {
-    try {
-      String newLifeTime =
-          SERVICE_CLIENT.updateLifetime(appName, updateAppData.getLifetime());
-      return Response.ok("Application " + appName + " lifeTime is successfully updated to "
-          + updateAppData.getLifetime() + " seconds from now: " + newLifeTime).build();
-    } catch (Exception e) {
-      String message =
-          "Failed to update application (" + appName + ") lifetime ("
-              + updateAppData.getLifetime() + ")";
-      LOG.error(message, e);
-      return Response.status(Status.INTERNAL_SERVER_ERROR)
-          .entity(message + " : " + e.getMessage()).build();
-    }
-  }
-
-  private Response startApplication(String appName) {
-    try {
-      SERVICE_CLIENT.actionStart(appName);
-      LOG.info("Successfully started application " + appName);
-      return Response.ok("Application " + appName + " is successfully started").build();
-    } catch (Exception e) {
-      String message = "Failed to start application " + appName;
-      LOG.info(message, e);
-      return Response.status(Status.INTERNAL_SERVER_ERROR)
-          .entity(message + ": " + e.getMessage()).build();
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/webapp/ApplicationApiWebApp.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/webapp/ApplicationApiWebApp.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/webapp/ApplicationApiWebApp.java
deleted file mode 100644
index 7fc01a1..0000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/services/webapp/ApplicationApiWebApp.java
+++ /dev/null
@@ -1,125 +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.services.webapp;
-
-import static org.apache.slider.util.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.services.api.impl.ApplicationApiService;
-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, CONTEXT_ROOT
-        + "/*");
-
-    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;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml
----------------------------------------------------------------------
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 2f090a2..88f74ef 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
@@ -277,9 +277,6 @@ definitions:
         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.
-      unique_component_support:
-        type: boolean
-        description: Certain applications need to define multiple components using the same artifact and resource profile, differing only in configurations. In such cases, this field helps app owners to avoid creating multiple component definitions with repeated information. The number_of_containers field dictates the initial number of components created. Component names typically differ with a trailing id, but assumptions should not be made on that, as the algorithm can change at any time. Configurations section will be able to use placeholders like ${USER}, ${CLUSTER_NAME} and ${COMPONENT_NAME} to be replaced at runtime with user the app is submitted as, application name and application component name respectively. Launch command can use placeholders like ${APP_COMPONENT_NAME} and ${APP_NAME} to get its component name and app name respectively at runtime. The best part of this feature is that when the component is flexed up, entirely new components (with new trailing ids) are crea
 ted.
       run_privileged_container:
         type: boolean
         description: Run all containers of this component in privileged mode (YARN-4262).

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/webapp/WEB-INF/web.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/webapp/WEB-INF/web.xml
index 31e3051..1282c9f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/webapp/WEB-INF/web.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/webapp/WEB-INF/web.xml
@@ -21,7 +21,7 @@
         <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
         <init-param>
             <param-name>com.sun.jersey.config.property.packages</param-name>
-            <param-value>org.apache.hadoop.yarn.services.webapp,org.apache.hadoop.yarn.services.api,org.apache.slider.api.resource,org.apache.hadoop.yarn.services.api.impl</param-value>
+            <param-value>org.apache.hadoop.yarn.service.webapp,org.apache.hadoop.yarn.service.api,org.apache.hadoop.yarn.service.api.records</param-value>
         </init-param>
         <init-param>
           <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d44876af/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/dev-support/findbugs-exclude.xml
----------------------------------------------------------------------
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-slider/dev-support/findbugs-exclude.xml
index f2bf582..2814cca 100644
--- 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-slider/dev-support/findbugs-exclude.xml
@@ -23,99 +23,26 @@
         <class name="org.apache.hadoop.yarn.service.utils.ServiceApiUtil" />
         <Bug pattern="MS_CANNOT_BE_FINAL" />
     </Match>
-
-    <Match>
-        <Package name="org.apache.slider.api.proto" />
-    </Match>
-    <Match>
-        <class name="~org\.apache\.slider\.*" />
-        <Bug pattern="IS2_INCONSISTENT_SYNC" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.core.zk.BlockingZKWatcher" />
-        <Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.appmaster.state.ProviderAppState" />
-        <Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.providers.ProviderUtils" />
-        <Bug pattern="SWL_SLEEP_WITH_LOCK_HELD" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.appmaster.SliderAppMaster" />
-        <Bug pattern="WA_AWAIT_NOT_IN_LOOP" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.core.zk.ZKIntegration" />
-        <Bug pattern="SBSC_USE_STRINGBUFFER_CONCATENATION" />
-    </Match>
-    <Match>
-        <Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.servicemonitor.ProbeWorker" />
-        <Bug pattern="SF_SWITCH_FALLTHROUGH" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.core.persist.JsonSerDeser" />
-        <Bug pattern="UI_INHERITANCE_UNSAFE_GETRESOURCE" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.appmaster.rpc.SliderAMPolicyProvider" />
-        <Bug pattern="EI_EXPOSE_REP" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.appmaster.state.OutstandingRequest" />
-        <Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.appmaster.web.SliderAMWebApp" />
-        <Bug pattern="LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.servicemonitor.Probe" />
-        <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
-    </Match>
     <Match>
-        <Class name="org.apache.slider.server.appmaster.web.rest.registry.PathEntryResource" />
-        <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.appmaster.web.rest.application.actions.StopResponse" />
-        <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.server.appmaster.state.ContainerAllocationResults" />
-        <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.core.persist.JsonSerDeser" />
-        <Method name="save" />
+        <Class name="org.apache.hadoop.yarn.service.utils.JsonSerDeser" />
         <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
     </Match>
     <Match>
-        <Class name="org.apache.slider.server.services.workflow.ForkedProcessService" />
-        <Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER" />
+        <Class name="org.apache.hadoop.yarn.service.utils.JsonSerDeser" />
+        <Bug pattern="UI_INHERITANCE_UNSAFE_GETRESOURCE" />
     </Match>
     <Match>
-        <Class name="org.apache.slider.server.appmaster.state.RoleInstance"/>
+        <Package name="org.apache.hadoop.yarn.service.client.params"/>
         <Bug pattern="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"/>
     </Match>
     <Match>
-        <Class name="org.apache.slider.client.SliderClient" />
-        <Method name="actionRegistryListConfigsYarn" />
-        <Bug pattern="OS_OPEN_STREAM" />
+        <Package name="org.apache.hadoop.yarn.service.client.params"/>
+        <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
     </Match>
     <Match>
-        <Class name="org.apache.slider.client.SliderClient" />
-        <Method name="actionRegistryListExports" />
-        <Bug pattern="OS_OPEN_STREAM" />
-    </Match>
-    <Match>
-        <Class name="org.apache.slider.common.tools.SliderUtils" />
-        <Method name="getApplicationResourceInputStream" />
-        <Bug pattern="OS_OPEN_STREAM" />
+        <Class name="org.apache.hadoop.yarn.service.client.ServiceClient"/>
+        <Field name="registryClient" />
+        <Bug pattern="IS2_INCONSISTENT_SYNC"/>
     </Match>
+
 </FindBugsFilter>


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message