AHSClient (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.client.api, class: AHSClient

Package org.apache.hadoop.yarn.client.api

# Class AHSClient

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.client.api.AHSClient

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Service`

@Public @Stable public abstract class AHSClient extends AbstractService

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service

  `Service.STATE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AHSClient(String name)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static AHSClient`
  `createAHSClient()`
  Create a new instance of AHSClient.
  `static AHSClient`
  `createAHSv2Client()`
  `abstract ApplicationAttemptReport`
  `getApplicationAttemptReport(ApplicationAttemptId applicationAttemptId)`
  Get a report of the given ApplicationAttempt.
  `abstract List<ApplicationAttemptReport>`
  `getApplicationAttempts(ApplicationId applicationId)`
  Get a report of all (ApplicationAttempts) of Application in the cluster.
  `abstract ApplicationReport`
  `getApplicationReport(ApplicationId appId)`
  Get a report of the given Application.
  `abstract List<ApplicationReport>`
  `getApplications()`
  Get a report (ApplicationReport) of all Applications in the cluster.
  `abstract ContainerReport`
  `getContainerReport(ContainerId containerId)`
  Get a report of the given Container.
  `abstract List<ContainerReport>`
  `getContainers(ApplicationAttemptId applicationAttemptId)`
  Get a report of all (Containers) of ApplicationAttempt in the cluster.

  ### Methods inherited from class org.apache.hadoop.service.AbstractService

  `close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### AHSClient

    @Private public AHSClient(String name)

- ## Method Details

  - ### createAHSClient

    @Public public static AHSClient createAHSClient()
    Create a new instance of AHSClient.

  - ### createAHSv2Client

    @Evolving @Public public static AHSClient createAHSv2Client()

  - ### getApplicationReport

    public abstract ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException
    Get a report of the given Application.

    In secure mode, `YARN` verifies access to the application, queue etc. before accepting the request.

    If the user does not have `VIEW_APP` access then the following fields in the report will be set to stubbed values:

    - host - set to "N/A"
    - RPC port - set to -1
    - client token - set to "N/A"
    - diagnostics - set to "N/A"
    - tracking URL - set to "N/A"
    - original tracking URL - set to "N/A"
    - resource usage report - all values are -1
    Parameters:
      `appId` - `ApplicationId` of the application that needs a report
    Returns:
      application report
    Throws:
      `YarnException`
      `IOException`

  - ### getApplications

    public abstract List<ApplicationReport> getApplications() throws YarnException, IOException

    Get a report (ApplicationReport) of all Applications in the cluster.

    If the user does not have `VIEW_APP` access for an application then the corresponding report will be filtered as described in `getApplicationReport(ApplicationId)`.

    Returns:
      a list of reports for all applications
    Throws:
      `YarnException`
      `IOException`

  - ### getApplicationAttemptReport

    public abstract ApplicationAttemptReport getApplicationAttemptReport(ApplicationAttemptId applicationAttemptId) throws YarnException, IOException

    Get a report of the given ApplicationAttempt.

    In secure mode, `YARN` verifies access to the application, queue etc. before accepting the request.

    Parameters:
      `applicationAttemptId` - `ApplicationAttemptId` of the application attempt that needs a report
    Returns:
      application attempt report
    Throws:
      `YarnException`
      `ApplicationAttemptNotFoundException` - if application attempt not found
      `IOException`

  - ### getApplicationAttempts

    public abstract List<ApplicationAttemptReport> getApplicationAttempts(ApplicationId applicationId) throws YarnException, IOException

    Get a report of all (ApplicationAttempts) of Application in the cluster.

    Parameters:
      `applicationId` -
    Returns:
      a list of reports for all application attempts for specified application
    Throws:
      `YarnException`
      `IOException`

  - ### getContainerReport

    public abstract ContainerReport getContainerReport(ContainerId containerId) throws YarnException, IOException

    Get a report of the given Container.

    In secure mode, `YARN` verifies access to the application, queue etc. before accepting the request.

    Parameters:
      `containerId` - `ContainerId` of the container that needs a report
    Returns:
      container report
    Throws:
      `YarnException`
      `ContainerNotFoundException` - if container not found
      `IOException`

  - ### getContainers

    public abstract List<ContainerReport> getContainers(ApplicationAttemptId applicationAttemptId) throws YarnException, IOException

    Get a report of all (Containers) of ApplicationAttempt in the cluster.

    Parameters:
      `applicationAttemptId` -
    Returns:
      a list of reports of all containers for specified application attempt
    Throws:
      `YarnException`
      `IOException`