YARN-7141. Move logging APIs to slf4j in timelineservice after ATSv2 merge. Contributed by Varun Saxena
(cherry picked from commit dcd0bedcc8113dd5e1d852c242ae9511d1b3d58e) Conflicts: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHATimelineCollectors.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/security/TimelineReaderWhitelistAuthorizationFilter.java Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7615cf69 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7615cf69 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7615cf69 Branch: refs/heads/YARN-5355_branch2 Commit: 7615cf69658a8d3da13d91991251afc7f693ea1e Parents: 16fcb41 Author: bibinchundatt <bibinchund...@apache.org> Authored: Fri Sep 1 11:29:16 2017 +0530 Committer: Varun Saxena <varunsax...@apache.org> Committed: Sat Oct 14 15:12:19 2017 +0530 ---------------------------------------------------------------------- .../server/resourcemanager/TestRMHATimelineCollectors.java | 4 ---- .../timelineservice/storage/reader/EntityTypeReader.java | 9 ++------- .../storage/subapplication/SubApplicationTable.java | 6 +++--- .../collector/AppLevelTimelineCollectorWithAgg.java | 8 ++------ .../TimelineV2DelegationTokenSecretManagerService.java | 8 ++++---- 5 files changed, 11 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/7615cf69/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHATimelineCollectors.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/TestRMHATimelineCollectors.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHATimelineCollectors.java index 7632a02..a0cd048 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHATimelineCollectors.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHATimelineCollectors.java @@ -26,8 +26,6 @@ import org.apache.hadoop.yarn.server.timelineservice.storage.FileSystemTimelineW import org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter; import org.junit.Before; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; @@ -40,8 +38,6 @@ import static org.junit.Assert.assertEquals; * transition. */ public class TestRMHATimelineCollectors extends RMHATestBase { - public static final Logger LOG = LoggerFactory - .getLogger(TestRMHATimelineCollectors.class); @Before @Override http://git-wip-us.apache.org/repos/asf/hadoop/blob/7615cf69/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java index c5f9259..0764775 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java @@ -86,9 +86,7 @@ public final class EntityTypeReader extends AbstractTimelineStorageReader { typeFilterList.addFilter(new FirstKeyOnlyFilter()); typeFilterList.addFilter(new KeyOnlyFilter()); typeFilterList.addFilter(new PageFilter(1)); - if (LOG.isDebugEnabled()) { - LOG.debug("FilterList created for scan is - " + typeFilterList); - } + LOG.debug("FilterList created for scan is - {}", typeFilterList); int counter = 0; while (true) { @@ -112,10 +110,7 @@ public final class EntityTypeReader extends AbstractTimelineStorageReader { currRowKey = getNextRowKey(prefix.getRowKeyPrefix(), currType); } } - if (LOG.isDebugEnabled()) { - LOG.debug("Scanned " + counter + "records for " - + types.size() + "types"); - } + LOG.debug("Scanned {} records for {} types", counter, types.size()); return types; } http://git-wip-us.apache.org/repos/asf/hadoop/blob/7615cf69/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/subapplication/SubApplicationTable.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/subapplication/SubApplicationTable.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/subapplication/SubApplicationTable.java index 334bab6..785a243 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/subapplication/SubApplicationTable.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/subapplication/SubApplicationTable.java @@ -19,8 +19,6 @@ package org.apache.hadoop.yarn.server.timelineservice.storage.subapplication; import java.io.IOException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; @@ -30,6 +28,8 @@ import org.apache.hadoop.hbase.regionserver.BloomType; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable; import org.apache.hadoop.yarn.server.timelineservice.storage.common.TimelineHBaseSchemaConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The sub application table has column families: @@ -103,7 +103,7 @@ public class SubApplicationTable extends BaseTable<SubApplicationTable> { /** default max number of versions. */ private static final int DEFAULT_METRICS_MAX_VERSIONS = 10000; - private static final Log LOG = LogFactory.getLog( + private static final Logger LOG = LoggerFactory.getLogger( SubApplicationTable.class); public SubApplicationTable() { http://git-wip-us.apache.org/repos/asf/hadoop/blob/7615cf69/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollectorWithAgg.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/collector/AppLevelTimelineCollectorWithAgg.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollectorWithAgg.java index b1ed690f..d7f47c8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollectorWithAgg.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollectorWithAgg.java @@ -112,9 +112,7 @@ public class AppLevelTimelineCollectorWithAgg private class AppLevelAggregator implements Runnable { private void aggregate() { - if (LOG.isDebugEnabled()) { - LOG.debug("App-level real-time aggregating"); - } + LOG.debug("App-level real-time aggregating"); if (!isReadyToAggregate()) { LOG.warn("App-level collector is not ready, skip aggregation. "); return; @@ -137,9 +135,7 @@ public class AppLevelTimelineCollectorWithAgg } catch (Exception e) { LOG.error("Error aggregating timeline metrics", e); } - if (LOG.isDebugEnabled()) { - LOG.debug("App-level real-time aggregation complete"); - } + LOG.debug("App-level real-time aggregation complete"); } @Override http://git-wip-us.apache.org/repos/asf/hadoop/blob/7615cf69/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/security/TimelineV2DelegationTokenSecretManagerService.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/security/TimelineV2DelegationTokenSecretManagerService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/security/TimelineV2DelegationTokenSecretManagerService.java index de5ccdc..1a8bf09 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/security/TimelineV2DelegationTokenSecretManagerService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/security/TimelineV2DelegationTokenSecretManagerService.java @@ -20,8 +20,6 @@ package org.apache.hadoop.yarn.server.timelineservice.security; import java.io.IOException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.io.Text; @@ -30,6 +28,8 @@ import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager; import org.apache.hadoop.yarn.security.client.TimelineDelegationTokenIdentifier; import org.apache.hadoop.yarn.server.timeline.security.TimelineDelgationTokenSecretManagerService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The service wrapper of {@link TimelineV2DelegationTokenSecretManager}. @@ -75,8 +75,8 @@ public class TimelineV2DelegationTokenSecretManagerService extends public static class TimelineV2DelegationTokenSecretManager extends AbstractDelegationTokenSecretManager<TimelineDelegationTokenIdentifier> { - private static final Log LOG = - LogFactory.getLog(TimelineV2DelegationTokenSecretManager.class); + private static final Logger LOG = + LoggerFactory.getLogger(TimelineV2DelegationTokenSecretManager.class); /** * Create a timeline v2 secret manager. --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org