hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject [20/50] [abbrv] hadoop git commit: YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang.
Date Wed, 02 Sep 2015 05:58:32 GMT
YARN-1556. NPE getting application report with a null appId. Contributed by Weiwei Yang.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/beb65c94
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/beb65c94
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/beb65c94

Branch: refs/heads/HDFS-7285
Commit: beb65c9465806114237aa271b07b31ff3c1f4404
Parents: e166c03
Author: Junping Du <junping_du@apache.org>
Authored: Fri Aug 28 05:57:34 2015 -0700
Committer: Junping Du <junping_du@apache.org>
Committed: Fri Aug 28 05:57:34 2015 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                         |  7 +++++--
 .../yarn/server/resourcemanager/ClientRMService.java    |  3 +++
 .../server/resourcemanager/TestClientRMService.java     | 12 ++++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/beb65c94/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 51715cf..0b733a4 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -413,12 +413,15 @@ Release 2.8.0 - UNRELEASED
     YARN-4026. Refactored ContainerAllocator to accept a list of priorites
     rather than a single priority. (Wangda Tan via jianhe)
 
-   YARN-4031. Add JvmPauseMonitor to ApplicationHistoryServer and
-   WebAppProxyServer (djp via rkanter)
+    YARN-4031. Add JvmPauseMonitor to ApplicationHistoryServer and
+    WebAppProxyServer (djp via rkanter)
 
     YARN-4057. If ContainersMonitor is not enabled, only print
     related log info one time. (Jun Gong via zxu)
 
+    YARN-1556. NPE getting application report with a null appId. (Weiwei Yang via 
+    junping_du)
+
   OPTIMIZATIONS
 
     YARN-3339. TestDockerContainerExecutor should pull a single image and not

http://git-wip-us.apache.org/repos/asf/hadoop/blob/beb65c94/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
index 3e16165..cce0fe5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java
@@ -315,6 +315,9 @@ public class ClientRMService extends AbstractService implements
   public GetApplicationReportResponse getApplicationReport(
       GetApplicationReportRequest request) throws YarnException {
     ApplicationId applicationId = request.getApplicationId();
+    if (applicationId == null) {
+      throw new ApplicationNotFoundException("Invalid application id: null");
+    }
 
     UserGroupInformation callerUGI;
     try {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/beb65c94/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
index 8031759..6a0b99c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMService.java
@@ -333,6 +333,18 @@ public class TestClientRMService {
           report.getApplicationResourceUsageReport();
       Assert.assertEquals(10, usageReport.getMemorySeconds());
       Assert.assertEquals(3, usageReport.getVcoreSeconds());
+
+      // if application id is null
+      GetApplicationReportRequest invalidRequest = recordFactory
+          .newRecordInstance(GetApplicationReportRequest.class);
+      invalidRequest.setApplicationId(null);
+      try {
+        rmService.getApplicationReport(invalidRequest);
+      } catch (YarnException e) {
+        // rmService should return a ApplicationNotFoundException
+        // when a null application id is provided
+        Assert.assertTrue(e instanceof ApplicationNotFoundException);
+      }
     } finally {
       rmService.close();
     }


Mime
View raw message