Class AppAdminClient
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHookNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intactionCancelUpgrade(String appName) Cancels the upgrade of the service.abstract intactionCleanUp(String appName, String userName) Operation to be performed by the RM after an application has completed.abstract intactionDecommissionInstances(String appName, List<String> componentInstances) Decommission component instances of a long running service.abstract intactionDestroy(String appName) Remove the specification and all application data for a YARN application.abstract intactionFlex(String appName, Map<String, String> componentCounts) Change the number of running containers for a component of a YARN application / long-running service.abstract intactionLaunch(String fileName, String appName, Long lifetime, String queue) Launch a new YARN application.abstract intactionSave(String fileName, String appName, Long lifetime, String queue) Save the specification for a YARN application / long-running service.abstract intactionStart(String appName) Start a YARN application from a previously saved specification.abstract intactionStop(String appName) Stop a YARN application (attempt to stop gracefully before killing the application).abstract intactionUpgradeComponents(String appName, List<String> components) Upgrade components of a long running service.abstract intactionUpgradeExpress(String appName, File fileName) Express upgrade a long running service.abstract intactionUpgradeInstances(String appName, List<String> componentInstances) Upgrade component instances of a long running service.static AppAdminClientcreateAppAdminClient(String appType, org.apache.hadoop.conf.Configuration conf) Create a new instance of AppAdminClient.abstract intenableFastLaunch(String destinationFolder) Upload AM dependencies to HDFS.abstract Stringabstract StringgetStatusString(String appIdOrName) Get detailed app specific status string for a YARN application.abstract intinitiateUpgrade(String appName, String fileName, boolean autoFinalize) Initiate upgrade of a long running service.Methods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeService, serviceInit, serviceStart, serviceStopMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
YARN_APP_ADMIN_CLIENT_PREFIX
- See Also:
-
DEFAULT_TYPE
- See Also:
-
DEFAULT_CLASS_NAME
- See Also:
-
UNIT_TEST_TYPE
- See Also:
-
UNIT_TEST_CLASS_NAME
- See Also:
-
-
Constructor Details
-
AppAdminClient
@Private protected AppAdminClient()
-
-
Method Details
-
createAppAdminClient
@Public @Unstable public static AppAdminClient createAppAdminClient(String appType, org.apache.hadoop.conf.Configuration conf) Create a new instance of AppAdminClient.
- Parameters:
appType- application typeconf- configuration- Returns:
- app admin client
-
actionLaunch
@Public @Unstable public abstract int actionLaunch(String fileName, String appName, Long lifetime, String queue) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Launch a new YARN application.
- Parameters:
fileName- specification of applicationappName- name of the applicationlifetime- lifetime of the applicationqueue- queue of the application- Returns:
- exit code
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
actionStop
@Public @Unstable public abstract int actionStop(String appName) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Stop a YARN application (attempt to stop gracefully before killing the application). In the case of a long-running service, the service may be restarted later.
- Parameters:
appName- the name of the application- Returns:
- exit code
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
actionStart
@Public @Unstable public abstract int actionStart(String appName) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Start a YARN application from a previously saved specification. In the case of a long-running service, the service must have been previously launched/started and then stopped, or previously saved but not started.
- Parameters:
appName- the name of the application- Returns:
- exit code
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
actionSave
@Public @Unstable public abstract int actionSave(String fileName, String appName, Long lifetime, String queue) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Save the specification for a YARN application / long-running service. The application may be started later.
- Parameters:
fileName- specification of application to saveappName- name of the applicationlifetime- lifetime of the applicationqueue- queue of the application- Returns:
- exit code
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
actionDestroy
@Public @Unstable public abstract int actionDestroy(String appName) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Remove the specification and all application data for a YARN application. The application cannot be running.
- Parameters:
appName- the name of the application- Returns:
- exit code
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
actionFlex
@Public @Unstable public abstract int actionFlex(String appName, Map<String, String> componentCounts) throws IOException, org.apache.hadoop.yarn.exceptions.YarnExceptionChange the number of running containers for a component of a YARN application / long-running service.
- Parameters:
appName- the name of the applicationcomponentCounts- map of component name to new component count or amount to change existing component count (e.g. 5, +5, -5)- Returns:
- exit code
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
enableFastLaunch
@Public @Unstable public abstract int enableFastLaunch(String destinationFolder) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Upload AM dependencies to HDFS. This makes future application launches faster since the dependencies do not have to be uploaded on each launch.
- Parameters:
destinationFolder- an optional HDFS folder where dependency tarball will be uploaded- Returns:
- exit code
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
getStatusString
@Public @Unstable public abstract String getStatusString(String appIdOrName) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Get detailed app specific status string for a YARN application.
- Parameters:
appIdOrName- appId or appName- Returns:
- status string
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
initiateUpgrade
@Public @Unstable public abstract int initiateUpgrade(String appName, String fileName, boolean autoFinalize) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Initiate upgrade of a long running service.- Parameters:
appName- the name of the application.fileName- specification of application upgrade to save.autoFinalize- when true, finalization of upgrade will be done automatically.- Returns:
- exit code
- Throws:
IOException- IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException- exception in client or server
-
actionUpgradeInstances
@Public @Unstable public abstract int actionUpgradeInstances(String appName, List<String> componentInstances) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Upgrade component instances of a long running service.- Parameters:
appName- the name of the application.componentInstances- the name of the component instances.- Returns:
- exit code.
- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-
actionUpgradeComponents
@Public @Unstable public abstract int actionUpgradeComponents(String appName, List<String> components) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Upgrade components of a long running service.- Parameters:
appName- the name of the application.components- the name of the components.- Returns:
- exit code.
- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-
actionCleanUp
@Public @Unstable public abstract int actionCleanUp(String appName, String userName) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException Operation to be performed by the RM after an application has completed.- Parameters:
appName- the name of the application.userName- the name of the user.- Returns:
- exit code
- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.InterruptedException- if interrupted.
-
getInstances
@Public @Unstable public abstract String getInstances(String appName, List<String> components, String version, List<String> containerStates) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException - Throws:
IOExceptionorg.apache.hadoop.yarn.exceptions.YarnException
-
actionUpgradeExpress
@Public @Unstable public abstract int actionUpgradeExpress(String appName, File fileName) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Express upgrade a long running service.- Parameters:
appName- the name of the applicationfileName- specification of application upgrade to save.- Returns:
- exit code
- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-
actionCancelUpgrade
@Public @Unstable public abstract int actionCancelUpgrade(String appName) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Cancels the upgrade of the service.- Parameters:
appName- the name of the application- Returns:
- exit code
- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-
actionDecommissionInstances
@Public @Unstable public abstract int actionDecommissionInstances(String appName, List<String> componentInstances) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Decommission component instances of a long running service.- Parameters:
appName- the name of the application.componentInstances- the name of the component instances.- Returns:
- exit code.
- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-