org.apache.hadoop.yarn.client.api

## Class YarnClient

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

- All Implemented Interfaces:
    Closeable, AutoCloseable, Service

      @InterfaceAudience.Public
       @InterfaceStability.Stable
      public abstract class YarnClient
      extends AbstractService

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `YarnClient(String name)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract YarnClientApplication` | `createApplication()` Obtain a `YarnClientApplication` for a new application, which in turn contains the `ApplicationSubmissionContext` and `GetNewApplicationResponse` objects.
    `abstract GetNewReservationResponse` | `createReservation()` Obtain a `GetNewReservationResponse` for a new reservation, which contains the `ReservationId` object.
    `static YarnClient` | `createYarnClient()` Create a new instance of YarnClient.
    `abstract ReservationDeleteResponse` | `deleteReservation(ReservationDeleteRequest request)` The interface used by clients to remove an existing Reservation.
    `abstract void` | `failApplicationAttempt(ApplicationAttemptId applicationAttemptId)` Fail an application attempt identified by given ID.
    `abstract List<QueueInfo>` | `getAllQueues()` Get information (`QueueInfo`) about all queues, recursively if there is a hierarchy
    `abstract Token<AMRMTokenIdentifier>` | `getAMRMToken(ApplicationId appId)` Get the AMRM token of the application.
    `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 List<ApplicationReport>` | `getApplications(EnumSet<YarnApplicationState> applicationStates)` Get a report (ApplicationReport) of Applications matching the given application states in the cluster.
    `List<ApplicationReport>` | `getApplications(GetApplicationsRequest request)` Get a list of ApplicationReports that match the given `GetApplicationsRequest`.
    `abstract List<ApplicationReport>` | `getApplications(Set<String> applicationTypes)` Get a report (ApplicationReport) of Applications matching the given application types in the cluster.
    `abstract List<ApplicationReport>` | `getApplications(Set<String> applicationTypes, EnumSet<YarnApplicationState> applicationStates)` Get a report (ApplicationReport) of Applications matching the given application types and application states in the cluster.
    `abstract List<ApplicationReport>` | `getApplications(Set<String> applicationTypes, EnumSet<YarnApplicationState> applicationStates, Set<String> applicationTags)` Get a report (ApplicationReport) of Applications matching the given application types, application states and application tags in the cluster.
    `abstract List<ApplicationReport>` | `getApplications(Set<String> queues, Set<String> users, Set<String> applicationTypes, EnumSet<YarnApplicationState> applicationStates)` Get a report (ApplicationReport) of Applications matching the given users, queues, application types and application states in the cluster.
    `abstract Map<NodeAttributeKey,List<NodeToAttributeValue>>` | `getAttributesToNodes(Set<NodeAttributeKey> attributes)` The interface used by client to get mapping of AttributeKey to associated NodeToAttributeValue list for specified node attributeKeys in the cluster.
    `abstract List<QueueInfo>` | `getChildQueueInfos(String parent)` Get information (`QueueInfo`) about all the immediate children queues of the given queue
    `abstract Set<NodeAttributeInfo>` | `getClusterAttributes()` The interface used by client to get node attributes in the cluster.
    `abstract List<NodeLabel>` | `getClusterNodeLabels()` The interface used by client to get node labels 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.
    `abstract Map<String,Set<NodeId>>` | `getLabelsToNodes()` The interface used by client to get labels to nodes mapping in existing cluster
    `abstract Map<String,Set<NodeId>>` | `getLabelsToNodes(Set<String> labels)` The interface used by client to get labels to nodes mapping for specified labels in existing cluster
    `abstract List<NodeReport>` | `getNodeReports(NodeState... states)` Get a report of nodes (`NodeReport`) in the cluster.
    `abstract Map<String,Set<NodeAttribute>>` | `getNodeToAttributes(Set<String> hostNames)` The interface used by client to get all node to attribute mapping in existing cluster.
    `abstract Map<NodeId,Set<String>>` | `getNodeToLabels()` The interface used by client to get node to labels mappings in existing cluster
    `abstract List<QueueUserACLInfo>` | `getQueueAclsInfo()` Get information about acls for current user on all the existing queues.
    `abstract QueueInfo` | `getQueueInfo(String queueName)` Get information (`QueueInfo`) about a given queue.
    `abstract Resource` | `getResourceProfile(String profile)` Get the details of a specific resource profile from the RM.
    `abstract Map<String,Resource>` | `getResourceProfiles()` Get the resource profiles available in the RM.
    `abstract List<org.apache.hadoop.yarn.api.records.ResourceTypeInfo>` | `getResourceTypeInfo()` Get available resource types supported by RM.
    `abstract Token` | `getRMDelegationToken(Text renewer)` Get a delegation token so as to be able to talk to YARN using those tokens.
    `abstract List<QueueInfo>` | `getRootQueueInfos()` Get information (`QueueInfo`) about top level queues.
    `abstract YarnClusterMetrics` | `getYarnClusterMetrics()` Get metrics (`YarnClusterMetrics`) about the cluster.
    `abstract void` | `killApplication(ApplicationId applicationId)` Kill an application identified by given ID.
    `abstract void` | `killApplication(ApplicationId applicationId, String diagnostics)` Kill an application identified by given ID.
    `abstract ReservationListResponse` | `listReservations(ReservationListRequest request)` The interface used by clients to get the list of reservations in a plan.
    `abstract void` | `moveApplicationAcrossQueues(ApplicationId appId, String queue)` Attempts to move the given application to the given queue.
    `abstract void` | `signalToContainer(ContainerId containerId, SignalContainerCommand command)` Signal a container identified by given ID.
    `abstract ApplicationId` | `submitApplication(ApplicationSubmissionContext appContext)` Submit a new application to `YARN.` It is a blocking call - it will not return `ApplicationId` until the submitted application is submitted successfully and accepted by the ResourceManager.
    `abstract ReservationSubmissionResponse` | `submitReservation(ReservationSubmissionRequest request)` The interface used by clients to submit a new reservation to the `ResourceManager`.
    `abstract Priority` | `updateApplicationPriority(ApplicationId applicationId, Priority priority)` The interface used by client to set priority of an application
    `UpdateApplicationTimeoutsResponse` | `updateApplicationTimeouts(UpdateApplicationTimeoutsRequest request)`
    `abstract ReservationUpdateResponse` | `updateReservation(ReservationUpdateRequest request)` The interface used by clients to update an existing Reservation.

    - ### 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 Detail

    - #### YarnClient

          @InterfaceAudience.Private
          protected YarnClient(String name)

  - ### Method Detail

    - #### createYarnClient

          @InterfaceAudience.Public
          public static YarnClient createYarnClient()

      Create a new instance of YarnClient.

    - #### createApplication

          public abstract YarnClientApplication createApplication()
                                                           throws YarnException,
                                                                  IOException

      Obtain a `YarnClientApplication` for a new application, which in turn contains the `ApplicationSubmissionContext` and `GetNewApplicationResponse` objects.

      Returns:
        `YarnClientApplication` built for a new application
      Throws:
        `YarnException`
        `IOException`

    - #### submitApplication

          public abstract ApplicationId submitApplication(ApplicationSubmissionContext appContext)
                                                   throws YarnException,
                                                          IOException

      Submit a new application to `YARN.` It is a blocking call - it will not return `ApplicationId` until the submitted application is submitted successfully and accepted by the ResourceManager.

      Users should provide an `ApplicationId` as part of the parameter `ApplicationSubmissionContext` when submitting a new application, otherwise it will throw the `ApplicationIdNotProvidedException`.

      This internally calls `(SubmitApplicationRequest)`, and after that, it internally invokes `(GetApplicationReportRequest)` and waits till it can make sure that the application gets properly submitted. If RM fails over or RM restart happens before ResourceManager saves the application's state, `#getApplicationReport(GetApplicationReportRequest)` will throw the `ApplicationNotFoundException`. This API automatically resubmits the application with the same `ApplicationSubmissionContext` when it catches the `ApplicationNotFoundException`

      Parameters:
        `appContext` - `ApplicationSubmissionContext` containing all the details needed to submit a new application
      Returns:
        `ApplicationId` of the accepted application
      Throws:
        `YarnException`
        `IOException`
      See Also:
        `createApplication()`

    - #### failApplicationAttempt

          public abstract void failApplicationAttempt(ApplicationAttemptId applicationAttemptId)
                                               throws YarnException,
                                                      IOException

      Fail an application attempt identified by given ID.

      Parameters:
        `applicationAttemptId` - `ApplicationAttemptId` of the attempt to fail.
      Throws:
        `YarnException` - in case of errors or if YARN rejects the request due to access-control restrictions.
        `IOException`
      See Also:
        `getQueueAclsInfo()`

    - #### killApplication

          public abstract void killApplication(ApplicationId applicationId)
                                        throws YarnException,
                                               IOException

      Kill an application identified by given ID.

      Parameters:
        `applicationId` - `ApplicationId` of the application that needs to be killed
      Throws:
        `YarnException` - in case of errors or if YARN rejects the request due to access-control restrictions.
        `IOException`
      See Also:
        `getQueueAclsInfo()`

    - #### killApplication

          public abstract void killApplication(ApplicationId applicationId,
                                               String diagnostics)
                                        throws YarnException,
                                               IOException

      Kill an application identified by given ID.

      Parameters:
        `applicationId` - `ApplicationId` of the application that needs to be killed
        `diagnostics` - for killing an application.
      Throws:
        `YarnException` - in case of errors or if YARN rejects the request due to access-control restrictions.
        `IOException`

    - #### 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`

    - #### getAMRMToken

          public abstract Token<AMRMTokenIdentifier> getAMRMToken(ApplicationId appId)
                                                           throws YarnException,
                                                                  IOException

      Get the AMRM token of the application.

      The AMRM token is required for AM to RM scheduling operations. For managed Application Masters YARN takes care of injecting it. For unmanaged Applications Masters, the token must be obtained via this method and set in the `UserGroupInformation` of the current user.

      The AMRM token will be returned only if all the following conditions are met:

      - the requester is the owner of the ApplicationMaster
      - the application master is an unmanaged ApplicationMaster
      - the application master is in ACCEPTED state
      Else this method returns NULL.
      Parameters:
        `appId` - `ApplicationId` of the application to get the AMRM token
      Returns:
        the AMRM token if available
      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 of all running applications
      Throws:
        `YarnException`
        `IOException`

    - #### getApplications

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

      Get a report (ApplicationReport) of Applications matching the given application types 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)`.

      Parameters:
        `applicationTypes` - set of application types you are interested in
      Returns:
        a list of reports of applications
      Throws:
        `YarnException`
        `IOException`

    - #### getApplications

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

      Get a report (ApplicationReport) of Applications matching the given application states 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)`.

      Parameters:
        `applicationStates` - set of application states you are interested in
      Returns:
        a list of reports of applications
      Throws:
        `YarnException`
        `IOException`

    - #### getApplications

          public abstract List<ApplicationReport> getApplications(Set<String> applicationTypes,
                                                                  EnumSet<YarnApplicationState> applicationStates)
                                                           throws YarnException,
                                                                  IOException

      Get a report (ApplicationReport) of Applications matching the given application types and application states 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)`.

      Parameters:
        `applicationTypes` - set of application types you are interested in
        `applicationStates` - set of application states you are interested in
      Returns:
        a list of reports of applications
      Throws:
        `YarnException`
        `IOException`

    - #### getApplications

          public abstract List<ApplicationReport> getApplications(Set<String> applicationTypes,
                                                                  EnumSet<YarnApplicationState> applicationStates,
                                                                  Set<String> applicationTags)
                                                           throws YarnException,
                                                                  IOException

      Get a report (ApplicationReport) of Applications matching the given application types, application states and application tags 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)`.

      Parameters:
        `applicationTypes` - set of application types you are interested in
        `applicationStates` - set of application states you are interested in
        `applicationTags` - set of application tags you are interested in
      Returns:
        a list of reports of applications
      Throws:
        `YarnException`
        `IOException`

    - #### getApplications

          public abstract List<ApplicationReport> getApplications(Set<String> queues,
                                                                  Set<String> users,
                                                                  Set<String> applicationTypes,
                                                                  EnumSet<YarnApplicationState> applicationStates)
                                                           throws YarnException,
                                                                  IOException

      Get a report (ApplicationReport) of Applications matching the given users, queues, application types and application states in the cluster. If any of the params is set to null, it is not used when filtering.

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

      Parameters:
        `queues` - set of queues you are interested in
        `users` - set of users you are interested in
        `applicationTypes` - set of application types you are interested in
        `applicationStates` - set of application states you are interested in
      Returns:
        a list of reports of applications
      Throws:
        `YarnException`
        `IOException`

    - #### getApplications

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

      Get a list of ApplicationReports that match the given `GetApplicationsRequest`.

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

      Parameters:
        `request` - the request object to get the list of applications.
      Returns:
        The list of ApplicationReports that match the request
      Throws:
        `YarnException` - Exception specific to YARN.
        `IOException` - Exception mostly related to connection errors.

    - #### getYarnClusterMetrics

          public abstract YarnClusterMetrics getYarnClusterMetrics()
                                                            throws YarnException,
                                                                   IOException

      Get metrics (`YarnClusterMetrics`) about the cluster.

      Returns:
        cluster metrics
      Throws:
        `YarnException`
        `IOException`

    - #### getNodeReports

          public abstract List<NodeReport> getNodeReports(NodeState... states)
                                                   throws YarnException,
                                                          IOException

      Get a report of nodes (`NodeReport`) in the cluster.

      Parameters:
        `states` - The `NodeState`s to filter on. If no filter states are given, nodes in all states will be returned.
      Returns:
        A list of node reports
      Throws:
        `YarnException`
        `IOException`

    - #### getRMDelegationToken

          public abstract Token getRMDelegationToken(Text renewer)
                                              throws YarnException,
                                                     IOException

      Get a delegation token so as to be able to talk to YARN using those tokens.

      Parameters:
        `renewer` - Address of the renewer who can renew these tokens when needed by securely talking to YARN.
      Returns:
        a delegation token (`Token`) that can be used to talk to YARN
      Throws:
        `YarnException`
        `IOException`

    - #### getQueueInfo

          public abstract QueueInfo getQueueInfo(String queueName)
                                          throws YarnException,
                                                 IOException

      Get information (`QueueInfo`) about a given queue.

      Parameters:
        `queueName` - Name of the queue whose information is needed
      Returns:
        queue information
      Throws:
        `YarnException` - in case of errors or if YARN rejects the request due to access-control restrictions.
        `IOException`

    - #### getAllQueues

          public abstract List<QueueInfo> getAllQueues()
                                                throws YarnException,
                                                       IOException

      Get information (`QueueInfo`) about all queues, recursively if there is a hierarchy

      Returns:
        a list of queue-information for all queues
      Throws:
        `YarnException`
        `IOException`

    - #### getRootQueueInfos

          public abstract List<QueueInfo> getRootQueueInfos()
                                                     throws YarnException,
                                                            IOException

      Get information (`QueueInfo`) about top level queues.

      Returns:
        a list of queue-information for all the top-level queues
      Throws:
        `YarnException`
        `IOException`

    - #### getChildQueueInfos

          public abstract List<QueueInfo> getChildQueueInfos(String parent)
                                                      throws YarnException,
                                                             IOException

      Get information (`QueueInfo`) about all the immediate children queues of the given queue

      Parameters:
        `parent` - Name of the queue whose child-queues' information is needed
      Returns:
        a list of queue-information for all queues who are direct children of the given parent queue.
      Throws:
        `YarnException`
        `IOException`

    - #### getQueueAclsInfo

          public abstract List<QueueUserACLInfo> getQueueAclsInfo()
                                                           throws YarnException,
                                                                  IOException

      Get information about acls for current user on all the existing queues.

      Returns:
        a list of queue acls (`QueueUserACLInfo`) for current user
      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` - application id of the app
      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` - application attempt id
      Returns:
        a list of reports of all containers for specified application attempts
      Throws:
        `YarnException`
        `IOException`

    - #### moveApplicationAcrossQueues

          public abstract void moveApplicationAcrossQueues(ApplicationId appId,
                                                           String queue)
                                                    throws YarnException,
                                                           IOException

      Attempts to move the given application to the given queue.

      Parameters:
        `appId` - Application to move.
        `queue` - Queue to place it in to.
      Throws:
        `YarnException`
        `IOException`

    - #### createReservation

          public abstract GetNewReservationResponse createReservation()
                                                               throws YarnException,
                                                                      IOException

      Obtain a `GetNewReservationResponse` for a new reservation, which contains the `ReservationId` object.

      Returns:
        The `GetNewReservationResponse` containing a new `ReservationId` object.
      Throws:
        `YarnException` - if reservation cannot be created.
        `IOException` - if reservation cannot be created.

    - #### submitReservation

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract ReservationSubmissionResponse submitReservation(ReservationSubmissionRequest request)
                                                                                                                           throws YarnException,
                                                                                                                                  IOException

      The interface used by clients to submit a new reservation to the `ResourceManager`.

      The client packages all details of its request in a `ReservationSubmissionRequest` object. This contains information about the amount of capacity, temporal constraints, and gang needs. Furthermore, the reservation might be composed of multiple stages, with ordering dependencies among them.

      In order to respond, a new admission control component in the `ResourceManager` performs an analysis of the resources that have been committed over the period of time the user is requesting, verify that the user requests can be fulfilled, and that it respect a sharing policy (e.g., `CapacityOverTimePolicy`). Once it has positively determined that the ReservationRequest is satisfiable the `ResourceManager` answers with a `ReservationSubmissionResponse` that includes a `ReservationId`. Upon failure to find a valid allocation the response is an exception with the message detailing the reason of failure.

      The semantics guarantees that the `ReservationId` returned, corresponds to a valid reservation existing in the time-range request by the user. The amount of capacity dedicated to such reservation can vary overtime, depending of the allocation that has been determined. But it is guaranteed to satisfy all the constraint expressed by the user in the `ReservationDefinition`

      Parameters:
        `request` - request to submit a new Reservation
      Returns:
        response contains the `ReservationId` on accepting the submission
      Throws:
        `YarnException` - if the reservation cannot be created successfully
        `IOException`

    - #### updateReservation

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract ReservationUpdateResponse updateReservation(ReservationUpdateRequest request)
                                                                                                                       throws YarnException,
                                                                                                                              IOException

      The interface used by clients to update an existing Reservation. This is referred to as a re-negotiation process, in which a user that has previously submitted a Reservation.

      The allocation is attempted by virtually substituting all previous allocations related to this Reservation with new ones, that satisfy the new `ReservationDefinition`. Upon success the previous allocation is atomically substituted by the new one, and on failure (i.e., if the system cannot find a valid allocation for the updated request), the previous allocation remains valid.

      Parameters:
        `request` - to update an existing Reservation (the `ReservationUpdateRequest` should refer to an existing valid `ReservationId`)
      Returns:
        response empty on successfully updating the existing reservation
      Throws:
        `YarnException` - if the request is invalid or reservation cannot be updated successfully
        `IOException`

    - #### deleteReservation

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract ReservationDeleteResponse deleteReservation(ReservationDeleteRequest request)
                                                                                                                       throws YarnException,
                                                                                                                              IOException

      The interface used by clients to remove an existing Reservation.

      Parameters:
        `request` - to remove an existing Reservation (the `ReservationDeleteRequest` should refer to an existing valid `ReservationId`)
      Returns:
        response empty on successfully deleting the existing reservation
      Throws:
        `YarnException` - if the request is invalid or reservation cannot be deleted successfully
        `IOException`

    - #### listReservations

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract ReservationListResponse listReservations(ReservationListRequest request)
                                                                                                                    throws YarnException,
                                                                                                                           IOException

      The interface used by clients to get the list of reservations in a plan. The reservationId will be used to search for reservations to list if it is provided. Otherwise, it will select active reservations within the startTime and endTime (inclusive).

      Parameters:
        `request` - to list reservations in a plan. Contains fields to select String queue, ReservationId reservationId, long startTime, long endTime, and a bool includeReservationAllocations. queue: Required. Cannot be null or empty. Refers to the reservable queue in the scheduler that was selected when creating a reservation submission `ReservationSubmissionRequest`. reservationId: Optional. If provided, other fields will be ignored. startTime: Optional. If provided, only reservations that end after the startTime will be selected. This defaults to 0 if an invalid number is used. endTime: Optional. If provided, only reservations that start on or before endTime will be selected. This defaults to Long.MAX_VALUE if an invalid number is used. includeReservationAllocations: Optional. Flag that determines whether the entire reservation allocations are to be returned. Reservation allocations are subject to change in the event of re-planning as described by `ReservationDefinition`.
      Returns:
        response that contains information about reservations that are being searched for.
      Throws:
        `YarnException` - if the request is invalid
        `IOException` - if the request failed otherwise

    - #### getNodeToLabels

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Map<NodeId,Set<String>> getNodeToLabels()
                                                                                                                   throws YarnException,
                                                                                                                          IOException

      The interface used by client to get node to labels mappings in existing cluster

      Returns:
        node to labels mappings
      Throws:
        `YarnException`
        `IOException`

    - #### getLabelsToNodes

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Map<String,Set<NodeId>> getLabelsToNodes()
                                                                                                                    throws YarnException,
                                                                                                                           IOException

      The interface used by client to get labels to nodes mapping in existing cluster

      Returns:
        node to labels mappings
      Throws:
        `YarnException`
        `IOException`

    - #### getLabelsToNodes

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Map<String,Set<NodeId>> getLabelsToNodes(Set<String> labels)
                                                                                                                    throws YarnException,
                                                                                                                           IOException

      The interface used by client to get labels to nodes mapping for specified labels in existing cluster

      Parameters:
        `labels` - labels for which labels to nodes mapping has to be retrieved
      Returns:
        labels to nodes mappings for specific labels
      Throws:
        `YarnException`
        `IOException`

    - #### getClusterNodeLabels

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract List<NodeLabel> getClusterNodeLabels()
                                                                                                                throws YarnException,
                                                                                                                       IOException

      The interface used by client to get node labels in the cluster

      Returns:
        cluster node labels collection
      Throws:
        `YarnException` - when there is a failure in `ApplicationClientProtocol`
        `IOException` - when there is a failure in `ApplicationClientProtocol`

    - #### updateApplicationPriority

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Priority updateApplicationPriority(ApplicationId applicationId,
                                                                                                                     Priority priority)
                                                                                                              throws YarnException,
                                                                                                                     IOException

      The interface used by client to set priority of an application

      Parameters:
        `applicationId` -
        `priority` -
      Returns:
        updated priority of an application.
      Throws:
        `YarnException`
        `IOException`

    - #### signalToContainer

          public abstract void signalToContainer(ContainerId containerId,
                                                 SignalContainerCommand command)
                                          throws YarnException,
                                                 IOException

      Signal a container identified by given ID.

      Parameters:
        `containerId` - `ContainerId` of the container that needs to be signaled
        `command` - the signal container command
      Throws:
        `YarnException`
        `IOException`

    - #### updateApplicationTimeouts

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public UpdateApplicationTimeoutsResponse updateApplicationTimeouts(UpdateApplicationTimeoutsRequest request)
                                                                                                                              throws YarnException,
                                                                                                                                     IOException

      Throws:
        `YarnException`
        `IOException`

    - #### getResourceProfiles

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Map<String,Resource> getResourceProfiles()
                                                                                                                    throws YarnException,
                                                                                                                           IOException

      Get the resource profiles available in the RM.

      Returns:
        a Map of the resource profile names to their capabilities
      Throws:
        `YARNFeatureNotEnabledException` - if resource-profile is disabled
        `YarnException` - if any error happens inside YARN
        `IOException` - in case of other errors

    - #### getResourceProfile

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Resource getResourceProfile(String profile)
                                                                                                       throws YarnException,
                                                                                                              IOException

      Get the details of a specific resource profile from the RM.

      Parameters:
        `profile` - the profile name
      Returns:
        resource profile name with its capabilities
      Throws:
        `YARNFeatureNotEnabledException` - if resource-profile is disabled
        `YarnException` - if any error happens inside YARN
        `IOException` - in case of other others

    - #### getResourceTypeInfo

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract List<org.apache.hadoop.yarn.api.records.ResourceTypeInfo> getResourceTypeInfo()
                                                                                                                                                         throws YarnException,
                                                                                                                                                                IOException

      Get available resource types supported by RM.

      Returns:
        list of supported resource types with detailed information
      Throws:
        `YarnException` - if any issue happens inside YARN
        `IOException` - in case of other others

    - #### getClusterAttributes

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Set<NodeAttributeInfo> getClusterAttributes()
                                                                                                                       throws YarnException,
                                                                                                                              IOException

      The interface used by client to get node attributes in the cluster.

      Returns:
        cluster node attributes collection
      Throws:
        `YarnException` - when there is a failure in `ApplicationClientProtocol`
        `IOException` - when there is a failure in `ApplicationClientProtocol`

    - #### getAttributesToNodes

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Map<NodeAttributeKey,List<NodeToAttributeValue>> getAttributesToNodes(Set<NodeAttributeKey> attributes)
                                                                                                                                                 throws YarnException,
                                                                                                                                                        IOException

      The interface used by client to get mapping of AttributeKey to associated NodeToAttributeValue list for specified node attributeKeys in the cluster.

      Parameters:
        `attributes` - AttributeKeys for which associated NodeToAttributeValue mapping value has to be retrieved. If empty or null is set then will return mapping for all attributeKeys in the cluster
      Returns:
        mapping of AttributeKey to List of associated NodeToAttributeValue's.
      Throws:
        `YarnException`
        `IOException`

    - #### getNodeToAttributes

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract Map<String,Set<NodeAttribute>> getNodeToAttributes(Set<String> hostNames)
                                                                                                                              throws YarnException,
                                                                                                                                     IOException

      The interface used by client to get all node to attribute mapping in existing cluster.

      Parameters:
        `hostNames` - HostNames for which host to attributes mapping has to be retrived.If empty or null is set then will return all nodes to attributes mapping in cluster.
      Returns:
        Node to attribute mappings
      Throws:
        `YarnException`
        `IOException`

Copyright © 2022 Apache Software Foundation. All rights reserved.