Class AppAdminClient

All Implemented Interfaces:
Closeable, AutoCloseable, Service
Direct Known Subclasses:
ServiceClient

@Public @Unstable public abstract class AppAdminClient extends CompositeService
Client for managing applications.
  • Field Details

  • Constructor Details

    • AppAdminClient

      @Private protected AppAdminClient()
  • Method Details

    • createAppAdminClient

      @Public @Unstable public static AppAdminClient createAppAdminClient(String appType, Configuration conf)

      Create a new instance of AppAdminClient.

      Parameters:
      appType - application type
      conf - configuration
      Returns:
      app admin client
    • actionLaunch

      @Public @Unstable public abstract int actionLaunch(String fileName, String appName, Long lifetime, String queue) throws IOException, YarnException

      Launch a new YARN application.

      Parameters:
      fileName - specification of application
      appName - name of the application
      lifetime - lifetime of the application
      queue - queue of the application
      Returns:
      exit code
      Throws:
      IOException - IOException
      YarnException - exception in client or server
    • actionStop

      @Public @Unstable public abstract int actionStop(String appName) throws IOException, 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 - IOException
      YarnException - exception in client or server
    • actionStart

      @Public @Unstable public abstract int actionStart(String appName) throws IOException, 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 - IOException
      YarnException - exception in client or server
    • actionSave

      @Public @Unstable public abstract int actionSave(String fileName, String appName, Long lifetime, String queue) throws IOException, YarnException

      Save the specification for a YARN application / long-running service. The application may be started later.

      Parameters:
      fileName - specification of application to save
      appName - name of the application
      lifetime - lifetime of the application
      queue - queue of the application
      Returns:
      exit code
      Throws:
      IOException - IOException
      YarnException - exception in client or server
    • actionDestroy

      @Public @Unstable public abstract int actionDestroy(String appName) throws IOException, 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 - IOException
      YarnException - exception in client or server
    • actionFlex

      @Public @Unstable public abstract int actionFlex(String appName, Map<String,String> componentCounts) throws IOException, YarnException

      Change the number of running containers for a component of a YARN application / long-running service.

      Parameters:
      appName - the name of the application
      componentCounts - 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 - IOException
      YarnException - exception in client or server
    • enableFastLaunch

      @Public @Unstable public abstract int enableFastLaunch(String destinationFolder) throws IOException, 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 - IOException
      YarnException - exception in client or server
    • getStatusString

      @Public @Unstable public abstract String getStatusString(String appIdOrName) throws IOException, YarnException

      Get detailed app specific status string for a YARN application.

      Parameters:
      appIdOrName - appId or appName
      Returns:
      status string
      Throws:
      IOException - IOException
      YarnException - exception in client or server
    • initiateUpgrade

      @Public @Unstable public abstract int initiateUpgrade(String appName, String fileName, boolean autoFinalize) throws IOException, 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 - IOException
      YarnException - exception in client or server
    • actionUpgradeInstances

      @Public @Unstable public abstract int actionUpgradeInstances(String appName, List<String> componentInstances) throws IOException, 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.
      YarnException - exceptions from yarn servers.
    • actionUpgradeComponents

      @Public @Unstable public abstract int actionUpgradeComponents(String appName, List<String> components) throws IOException, 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.
      YarnException - exceptions from yarn servers.
    • actionCleanUp

      @Public @Unstable public abstract int actionCleanUp(String appName, String userName) throws IOException, 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.
      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, YarnException
      Throws:
      IOException
      YarnException
    • actionUpgradeExpress

      @Public @Unstable public abstract int actionUpgradeExpress(String appName, File fileName) throws IOException, YarnException
      Express upgrade a long running service.
      Parameters:
      appName - the name of the application
      fileName - specification of application upgrade to save.
      Returns:
      exit code
      Throws:
      IOException - io error occur.
      YarnException - exceptions from yarn servers.
    • actionCancelUpgrade

      @Public @Unstable public abstract int actionCancelUpgrade(String appName) throws IOException, YarnException
      Cancels the upgrade of the service.
      Parameters:
      appName - the name of the application
      Returns:
      exit code
      Throws:
      IOException - io error occur.
      YarnException - exceptions from yarn servers.
    • actionDecommissionInstances

      @Public @Unstable public abstract int actionDecommissionInstances(String appName, List<String> componentInstances) throws IOException, 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.
      YarnException - exceptions from yarn servers.