From e8a09094f52ed1195e99937448bd93369f2a4a26 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Tue, 28 Jan 2014 19:52:48 +0000 Subject: [PATCH] YARN-979. Added more APIs for getting information about ApplicationAttempts and Containers from ApplicationHistoryProtocol. Contributed by Mayank Bansal and Zhijie Shen. svn merge --ignore-ancestry -c 1556731 ../YARN-321 git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1562187 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 4 + .../yarn/api/ApplicationHistoryProtocol.java | 200 +++++++++++++++--- .../GetApplicationAttemptReportRequest.java | 71 +++++++ .../GetApplicationAttemptReportResponse.java | 70 ++++++ .../GetApplicationAttemptsRequest.java | 64 ++++++ .../GetApplicationAttemptsResponse.java | 73 +++++++ .../GetContainerReportRequest.java | 61 ++++++ .../GetContainerReportResponse.java | 59 ++++++ .../protocolrecords/GetContainersRequest.java | 65 ++++++ .../GetContainersResponse.java | 75 +++++++ ...proto => application_history_client.proto} | 7 +- .../src/main/proto/yarn_service_protos.proto | 36 ++++ ...ApplicationAttemptReportRequestPBImpl.java | 138 ++++++++++++ ...pplicationAttemptReportResponsePBImpl.java | 140 ++++++++++++ .../GetApplicationAttemptsRequestPBImpl.java | 134 ++++++++++++ .../GetApplicationAttemptsResponsePBImpl.java | 186 ++++++++++++++++ .../pb/GetContainerReportRequestPBImpl.java | 129 +++++++++++ .../pb/GetContainerReportResponsePBImpl.java | 129 +++++++++++ .../impl/pb/GetContainersRequestPBImpl.java | 131 ++++++++++++ .../impl/pb/GetContainersResponsePBImpl.java | 180 ++++++++++++++++ .../AHSClientService.java | 39 ++++ 21 files changed, 1963 insertions(+), 28 deletions(-) create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationAttemptReportRequest.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationAttemptReportResponse.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationAttemptsRequest.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetApplicationAttemptsResponse.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerReportRequest.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerReportResponse.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainersRequest.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainersResponse.java rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/{application_history_service.proto => application_history_client.proto} (74%) create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportRequestPBImpl.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportResponsePBImpl.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsRequestPBImpl.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsResponsePBImpl.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportRequestPBImpl.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportResponsePBImpl.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersRequestPBImpl.java create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersResponsePBImpl.java diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index be1d4593bf4..be0cf8ffe9c 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -483,6 +483,10 @@ Branch YARN-321: Generic ApplicationHistoryService YARN-1123. Added a new ContainerReport and its Protobuf implementation. (Mayank Bansal via vinodkv) + YARN-979. Added more APIs for getting information about ApplicationAttempts + and Containers from ApplicationHistoryProtocol. (Mayank Bansal and Zhijie Shen + via vinodkv) + Release 2.2.0 - 2013-10-13 INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ApplicationHistoryProtocol.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ApplicationHistoryProtocol.java index 491aad3b81c..b10a1adb485 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ApplicationHistoryProtocol.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/ApplicationHistoryProtocol.java @@ -18,42 +18,60 @@ package org.apache.hadoop.yarn.api; +import java.io.IOException; + import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenResponse; +import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptReportRequest; +import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptReportResponse; +import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptsRequest; +import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptsResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationsRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationsResponse; +import org.apache.hadoop.yarn.api.protocolrecords.GetContainerReportRequest; +import org.apache.hadoop.yarn.api.protocolrecords.GetContainerReportResponse; +import org.apache.hadoop.yarn.api.protocolrecords.GetContainersRequest; +import org.apache.hadoop.yarn.api.protocolrecords.GetContainersResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenResponse; import org.apache.hadoop.yarn.api.protocolrecords.RenewDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.RenewDelegationTokenResponse; +import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; +import org.apache.hadoop.yarn.api.records.ApplicationAttemptReport; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationReport; +import org.apache.hadoop.yarn.api.records.ContainerId; +import org.apache.hadoop.yarn.api.records.ContainerReport; import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.exceptions.YarnException; /** - *

The protocol between clients and the ApplicationHistoryService - * to get information on completed applications etc.

+ *

The protocol between clients and the ApplicationHistoryServer + * to get the information of completed applications etc.

*/ +@Public +@Unstable public interface ApplicationHistoryProtocol { /** *

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

- * + * the ResourceManager.

+ * *

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

* - *

In secure mode,the HistoryServer verifies access to the - * application etc. before accepting the request.

- * - *

The HistoryServer responds with a + *

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

+ * + *

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

- * + * *

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