Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io 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 5E726166D88 for ; Tue, 22 Aug 2017 14:43:25 +0200 (CEST) Received: (qmail 87876 invoked by uid 500); 22 Aug 2017 12:43:22 -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 82993 invoked by uid 99); 22 Aug 2017 12:43:16 -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; Tue, 22 Aug 2017 12:43:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4B406F5EEF; Tue, 22 Aug 2017 12:43:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: varunsaxena@apache.org To: common-commits@hadoop.apache.org Date: Tue, 22 Aug 2017 12:43:32 -0000 Message-Id: <16eb8047029e4f0b9c766aa500e43afe@git.apache.org> In-Reply-To: <53228fa050ba4b2386f666ff81f37c80@git.apache.org> References: <53228fa050ba4b2386f666ff81f37c80@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [18/50] [abbrv] hadoop git commit: YARN-6237. Move UID constant to TimelineReaderUtils (Rohith Sharma K S via Varun Saxena) YARN-6237. Move UID constant to TimelineReaderUtils (Rohith Sharma K S via Varun Saxena) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3c1fbb9e Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3c1fbb9e Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3c1fbb9e Branch: refs/heads/YARN-5355 Commit: 3c1fbb9e8ec8927eea3d02e5749d83ff66f680cb Parents: ba9bdac Author: Varun Saxena Authored: Thu Mar 9 01:06:54 2017 +0530 Committer: Varun Saxena Committed: Tue Aug 22 16:08:06 2017 +0530 ---------------------------------------------------------------------- .../TestTimelineReaderWebServicesHBaseStorage.java | 12 ++++++------ .../timelineservice/reader/TimelineReaderManager.java | 12 ++++-------- .../timelineservice/reader/TimelineReaderUtils.java | 3 +++ .../reader/TestTimelineReaderWebServices.java | 4 ++-- 4 files changed, 15 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/3c1fbb9e/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServicesHBaseStorage.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServicesHBaseStorage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServicesHBaseStorage.java index b2fe267..6b0f95e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServicesHBaseStorage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServicesHBaseStorage.java @@ -657,7 +657,7 @@ public class TestTimelineReaderWebServicesHBaseStorage List listFlowUIDs = new ArrayList(); for (FlowActivityEntity entity : flowEntities) { String flowUID = - (String)entity.getInfo().get(TimelineReaderManager.UID_KEY); + (String) entity.getInfo().get(TimelineReaderUtils.UID_KEY); listFlowUIDs.add(flowUID); assertEquals(TimelineUIDConverter.FLOW_UID.encodeUID( new TimelineReaderContext(entity.getCluster(), entity.getUser(), @@ -681,7 +681,7 @@ public class TestTimelineReaderWebServicesHBaseStorage assertNotNull(frEntities); for (FlowRunEntity entity : frEntities) { String flowRunUID = - (String)entity.getInfo().get(TimelineReaderManager.UID_KEY); + (String) entity.getInfo().get(TimelineReaderUtils.UID_KEY); listFlowRunUIDs.add(flowRunUID); assertEquals(TimelineUIDConverter.FLOWRUN_UID.encodeUID( new TimelineReaderContext("cluster1", entity.getUser(), @@ -713,7 +713,7 @@ public class TestTimelineReaderWebServicesHBaseStorage assertNotNull(appEntities); for (TimelineEntity entity : appEntities) { String appUID = - (String)entity.getInfo().get(TimelineReaderManager.UID_KEY); + (String) entity.getInfo().get(TimelineReaderUtils.UID_KEY); listAppUIDs.add(appUID); assertEquals(TimelineUIDConverter.APPLICATION_UID.encodeUID( new TimelineReaderContext(context.getClusterId(), @@ -746,7 +746,7 @@ public class TestTimelineReaderWebServicesHBaseStorage assertNotNull(entities); for (TimelineEntity entity : entities) { String entityUID = - (String)entity.getInfo().get(TimelineReaderManager.UID_KEY); + (String) entity.getInfo().get(TimelineReaderUtils.UID_KEY); listEntityUIDs.add(entityUID); assertEquals(TimelineUIDConverter.GENERIC_ENTITY_UID.encodeUID( new TimelineReaderContext(context.getClusterId(), @@ -827,7 +827,7 @@ public class TestTimelineReaderWebServicesHBaseStorage assertNotNull(entity.getInfo()); assertEquals(2, entity.getInfo().size()); String uid = - (String) entity.getInfo().get(TimelineReaderManager.UID_KEY); + (String) entity.getInfo().get(TimelineReaderUtils.UID_KEY); assertNotNull(uid); assertTrue(uid.equals(appUIDWithFlowInfo + "!type1!0!entity1") || uid.equals(appUIDWithFlowInfo + "!type1!0!entity2")); @@ -855,7 +855,7 @@ public class TestTimelineReaderWebServicesHBaseStorage assertNotNull(entity.getInfo()); assertEquals(2, entity.getInfo().size()); String uid = - (String) entity.getInfo().get(TimelineReaderManager.UID_KEY); + (String) entity.getInfo().get(TimelineReaderUtils.UID_KEY); assertNotNull(uid); assertTrue(uid.equals(appUIDWithoutFlowInfo + "!type1!0!entity1") || uid.equals(appUIDWithoutFlowInfo + "!type1!0!entity2")); http://git-wip-us.apache.org/repos/asf/hadoop/blob/3c1fbb9e/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderManager.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderManager.java index 66e4cbf..ee827da 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderManager.java @@ -32,8 +32,6 @@ import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader; -import com.google.common.annotations.VisibleForTesting; - /** * This class wraps over the timeline reader store implementation. It does some * non trivial manipulation of the timeline data before or after getting @@ -43,8 +41,6 @@ import com.google.common.annotations.VisibleForTesting; @Unstable public class TimelineReaderManager extends AbstractService { - @VisibleForTesting - public static final String UID_KEY = "UID"; private TimelineReader reader; public TimelineReaderManager(TimelineReader timelineReader) { @@ -94,18 +90,18 @@ public class TimelineReaderManager extends AbstractService { FlowActivityEntity activityEntity = (FlowActivityEntity)entity; context.setUserId(activityEntity.getUser()); context.setFlowName(activityEntity.getFlowName()); - entity.setUID(UID_KEY, + entity.setUID(TimelineReaderUtils.UID_KEY, TimelineUIDConverter.FLOW_UID.encodeUID(context)); return; case YARN_FLOW_RUN: FlowRunEntity runEntity = (FlowRunEntity)entity; context.setFlowRunId(runEntity.getRunId()); - entity.setUID(UID_KEY, + entity.setUID(TimelineReaderUtils.UID_KEY, TimelineUIDConverter.FLOWRUN_UID.encodeUID(context)); return; case YARN_APPLICATION: context.setAppId(entity.getId()); - entity.setUID(UID_KEY, + entity.setUID(TimelineReaderUtils.UID_KEY, TimelineUIDConverter.APPLICATION_UID.encodeUID(context)); return; default: @@ -115,7 +111,7 @@ public class TimelineReaderManager extends AbstractService { context.setEntityType(entity.getType()); context.setEntityIdPrefix(entity.getIdPrefix()); context.setEntityId(entity.getId()); - entity.setUID(UID_KEY, + entity.setUID(TimelineReaderUtils.UID_KEY, TimelineUIDConverter.GENERIC_ENTITY_UID.encodeUID(context)); } http://git-wip-us.apache.org/repos/asf/hadoop/blob/3c1fbb9e/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderUtils.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderUtils.java index 8f92433..4fd8468 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderUtils.java @@ -47,6 +47,9 @@ public final class TimelineReaderUtils { public static final String FROMID_KEY = "FROM_ID"; + @VisibleForTesting + public static final String UID_KEY = "UID"; + /** * Split the passed string along the passed delimiter character while looking * for escape char to interpret the splitted parts correctly. For delimiter or http://git-wip-us.apache.org/repos/asf/hadoop/blob/3c1fbb9e/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServices.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServices.java index 4bd37f8..f760834 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServices.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderWebServices.java @@ -238,7 +238,7 @@ public class TestTimelineReaderWebServices { assertEquals(3, entity.getConfigs().size()); assertEquals(3, entity.getMetrics().size()); assertTrue("UID should be present", - entity.getInfo().containsKey(TimelineReaderManager.UID_KEY)); + entity.getInfo().containsKey(TimelineReaderUtils.UID_KEY)); // Includes UID. assertEquals(3, entity.getInfo().size()); // No events will be returned as events are not part of fields. @@ -265,7 +265,7 @@ public class TestTimelineReaderWebServices { assertEquals(3, entity.getConfigs().size()); assertEquals(3, entity.getMetrics().size()); assertTrue("UID should be present", - entity.getInfo().containsKey(TimelineReaderManager.UID_KEY)); + entity.getInfo().containsKey(TimelineReaderUtils.UID_KEY)); // Includes UID. assertEquals(3, entity.getInfo().size()); assertEquals(2, entity.getEvents().size()); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org