Interface ApplicationClientProtocol
- All Superinterfaces:
ApplicationBaseProtocol
The protocol between clients and the ResourceManager
to submit/abort jobs and to get information on applications, cluster metrics,
nodes, queues and ACLs.
-
Method Summary
Modifier and TypeMethodDescriptionThe interface used by clients to remove an existing Reservation.The interface used by clients to request theResourceManagerto fail an application attempt.The interface used by clients to request theResourceManagerto abort submitted application.The interface used by client to get attributes to nodes mappings available in ResourceManager.The interface used by clients to get metrics about the cluster from theResourceManager.The interface used by client to get node attributes available in ResourceManager.The interface used by client to get node labels in the clustergetClusterNodes(GetClusterNodesRequest request) The interface used by clients to get a report of all nodes in the cluster from theResourceManager.getLabelsToNodes(GetLabelsToNodesRequest request) The interface used by client to get labels to nodes mappings in existing cluster.The interface used by clients to obtain a newApplicationIdfor submitting new applications.The interface used by clients to obtain a newReservationIdfor submitting new reservations.The interface used by client to get node to attributes mappings.getNodeToLabels(GetNodesToLabelsRequest request) The interface used by client to get node to labels mappings in existing cluster.getQueueInfo(GetQueueInfoRequest request) The interface used by clients to get information about queues from theResourceManager.The interface used by clients to get information about queue acls for current user from theResourceManager.The interface to get the details for a specific resource profile.The interface used by clients to get all the resource profiles that are available on the ResourceManager.The interface to get the details for a specific resource profile.listReservations(ReservationListRequest request) The interface used by clients to get the list of reservations in a plan.Move an application to a new queue.signalToContainer(SignalContainerRequest request) The interface used by clients to request theResourceManagerto signal a container.The interface used by clients to submit a new application to theResourceManager.The interface used by clients to submit a new reservation to theResourceManager.The interface used by client to set priority of an application.The interface used by client to set ApplicationTimeouts of an application.The interface used by clients to update an existing Reservation.Methods inherited from interface org.apache.hadoop.yarn.api.ApplicationBaseProtocol
cancelDelegationToken, getApplicationAttemptReport, getApplicationAttempts, getApplicationReport, getApplications, getContainerReport, getContainers, getDelegationToken, renewDelegationToken
-
Method Details
-
getNewApplication
@Public @Stable GetNewApplicationResponse getNewApplication(GetNewApplicationRequest request) throws YarnException, IOException The interface used by clients to obtain a new
ApplicationIdfor submitting new applications.The
ResourceManagerresponds with a new, monotonically increasing,ApplicationIdwhich is used by the client to submit a new application.The
ResourceManageralso responds with details such as maximum resource capabilities in the cluster as specified inGetNewApplicationResponse.- Parameters:
request- request to get a newApplicationId- Returns:
- response containing the new
ApplicationIdto be used to submit an application - Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.- See Also:
-
submitApplication
@Public @Stable SubmitApplicationResponse submitApplication(SubmitApplicationRequest request) throws YarnException, IOException The interface used by clients to submit a new application to the
ResourceManager.The client is required to provide details such as queue,
Resourcerequired to run theApplicationMaster, the equivalent ofContainerLaunchContextfor launching theApplicationMasteretc. via theSubmitApplicationRequest.Currently the
ResourceManagersends an immediate (empty)SubmitApplicationResponseon accepting the submission and throws an exception if it rejects the submission. However, this call needs to be followed byApplicationBaseProtocol.getApplicationReport(GetApplicationReportRequest)to make sure that the application gets properly submitted - obtaining aSubmitApplicationResponsefrom ResourceManager doesn't guarantee that RM 'remembers' this application beyond failover or restart. If RM failover or RM restart happens before ResourceManager saves the application's state successfully, the subsequentApplicationBaseProtocol.getApplicationReport(GetApplicationReportRequest)will throw aApplicationNotFoundException. The Clients need to re-submit the application with the sameApplicationSubmissionContextwhen it encounters theApplicationNotFoundExceptionon theApplicationBaseProtocol.getApplicationReport(GetApplicationReportRequest)call.During the submission process, it checks whether the application already exists. If the application exists, it will simply return SubmitApplicationResponse
In secure mode,the
ResourceManagerverifies access to queues etc. before accepting the application submission.- Parameters:
request- request to submit a new application- Returns:
- (empty) response on accepting the submission
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.- See Also:
-
failApplicationAttempt
@Public @Unstable FailApplicationAttemptResponse failApplicationAttempt(FailApplicationAttemptRequest request) throws YarnException, IOException The interface used by clients to request the
ResourceManagerto fail an application attempt.The client, via
FailApplicationAttemptRequestprovides theApplicationAttemptIdof the attempt to be failed.In secure mode,the
ResourceManagerverifies access to the application, queue etc. before failing the attempt.Currently, the
ResourceManagerreturns an empty response on success and throws an exception on rejecting the request.- Parameters:
request- request to fail an attempt- Returns:
ResourceManagerreturns an empty response on success and throws an exception on rejecting the request- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.- See Also:
-
forceKillApplication
@Public @Stable KillApplicationResponse forceKillApplication(KillApplicationRequest request) throws YarnException, IOException The interface used by clients to request the
ResourceManagerto abort submitted application.The client, via
KillApplicationRequestprovides theApplicationIdof the application to be aborted.In secure mode,the
ResourceManagerverifies access to the application, queue etc. before terminating the application.Currently, the
ResourceManagerreturns an empty response on success and throws an exception on rejecting the request.- Parameters:
request- request to abort a submitted application- Returns:
ResourceManagerreturns an empty response on success and throws an exception on rejecting the request- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.- See Also:
-
getClusterMetrics
@Public @Stable GetClusterMetricsResponse getClusterMetrics(GetClusterMetricsRequest request) throws YarnException, IOException The interface used by clients to get metrics about the cluster from the
ResourceManager.The
ResourceManagerresponds with aGetClusterMetricsResponsewhich includes theYarnClusterMetricswith details such as number of current nodes in the cluster.- Parameters:
request- request for cluster metrics- Returns:
- cluster metrics
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
getClusterNodes
@Public @Stable GetClusterNodesResponse getClusterNodes(GetClusterNodesRequest request) throws YarnException, IOException The interface used by clients to get a report of all nodes in the cluster from the
ResourceManager.The
ResourceManagerresponds with aGetClusterNodesResponsewhich includes theNodeReportfor all the nodes in the cluster.- Parameters:
request- request for report on all nodes- Returns:
- report on all nodes
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
getQueueInfo
@Public @Stable GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request) throws YarnException, IOException The interface used by clients to get information about queues from the
ResourceManager.The client, via
GetQueueInfoRequest, can ask for details such as used/total resources, child queues, running applications etc.In secure mode,the
ResourceManagerverifies access before providing the information.- Parameters:
request- request to get queue information- Returns:
- queue information
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
getQueueUserAcls
@Public @Stable GetQueueUserAclsInfoResponse getQueueUserAcls(GetQueueUserAclsInfoRequest request) throws YarnException, IOException The interface used by clients to get information about queue acls for current user from the
ResourceManager.The
ResourceManagerresponds with queue acls for all existing queues.- Parameters:
request- request to get queue acls for current user- Returns:
- queue acls for current user
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
moveApplicationAcrossQueues
@Public @Unstable MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(MoveApplicationAcrossQueuesRequest request) throws YarnException, IOException Move an application to a new queue.- Parameters:
request- the application ID and the target queue- Returns:
- an empty response
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
getNewReservation
@Public @Unstable GetNewReservationResponse getNewReservation(GetNewReservationRequest request) throws YarnException, IOException The interface used by clients to obtain a new
ReservationIdfor submitting new reservations.The
ResourceManagerresponds with a new, unique,ReservationIdwhich is used by the client to submit a new reservation.- Parameters:
request- to get a newReservationId- Returns:
- response containing the new
ReservationIdto be used to submit a new reservation - Throws:
YarnException- if the reservation system is not enabled.IOException- on IO failures.- See Also:
-
submitReservation
@Public @Unstable 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
ReservationSubmissionRequestobject. This contains information about the amount of capacity, temporal constraints, and concurrency 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
ResourceManagerperforms 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 ReservationSubmissionRequest is satisfiable theResourceManageranswers with aReservationSubmissionResponsethat include a non-nullReservationId. Upon failure to find a valid allocation the response is an exception with the reason. On application submission the client can use thisReservationIdto obtain access to the reserved resources.The system guarantees that during the time-range specified by the user, the reservationID will be corresponding to a valid reservation. The amount of capacity dedicated to such queue 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
ReservationSubmissionRequest.- Parameters:
request- the request to submit a new Reservation- Returns:
- response the
ReservationIdon accepting the submission - Throws:
YarnException- if the request is invalid or reservation cannot be created successfullyIOException- io error occur.
-
updateReservation
@Public @Unstable 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
ReservationUpdateRequest. Upon success the previous allocation is 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. TheReservationIdis not changed, and applications currently running within this reservation will automatically receive the resources based on the new allocation.- Parameters:
request- to update an existing Reservation (the ReservationRequest should refer to an existing validReservationId)- Returns:
- response empty on successfully updating the existing reservation
- Throws:
YarnException- if the request is invalid or reservation cannot be updated successfullyIOException- io error occur.
-
deleteReservation
@Public @Unstable ReservationDeleteResponse deleteReservation(ReservationDeleteRequest request) throws YarnException, IOException The interface used by clients to remove an existing Reservation. Upon deletion of a reservation applications running with this reservation, are automatically downgraded to normal jobs running without any dedicated reservation.
- Parameters:
request- to remove an existing Reservation (the ReservationRequest should refer to an existing validReservationId)- Returns:
- response empty on successfully deleting the existing reservation
- Throws:
YarnException- if the request is invalid or reservation cannot be deleted successfullyIOException- io error occur.
-
listReservations
@Public @Unstable 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 submissionReservationSubmissionRequest. 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 byReservationDefinition.- Returns:
- response that contains information about reservations that are being searched for.
- Throws:
YarnException- if the request is invalidIOException- on IO failures
-
getNodeToLabels
@Public @Unstable GetNodesToLabelsResponse getNodeToLabels(GetNodesToLabelsRequest request) throws YarnException, IOException The interface used by client to get node to labels mappings in existing cluster.
- Parameters:
request- get node to labels request.- Returns:
- node to labels mappings
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
getLabelsToNodes
@Public @Unstable GetLabelsToNodesResponse getLabelsToNodes(GetLabelsToNodesRequest request) throws YarnException, IOException The interface used by client to get labels to nodes mappings in existing cluster.
- Parameters:
request- get label to nodes request.- Returns:
- labels to nodes mappings
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
getClusterNodeLabels
@Public @Unstable GetClusterNodeLabelsResponse getClusterNodeLabels(GetClusterNodeLabelsRequest request) throws YarnException, IOException The interface used by client to get node labels in the cluster
- Parameters:
request- to get node labels collection of this cluster- Returns:
- node labels collection of this cluster
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
updateApplicationPriority
@Public @Unstable UpdateApplicationPriorityResponse updateApplicationPriority(UpdateApplicationPriorityRequest request) throws YarnException, IOException The interface used by client to set priority of an application.
- Parameters:
request- to set priority of an application- Returns:
- an empty response
- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
signalToContainer
@Public @Unstable SignalContainerResponse signalToContainer(SignalContainerRequest request) throws YarnException, IOException The interface used by clients to request the
ResourceManagerto signal a container. For example, the client can send command OUTPUT_THREAD_DUMP to dump threads of the container.The client, via
SignalContainerRequestprovides the id of the container and the signal command.In secure mode,the
ResourceManagerverifies access to the application before signaling the container. The user needs to haveMODIFY_APPpermission.Currently, the
ResourceManagerreturns an empty response on success and throws an exception on rejecting the request.- Parameters:
request- request to signal a container- Returns:
ResourceManagerreturns an empty response on success and throws an exception on rejecting the request- Throws:
YarnException- exceptions from yarn servers.IOException- io error occur.
-
updateApplicationTimeouts
@Public @Unstable UpdateApplicationTimeoutsResponse updateApplicationTimeouts(UpdateApplicationTimeoutsRequest request) throws YarnException, IOException The interface used by client to set ApplicationTimeouts of an application. The UpdateApplicationTimeoutsRequest should have timeout value with absolute time with ISO8601 format yyyy-MM-dd'T'HH:mm:ss.SSSZ.
Note: If application timeout value is less than or equal to current time then update application throws YarnException.- Parameters:
request- to set ApplicationTimeouts of an application- Returns:
- a response with updated timeouts.
- Throws:
YarnException- if update request has empty values or application is in completing states.IOException- on IO failures
-
getResourceProfiles
@Public @Unstable GetAllResourceProfilesResponse getResourceProfiles(GetAllResourceProfilesRequest request) throws YarnException, IOException The interface used by clients to get all the resource profiles that are available on the ResourceManager.
- Parameters:
request- request to get all the resource profiles- Returns:
- Response containing a map of the profile name to Resource capabilities
- Throws:
YARNFeatureNotEnabledException- if resource-profile is disabledYarnException- if any error happens inside YARNIOException- in case of other errors
-
getResourceProfile
@Public @Unstable GetResourceProfileResponse getResourceProfile(GetResourceProfileRequest request) throws YarnException, IOException The interface to get the details for a specific resource profile.
- Parameters:
request- request to get the details of a resource profile- Returns:
- Response containing the details for a particular resource profile
- Throws:
YARNFeatureNotEnabledException- if resource-profile is disabledYarnException- if any error happens inside YARNIOException- in case of other errors
-
getResourceTypeInfo
@Public @Unstable GetAllResourceTypeInfoResponse getResourceTypeInfo(GetAllResourceTypeInfoRequest request) throws YarnException, IOException The interface to get the details for a specific resource profile.
- Parameters:
request- request to get the details of a resource profile- Returns:
- Response containing the details for a particular resource profile
- Throws:
YarnException- if any error happens inside YARNIOException- in case of other errors
-
getAttributesToNodes
@Public @Unstable GetAttributesToNodesResponse getAttributesToNodes(GetAttributesToNodesRequest request) throws YarnException, IOException The interface used by client to get attributes to nodes mappings available in ResourceManager.
- Parameters:
request- request to get details of attributes to nodes mapping.- Returns:
- Response containing the details of attributes to nodes mappings.
- Throws:
YarnException- if any error happens inside YARNIOException- incase of other errors
-
getClusterNodeAttributes
@Public @Unstable GetClusterNodeAttributesResponse getClusterNodeAttributes(GetClusterNodeAttributesRequest request) throws YarnException, IOException The interface used by client to get node attributes available in ResourceManager.
- Parameters:
request- request to get node attributes collection of this cluster.- Returns:
- Response containing node attributes collection.
- Throws:
YarnException- if any error happens inside YARN.IOException- incase of other errors.
-
getNodesToAttributes
@Public @Unstable GetNodesToAttributesResponse getNodesToAttributes(GetNodesToAttributesRequest request) throws YarnException, IOException The interface used by client to get node to attributes mappings. in existing cluster.
- Parameters:
request- request to get nodes to attributes mapping.- Returns:
- nodes to attributes mappings.
- Throws:
YarnException- if any error happens inside YARN.IOException- io error occur.
-