Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2E26A200D02 for ; Sat, 23 Sep 2017 20:15:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2CA951609B8; Sat, 23 Sep 2017 18:15:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4C1311609B6 for ; Sat, 23 Sep 2017 20:15:26 +0200 (CEST) Received: (qmail 2894 invoked by uid 500); 23 Sep 2017 18:15:25 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 2885 invoked by uid 99); 23 Sep 2017 18:15:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Sep 2017 18:15:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 75C5FF331D; Sat, 23 Sep 2017 18:15:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aengineer@apache.org To: common-commits@hadoop.apache.org Message-Id: <896ea3a60d3d49eebefc5a8b12fb20e7@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Sat, 23 Sep 2017 18:15:27 -0000 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 Authored: Sat Sep 23 11:12:16 2017 -0700 Committer: Anu Engineer 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