From 1a9c5d479e2259ac024da392b020967112c5af55 Mon Sep 17 00:00:00 2001 From: Takanobu Asanuma Date: Mon, 15 Jan 2018 15:38:03 +0900 Subject: [PATCH] MAPREDUCE-7034. Moving logging APIs over to slf4j the rest of all in hadoop-mapreduce Signed-off-by: Akira Ajisaka --- .../hadoop/mapreduce/v2/util/LocalResourceBuilder.java | 7 ++++--- .../org/apache/hadoop/mapreduce/SharedCacheConfig.java | 7 ++++--- .../mapreduce/TestJobResourceUploaderWithSharedCache.java | 8 ++++---- .../test/java/org/apache/hadoop/fs/TestFileSystem.java | 6 ++++-- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/LocalResourceBuilder.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/LocalResourceBuilder.java index cb55e1332b..48b157ee26 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/LocalResourceBuilder.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/LocalResourceBuilder.java @@ -22,8 +22,6 @@ import java.net.URI; import java.util.Map; -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.conf.Configuration; @@ -36,6 +34,8 @@ import org.apache.hadoop.yarn.api.records.LocalResourceType; import org.apache.hadoop.yarn.api.records.LocalResourceVisibility; import org.apache.hadoop.yarn.api.records.URL; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Helper class for MR applications that parses distributed cache artifacts and @@ -45,7 +45,8 @@ @Private @Unstable class LocalResourceBuilder { - public static final Log LOG = LogFactory.getLog(LocalResourceBuilder.class); + public static final Logger LOG = + LoggerFactory.getLogger(LocalResourceBuilder.class); private Configuration conf; private LocalResourceType type; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/SharedCacheConfig.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/SharedCacheConfig.java index de033e58b2..34ec4e7949 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/SharedCacheConfig.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/SharedCacheConfig.java @@ -19,13 +19,13 @@ import java.util.Collection; -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.conf.Configuration; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A class for parsing configuration parameters associated with the shared @@ -34,7 +34,8 @@ @Private @Unstable public class SharedCacheConfig { - protected static final Log LOG = LogFactory.getLog(SharedCacheConfig.class); + protected static final Logger LOG = + LoggerFactory.getLogger(SharedCacheConfig.class); private boolean sharedCacheFilesEnabled = false; private boolean sharedCacheLibjarsEnabled = false; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploaderWithSharedCache.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploaderWithSharedCache.java index 7598141f98..53219af42c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploaderWithSharedCache.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploaderWithSharedCache.java @@ -37,8 +37,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.fs.FSDataOutputStream; @@ -58,13 +56,15 @@ import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Tests the JobResourceUploader class with the shared cache. */ public class TestJobResourceUploaderWithSharedCache { - protected static final Log LOG = LogFactory - .getLog(TestJobResourceUploaderWithSharedCache.class); + protected static final Logger LOG = LoggerFactory + .getLogger(TestJobResourceUploaderWithSharedCache.class); private static MiniDFSCluster dfs; private static FileSystem localFs; private static FileSystem remoteFs; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java index f0300b368a..c874a38395 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java @@ -34,7 +34,6 @@ import java.net.InetSocketAddress; import java.net.URI; -import org.apache.commons.logging.Log; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.hdfs.MiniDFSCluster; @@ -49,6 +48,8 @@ import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.util.StringUtils; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; @@ -57,7 +58,8 @@ public class TestFileSystem { - private static final Log LOG = FileSystem.LOG; + private static final Logger LOG = + LoggerFactory.getLogger(TestFileSystem.class); private static Configuration conf = new Configuration(); private static int BUFFER_SIZE = conf.getInt("io.file.buffer.size", 4096);