diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 180724b507c..f1da51a9764 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1172,6 +1172,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-2886. Fix Javadoc warnings in MapReduce. (mahadev) + MAPREDUCE-2897. Javadoc for ClientRMProtocol protocol and related records. + (acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java index d194926f94e..d436f8e67fa 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/AMRMProtocol.java @@ -89,6 +89,11 @@ public interface AMRMProtocol { * of {@link ResourceRequest} and returns unused {@link Container} allocated * to it via {@link AllocateRequest}.

* + *

This also doubles up as a heartbeat to let the + * ResourceManager know that the ApplicationMaster + * is alive. Thus, applications should use periodically make this call to + * be kept alive.

+ * *

The ResourceManager responds with list of allocated * {@link Container}, status of completed containers and headroom information * for the application.

diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java index 2f4d69d14ff..db4c4790cf0 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ClientRMProtocol.java @@ -18,6 +18,9 @@ package org.apache.hadoop.yarn.api; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; + import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationRequest; import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest; @@ -36,17 +39,190 @@ import org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoResponse; import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest; import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse; +import org.apache.hadoop.yarn.api.records.ApplicationId; +import org.apache.hadoop.yarn.api.records.ApplicationReport; +import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; +import org.apache.hadoop.yarn.api.records.NodeReport; +import org.apache.hadoop.yarn.api.records.Resource; +import org.apache.hadoop.yarn.api.records.YarnClusterMetrics; import org.apache.hadoop.yarn.exceptions.YarnRemoteException; +/** + *

The protocol between clients and the ResourceManager + * to submit/abort jobs and to get information on applications, cluster metrics, + * nodes, queues and ACLs.

+ */ +@Public +@Stable public interface ClientRMProtocol { - public GetNewApplicationIdResponse getNewApplicationId(GetNewApplicationIdRequest request) throws YarnRemoteException; - public SubmitApplicationResponse submitApplication(SubmitApplicationRequest request) throws YarnRemoteException; - public FinishApplicationResponse finishApplication(FinishApplicationRequest request) throws YarnRemoteException; + /** + *

The interface used by clients to obtain a new {@link ApplicationId} for + * submitting new applications.

+ * + *

The ResourceManager responds with a new, monotonically + * increasing, {@link ApplicationId} which is used by the client to submit + * a new application.

+ * + * @param request request to get a new ApplicationId + * @return new ApplicationId to be used to submit an application + * @throws YarnRemoteException + * @see #submitApplication(SubmitApplicationRequest) + */ + public GetNewApplicationIdResponse getNewApplicationId( + GetNewApplicationIdRequest request) + throws YarnRemoteException; + + /** + *

The interface used by clients to submit a new application to the + * ResourceManager.

+ * + *

The client is required to provide details such as queue, + * {@link Resource} required to run the ApplicationMaster, + * the equivalent of {@link ContainerLaunchContext} for launching + * the ApplicationMaster etc. via the + * {@link SubmitApplicationRequest}.

+ * + *

Currently the ResourceManager sends an immediate (empty) + * {@link SubmitApplicationResponse} on accepting the submission and throws + * an exception if it rejects the submission.

+ * + *

In secure mode,the ResourceManager verifies access to + * queues etc. before accepting the application submission.

+ * + * @param request request to submit a new application + * @return (empty) response on accepting the submission + * @throws YarnRemoteException + * @see #getNewApplicationId(GetNewApplicationIdRequest) + */ + public SubmitApplicationResponse submitApplication( + SubmitApplicationRequest request) + throws YarnRemoteException; + + /** + *

The interface used by clients to request the + * ResourceManager to abort submitted application.

+ * + *

The client, via {@link FinishApplicationRequest} provides the + * {@link ApplicationId} of the application to be aborted.

+ * + *

In secure mode,the ResourceManager verifies access to the + * application, queue etc. before terminating the application.

+ * + *

Currently, the ResourceManager returns an empty response + * on success and throws an exception on rejecting the request.

+ * + * @param request request to abort a submited application + * @return ResourceManager returns an empty response + * on success and throws an exception on rejecting the request + * @throws YarnRemoteException + * @see #getQueueUserAcls(GetQueueUserAclsInfoRequest) + */ + public FinishApplicationResponse finishApplication( + FinishApplicationRequest request) + throws YarnRemoteException; - public GetApplicationReportResponse getApplicationReport(GetApplicationReportRequest request) throws YarnRemoteException; - public GetClusterMetricsResponse getClusterMetrics(GetClusterMetricsRequest request) throws YarnRemoteException; - public GetAllApplicationsResponse getAllApplications(GetAllApplicationsRequest request) throws YarnRemoteException; - public GetClusterNodesResponse getClusterNodes(GetClusterNodesRequest request) throws YarnRemoteException; - public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request) throws YarnRemoteException; - public GetQueueUserAclsInfoResponse getQueueUserAcls(GetQueueUserAclsInfoRequest request) throws YarnRemoteException; + /** + *

The interface used by clients to get a report of an Application from + * the ResourceManager.

+ * + *

The client, via {@link GetApplicationReportRequest} provides the + * {@link ApplicationId} of the application.

+ * + *

In secure mode,the ResourceManager verifies access to the + * application, queue etc. before accepting the request.

+ * + *

The ResourceManager responds with a + * {@link GetApplicationReportResponse} which includes the + * {@link ApplicationReport} for the application.

+ * + * @param request request for an application report + * @return application report + * @throws YarnRemoteException + */ + public GetApplicationReportResponse getApplicationReport( + GetApplicationReportRequest request) + throws YarnRemoteException; + + /** + *

The interface used by clients to get metrics about the cluster from + * the ResourceManager.

+ * + *

The ResourceManager responds with a + * {@link GetClusterMetricsResponse} which includes the + * {@link YarnClusterMetrics} with details such as number of current + * nodes in the cluster.

+ * + * @param request request for cluster metrics + * @return cluster metrics + * @throws YarnRemoteException + */ + public GetClusterMetricsResponse getClusterMetrics( + GetClusterMetricsRequest request) + throws YarnRemoteException; + + /** + *

The interface used by clients to get a report of all Applications + * in the cluster from the ResourceManager.

+ * + *

The ResourceManager responds with a + * {@link GetAllApplicationsResponse} which includes the + * {@link ApplicationReport} for all the applications.

+ * + * @param request request for report on all running applications + * @return report on all running applications + * @throws YarnRemoteException + */ + public GetAllApplicationsResponse getAllApplications( + GetAllApplicationsRequest request) + throws YarnRemoteException; + + /** + *

The interface used by clients to get a report of all nodes + * in the cluster from the ResourceManager.

+ * + *

The ResourceManager responds with a + * {@link GetClusterNodesResponse} which includes the + * {@link NodeReport} for all the nodes in the cluster.

+ * + * @param request request for report on all nodes + * @return report on all nodes + * @throws YarnRemoteException + */ + public GetClusterNodesResponse getClusterNodes( + GetClusterNodesRequest request) + throws YarnRemoteException; + + /** + *

The interface used by clients to get information about queues + * from the ResourceManager.

+ * + *

The client, via {@link GetQueueInfoRequest}, can ask for details such + * as used/total resources, child queues, running applications etc.

+ * + *

In secure mode,the ResourceManager verifies access before + * providing the information.

+ * + * @param request request to get queue information + * @return queue information + * @throws YarnRemoteException + */ + public GetQueueInfoResponse getQueueInfo( + GetQueueInfoRequest request) + throws YarnRemoteException; + + /** + *

The interface used by clients to get information about queue + * acls for current users from the ResourceManager. + *

+ * + *

The ResourceManager responds with queue acls for all + * existing queues.

+ * + * @param request request to get queue acls for current user + * @return queue acls for current user + * @throws YarnRemoteException + */ + public GetQueueUserAclsInfoResponse getQueueUserAcls( + GetQueueUserAclsInfoRequest request) + throws YarnRemoteException; } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManager.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManager.java index 8faebd93a31..1d16cec26cd 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManager.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ContainerManager.java @@ -115,7 +115,7 @@ public interface ContainerManager { * * @param request request to get ContainerStatus of a container * with the specified ContainerId - * @return the ContainerStatus of the container + * @return ContainerStatus of the container * @throws YarnRemoteException */ @Public diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateRequest.java index 10448b19a2c..ff03dfea9e0 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateRequest.java @@ -32,8 +32,7 @@ import org.apache.hadoop.yarn.api.records.ResourceRequest; /** *

The core request sent by the ApplicationMaster to the - * ResourceManager to obtain resources in the cluster via - * {@link AMRMProtocol#allocate(AllocateRequest)}.

+ * ResourceManager to obtain resources in the cluster.

* *

The request includes: *

*

* + * @see AMRMProtocol#allocate(AllocateRequest) */ @Public @Stable public interface AllocateRequest { /** - * Get the {@link ApplicationAttemptId} being managed by the + * Get the ApplicationAttemptId being managed by the * ApplicationMaster. * @return ApplicationAttemptId being managed by the * ApplicationMaster @@ -70,32 +70,46 @@ public interface AllocateRequest { @Stable ApplicationAttemptId getApplicationAttemptId(); - @Private - @Unstable + /** + * Set the ApplicationAttemptId being managed by the + * ApplicationMaster. + * @param applicationAttemptId ApplicationAttemptId being managed + * by the ApplicationMaster + */ + @Public + @Stable void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId); /** - * Get the response id. - * @return the response id + * Get the response id. + * @return response id */ @Public @Stable int getResponseId(); - - @Private - @Unstable + + /** + * Set the response id + * @param id response id + */ + @Public + @Stable void setResponseId(int id); /** - * Get the current progress of application. - * @return the current progress of application + * Get the current progress of application. + * @return current progress of application */ @Public @Stable float getProgress(); - @Private - @Unstable + /** + * Set the current progress of application + * @param progress current progress of application + */ + @Public + @Stable void setProgress(float progress); /** @@ -115,6 +129,29 @@ public interface AllocateRequest { @Unstable int getAskCount(); + /** + * Add list of ResourceRequest to upate the + * ResourceManager about the application's resource requirements. + * @param resourceRequest list of ResourceRequest to upate the + * ResourceManager about the application's + * resource requirements + */ + @Public + @Stable + void addAllAsks(List resourceRequest); + + @Private + @Unstable + void addAsk(ResourceRequest request); + + @Private + @Unstable + void removeAsk(int index); + + @Private + @Unstable + void clearAsks(); + /** * Get the list of ContainerId of unused containers being * released by the ApplicationMaster. @@ -133,26 +170,15 @@ public interface AllocateRequest { @Unstable int getReleaseCount(); - - @Private - @Unstable - void addAllAsks(List resourceRequest); - - @Private - @Unstable - void addAsk(ResourceRequest request); - - @Private - @Unstable - void removeAsk(int index); - - @Private - @Unstable - void clearAsks(); - - - @Private - @Unstable + /** + * Add the list of ContainerId of unused containers being + * released by the ApplicationMaster + * @param releaseContainers list of ContainerId of unused + * containers being released by the < + * code>ApplicationMaster + */ + @Public + @Stable void addAllReleases(List releaseContainers); @Private diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateResponse.java index 0d7140223ba..cdf8382b013 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/AllocateResponse.java @@ -28,8 +28,7 @@ import org.apache.hadoop.yarn.api.records.Container; /** *

The response sent by the ResourceManager the - * ApplicationMaster during resource negotiation via - * {@link AMRMProtocol#allocate(AllocateRequest)}.

+ * ApplicationMaster during resource negotiation.

* *

The response, via {@link AMResponse}, includes: *

    @@ -45,6 +44,8 @@ import org.apache.hadoop.yarn.api.records.Container; * *
*

+ * + * @see AMRMProtocol#allocate(AllocateRequest) */ @Public @Stable diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java index d9baf4b1485..36d2af22f96 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterRequest.java @@ -18,18 +18,14 @@ package org.apache.hadoop.yarn.api.protocolrecords; -import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceStability.Stable; -import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.yarn.api.AMRMProtocol; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; /** *

The finalization request sent by the ApplicationMaster to - * inform the ResourceManager about its completion via the - * {@link AMRMProtocol#finishApplicationMaster(FinishApplicationMasterRequest)} - * api.

+ * inform the ResourceManager about its completion.

* *

The final request includes details such: *

    @@ -46,11 +42,12 @@ import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; *
*

* + * @see AMRMProtocol#finishApplicationMaster(FinishApplicationMasterRequest) */ public interface FinishApplicationMasterRequest { /** - * Get the {@link ApplicationAttemptId} being managed by the + * Get the ApplicationAttemptId being managed by the * ApplicationMaster. * @return ApplicationAttemptId being managed by the * ApplicationMaster @@ -59,44 +56,63 @@ public interface FinishApplicationMasterRequest { @Stable ApplicationAttemptId getApplicationAttemptId(); - @Private - @Unstable + /** + * Set the ApplicationAttemptId being managed by the + * ApplicationMaster. + * @param applicationAttemptId ApplicationAttemptId being managed + * by the ApplicationMaster + */ + @Public + @Stable void setAppAttemptId(ApplicationAttemptId applicationAttemptId); /** - * Get final state of the ApplicationMaster. - * @return final state of the ApplicationMaster + * Get final state of the ApplicationMaster. + * @return final state of the ApplicationMaster */ @Public @Stable String getFinalState(); - @Private - @Unstable - void setFinalState(String string); + /** + * Set final state of the ApplicationMaster + * @param finalState final state of the ApplicationMaster + */ + @Public + @Stable + void setFinalState(String finalState); /** - * Get diagnostic information if the application failed. - * @return diagnostic information if the application failed + * Get diagnostic information on application failure. + * @return diagnostic information on application failure */ @Public @Stable String getDiagnostics(); - @Private - @Unstable - void setDiagnostics(String string); + /** + * Set diagnostic information on application failure. + * @param diagnostics diagnostic information on application failure + */ + @Public + @Stable + void setDiagnostics(String diagnostics); /** - * Get the tracking URL for the ApplicationMaster. - * @return the tracking URL for the ApplicationMaster + * Get the tracking URL for the ApplicationMaster. + * @return tracking URLfor the ApplicationMaster */ @Public @Stable String getTrackingUrl(); - @Private - @Unstable - void setTrackingUrl(String historyUrl); + /** + * Set the tracking URLfor the ApplicationMaster + * @param url tracking URLfor the + * ApplicationMaster + */ + @Public + @Stable + void setTrackingUrl(String url); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterResponse.java index 45682bf5dc7..b7710c41cab 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationMasterResponse.java @@ -24,11 +24,11 @@ import org.apache.hadoop.yarn.api.AMRMProtocol; /** *

The response sent by the ResourceManager to a - * ApplicationMaster on it's completion via the - * {@link AMRMProtocol#finishApplicationMaster(FinishApplicationMasterRequest)} - * api.

+ * ApplicationMaster on it's completion.

* *

Currently, this is empty.

+ * + * @see AMRMProtocol#finishApplicationMaster(FinishApplicationMasterRequest) */ @Public @Stable diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationRequest.java index 0074b6f9832..023ee3c4ac7 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationRequest.java @@ -18,10 +18,34 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.ApplicationId; +/** + *

The request sent by the client to the ResourceManager + * to abort a submitted application.

+ * + *

The request includes the {@link ApplicationId} of the application to be + * aborted.

+ * + * @see ClientRMProtocol#finishApplication(FinishApplicationRequest) + */ +@Public +@Stable public interface FinishApplicationRequest { + /** + * Get the ApplicationId of the application to be aborted. + * @return ApplicationId of the application to be aborted + */ + @Public + @Stable public abstract ApplicationId getApplicationId(); + @Private + @Unstable public abstract void setApplicationId(ApplicationId applicationId); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationResponse.java index 18e76a4522f..cd0c728e536 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/FinishApplicationResponse.java @@ -18,6 +18,20 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

The response sent by the ResourceManager to the client + * aborting a submitted application.

+ * + *

Currently it's empty.

+ * + * @see ClientRMProtocol#finishApplication(FinishApplicationRequest) + */ +@Public +@Stable public interface FinishApplicationResponse { } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java index f3b5bf7cb9b..a958331244c 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsRequest.java @@ -18,5 +18,17 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

The request from clients to get a report of all Applications + * in the cluster from the ResourceManager.

+ * + * @see ClientRMProtocol#getAllApplications(GetAllApplicationsRequest) + */ +@Public +@Stable public interface GetAllApplicationsRequest { } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java index 641d8a34934..3e2e401bb95 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetAllApplicationsResponse.java @@ -20,9 +20,36 @@ package org.apache.hadoop.yarn.api.protocolrecords; import java.util.List; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.ApplicationReport; +/** + *

The response sent by the ResourceManager to a client + * requesting an {@link ApplicationReport} for all applications.

+ * + *

The ApplicationReport for each application includes details + * such as user, queue, name, host on which the ApplicationMaster + * is running, RPC port, tracking URL, diagnostics, start time etc.

+ * + * @see ApplicationReport + * @see ClientRMProtocol#getAllApplications(GetAllApplicationsRequest) + */ +@Public +@Stable public interface GetAllApplicationsResponse { + /** + * Get ApplicationReport for all applications. + * @return ApplicationReport for all applications + */ + @Public + @Stable List getApplicationList(); + + @Private + @Unstable void setApplicationList(List applications); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationReportRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationReportRequest.java index 51f366cf9fe..d6f9ee48f04 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationReportRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationReportRequest.java @@ -18,9 +18,34 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.ApplicationId; +import org.apache.hadoop.yarn.api.records.ApplicationReport; +/** + *

The request sent by a client to the ResourceManager to + * get an {@link ApplicationReport} for an application.

+ * + *

The request should include the {@link ApplicationId} of the + * application.

+ * + * @see ClientRMProtocol#getApplicationReport(GetApplicationReportRequest) + * @see ApplicationReport + */ +@Public +@Stable public interface GetApplicationReportRequest { - public abstract ApplicationId getApplicationId(); - public abstract void setApplicationId(ApplicationId applicationId); + /** + * Get the ApplicationId of the application. + * @return ApplicationId of the application + */ + public ApplicationId getApplicationId(); + + /** + * Set the ApplicationId of the application + * @param applicationId ApplicationId of the application + */ + public void setApplicationId(ApplicationId applicationId); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationReportResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationReportResponse.java index ddc18d811a4..cc93f20c271 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationReportResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationReportResponse.java @@ -18,9 +18,35 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.ApplicationReport; +/** + *

The response sent by the ResourceManager to a client + * requesting an application report.

+ * + *

The response includes an {@link ApplicationReport} which has details such + * as user, queue, name, host on which the ApplicationMaster is + * running, RPC port, tracking URL, diagnostics, start time etc.

+ * + * @see ClientRMProtocol#getApplicationReport(GetApplicationReportRequest) + */ +@Public +@Stable public interface GetApplicationReportResponse { - public abstract ApplicationReport getApplicationReport(); - public abstract void setApplicationReport(ApplicationReport ApplicationReport); + /** + * Get the ApplicationReport for the application. + * @return ApplicationReport for the application + */ + @Public + @Stable + public ApplicationReport getApplicationReport(); + + @Private + @Unstable + public void setApplicationReport(ApplicationReport ApplicationReport); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsRequest.java index 000653948de..81b93428036 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsRequest.java @@ -18,6 +18,18 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

The request sent by clients to get cluster metrics from the + * ResourceManager.

+ * + * @see ClientRMProtocol#getClusterMetrics(GetClusterMetricsRequest) + */ +@Public +@Stable public interface GetClusterMetricsRequest { } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsResponse.java index c802d3eee94..691bcc0b38d 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterMetricsResponse.java @@ -18,9 +18,32 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.YarnClusterMetrics; +/** + *

The response sent by the ResourceManager to a client + * requesting cluster metrics.

+ * + * @see YarnClusterMetrics + * @see ClientRMProtocol#getClusterMetrics(GetClusterMetricsRequest) + */ +@Public +@Stable public interface GetClusterMetricsResponse { - public abstract YarnClusterMetrics getClusterMetrics(); - public abstract void setClusterMetrics(YarnClusterMetrics metrics); + /** + * Get the YarnClusterMetrics for the cluster. + * @return YarnClusterMetrics for the cluster + */ + @Public + @Stable + public YarnClusterMetrics getClusterMetrics(); + + @Private + @Unstable + public void setClusterMetrics(YarnClusterMetrics metrics); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java index c6326ed2636..35ab1693717 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesRequest.java @@ -18,6 +18,18 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

The request from clients to get a report of all nodes + * in the cluster from the ResourceManager.

+ * + * @see ClientRMProtocol#getClusterNodes(GetClusterNodesRequest) + */ +@Public +@Stable public interface GetClusterNodesRequest { } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java index 991f9d2b47b..e9475fd8d2c 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetClusterNodesResponse.java @@ -20,9 +20,36 @@ package org.apache.hadoop.yarn.api.protocolrecords; import java.util.List; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.NodeReport; +/** + *

The response sent by the ResourceManager to a client + * requesting an {@link NodeReport} for all nodes.

+ * + *

The NodeReport contains per-node information such as + * available resources, number of containers, tracking url, rack name, health + * status etc. + * + * @see NodeReport + * @see ClientRMProtocol#getClusterNodes(GetClusterNodesRequest) + */ +@Public +@Stable public interface GetClusterNodesResponse { + /** + * Get NodeReport for all nodes in the cluster. + * @return NodeReport for all nodes in the cluster + */ + @Public + @Stable List getNodeReports(); + + @Private + @Unstable void setNodeReports(List nodeReports); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusRequest.java index 61b0aa7f087..6cd91f2dd99 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusRequest.java @@ -18,18 +18,17 @@ package org.apache.hadoop.yarn.api.protocolrecords; -import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceStability.Stable; -import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.ContainerStatus; /** *

The request sent by the ApplicationMaster to the - * NodeManager to get {@link ContainerStatus} of a container via - * {@link ContainerManager#getContainerStatus(GetContainerStatusRequest)}.

+ * NodeManager to get {@link ContainerStatus} of a container.

+ * + * @see ContainerManager#getContainerStatus(GetContainerStatusRequest) */ @Public @Stable @@ -44,7 +43,13 @@ public interface GetContainerStatusRequest { @Stable public abstract ContainerId getContainerId(); - @Private - @Unstable + /** + * Set the ContainerId of container for which to obtain the + * ContainerStatus + * @param containerId ContainerId of container for which to + * obtain the ContainerStatus + */ + @Public + @Stable public abstract void setContainerId(ContainerId containerId); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusResponse.java index 7893c733a60..03b361d8377 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerStatusResponse.java @@ -28,8 +28,9 @@ import org.apache.hadoop.yarn.api.records.ContainerStatus; /** *

The response sent by the NodeManager to the * ApplicationMaster when asked to obtainer status - * of a container via - * {@link ContainerManager#getContainerStatus(GetContainerStatusRequest)}.

+ * of a container.

+ * + * @see ContainerManager#getContainerStatus(GetContainerStatusRequest) */ @Public @Stable diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdRequest.java index a914092f072..c841070080d 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdRequest.java @@ -18,6 +18,19 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; +import org.apache.hadoop.yarn.api.records.ApplicationId; + +/** + *

The request sent by clients to get a new {@link ApplicationId} for + * submitting an application.

+ * + * @see ClientRMProtocol#getNewApplicationId(GetNewApplicationIdRequest) + */ +@Public +@Stable public interface GetNewApplicationIdRequest { } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdResponse.java index 62a48a9b5fb..93a1ab680b3 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetNewApplicationIdResponse.java @@ -18,9 +18,33 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.ApplicationId; +/** + *

The response sent by the ResourceManager to the client for + * a request to a new {@link ApplicationId} for submitting applications.

+ * + * @see ClientRMProtocol#getNewApplicationId(GetNewApplicationIdRequest) + */ +@Public +@Stable public interface GetNewApplicationIdResponse { + /** + * Get the new ApplicationId allocated by the + * ResourceManager. + * @return new ApplicationId allocated by the + * ResourceManager + */ + @Public + @Stable public abstract ApplicationId getApplicationId(); + + @Private + @Unstable public abstract void setApplicationId(ApplicationId applicationId); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueInfoRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueInfoRequest.java index 872f8aba5fc..435b03cf170 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueInfoRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueInfoRequest.java @@ -18,17 +18,70 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

The request sent by clients to get queue information + * from the ResourceManager.

+ * + * @see ClientRMProtocol#getQueueInfo(GetQueueInfoRequest) + */ +@Public +@Stable public interface GetQueueInfoRequest { + /** + * Get the queue name for which to get queue information. + * @return queue name for which to get queue information + */ String getQueueName(); + + /** + * Set the queue name for which to get queue information + * @param queueName queue name for which to get queue information + */ void setQueueName(String queueName); + /** + * Is information about active applications required? + * @return true if applications' information is to be included, + * else false + */ boolean getIncludeApplications(); + + /** + * Should we get fetch information about active applications? + * @param includeApplications fetch information about active + * applications? + */ void setIncludeApplications(boolean includeApplications); + /** + * Is information about child queues required? + * @return true if information about child queues is required, + * else false + */ boolean getIncludeChildQueues(); + + /** + * Should we fetch information about child queues? + * @param includeChildQueues fetch information about child queues? + */ void setIncludeChildQueues(boolean includeChildQueues); + /** + * Is information on the entire child queue hierarchy required? + * @return true if information about entire hierarchy is + * required, false otherwise + */ boolean getRecursive(); + + /** + * Should we fetch information on the entire child queue hierarchy? + * @param recursive fetch information on the entire child queue + * hierarchy? + */ void setRecursive(boolean recursive); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueInfoResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueInfoResponse.java index 8cef4e93c6c..830945744f3 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueInfoResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueInfoResponse.java @@ -18,9 +18,34 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.QueueInfo; +/** + *

The response sent by the ResourceManager to a client + * requesting information about queues in the system.

+ * + *

The response includes a {@link QueueInfo} which has details such as + * queue name, used/total capacities, running applications, child queues etc + * .

+ * + * @see QueueInfo + * @see ClientRMProtocol#getQueueInfo(GetQueueInfoRequest) + */ +@Public +@Stable public interface GetQueueInfoResponse { + /** + * Get the QueueInfo for the specified queue. + * @return QueueInfo for the specified queue + */ QueueInfo getQueueInfo(); + + @Private + @Unstable void setQueueInfo(QueueInfo queueInfo); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueUserAclsInfoRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueUserAclsInfoRequest.java index 44fd32e8bb6..ec16c1cb11e 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueUserAclsInfoRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueUserAclsInfoRequest.java @@ -18,6 +18,18 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

The request sent by clients to the ResourceManager to + * get queue acls for the current user.

+ * + * @see ClientRMProtocol#getQueueUserAcls(GetQueueUserAclsInfoRequest) + */ +@Public +@Stable public interface GetQueueUserAclsInfoRequest { } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueUserAclsInfoResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueUserAclsInfoResponse.java index 3aa09f064ba..58f640593a6 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueUserAclsInfoResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetQueueUserAclsInfoResponse.java @@ -20,12 +20,39 @@ package org.apache.hadoop.yarn.api.protocolrecords; import java.util.List; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; +import org.apache.hadoop.yarn.api.records.QueueACL; import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; +/** + *

The response sent by the ResourceManager to clients + * seeking queue acls for the user.

+ * + *

The response contains a list of {@link QueueUserACLInfo} which + * provides information about {@link QueueACL} per queue.

+ * + * @see QueueACL + * @see QueueUserACLInfo + * @see ClientRMProtocol#getQueueUserAcls(GetQueueUserAclsInfoRequest) + */ +@Public +@Stable public interface GetQueueUserAclsInfoResponse { + /** + * Get the QueueUserACLInfo per queue for the user. + * @return QueueUserACLInfo per queue for the user + */ + @Public + @Stable public List getUserAclsInfoList(); + @Private + @Unstable public void setUserAclsInfoList(List queueUserAclsList); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterRequest.java index 2325b5ad0d9..1accbd22d6e 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterRequest.java @@ -27,9 +27,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; /** *

The request sent by the ApplicationMaster to - * ResourceManager on registration via the - * {@link AMRMProtocol#registerApplicationMaster(RegisterApplicationMasterRequest)} - * api.

+ * ResourceManager on registration.

* *

The registration includes details such as: *

    @@ -42,13 +40,15 @@ import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; *
  • Tracking URL
  • *
*

+ * + * @see AMRMProtocol#registerApplicationMaster(RegisterApplicationMasterRequest) */ @Public @Stable public interface RegisterApplicationMasterRequest { /** - * Get the {@link ApplicationAttemptId} being managed by the + * Get the ApplicationAttemptId being managed by the * ApplicationMaster. * @return ApplicationAttemptId being managed by the * ApplicationMaster @@ -57,44 +57,69 @@ public interface RegisterApplicationMasterRequest { @Stable ApplicationAttemptId getApplicationAttemptId(); - @Private - @Unstable + /** + * Set the ApplicationAttemptId being managed by the + * ApplicationMaster. + * @param applicationAttemptId ApplicationAttemptId being managed + * by the ApplicationMaster + */ + @Public + @Stable void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId); /** - * Get the host on which the ApplicationMaster is running. - * @return host on which the ApplicationMaster is running + * Get the host on which the ApplicationMaster is + * running. + * @return host on which the ApplicationMaster is running */ @Public @Stable String getHost(); + /** + * Set the host on which the ApplicationMaster is + * running. + * @param host host on which the ApplicationMaster + * is running + */ @Private @Unstable void setHost(String host); /** - * Get the RPC port on which the ApplicationMaster is responding. - * @return the RPC port on which the ApplicationMaster is + * Get the RPC port on which the ApplicationMaster + * is responding. + * @return the RPC port on which the ApplicationMaster is * responding */ @Public @Stable int getRpcPort(); - @Private - @Unstable + /** + * Set the RPC port on which the ApplicationMaster is + * responding. + * @param port RPC port on which the ApplicationMaster is + * responding + */ + @Public + @Stable void setRpcPort(int port); /** - * Get the tracking URL for the ApplicationMaster. - * @return the tracking URL for the ApplicationMaster + * Get the tracking URL for the ApplicationMaster. + * @return tracking URL for the ApplicationMaster */ @Public @Stable String getTrackingUrl(); - @Private - @Unstable - void setTrackingUrl(String string); + /** + * Set the tracking URL for the ApplicationMaster. + * @param trackingUrl tracking URL for the + * ApplicationMaster + */ + @Public + @Stable + void setTrackingUrl(String trackingUrl); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterResponse.java index b2232b8d7c1..9a1895fb14e 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/RegisterApplicationMasterResponse.java @@ -27,9 +27,7 @@ import org.apache.hadoop.yarn.api.records.Resource; /** *

The response sent by the ResourceManager to a new - * ApplicationMaster on registration via the - * {@link AMRMProtocol#registerApplicationMaster(RegisterApplicationMasterRequest)} - * api.

+ * ApplicationMaster on registration.

* *

The response contains critical details such as: *

    @@ -37,6 +35,8 @@ import org.apache.hadoop.yarn.api.records.Resource; *
  • Maximum capability for allocated resources in the cluster.
  • *
*

+ * + * @see AMRMProtocol#registerApplicationMaster(RegisterApplicationMasterRequest) */ @Public @Stable diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerRequest.java index 0f986442b57..a3f7e4b70d0 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerRequest.java @@ -18,17 +18,14 @@ package org.apache.hadoop.yarn.api.protocolrecords; -import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceStability.Stable; -import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; /** *

The request sent by the ApplicationMaster to the - * NodeManager to start a container via - * {@link ContainerManager#startContainer(StartContainerRequest)}.

+ * NodeManager to start a container.

* *

The ApplicationMaster has to provide details such as * allocated resource capability, security tokens (if enabled), command @@ -36,6 +33,7 @@ import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; * necessary binaries/jar/shared-objects etc. via the * {@link ContainerLaunchContext}.

* + * @see ContainerManager#startContainer(StartContainerRequest) */ @Public @Stable @@ -51,7 +49,13 @@ public interface StartContainerRequest { @Stable public abstract ContainerLaunchContext getContainerLaunchContext(); - @Private - @Unstable + /** + * Set the ContainerLaunchContext for the container to be started + * by the NodeManager + * @param context ContainerLaunchContext for the container to be + * started by the NodeManager + */ + @Public + @Stable public abstract void setContainerLaunchContext(ContainerLaunchContext context); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerResponse.java index ffbdbc9ee1a..b648eb67e39 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StartContainerResponse.java @@ -25,8 +25,9 @@ import org.apache.hadoop.yarn.api.ContainerManager; /** *

The response sent by the NodeManager to the * ApplicationMaster when asked to start an - * allocated container via - * {@link ContainerManager#startContainer(StartContainerRequest)}.

+ * allocated container.

+ * + * @see ContainerManager#startContainer(StartContainerRequest) */ @Public @Stable diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerRequest.java index bb538137938..2188939705e 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerRequest.java @@ -18,17 +18,16 @@ package org.apache.hadoop.yarn.api.protocolrecords; -import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceStability.Stable; -import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.records.ContainerId; /** *

The request sent by the ApplicationMaster to the - * NodeManager to stop a container via - * {@link ContainerManager#stopContainer(StopContainerRequest)}.

+ * NodeManager to stop a container.

+ * + * @see ContainerManager#stopContainer(StopContainerRequest) */ @Public @Stable @@ -41,7 +40,11 @@ public interface StopContainerRequest { @Stable ContainerId getContainerId(); - @Private - @Unstable + /** + * Set the ContainerId of the container to be stopped. + * @param containerId ContainerId of the container to be stopped + */ + @Public + @Stable void setContainerId(ContainerId containerId); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerResponse.java index 6b59ae66703..6bfd7cffe86 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/StopContainerResponse.java @@ -25,8 +25,9 @@ import org.apache.hadoop.yarn.api.ContainerManager; /** *

The response sent by the NodeManager to the * ApplicationMaster when asked to stop an - * allocated container via - * {@link ContainerManager#stopContainer(StopContainerRequest)}.

+ * allocated container.

+ * + * @see ContainerManager#stopContainer(StopContainerRequest) */ @Public @Stable diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationRequest.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationRequest.java index ac3e72eea46..0d548428964 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationRequest.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationRequest.java @@ -18,9 +18,43 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext; +import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; +import org.apache.hadoop.yarn.api.records.Resource; +/** + *

The request sent by a client to submit an application to the + * ResourceManager.

+ * + *

The request, via {@link ApplicationSubmissionContext}, contains + * details such as queue, {@link Resource} required to run the + * ApplicationMaster, the equivalent of + * {@link ContainerLaunchContext} for launching the + * ApplicationMaster etc. + * + * @see ClientRMProtocol#submitApplication(SubmitApplicationRequest) + */ +@Public +@Stable public interface SubmitApplicationRequest { + /** + * Get the ApplicationSubmissionContext for the application. + * @return ApplicationSubmissionContext for the application + */ + @Public + @Stable public abstract ApplicationSubmissionContext getApplicationSubmissionContext(); - public abstract void setApplicationSubmissionContext(ApplicationSubmissionContext context); + + /** + * Set the ApplicationSubmissionContext for the application. + * @param context ApplicationSubmissionContext for the + * application + */ + @Public + @Stable + public abstract void setApplicationSubmissionContext( + ApplicationSubmissionContext context); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationResponse.java index 9b1df9f1f8d..618641be6ae 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SubmitApplicationResponse.java @@ -18,6 +18,18 @@ package org.apache.hadoop.yarn.api.protocolrecords; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

The response sent by the ResourceManager to a client on + * application submission.

+ * + * @see ClientRMProtocol#submitApplication(SubmitApplicationRequest) + */ +@Public +@Stable public interface SubmitApplicationResponse { } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java index e51a0698acf..54b00551334 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java @@ -29,8 +29,7 @@ import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest; /** *

The response sent by the ResourceManager the - * ApplicationMaster during resource negotiation via - * {@link AMRMProtocol#allocate(AllocateRequest)}.

+ * ApplicationMaster during resource negotiation.

* *

The response includes: *

    @@ -46,6 +45,8 @@ import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest; * *
*

+ * + * @see AMRMProtocol#allocate(AllocateRequest) */ @Public @Unstable @@ -67,8 +68,8 @@ public interface AMResponse { public void setReboot(boolean reboot); /** - * Get the last response id. - * @return the last response id + * Get the last response id. + * @return last response id */ @Public @Stable @@ -79,9 +80,9 @@ public interface AMResponse { public void setResponseId(int responseId); /** - * Get the list of newly allocated {@link Container} by the + * Get the list of newly allocated Container by the * ResourceManager. - * @return list of newly allocated Container + * @return list of newly allocated Container */ @Public @Stable @@ -112,7 +113,10 @@ public interface AMResponse { public void clearNewContainers(); /** - * Get available headroom for resources in the cluster for the application. + * Get the available headroom for resources in the cluster for the + * application. + * @return limit available headroom for resources in the cluster for the + * application */ @Public @Stable @@ -123,8 +127,8 @@ public interface AMResponse { public void setAvailableResources(Resource limit); /** - * Get the list of completed containers. - * @return the list of completed containers + * Get the list of completed containers. + * @return the list of completed containers */ @Public @Stable diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationReport.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationReport.java index 5512db4beb6..ca7a6f415a1 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationReport.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationReport.java @@ -18,38 +18,172 @@ package org.apache.hadoop.yarn.api.records; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

ApplicationReport is a report of an application.

+ * + *

It includes details such as: + *

    + *
  • {@link ApplicationId} of the application.
  • + *
  • Applications user.
  • + *
  • Application queue.
  • + *
  • Application name.
  • + *
  • Host on which the ApplicationMasteris running.
  • + *
  • RPC port of the ApplicationMaster.
  • + *
  • Tracking URL.
  • + *
  • {@link ApplicationState} of the application.
  • + *
  • Diagnostic information in case of errors.
  • + *
  • Start time of the application.
  • + *
  • Client token of the application (if security is enabled).
  • + *
+ *

+ * + * @see ClientRMProtocol#getApplicationReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest) + */ +@Public +@Stable public interface ApplicationReport { + /** + * Get the ApplicationId of the application. + * @return ApplicationId of the application + */ + @Public + @Stable ApplicationId getApplicationId(); + + @Private + @Unstable void setApplicationId(ApplicationId applicationId); + /** + * Get the user who submitted the application. + * @return user who submitted the application + */ + @Public + @Stable String getUser(); + + @Private + @Unstable void setUser(String user); + /** + * Get the queue to which the application was submitted. + * @return queue to which the application was submitted + */ + @Public + @Stable String getQueue(); + + @Private + @Unstable void setQueue(String queue); + /** + * Get the user-defined name of the application. + * @return name of the application + */ + @Public + @Stable String getName(); + + @Private + @Unstable void setName(String name); + /** + * Get the host on which the ApplicationMaster + * is running. + * @return host on which the ApplicationMaster + * is running + */ + @Public + @Stable String getHost(); + + @Private + @Unstable void setHost(String host); + /** + * Get the RPC port of the ApplicationMaster. + * @return RPC port of the ApplicationMaster + */ + @Public + @Stable int getRpcPort(); + + @Private + @Unstable void setRpcPort(int rpcPort); + /** + * Get the client token for communicating with the + * ApplicationMaster. + * @return client token for communicating with the + * ApplicationMaster + */ + @Public + @Stable String getClientToken(); + + @Private + @Unstable void setClientToken(String clientToken); + /** + * Get the ApplicationState of the application. + * @return ApplicationState of the application + */ + @Public + @Stable ApplicationState getState(); + + @Private + @Unstable void setState(ApplicationState state); + /** + * Get the diagnositic information of the application in case of + * errors. + * @return diagnositic information of the application in case + * of errors + */ + @Public + @Stable String getDiagnostics(); + + @Private + @Unstable void setDiagnostics(String diagnostics); + /** + * Get the tracking url for the application. + * @return tracking url for the application + */ + @Public + @Stable String getTrackingUrl(); + + @Private + @Unstable void setTrackingUrl(String url); + /** + * Get the start time of the application. + * @return start time of the application + */ + @Public + @Stable long getStartTime(); + + @Private + @Unstable void setStartTime(long startTime); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationSubmissionContext.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationSubmissionContext.java index e8de1f3f624..46511ca0d27 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationSubmissionContext.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationSubmissionContext.java @@ -22,68 +22,319 @@ import java.nio.ByteBuffer; import java.util.List; import java.util.Map; -public interface ApplicationSubmissionContext { - public abstract ApplicationId getApplicationId(); - public abstract String getApplicationName(); - public abstract Resource getMasterCapability(); - - public abstract Map getAllResources(); - public abstract URL getResource(String key); - - public abstract Map getAllResourcesTodo(); - public abstract LocalResource getResourceTodo(String key); - - public abstract List getFsTokenList(); - public abstract String getFsToken(int index); - public abstract int getFsTokenCount(); - - public abstract ByteBuffer getFsTokensTodo(); - - public abstract Map getAllEnvironment(); - public abstract String getEnvironment(String key); - - public abstract List getCommandList(); - public abstract String getCommand(int index); - public abstract int getCommandCount(); - - public abstract String getQueue(); - public abstract Priority getPriority(); - public abstract String getUser(); +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; +/** + *

ApplicationSubmissionContext represents the all of the + * information needed by the ResourceManager to launch + * the ApplicationMaster for an application.

+ * + *

It includes details such as: + *

    + *
  • {@link ApplicationId} of the application.
  • + *
  • + * {@link Resource} necessary to run the ApplicationMaster. + *
  • + *
  • Application user.
  • + *
  • Application name.
  • + *
  • {@link Priority} of the application.
  • + *
  • Security tokens (if security is enabled).
  • + *
  • + * {@link LocalResource} necessary for running the + * ApplicationMaster container such + * as binaries, jar, shared-objects, side-files etc. + *
  • + *
  • + * Environment variables for the launched ApplicationMaster + * process. + *
  • + *
  • Command to launch the ApplicationMaster.
  • + *
+ *

+ * + * @see ClientRMProtocol#submitApplication(org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest) + */ +@Public +@Stable +public interface ApplicationSubmissionContext { + /** + * Get the ApplicationId of the submitted application. + * @return ApplicationId of the submitted application + */ + @Public + @Stable + public ApplicationId getApplicationId(); + /** + * Set the ApplicationId of the submitted application. + * @param appplicationId ApplicationId of the submitted + * application + */ + @Public + @Stable + public void setApplicationId(ApplicationId appplicationId); + + /** + * Get the application name. + * @return application name + */ + @Public + @Stable + public String getApplicationName(); - public abstract void setApplicationId(ApplicationId appplicationId); - public abstract void setApplicationName(String applicationName); - public abstract void setMasterCapability(Resource masterCapability); + /** + * Set the application name. + * @param applicationName application name + */ + @Public + @Stable + public void setApplicationName(String applicationName); - public abstract void addAllResources(Map resources); - public abstract void setResource(String key, URL url); - public abstract void removeResource(String key); - public abstract void clearResources(); + /** + * Get the queue to which the application is being submitted. + * @return queue to which the application is being submitted + */ + @Public + @Stable + public String getQueue(); - public abstract void addAllResourcesTodo(Map resourcesTodo); - public abstract void setResourceTodo(String key, LocalResource localResource); - public abstract void removeResourceTodo(String key); - public abstract void clearResourcesTodo(); + /** + * Set the queue to which the application is being submitted + * @param queue queue to which the application is being submitted + */ + @Public + @Stable + public void setQueue(String queue); - public abstract void addAllFsTokens(List fsTokens); - public abstract void addFsToken(String fsToken); - public abstract void removeFsToken(int index); - public abstract void clearFsTokens(); + /** + * Get the Priority of the application. + * @return Priority of the application + */ + @Public + @Stable + public Priority getPriority(); + + /** + * Set the Priority of the application. + * @param priority Priority of the application + */ + @Public + @Stable + public void setPriority(Priority priority); - public abstract void setFsTokensTodo(ByteBuffer fsTokensTodo); + /** + * Get the user submitting the application. + * @return user submitting the application + */ + @Public + @Stable + public String getUser(); - public abstract void addAllEnvironment(Map environment); - public abstract void setEnvironment(String key, String env); - public abstract void removeEnvironment(String key); - public abstract void clearEnvironment(); + /** + * Set the user submitting the application. + * @param user user submitting the application + */ + @Public + @Stable + public void setUser(String user); - public abstract void addAllCommands(List commands); - public abstract void addCommand(String command); - public abstract void removeCommand(int index); - public abstract void clearCommands(); + /** + * Get the Resource required to run the + * ApplicationMaster. + * @return Resource required to run the + * ApplicationMaster + */ + @Public + @Stable + public Resource getMasterCapability(); - public abstract void setQueue(String queue); - public abstract void setPriority(Priority priority); - public abstract void setUser(String user); + /** + * Set Resource required to run the + * ApplicationMaster. + * @param masterCapability Resource required to run the + * ApplicationMaster + */ + @Public + @Stable + public void setMasterCapability(Resource masterCapability); + + @Private + @Unstable + public Map getAllResources(); + + @Private + @Unstable + public URL getResource(String key); + + @Private + @Unstable + public void addAllResources(Map resources); + + @Private + @Unstable + public void setResource(String key, URL url); + + @Private + @Unstable + public void removeResource(String key); + + @Private + @Unstable + public void clearResources(); + + /** + * Get all the LocalResource required to run the + * ApplicationMaster. + * @return LocalResource required to run the + * ApplicationMaster + */ + @Public + @Stable + public Map getAllResourcesTodo(); + + @Private + @Unstable + public LocalResource getResourceTodo(String key); + + /** + * Add all the LocalResource required to run the + * ApplicationMaster. + * @param resources all LocalResource required to run the + * ApplicationMaster + */ + @Public + @Stable + public void addAllResourcesTodo(Map resources); + + @Private + @Unstable + public void setResourceTodo(String key, LocalResource localResource); + + @Private + @Unstable + public void removeResourceTodo(String key); + + @Private + @Unstable + public void clearResourcesTodo(); + + @Private + @Unstable + public List getFsTokenList(); + + @Private + @Unstable + public String getFsToken(int index); + + @Private + @Unstable + public int getFsTokenCount(); + + @Private + @Unstable + public void addAllFsTokens(List fsTokens); + + @Private + @Unstable + public void addFsToken(String fsToken); + + @Private + @Unstable + public void removeFsToken(int index); + + @Private + @Unstable + public void clearFsTokens(); + + /** + * Get file-system tokens for the ApplicationMaster. + * @return file-system tokens for the ApplicationMaster + */ + @Public + @Stable + public ByteBuffer getFsTokensTodo(); + + /** + * Set file-system tokens for the ApplicationMaster. + * @param fsTokens file-system tokens for the ApplicationMaster + */ + @Public + @Stable + public void setFsTokensTodo(ByteBuffer fsTokens); + + /** + * Get the environment variables for the + * ApplicationMaster. + * @return environment variables for the ApplicationMaster + */ + @Public + @Stable + public Map getAllEnvironment(); + + @Private + @Unstable + public String getEnvironment(String key); + + /** + * Add all of the environment variables for the + * ApplicationMaster. + * @param environment environment variables for the + * ApplicationMaster + */ + @Public + @Stable + public void addAllEnvironment(Map environment); + + @Private + @Unstable + public void setEnvironment(String key, String env); + + @Private + @Unstable + public void removeEnvironment(String key); + + @Private + @Unstable + public void clearEnvironment(); + + /** + * Get the commands to launch the ApplicationMaster. + * @return commands to launch the ApplicationMaster + */ + @Public + @Stable + public List getCommandList(); + + @Private + @Unstable + public String getCommand(int index); + + @Private + @Unstable + public int getCommandCount(); + + /** + * Add all of the commands to launch the + * ApplicationMaster. + * @param commands commands to launch the ApplicationMaster + */ + @Public + @Stable + public void addAllCommands(List commands); + + @Private + @Unstable + public void addCommand(String command); + + @Private + @Unstable + public void removeCommand(int index); + + @Private + @Unstable + public void clearCommands(); } \ No newline at end of file diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java index 0921b926f28..cf5c9d0d4e0 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java @@ -26,6 +26,7 @@ import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ContainerManager; /** *

ContainerLaunchContext represents the all of the information @@ -43,17 +44,11 @@ import org.apache.hadoop.classification.InterfaceStability.Unstable; * *

  • Optional, application-specific binary service data.
  • *
  • Environment variables for the launched process.
  • - *
  • Command to be executed to launch the container.
  • - *
  • - *
  • - *
  • - *
  • - *
  • - *
  • - *
  • - *
  • + *
  • Command to launch the container.
  • * *

    + * + * @see ContainerManager#startContainer(org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest) */ @Public @Stable @@ -66,8 +61,12 @@ public interface ContainerLaunchContext { @Stable ContainerId getContainerId(); - @Private - @Unstable + /** + * Set ContainerId of container to be launched. + * @param containerId et ContainerId of container to be launched + */ + @Public + @Stable void setContainerId(ContainerId containerId); /** @@ -78,8 +77,12 @@ public interface ContainerLaunchContext { @Stable String getUser(); - @Private - @Unstable + /** + * Set the user to whom the container has been allocated + * @param user user to whom the container has been allocated + */ + @Public + @Stable void setUser(String user); /** @@ -91,9 +94,14 @@ public interface ContainerLaunchContext { @Public @Stable Resource getResource(); - - @Private - @Unstable + + /** + * Set the Resource allocated to the container by the + * ResourceManager. + * @param resource allocated resource + */ + @Public + @Stable void setResource(Resource resource); /** @@ -104,8 +112,12 @@ public interface ContainerLaunchContext { @Stable ByteBuffer getContainerTokens(); - @Private - @Unstable + /** + * Set security tokens (if security is enabled). + * @param containerToken security tokens + */ + @Public + @Stable void setContainerTokens(ByteBuffer containerToken); /** @@ -119,9 +131,13 @@ public interface ContainerLaunchContext { @Private @Unstable LocalResource getLocalResource(String key); - - @Private - @Unstable + + /** + * Add all LocalResource required by the container. + * @param localResources LocalResource required by the container + */ + @Public + @Stable void addAllLocalResources(Map localResources); @Private @@ -147,9 +163,13 @@ public interface ContainerLaunchContext { @Private @Unstable ByteBuffer getServiceData(String key); - - @Private - @Unstable + + /** + * Add add application-specific binary service data. + * @param serviceData application-specific binary service data + */ + @Public + @Stable void addAllServiceData(Map serviceData); @Private @@ -176,8 +196,12 @@ public interface ContainerLaunchContext { @Unstable String getEnv(String key); - @Private - @Unstable + /** + * Add environment variables for the launched container. + * @param env environment variables for the launched container + */ + @Public + @Stable void addAllEnv(Map env); @Private @@ -208,8 +232,12 @@ public interface ContainerLaunchContext { @Unstable int getCommandCount(); - @Private - @Unstable + /** + * Add the list of commands for launching the container. + * @param commands the list of commands for launching the container + */ + @Public + @Stable void addAllCommands(List commands); @Private diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResource.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResource.java index 0419a03f4d4..10dd23a3fae 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResource.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResource.java @@ -18,16 +18,92 @@ package org.apache.hadoop.yarn.api.records; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ContainerManager; + +/** + *

    LocalResource represents a local resource required to + * run a container.

    + * + *

    The NodeManager is responsible for localizing the resource + * prior to launching the container.

    + * + *

    Applications can specify {@link LocalResourceType} and + * {@link LocalResourceVisibility}.

    + * + * @see LocalResourceType + * @see LocalResourceVisibility + * @see ContainerLaunchContext + * @see ApplicationSubmissionContext + * @see ContainerManager#startContainer(org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest) + */ +@Public +@Stable public interface LocalResource { - public abstract URL getResource(); - public abstract long getSize(); - public abstract long getTimestamp(); - public abstract LocalResourceType getType(); - public abstract LocalResourceVisibility getVisibility(); + /** + * Get the location of the resource to be localized. + * @return location of the resource to be localized + */ + public URL getResource(); - public abstract void setResource(URL resource); - public abstract void setSize(long size); - public abstract void setTimestamp(long timestamp); - public abstract void setType(LocalResourceType type); - public abstract void setVisibility(LocalResourceVisibility visibility); + /** + * Set location of the resource to be localized. + * @param resource location of the resource to be localized + */ + public void setResource(URL resource); + + /** + * Get the size of the resource to be localized. + * @return size of the resource to be localized + */ + public long getSize(); + + /** + * Set the size of the resource to be localized. + * @param size size of the resource to be localized + */ + public void setSize(long size); + + /** + * Get the original timestamp of the resource to be localized, used + * for verification. + * @return timestamp of the resource to be localized + */ + public long getTimestamp(); + + /** + * Set the timestamp of the resource to be localized, used + * for verification. + * @param timestamp timestamp of the resource to be localized + */ + public void setTimestamp(long timestamp); + + /** + * Get the LocalResourceType of the resource to be localized. + * @return LocalResourceType of the resource to be localized + */ + public LocalResourceType getType(); + + /** + * Set the LocalResourceType of the resource to be localized. + * @param type LocalResourceType of the resource to be localized + */ + public void setType(LocalResourceType type); + + /** + * Get the LocalResourceVisibility of the resource to be + * localized. + * @return LocalResourceVisibility of the resource to be + * localized + */ + public LocalResourceVisibility getVisibility(); + + /** + * Set the LocalResourceVisibility of the resource to be + * localized. + * @param visibility LocalResourceVisibility of the resource to be + * localized + */ + public void setVisibility(LocalResourceVisibility visibility); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResourceType.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResourceType.java index 72a1dd04d2e..0cfed1c4d2d 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResourceType.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResourceType.java @@ -18,6 +18,42 @@ package org.apache.hadoop.yarn.api.records; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ContainerManager; + +/** + *

    LocalResourceType specifies the type + * of a resource localized by the NodeManager.

    + * + *

    The type can be one of: + *

      + *
    • + * {@link #FILE} - Regular file i.e. uninterpreted bytes. + *
    • + *
    • + * {@link #ARCHIVE} - Archive, which is automatically unarchived by the + * NodeManager. + *
    • + *
    + *

    + * + * @see LocalResource + * @see ContainerLaunchContext + * @see ApplicationSubmissionContext + * @see ContainerManager#startContainer(org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest) + */ +@Public +@Stable public enum LocalResourceType { - ARCHIVE, FILE + + /** + * Archive, which is automatically unarchived by the NodeManager. + */ + ARCHIVE, + + /** + * Regular file i.e. uninterpreted bytes. + */ + FILE } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResourceVisibility.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResourceVisibility.java index 45932131e6e..232ab0a3531 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResourceVisibility.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/LocalResourceVisibility.java @@ -18,6 +18,48 @@ package org.apache.hadoop.yarn.api.records; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ContainerManager; + +/** + *

    LocalResourceVisibility specifies the visibility + * of a resource localized by the NodeManager.

    + * + *

    The visibility can be one of: + *

      + *
    • {@link #PUBLIC} - Shared by all users on the node.
    • + *
    • + * {@link #PRIVATE} - Shared among all applications of the + * same user on the node. + *
    • + *
    • + * {@link #APPLICATION} - Shared only among containers of the + * same application on the node. + *
    • + *
    + *

    + * + * @see LocalResource + * @see ContainerLaunchContext + * @see ApplicationSubmissionContext + * @see ContainerManager#startContainer(org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest) + */ +@Public +@Stable public enum LocalResourceVisibility { - PUBLIC, PRIVATE, APPLICATION + /** + * Shared by all users on the node. + */ + PUBLIC, + + /** + * Shared among all applications of the same user on the node. + */ + PRIVATE, + + /** + * Shared only among containers of the same application on the node. + */ + APPLICATION } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeHealthStatus.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeHealthStatus.java index 01f5f6017bd..c507e45b1a4 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeHealthStatus.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeHealthStatus.java @@ -17,17 +17,69 @@ */ package org.apache.hadoop.yarn.api.records; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

    NodeHealthStatus is a summary of the health status of the + * node.

    + * + *

    It includes information such as: + *

      + *
    • + * An indicator of whether the node is healthy, as determined by the + * health-check script. + *
    • + *
    • The previous time at which the health status was reported.
    • + *
    • A diagnostic report on the health status.
    • + *
    • + *
    • + *
    + *

    + * + * @see NodeReport + * @see ClientRMProtocol#getClusterNodes(org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest) + */ +@Public +@Stable public interface NodeHealthStatus { + /** + * Is the node healthy? + * @return true if the node is healthy, else false + */ + @Public + @Stable boolean getIsNodeHealthy(); - String getHealthReport(); - - long getLastHealthReportTime(); - + @Private + @Unstable void setIsNodeHealthy(boolean isNodeHealthy); + /** + * Get the diagnostic health report of the node. + * @return diagnostic health report of the node + */ + @Public + @Stable + String getHealthReport(); + + @Private + @Unstable void setHealthReport(String healthReport); + /** + * Get the last timestamp at which the health report was received. + * @return last timestamp at which the health report was received + */ + @Public + @Stable + long getLastHealthReportTime(); + + @Private + @Unstable void setLastHealthReportTime(long lastHealthReport); } \ No newline at end of file diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java index 7e333e909b2..8241db6b1b2 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java @@ -18,19 +18,113 @@ package org.apache.hadoop.yarn.api.records; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

    NodeReport is a summary of runtime information of a + * node in the cluster.

    + * + *

    It includes details such as: + *

      + *
    • {@link NodeId} of the node.
    • + *
    • HTTP Tracking URL of the node.
    • + *
    • Rack name for the node.
    • + *
    • Used {@link Resource} on the node.
    • + *
    • Total available {@link Resource} of the node.
    • + *
    • Number of running containers on the node.
    • + *
    • {@link NodeHealthStatus} of the node.
    • + *
    + *

    + * + * @see NodeHealthStatus + * @see ClientRMProtocol#getClusterNodes(org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest) + */ +@Public +@Stable public interface NodeReport { + /** + * Get the NodeId of the node. + * @return NodeId of the node + */ NodeId getNodeId(); + + @Private + @Unstable void setNodeId(NodeId nodeId); + + /** + * Get the http address of the node. + * @return http address of the node + */ + @Public + @Stable String getHttpAddress(); + + @Private + @Unstable void setHttpAddress(String httpAddress); + + /** + * Get the rack name for the node. + * @return rack name for the node + */ + @Public + @Stable String getRackName(); + + @Private + @Unstable void setRackName(String rackName); + + /** + * Get used Resource on the node. + * @return used Resource on the node + */ + @Public + @Stable Resource getUsed(); + + @Private + @Unstable void setUsed(Resource used); + + /** + * Get the total Resource on the node. + * @return total Resource on the node + */ + @Public + @Stable Resource getCapability(); + + @Private + @Unstable void setCapability(Resource capability); + + /** + * Get the number of running containers on the node. + * @return number of running containers on the node + */ + @Public + @Stable int getNumContainers(); + + @Private + @Unstable void setNumContainers(int numContainers); + + /** + * Get the NodeHealthStatus of the node. + * @return NodeHealthStatus of the node + */ + @Public + @Stable NodeHealthStatus getNodeHealthStatus(); + + @Private + @Unstable void setNodeHealthStatus(NodeHealthStatus nodeHealthStatus); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueACL.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueACL.java index 826222880ae..eab91fa3a8d 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueACL.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueACL.java @@ -18,8 +18,39 @@ package org.apache.hadoop.yarn.api.records; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

    QueueACL enumerates the various ACLs for queues.

    + * + *

    The ACLs are one of: + *

      + *
    • {@link #SUBMIT_JOB} - ACL to submit jobs to the queue.
    • + *
    • {@link #ADMINISTER_QUEUE} - ACL to administer the queue.
    • + *
    • {@link #ADMINISTER_JOBS} - ACL to administer jobs in the queue.
    • + *
    + *

    + * + * @see QueueInfo + * @see ClientRMProtocol#getQueueUserAcls(org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoRequest) + */ +@Public +@Stable public enum QueueACL { + /** + * ACL to submit jobs to the queue. + */ SUBMIT_JOB, + + /** + * ACL to administer the queue. + */ ADMINISTER_QUEUE, + + /** + * ACL to administer jobs in the queue. + */ ADMINISTER_JOBS; // currently unused } \ No newline at end of file diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueInfo.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueInfo.java index 85c51e9fda7..a783c3ced8a 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueInfo.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueInfo.java @@ -20,25 +20,114 @@ package org.apache.hadoop.yarn.api.records; import java.util.List; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

    QueueInfo

    is a report of the runtime information of the queue.

    + * + *

    It includes information such as: + *

      + *
    • Queue name.
    • + *
    • Capacity of the queue.
    • + *
    • Maximum capacity of the queue.
    • + *
    • Current capacity of the queue.
    • + *
    • Child queues.
    • + *
    • Running applications.
    • + *
    • {@link QueueState} of the queue.
    • + *
    + *

    + * + * @see QueueState + * @see ClientRMProtocol#getQueueInfo(org.apache.hadoop.yarn.api.protocolrecords.GetQueueInfoRequest) + */ +@Public +@Stable public interface QueueInfo { + /** + * Get the name of the queue. + * @return name of the queue + */ + @Public + @Stable String getQueueName(); + + @Private + @Unstable void setQueueName(String queueName); + /** + * Get the configured capacity of the queue. + * @return configured capacity of the queue + */ + @Public + @Stable float getCapacity(); + + @Private + @Unstable void setCapacity(float capacity); + /** + * Get the maximum capacity of the queue. + * @return maximum capacity of the queue + */ + @Public + @Stable float getMaximumCapacity(); + + @Private + @Unstable void setMaximumCapacity(float maximumCapacity); + /** + * Get the current capacity of the queue. + * @return current capacity of the queue + */ + @Public + @Stable float getCurrentCapacity(); + + @Private + @Unstable void setCurrentCapacity(float currentCapacity); + /** + * Get the child queues of the queue. + * @return child queues of the queue + */ + @Public + @Stable List getChildQueues(); + + @Private + @Unstable void setChildQueues(List childQueues); + /** + * Get the running applications of the queue. + * @return running applications of the queue + */ + @Public + @Stable List getApplications(); + + @Private + @Unstable void setApplications(List applications); + /** + * Get the QueueState of the queue. + * @return QueueState of the queue + */ + @Public + @Stable QueueState getQueueState(); + + @Private + @Unstable void setQueueState(QueueState queueState); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueState.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueState.java index 32696b6663b..3d019669357 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueState.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueState.java @@ -18,10 +18,33 @@ package org.apache.hadoop.yarn.api.records; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + /** - * State of a Queue + *

    State of a Queue.

    + * + *

    A queue is one of: + *

      + *
    • {@link #RUNNING} - normal state.
    • + *
    • {@link #STOPPED} - not accepting new application submissions. + *
    + *

    + * + * @see QueueInfo + * @see ClientRMProtocol#getQueueInfo(org.apache.hadoop.yarn.api.protocolrecords.GetQueueInfoRequest) */ +@Public +@Stable public enum QueueState { - STOPPED, + /** + * Stopped - Not accepting submissions of new applications. + */ + STOPPED, + + /** + * Running - normal operation. + */ RUNNING } \ No newline at end of file diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueUserACLInfo.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueUserACLInfo.java index b72159acac2..704cc16e90a 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueUserACLInfo.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueUserACLInfo.java @@ -20,10 +20,43 @@ package org.apache.hadoop.yarn.api.records; import java.util.List; +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ClientRMProtocol; + +/** + *

    QueueUserACLInfo provides information {@link QueueACL} for + * the given user.

    + * + * @see QueueACL + * @see ClientRMProtocol#getQueueUserAcls(org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoRequest) + */ +@Public +@Stable public interface QueueUserACLInfo { + /** + * Get the queue name of the queue. + * @return queue name of the queue + */ + @Public + @Stable String getQueueName(); - void setQueueName(String queueName); + @Private + @Unstable + void setQueueName(String queueName); + + /** + * Get the list of QueueACL for the given user. + * @return list of QueueACL for the given user + */ + @Public + @Stable List getUserAcls(); + + @Private + @Unstable void setUserAcls(List acls); }