hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject hadoop git commit: Revert "YARN-7118. AHS REST API can return NullPointerException. Contributed by Billie Rinaldi."
Date Sat, 23 Sep 2017 18:15:24 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 de1d74764 -> d0c0bd573


Revert "YARN-7118. AHS REST API can return NullPointerException. Contributed by Billie Rinaldi."

This reverts commit de1d747644727ed7c469570bad56400741fb034e.


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

Branch: refs/heads/branch-2
Commit: d0c0bd573ba3c7d1a414699143b5114626e50215
Parents: de1d747
Author: Anu Engineer <aengineer@apache.org>
Authored: Sat Sep 23 11:12:16 2017 -0700
Committer: Anu Engineer <aengineer@apache.org>
Committed: Sat Sep 23 11:12:16 2017 -0700

----------------------------------------------------------------------
 ...pplicationHistoryManagerOnTimelineStore.java | 16 +++--------
 .../webapp/TestAHSWebServices.java              | 28 +++-----------------
 .../hadoop/yarn/server/webapp/WebServices.java  |  3 +--
 3 files changed, 9 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d0c0bd57/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
index 99bbe32..4c3705f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
@@ -146,11 +146,7 @@ public class TestApplicationHistoryManagerOnTimelineStore {
       } else if (i == 3) {
         entities.addEntity(createApplicationTimelineEntity(
             appId, false, false, false, false, YarnApplicationState.FINISHED,
-            true, false));
-      } else if (i == SCALE + 1) {
-        entities.addEntity(createApplicationTimelineEntity(
-            appId, false, false, false, false, YarnApplicationState.FINISHED,
-            false, true));
+            true));
       } else {
         entities.addEntity(createApplicationTimelineEntity(
             appId, false, false, false, false, YarnApplicationState.FINISHED));
@@ -501,14 +497,13 @@ public class TestApplicationHistoryManagerOnTimelineStore {
       boolean wrongAppId, boolean enableUpdateEvent,
       YarnApplicationState state) {
     return createApplicationTimelineEntity(appId, emptyACLs, noAttemptId,
-        wrongAppId, enableUpdateEvent, state, false, false);
+        wrongAppId, enableUpdateEvent, state, false);
   }
 
   private static TimelineEntity createApplicationTimelineEntity(
       ApplicationId appId, boolean emptyACLs, boolean noAttemptId,
       boolean wrongAppId, boolean enableUpdateEvent,
-      YarnApplicationState state, boolean missingPreemptMetrics,
-      boolean missingQueue) {
+      YarnApplicationState state, boolean missingPreemptMetrics) {
     TimelineEntity entity = new TimelineEntity();
     entity.setEntityType(ApplicationMetricsConstants.ENTITY_TYPE);
     if (wrongAppId) {
@@ -524,10 +519,7 @@ public class TestApplicationHistoryManagerOnTimelineStore {
     entityInfo.put(ApplicationMetricsConstants.TYPE_ENTITY_INFO,
         "test app type");
     entityInfo.put(ApplicationMetricsConstants.USER_ENTITY_INFO, "user1");
-    if (!missingQueue) {
-      entityInfo.put(ApplicationMetricsConstants.QUEUE_ENTITY_INFO,
-          "test queue");
-    }
+    entityInfo.put(ApplicationMetricsConstants.QUEUE_ENTITY_INFO, "test queue");
     entityInfo.put(
         ApplicationMetricsConstants.UNMANAGED_APPLICATION_ENTITY_INFO, "false");
     entityInfo.put(ApplicationMetricsConstants.APPLICATION_PRIORITY_INFO,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d0c0bd57/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java
index 9124ee5..9ae792c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TestAHSWebServices.java
@@ -98,7 +98,7 @@ public class TestAHSWebServices extends JerseyTestBase {
   private static ApplicationHistoryClientService historyClientService;
   private static AHSWebServices ahsWebservice;
   private static final String[] USERS = new String[] { "foo" , "bar" };
-  private static final int MAX_APPS = 6;
+  private static final int MAX_APPS = 5;
   private static Configuration conf;
   private static FileSystem fs;
   private static final String remoteLogRootDir = "target/logs/";
@@ -361,27 +361,7 @@ public class TestAHSWebServices extends JerseyTestBase {
     JSONObject apps = json.getJSONObject("apps");
     assertEquals("incorrect number of elements", 1, apps.length());
     JSONArray array = apps.getJSONArray("app");
-    assertEquals("incorrect number of elements", MAX_APPS, array.length());
-  }
-
-  @Test
-  public void testQueueQuery() throws Exception {
-    WebResource r = resource();
-    ClientResponse response =
-        r.path("ws").path("v1").path("applicationhistory").path("apps")
-            .queryParam("queue", "test queue")
-            .queryParam("user.name", USERS[round])
-            .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-    assertResponseStatusCode(Status.OK, response.getStatusInfo());
-    assertEquals(MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
-        response.getType().toString());
-    JSONObject json = response.getEntity(JSONObject.class);
-    assertEquals("incorrect number of elements", 1, json.length());
-    JSONObject apps = json.getJSONObject("apps");
-    assertEquals("incorrect number of elements", 1, apps.length());
-    JSONArray array = apps.getJSONArray("app");
-    assertEquals("incorrect number of elements", MAX_APPS - 1,
-        array.length());
+    assertEquals("incorrect number of elements", 5, array.length());
   }
 
   @Test
@@ -430,7 +410,7 @@ public class TestAHSWebServices extends JerseyTestBase {
     JSONObject appAttempts = json.getJSONObject("appAttempts");
     assertEquals("incorrect number of elements", 1, appAttempts.length());
     JSONArray array = appAttempts.getJSONArray("appAttempt");
-    assertEquals("incorrect number of elements", MAX_APPS, array.length());
+    assertEquals("incorrect number of elements", 5, array.length());
   }
 
   @Test
@@ -487,7 +467,7 @@ public class TestAHSWebServices extends JerseyTestBase {
     JSONObject containers = json.getJSONObject("containers");
     assertEquals("incorrect number of elements", 1, containers.length());
     JSONArray array = containers.getJSONArray("container");
-    assertEquals("incorrect number of elements", MAX_APPS, array.length());
+    assertEquals("incorrect number of elements", 5, array.length());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d0c0bd57/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
index d460c81..cf6552a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/WebServices.java
@@ -192,8 +192,7 @@ public class WebServices {
         }
       }
       if (queueQuery != null && !queueQuery.isEmpty()) {
-        if (appReport.getQueue() == null || !appReport.getQueue()
-            .equals(queueQuery)) {
+        if (!appReport.getQueue().equals(queueQuery)) {
           continue;
         }
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message