From d4cae977a2471ad7b8f803617e41b6f94df19c11 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Thu, 7 Dec 2017 16:21:25 +0900 Subject: [PATCH] =?UTF-8?q?MAPREDUCE-6998.=20Moving=20logging=20APIs=20ove?= =?UTF-8?q?r=20to=20slf4j=20in=20hadoop-mapreduce-client-jobclient.=20Cont?= =?UTF-8?q?ributed=20by=20Gergely=20Nov=C3=A1k.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/apache/hadoop/mapred/ClientCache.java | 6 +++--- .../hadoop/mapred/ClientServiceDelegate.java | 7 ++++--- .../apache/hadoop/mapred/ResourceMgrDelegate.java | 7 ++++--- .../java/org/apache/hadoop/mapred/YARNRunner.java | 6 +++--- .../org/apache/hadoop/fi/ProbabilityModel.java | 7 ++++--- .../org/apache/hadoop/fs/AccumulatingReducer.java | 8 +++++--- .../java/org/apache/hadoop/fs/DFSCIOTest.java | 6 +++--- .../org/apache/hadoop/fs/DistributedFSCheck.java | 7 ++++--- .../java/org/apache/hadoop/fs/JHLogAnalyzer.java | 7 ++++--- .../test/java/org/apache/hadoop/fs/TestDFSIO.java | 6 +++--- .../test/java/org/apache/hadoop/fs/TestJHLA.java | 7 ++++--- .../hadoop/fs/loadGenerator/LoadGeneratorMR.java | 6 +++--- .../java/org/apache/hadoop/fs/slive/AppendOp.java | 6 +++--- .../apache/hadoop/fs/slive/ConfigExtractor.java | 7 ++++--- .../java/org/apache/hadoop/fs/slive/CreateOp.java | 6 +++--- .../java/org/apache/hadoop/fs/slive/DeleteOp.java | 6 +++--- .../java/org/apache/hadoop/fs/slive/ListOp.java | 6 +++--- .../java/org/apache/hadoop/fs/slive/MkdirOp.java | 6 +++--- .../java/org/apache/hadoop/fs/slive/ReadOp.java | 6 +++--- .../java/org/apache/hadoop/fs/slive/RenameOp.java | 6 +++--- .../org/apache/hadoop/fs/slive/ReportWriter.java | 6 +++--- .../java/org/apache/hadoop/fs/slive/SleepOp.java | 6 +++--- .../org/apache/hadoop/fs/slive/SliveMapper.java | 6 +++--- .../org/apache/hadoop/fs/slive/SliveReducer.java | 6 +++--- .../org/apache/hadoop/fs/slive/SliveTest.java | 6 +++--- .../org/apache/hadoop/fs/slive/TestSlive.java | 10 +++++----- .../org/apache/hadoop/fs/slive/TruncateOp.java | 6 +++--- .../apache/hadoop/fs/slive/WeightSelector.java | 7 ++++--- .../test/java/org/apache/hadoop/hdfs/NNBench.java | 7 +++---- .../org/apache/hadoop/hdfs/NNBenchWithoutMR.java | 8 ++++---- .../org/apache/hadoop/mapred/BigMapOutput.java | 8 ++++---- .../java/org/apache/hadoop/mapred/MRBench.java | 6 +++--- .../org/apache/hadoop/mapred/MiniMRCluster.java | 15 ++++++++------- .../hadoop/mapred/MiniMRYarnClusterAdapter.java | 7 ++++--- .../org/apache/hadoop/mapred/ReliabilityTest.java | 13 +++++++------ .../org/apache/hadoop/mapred/TestBadRecords.java | 8 ++++---- .../apache/hadoop/mapred/TestClientRedirect.java | 7 ++++--- .../hadoop/mapred/TestCombineFileInputFormat.java | 11 +++++------ .../TestCombineSequenceFileInputFormat.java | 8 ++++---- .../hadoop/mapred/TestCombineTextInputFormat.java | 8 ++++---- .../mapred/TestConcatenatedCompressedInput.java | 9 +++++---- .../hadoop/mapred/TestFixedLengthInputFormat.java | 11 ++++++----- .../org/apache/hadoop/mapred/TestJobCleanup.java | 9 +++++---- .../hadoop/mapred/TestJobSysDirWithDFS.java | 8 ++++---- .../mapred/TestKeyValueTextInputFormat.java | 8 +++++--- .../mapred/TestMRTimelineEventHandling.java | 8 ++++---- .../org/apache/hadoop/mapred/TestMapProgress.java | 8 +++++--- .../apache/hadoop/mapred/TestMiniMRChildTask.java | 8 ++++---- .../hadoop/mapred/TestMultiFileInputFormat.java | 8 +++++--- .../TestSequenceFileAsBinaryOutputFormat.java | 13 ++++++------- .../apache/hadoop/mapred/TestSortedRanges.java | 12 ++++++------ .../mapred/TestSpecialCharactersInOutputPath.java | 15 +++++++-------- .../org/apache/hadoop/mapred/TestTaskStatus.java | 4 +--- .../apache/hadoop/mapred/TestTextInputFormat.java | 11 +++++------ .../org/apache/hadoop/mapred/TestYARNRunner.java | 14 ++++++++------ .../hadoop/mapred/ThreadedMapBenchmark.java | 7 ++++--- .../org/apache/hadoop/mapred/UtilsForTests.java | 6 +++--- .../mapred/jobcontrol/TestLocalJobControl.java | 9 +++++---- .../org/apache/hadoop/mapred/pipes/TestPipes.java | 8 ++++---- .../apache/hadoop/mapreduce/GrowingSleepJob.java | 12 ++++++------ .../hadoop/mapreduce/JobHistoryFileParser.java | 7 ++++--- .../mapreduce/JobHistoryFileReplayHelper.java | 9 ++++----- .../mapreduce/JobHistoryFileReplayMapperV1.java | 9 ++++----- .../mapreduce/JobHistoryFileReplayMapperV2.java | 8 ++++---- .../hadoop/mapreduce/MapReduceTestUtil.java | 13 ++++--------- .../mapreduce/MiniHadoopClusterManager.java | 8 ++++---- .../hadoop/mapreduce/SimpleEntityWriterV1.java | 7 ++++--- .../hadoop/mapreduce/SimpleEntityWriterV2.java | 9 +++++---- .../org/apache/hadoop/mapreduce/TestCounters.java | 11 +++++------ .../apache/hadoop/mapreduce/TestLocalRunner.java | 11 ++++++----- .../apache/hadoop/mapreduce/TestMRJobClient.java | 7 ++++--- .../hadoop/mapreduce/TestMapCollection.java | 13 ++++++------- .../hadoop/mapreduce/TestValueIterReset.java | 8 ++++---- .../mapreduce/TimelineEntityConverterV1.java | 8 ++++---- .../mapreduce/TimelineEntityConverterV2.java | 8 ++++---- .../lib/db/TestDataDrivenDBInputFormat.java | 6 +++--- .../input/TestCombineSequenceFileInputFormat.java | 8 ++++---- .../lib/input/TestCombineTextInputFormat.java | 8 ++++---- .../lib/input/TestFixedLengthInputFormat.java | 12 ++++++------ .../lib/input/TestMRKeyValueTextInputFormat.java | 12 +++++------- .../lib/input/TestMRSequenceFileInputFilter.java | 8 ++++---- .../lib/jobcontrol/TestMapReduceJobControl.java | 12 ++++++------ .../TestMRSequenceFileAsBinaryOutputFormat.java | 8 ++++---- .../lib/partition/TestKeyFieldHelper.java | 10 ++++++---- .../mapreduce/security/TestJHSSecurity.java | 10 +++++----- .../hadoop/mapreduce/util/MRAsyncDiskService.java | 7 ++++--- .../mapreduce/util/TestMRAsyncDiskService.java | 9 ++++----- .../hadoop/mapreduce/v2/MiniMRYarnCluster.java | 7 ++++--- .../v2/TestMRAMWithNonNormalizedCapabilities.java | 7 ++++--- .../mapreduce/v2/TestMRAppWithCombiner.java | 7 ++++--- .../apache/hadoop/mapreduce/v2/TestMRJobs.java | 6 +++--- .../v2/TestMRJobsWithHistoryService.java | 8 ++++---- .../mapreduce/v2/TestMRJobsWithProfiler.java | 8 ++++---- .../hadoop/mapreduce/v2/TestMROldApiJobs.java | 7 ++++--- .../apache/hadoop/mapreduce/v2/TestRMNMInfo.java | 7 ++++--- .../mapreduce/v2/TestSpeculativeExecution.java | 7 ++++--- .../apache/hadoop/mapreduce/v2/TestUberAM.java | 6 +++--- .../src/test/java/testjar/UserNamePermission.java | 13 ++++--------- 98 files changed, 411 insertions(+), 394 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientCache.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientCache.java index 93ea5c437c7..8268d1ef626 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientCache.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientCache.java @@ -23,8 +23,6 @@ import java.security.PrivilegedAction; import java.util.HashMap; import java.util.Map; import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.ipc.RPC; import org.apache.hadoop.mapreduce.JobID; @@ -35,13 +33,15 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.ipc.YarnRPC; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ClientCache { private final Configuration conf; private final ResourceMgrDelegate rm; - private static final Log LOG = LogFactory.getLog(ClientCache.class); + private static final Logger LOG = LoggerFactory.getLogger(ClientCache.class); private Map cache = new HashMap(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java index 72339e5ac2b..792e4968696 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java @@ -29,8 +29,6 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeysPublic; import org.apache.hadoop.ipc.RPC; @@ -79,11 +77,14 @@ import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; import org.apache.hadoop.yarn.ipc.YarnRPC; import org.apache.hadoop.yarn.security.client.ClientToAMTokenIdentifier; import org.apache.hadoop.yarn.util.ConverterUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.annotations.VisibleForTesting; public class ClientServiceDelegate { - private static final Log LOG = LogFactory.getLog(ClientServiceDelegate.class); + private static final Logger LOG = + LoggerFactory.getLogger(ClientServiceDelegate.class); private static final String UNAVAILABLE = "N/A"; // Caches for per-user NotRunningJobs diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java index 94f741a03e6..ac4b73b2417 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java @@ -25,8 +25,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; @@ -78,11 +76,14 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.security.AMRMTokenIdentifier; import org.apache.hadoop.yarn.util.ConverterUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.annotations.VisibleForTesting; public class ResourceMgrDelegate extends YarnClient { - private static final Log LOG = LogFactory.getLog(ResourceMgrDelegate.class); + private static final Logger LOG = + LoggerFactory.getLogger(ResourceMgrDelegate.class); private YarnConfiguration conf; private ApplicationSubmissionContext application; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java index 12a307930fc..127e1dc0f79 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java @@ -36,8 +36,6 @@ import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileContext; @@ -99,6 +97,8 @@ import org.apache.hadoop.yarn.security.client.RMDelegationTokenSelector; import org.apache.hadoop.yarn.util.ConverterUtils; import org.apache.hadoop.yarn.util.UnitsConversionUtil; import org.apache.hadoop.yarn.util.resource.ResourceUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.annotations.VisibleForTesting; @@ -108,7 +108,7 @@ import com.google.common.annotations.VisibleForTesting; @SuppressWarnings("unchecked") public class YARNRunner implements ClientProtocol { - private static final Log LOG = LogFactory.getLog(YARNRunner.class); + private static final Logger LOG = LoggerFactory.getLogger(YARNRunner.class); private static final String RACK_GROUP = "rack"; private static final String NODE_IF_RACK_GROUP = "node1"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fi/ProbabilityModel.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fi/ProbabilityModel.java index 48e57f586a5..ce3f1fa5898 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fi/ProbabilityModel.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fi/ProbabilityModel.java @@ -19,9 +19,9 @@ package org.apache.hadoop.fi; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class is responsible for the decision of when a fault @@ -42,7 +42,8 @@ import org.apache.hadoop.conf.Configuration; */ public class ProbabilityModel { private static Random generator = new Random(); - private static final Log LOG = LogFactory.getLog(ProbabilityModel.class); + private static final Logger LOG = + LoggerFactory.getLogger(ProbabilityModel.class); static final String FPROB_NAME = "fi."; private static final String ALL_PROBABILITIES = FPROB_NAME + "*"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/AccumulatingReducer.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/AccumulatingReducer.java index 3991d94d61d..f6c2a06bfbb 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/AccumulatingReducer.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/AccumulatingReducer.java @@ -20,10 +20,10 @@ package org.apache.hadoop.fs; import java.io.IOException; import java.util.Iterator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Reducer that accumulates values based on their type. @@ -47,7 +47,9 @@ public class AccumulatingReducer extends MapReduceBase static final String VALUE_TYPE_LONG = "l:"; static final String VALUE_TYPE_FLOAT = "f:"; static final String VALUE_TYPE_STRING = "s:"; - private static final Log LOG = LogFactory.getLog(AccumulatingReducer.class); + + private static final Logger LOG = + LoggerFactory.getLogger(AccumulatingReducer.class); protected String hostName; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java index b01954e1c87..d718556a054 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java @@ -28,8 +28,6 @@ import java.io.PrintStream; import java.util.Date; import java.util.StringTokenizer; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.SequenceFile; @@ -38,6 +36,8 @@ import org.apache.hadoop.io.SequenceFile.CompressionType; import org.apache.hadoop.mapred.*; import org.junit.Ignore; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Distributed i/o benchmark. @@ -69,7 +69,7 @@ import org.junit.Test; @Ignore public class DFSCIOTest { // Constants - private static final Log LOG = LogFactory.getLog(DFSCIOTest.class); + private static final Logger LOG = LoggerFactory.getLogger(DFSCIOTest.class); private static final int TEST_TYPE_READ = 0; private static final int TEST_TYPE_WRITE = 1; private static final int TEST_TYPE_CLEANUP = 2; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DistributedFSCheck.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DistributedFSCheck.java index 67ef5d9b3d5..8ed2c19dfd4 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DistributedFSCheck.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DistributedFSCheck.java @@ -33,8 +33,6 @@ import java.util.Vector; import junit.framework.TestCase; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.SequenceFile; @@ -42,6 +40,8 @@ import org.apache.hadoop.io.Text; import org.apache.hadoop.io.SequenceFile.CompressionType; import org.apache.hadoop.mapred.*; import org.junit.Ignore; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Distributed checkup of the file system consistency. @@ -56,7 +56,8 @@ import org.junit.Ignore; @Ignore public class DistributedFSCheck extends TestCase { // Constants - private static final Log LOG = LogFactory.getLog(DistributedFSCheck.class); + private static final Logger LOG = + LoggerFactory.getLogger(DistributedFSCheck.class); private static final int TEST_TYPE_READ = 0; private static final int TEST_TYPE_CLEANUP = 2; private static final int DEFAULT_BUFFER_SIZE = 1000000; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/JHLogAnalyzer.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/JHLogAnalyzer.java index 91c3c2688c2..5e3e745f022 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/JHLogAnalyzer.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/JHLogAnalyzer.java @@ -34,8 +34,6 @@ import java.util.Map; import java.util.StringTokenizer; import java.util.HashMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.SequenceFile; @@ -46,6 +44,8 @@ import org.apache.hadoop.io.compress.GzipCodec; import org.apache.hadoop.mapred.*; import org.apache.hadoop.util.ReflectionUtils; import org.apache.hadoop.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Job History Log Analyzer. @@ -144,7 +144,8 @@ import org.apache.hadoop.util.StringUtils; */ @SuppressWarnings("deprecation") public class JHLogAnalyzer { - private static final Log LOG = LogFactory.getLog(JHLogAnalyzer.class); + private static final Logger LOG = + LoggerFactory.getLogger(JHLogAnalyzer.class); // Constants private static final String JHLA_ROOT_DIR = System.getProperty("test.build.data", "stats/JHLA"); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java index 61485be7648..68befea9adb 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java @@ -33,8 +33,6 @@ import java.util.Collection; import java.util.Date; import java.util.Random; import java.util.StringTokenizer; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.DistributedFileSystem; @@ -62,6 +60,8 @@ import org.apache.hadoop.util.ToolRunner; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Distributed i/o benchmark. @@ -92,7 +92,7 @@ import org.junit.Test; */ public class TestDFSIO implements Tool { // Constants - private static final Log LOG = LogFactory.getLog(TestDFSIO.class); + private static final Logger LOG = LoggerFactory.getLogger(TestDFSIO.class); private static final int DEFAULT_BUFFER_SIZE = 1000000; private static final String BASE_FILE_NAME = "test_io_"; private static final String DEFAULT_RES_FILE_NAME = "TestDFSIO_results.log"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java index 31950fd6104..9334a8a0dfa 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java @@ -23,11 +23,11 @@ import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.io.File; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Test Job History Log Analyzer. @@ -35,7 +35,8 @@ import org.junit.Test; * @see JHLogAnalyzer */ public class TestJHLA { - private static final Log LOG = LogFactory.getLog(JHLogAnalyzer.class); + private static final Logger LOG = + LoggerFactory.getLogger(JHLogAnalyzer.class); private String historyLog = System.getProperty("test.build.data", "build/test/data") + "/history/test.log"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/loadGenerator/LoadGeneratorMR.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/loadGenerator/LoadGeneratorMR.java index c47d9713460..044c77c0853 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/loadGenerator/LoadGeneratorMR.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/loadGenerator/LoadGeneratorMR.java @@ -26,8 +26,6 @@ import java.net.UnknownHostException; import java.util.EnumSet; import java.util.Iterator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.fs.CreateFlag; @@ -50,6 +48,8 @@ import org.apache.hadoop.mapred.Reducer; import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.mapred.TextOutputFormat; import org.apache.hadoop.util.ToolRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** The load generator is a tool for testing NameNode behavior under * different client loads. @@ -63,7 +63,7 @@ import org.apache.hadoop.util.ToolRunner; * */ public class LoadGeneratorMR extends LoadGenerator { - public static final Log LOG = LogFactory.getLog(LoadGenerator.class); + public static final Logger LOG = LoggerFactory.getLogger(LoadGenerator.class); private static int numMapTasks = 1; private String mrOutDir; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/AppendOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/AppendOp.java index 82d221fb25f..b118e6e36d2 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/AppendOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/AppendOp.java @@ -24,12 +24,12 @@ import java.io.OutputStream; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.DataWriter.GenerateOutput; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which selects a random file and appends a random amount of bytes @@ -41,7 +41,7 @@ import org.apache.hadoop.fs.slive.OperationOutput.OutputType; */ class AppendOp extends Operation { - private static final Log LOG = LogFactory.getLog(AppendOp.class); + private static final Logger LOG = LoggerFactory.getLogger(AppendOp.class); AppendOp(ConfigExtractor cfg, Random rnd) { super(AppendOp.class.getSimpleName(), cfg, rnd); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ConfigExtractor.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ConfigExtractor.java index ef4e436a7df..2668770523f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ConfigExtractor.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ConfigExtractor.java @@ -22,12 +22,12 @@ import java.text.NumberFormat; import java.util.HashMap; import java.util.Map; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.Constants.OperationType; import org.apache.hadoop.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Simple access layer onto of a configuration object that extracts the slive @@ -35,7 +35,8 @@ import org.apache.hadoop.util.StringUtils; */ class ConfigExtractor { - private static final Log LOG = LogFactory.getLog(ConfigExtractor.class); + private static final Logger LOG = + LoggerFactory.getLogger(ConfigExtractor.class); private Configuration config; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/CreateOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/CreateOp.java index 7da32c71a72..d7d2989287f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/CreateOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/CreateOp.java @@ -22,13 +22,13 @@ import java.io.IOException; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.DataWriter.GenerateOutput; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which selects a random file and a random number of bytes to create @@ -42,7 +42,7 @@ import org.apache.hadoop.fs.slive.OperationOutput.OutputType; */ class CreateOp extends Operation { - private static final Log LOG = LogFactory.getLog(CreateOp.class); + private static final Logger LOG = LoggerFactory.getLogger(CreateOp.class); private static int DEF_IO_BUFFER_SIZE = 4096; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/DeleteOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/DeleteOp.java index 31afd16b1dc..0ed425a852b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/DeleteOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/DeleteOp.java @@ -23,11 +23,11 @@ import java.io.IOException; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which selects a random file and attempts to delete that file (if it @@ -39,7 +39,7 @@ import org.apache.hadoop.fs.slive.OperationOutput.OutputType; */ class DeleteOp extends Operation { - private static final Log LOG = LogFactory.getLog(DeleteOp.class); + private static final Logger LOG = LoggerFactory.getLogger(DeleteOp.class); DeleteOp(ConfigExtractor cfg, Random rnd) { super(DeleteOp.class.getSimpleName(), cfg, rnd); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ListOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ListOp.java index f83a6bdd4ab..46377d5dff7 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ListOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ListOp.java @@ -23,12 +23,12 @@ import java.io.IOException; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which selects a random directory and attempts to list that @@ -41,7 +41,7 @@ import org.apache.hadoop.fs.slive.OperationOutput.OutputType; */ class ListOp extends Operation { - private static final Log LOG = LogFactory.getLog(ListOp.class); + private static final Logger LOG = LoggerFactory.getLogger(ListOp.class); ListOp(ConfigExtractor cfg, Random rnd) { super(ListOp.class.getSimpleName(), cfg, rnd); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/MkdirOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/MkdirOp.java index 585f41886f9..0f24d149387 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/MkdirOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/MkdirOp.java @@ -23,11 +23,11 @@ import java.io.IOException; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which selects a random directory and attempts to create that @@ -40,7 +40,7 @@ import org.apache.hadoop.fs.slive.OperationOutput.OutputType; */ class MkdirOp extends Operation { - private static final Log LOG = LogFactory.getLog(MkdirOp.class); + private static final Logger LOG = LoggerFactory.getLogger(MkdirOp.class); MkdirOp(ConfigExtractor cfg, Random rnd) { super(MkdirOp.class.getSimpleName(), cfg, rnd); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ReadOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ReadOp.java index 9683323ba90..d6f29a69646 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ReadOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ReadOp.java @@ -24,12 +24,12 @@ import java.io.IOException; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.DataVerifier.VerifyOutput; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which selects a random file and selects a random read size (from @@ -43,7 +43,7 @@ import org.apache.hadoop.fs.slive.OperationOutput.OutputType; * number of failures and the amount of time taken to fail */ class ReadOp extends Operation { - private static final Log LOG = LogFactory.getLog(ReadOp.class); + private static final Logger LOG = LoggerFactory.getLogger(ReadOp.class); ReadOp(ConfigExtractor cfg, Random rnd) { super(ReadOp.class.getSimpleName(), cfg, rnd); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/RenameOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/RenameOp.java index 94d6db46717..a608a879365 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/RenameOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/RenameOp.java @@ -23,11 +23,11 @@ import java.io.IOException; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which selects a random file and a second random file and attempts @@ -60,7 +60,7 @@ class RenameOp extends Operation { } } - private static final Log LOG = LogFactory.getLog(RenameOp.class); + private static final Logger LOG = LoggerFactory.getLogger(RenameOp.class); RenameOp(ConfigExtractor cfg, Random rnd) { super(RenameOp.class.getSimpleName(), cfg, rnd); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ReportWriter.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ReportWriter.java index 1f9abdeca1f..873a2ffd597 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ReportWriter.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/ReportWriter.java @@ -24,8 +24,8 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Class which provides a report for the given operation output @@ -48,7 +48,7 @@ class ReportWriter { static final String NOT_FOUND = "files_not_found"; static final String BAD_FILES = "bad_files"; - private static final Log LOG = LogFactory.getLog(ReportWriter.class); + private static final Logger LOG = LoggerFactory.getLogger(ReportWriter.class); private static final String SECTION_DELIM = "-------------"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SleepOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SleepOp.java index 9fc9b30dc26..2b9d54e9857 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SleepOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SleepOp.java @@ -21,10 +21,10 @@ package org.apache.hadoop.fs.slive; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which sleeps for a given number of milliseconds according to the @@ -32,7 +32,7 @@ import org.apache.hadoop.fs.slive.OperationOutput.OutputType; */ class SleepOp extends Operation { - private static final Log LOG = LogFactory.getLog(SleepOp.class); + private static final Logger LOG = LoggerFactory.getLogger(SleepOp.class); SleepOp(ConfigExtractor cfg, Random rnd) { super(SleepOp.class.getSimpleName(), cfg, rnd); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveMapper.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveMapper.java index e02c5d9b07d..93ee9f9f1fe 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveMapper.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveMapper.java @@ -22,8 +22,6 @@ import java.io.IOException; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; import org.apache.hadoop.io.Text; @@ -35,6 +33,8 @@ import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.mapreduce.MRJobConfig; import org.apache.hadoop.mapreduce.TaskAttemptID; import org.apache.hadoop.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The slive class which sets up the mapper to be used which itself will receive @@ -45,7 +45,7 @@ import org.apache.hadoop.util.StringUtils; public class SliveMapper extends MapReduceBase implements Mapper { - private static final Log LOG = LogFactory.getLog(SliveMapper.class); + private static final Logger LOG = LoggerFactory.getLogger(SliveMapper.class); private static final String OP_TYPE = SliveMapper.class.getSimpleName(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveReducer.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveReducer.java index 323559cd208..d4f24736445 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveReducer.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveReducer.java @@ -21,8 +21,6 @@ package org.apache.hadoop.fs.slive; import java.io.IOException; import java.util.Iterator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.MapReduceBase; @@ -30,6 +28,8 @@ import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reducer; import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.util.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The slive reducer which iterates over the given input values and merges them @@ -38,7 +38,7 @@ import org.apache.hadoop.util.StringUtils; public class SliveReducer extends MapReduceBase implements Reducer { - private static final Log LOG = LogFactory.getLog(SliveReducer.class); + private static final Logger LOG = LoggerFactory.getLogger(SliveReducer.class); private ConfigExtractor config; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveTest.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveTest.java index 97360d6693d..c2918abe4ce 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveTest.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/SliveTest.java @@ -30,8 +30,6 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; @@ -45,6 +43,8 @@ import org.apache.hadoop.mapred.TextOutputFormat; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Slive test entry point + main program @@ -61,7 +61,7 @@ import org.apache.hadoop.util.ToolRunner; */ public class SliveTest implements Tool { - private static final Log LOG = LogFactory.getLog(SliveTest.class); + private static final Logger LOG = LoggerFactory.getLogger(SliveTest.class); // ensures the hdfs configurations are loaded if they exist static { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/TestSlive.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/TestSlive.java index 25e3340e20d..575cd0bf60e 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/TestSlive.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/TestSlive.java @@ -31,8 +31,6 @@ import java.util.List; import java.util.Random; import java.util.Set; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -43,13 +41,15 @@ import org.apache.hadoop.fs.slive.DataWriter.GenerateOutput; import org.apache.hadoop.util.ToolRunner; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Junit 4 test for slive */ public class TestSlive { - private static final Log LOG = LogFactory.getLog(TestSlive.class); + private static final Logger LOG = LoggerFactory.getLogger(TestSlive.class); private static final Random rnd = new Random(1L); @@ -258,13 +258,13 @@ public class TestSlive { DataWriter writer = new DataWriter(rnd); FileOutputStream fs = new FileOutputStream(fn); GenerateOutput ostat = writer.writeSegment(byteAm, fs); - LOG.info(ostat); + LOG.info(ostat.toString()); fs.close(); assertTrue(ostat.getBytesWritten() == byteAm); DataVerifier vf = new DataVerifier(); FileInputStream fin = new FileInputStream(fn); VerifyOutput vfout = vf.verifyFile(byteAm, new DataInputStream(fin)); - LOG.info(vfout); + LOG.info(vfout.toString()); fin.close(); assertEquals(vfout.getBytesRead(), byteAm); assertTrue(vfout.getChunksDifferent() == 0); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/TruncateOp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/TruncateOp.java index 202d8074786..295b797cb1d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/TruncateOp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/TruncateOp.java @@ -22,12 +22,12 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.slive.OperationOutput.OutputType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Operation which selects a random file and truncates a random amount of bytes @@ -40,7 +40,7 @@ import org.apache.hadoop.fs.slive.OperationOutput.OutputType; */ class TruncateOp extends Operation { - private static final Log LOG = LogFactory.getLog(TruncateOp.class); + private static final Logger LOG = LoggerFactory.getLogger(TruncateOp.class); TruncateOp(ConfigExtractor cfg, Random rnd) { super(TruncateOp.class.getSimpleName(), cfg, rnd); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/WeightSelector.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/WeightSelector.java index d8acc39cd3d..3d80357090c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/WeightSelector.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/slive/WeightSelector.java @@ -26,12 +26,12 @@ import java.util.Map; import java.util.Random; import java.util.TreeMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.slive.Constants.Distribution; import org.apache.hadoop.fs.slive.Constants.OperationType; import org.apache.hadoop.fs.slive.Weights.UniformWeight; import org.apache.hadoop.fs.slive.ObserveableOp.Observer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class is the main handler that selects operations to run using the @@ -47,7 +47,8 @@ class WeightSelector { Double weight(int elapsed, int duration); } - private static final Log LOG = LogFactory.getLog(WeightSelector.class); + private static final Logger LOG = + LoggerFactory.getLogger(WeightSelector.class); private static class OperationInfo { Integer amountLeft; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java index 29eac43d66a..2346c3c472c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java @@ -30,8 +30,6 @@ import java.util.Date; import java.util.Iterator; import java.util.StringTokenizer; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.HadoopIllegalArgumentException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; @@ -57,6 +55,8 @@ import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.mapred.SequenceFileInputFormat; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This program executes a specified operation that applies load to @@ -78,8 +78,7 @@ import org.apache.hadoop.util.ToolRunner; */ public class NNBench extends Configured implements Tool { - private static final Log LOG = LogFactory.getLog( - "org.apache.hadoop.hdfs.NNBench"); + private static final Logger LOG = LoggerFactory.getLogger(NNBench.class); private static String CONTROL_DIR_NAME = "control"; private static String OUTPUT_DIR_NAME = "output"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBenchWithoutMR.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBenchWithoutMR.java index 9b6301095e5..af161779f79 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBenchWithoutMR.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBenchWithoutMR.java @@ -21,8 +21,6 @@ package org.apache.hadoop.hdfs; import java.io.IOException; import java.util.Date; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; @@ -30,6 +28,8 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.mapred.JobConf; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This program executes a specified operation that applies load to @@ -45,8 +45,8 @@ import org.apache.hadoop.mapred.JobConf; */ public class NNBenchWithoutMR { - private static final Log LOG = LogFactory.getLog( - "org.apache.hadoop.hdfs.NNBench"); + private static final Logger LOG = + LoggerFactory.getLogger(NNBenchWithoutMR.class); // variable initialzed from command line arguments private static long startTime = 0; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/BigMapOutput.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/BigMapOutput.java index 14e32fd6db1..964673b1ba6 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/BigMapOutput.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/BigMapOutput.java @@ -22,8 +22,6 @@ import java.io.IOException; import java.util.Date; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.fs.FileSystem; @@ -37,10 +35,12 @@ import org.apache.hadoop.mapred.lib.IdentityMapper; import org.apache.hadoop.mapred.lib.IdentityReducer; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class BigMapOutput extends Configured implements Tool { - public static final Log LOG = - LogFactory.getLog(BigMapOutput.class.getName()); + public static final Logger LOG = + LoggerFactory.getLogger(BigMapOutput.class); private static Random random = new Random(); public static String MIN_KEY = "mapreduce.bmo.minkey"; public static String MIN_VALUE = "mapreduce.bmo.minvalue"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java index 5286e86ad6e..53287563a99 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java @@ -24,8 +24,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -33,13 +31,15 @@ import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.io.Text; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Runs a job multiple times and takes average of all runs. */ public class MRBench extends Configured implements Tool{ - private static final Log LOG = LogFactory.getLog(MRBench.class); + private static final Logger LOG = LoggerFactory.getLogger(MRBench.class); private static final String DEFAULT_INPUT_SUB = "mr_input"; private static final String DEFAULT_OUTPUT_SUB = "mr_output"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java index 2e14441410d..e7df5b304b5 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRCluster.java @@ -20,13 +20,13 @@ package org.apache.hadoop.mapred; import java.io.IOException; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.security.AccessControlException; import org.apache.hadoop.security.UserGroupInformation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class is an MR2 replacement for older MR1 MiniMRCluster, that was used @@ -45,7 +45,8 @@ import org.apache.hadoop.security.UserGroupInformation; @InterfaceAudience.Public @InterfaceStability.Evolving public class MiniMRCluster { - private static final Log LOG = LogFactory.getLog(MiniMRCluster.class); + private static final Logger LOG = + LoggerFactory.getLogger(MiniMRCluster.class); private MiniMRClientCluster mrClientCluster; @@ -98,7 +99,7 @@ public class MiniMRCluster { try { jobConf = new JobConf(mrClientCluster.getConfig()); } catch (IOException e) { - LOG.error(e); + LOG.error(e.getMessage()); } return jobConf; } @@ -108,7 +109,7 @@ public class MiniMRCluster { try { jobConf = new JobConf(mrClientCluster.getConfig()); } catch (IOException e) { - LOG.error(e); + LOG.error(e.getMessage()); } return jobConf; } @@ -224,7 +225,7 @@ public class MiniMRCluster { try { jobConf = new JobConf(mrClientCluster.getConfig()); } catch (IOException e) { - LOG.error(e); + LOG.error(e.getMessage()); } return jobConf; } @@ -266,7 +267,7 @@ public class MiniMRCluster { try { mrClientCluster.stop(); } catch (IOException e) { - LOG.error(e); + LOG.error(e.getMessage()); } } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRYarnClusterAdapter.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRYarnClusterAdapter.java index 94d6ff32832..4f89840f300 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRYarnClusterAdapter.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MiniMRYarnClusterAdapter.java @@ -18,13 +18,13 @@ package org.apache.hadoop.mapred; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapreduce.v2.MiniMRYarnCluster; import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig; import org.apache.hadoop.service.Service.STATE; import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An adapter for MiniMRYarnCluster providing a MiniMRClientCluster interface. @@ -34,7 +34,8 @@ public class MiniMRYarnClusterAdapter implements MiniMRClientCluster { private MiniMRYarnCluster miniMRYarnCluster; - private static final Log LOG = LogFactory.getLog(MiniMRYarnClusterAdapter.class); + private static final Logger LOG = + LoggerFactory.getLogger(MiniMRYarnClusterAdapter.class); public MiniMRYarnClusterAdapter(MiniMRYarnCluster miniMRYarnCluster) { this.miniMRYarnCluster = miniMRYarnCluster; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ReliabilityTest.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ReliabilityTest.java index 983a4a7e67b..303857bf70e 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ReliabilityTest.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ReliabilityTest.java @@ -29,8 +29,6 @@ import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.fs.FileSystem; @@ -41,6 +39,8 @@ import org.apache.hadoop.util.Shell; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class tests reliability of the framework in the face of failures of @@ -73,7 +73,8 @@ import org.apache.hadoop.util.ToolRunner; public class ReliabilityTest extends Configured implements Tool { private String dir; - private static final Log LOG = LogFactory.getLog(ReliabilityTest.class); + private static final Logger LOG = + LoggerFactory.getLogger(ReliabilityTest.class); private void displayUsage() { LOG.info("This must be run in only the distributed mode " + @@ -207,7 +208,7 @@ public class ReliabilityTest extends Configured implements Tool { args); checkJobExitStatus(status, jobClass); } catch (Exception e) { - LOG.fatal("JOB " + jobClass + " failed to run"); + LOG.error("JOB " + jobClass + " failed to run"); System.exit(-1); } } @@ -325,7 +326,7 @@ public class ReliabilityTest extends Configured implements Tool { killed = true; return; } catch (Exception e) { - LOG.fatal(StringUtils.stringifyException(e)); + LOG.error(StringUtils.stringifyException(e)); } } } @@ -495,7 +496,7 @@ public class ReliabilityTest extends Configured implements Tool { } catch (InterruptedException ie) { killed = true; } catch (Exception e) { - LOG.fatal(StringUtils.stringifyException(e)); + LOG.error(StringUtils.stringifyException(e)); } } } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java index c2d6257823e..b45a2a6f8cf 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java @@ -30,8 +30,6 @@ import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; @@ -41,6 +39,8 @@ import org.apache.hadoop.mapreduce.TaskCounter; import org.apache.hadoop.util.ReflectionUtils; import org.junit.Ignore; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -48,8 +48,8 @@ import static org.junit.Assert.assertNotNull; @Ignore public class TestBadRecords extends ClusterMapReduceTestCase { - private static final Log LOG = - LogFactory.getLog(TestBadRecords.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestBadRecords.class); private static final List MAPPER_BAD_RECORDS = Arrays.asList("hello01","hello04","hello05"); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java index a9b4626581b..f97d0a48f72 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientRedirect.java @@ -24,8 +24,6 @@ import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.util.Iterator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.ipc.Server; import org.apache.hadoop.mapreduce.Cluster; @@ -144,6 +142,8 @@ import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; import org.apache.hadoop.yarn.ipc.YarnRPC; import org.junit.Assert; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestClientRedirect { @@ -151,7 +151,8 @@ public class TestClientRedirect { DefaultMetricsSystem.setMiniClusterMode(true); } - private static final Log LOG = LogFactory.getLog(TestClientRedirect.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestClientRedirect.class); private static final String RMADDRESS = "0.0.0.0:8054"; private static final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineFileInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineFileInputFormat.java index de7880dc656..4ed9eb2ccd7 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineFileInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineFileInputFormat.java @@ -26,16 +26,15 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.mapred.lib.CombineFileInputFormat; import org.apache.hadoop.mapred.lib.CombineFileSplit; import org.apache.hadoop.mapred.lib.CombineFileRecordReader; - import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.*; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - public class TestCombineFileInputFormat { - private static final Log LOG = - LogFactory.getLog(TestCombineFileInputFormat.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestCombineFileInputFormat.class); private static JobConf defaultConf = new JobConf(); private static FileSystem localFs = null; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineSequenceFileInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineSequenceFileInputFormat.java index 8cdaa8024cb..4f1d6bae4f1 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineSequenceFileInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineSequenceFileInputFormat.java @@ -25,8 +25,6 @@ import java.io.IOException; import java.util.BitSet; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -36,10 +34,12 @@ import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.mapred.lib.CombineFileSplit; import org.apache.hadoop.mapred.lib.CombineSequenceFileInputFormat; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestCombineSequenceFileInputFormat { - private static final Log LOG = - LogFactory.getLog(TestCombineSequenceFileInputFormat.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestCombineSequenceFileInputFormat.class); private static Configuration conf = new Configuration(); private static FileSystem localFs = null; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineTextInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineTextInputFormat.java index 581e62b639b..394630cc595 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineTextInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCombineTextInputFormat.java @@ -31,8 +31,6 @@ import java.util.BitSet; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; @@ -43,10 +41,12 @@ import org.apache.hadoop.mapred.lib.CombineFileSplit; import org.apache.hadoop.mapred.lib.CombineTextInputFormat; import org.apache.hadoop.util.ReflectionUtils; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestCombineTextInputFormat { - private static final Log LOG = - LogFactory.getLog(TestCombineTextInputFormat.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestCombineTextInputFormat.class); private static JobConf defaultConf = new JobConf(); private static FileSystem localFs = null; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestConcatenatedCompressedInput.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestConcatenatedCompressedInput.java index 15d651d18f1..977d083dff7 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestConcatenatedCompressedInput.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestConcatenatedCompressedInput.java @@ -30,8 +30,6 @@ import java.util.ArrayList; import java.util.List; import java.util.zip.Inflater; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; @@ -46,10 +44,13 @@ import org.apache.hadoop.util.ReflectionUtils; import org.junit.After; import org.junit.Ignore; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + @Ignore public class TestConcatenatedCompressedInput { - private static final Log LOG = - LogFactory.getLog(TestConcatenatedCompressedInput.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestConcatenatedCompressedInput.class); private static int MAX_LENGTH = 10000; private static JobConf defaultConf = new JobConf(); private static FileSystem localFs = null; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFixedLengthInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFixedLengthInputFormat.java index 8013feb1ba2..4864dd04a18 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFixedLengthInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFixedLengthInputFormat.java @@ -26,8 +26,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -35,14 +33,18 @@ import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.compress.*; import org.apache.hadoop.util.ReflectionUtils; - import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.*; public class TestFixedLengthInputFormat { - private static Log LOG; + private static final Logger LOG = + LoggerFactory.getLogger(TestFixedLengthInputFormat.class); + private static Configuration defaultConf; private static FileSystem localFs; private static Path workDir; @@ -55,7 +57,6 @@ public class TestFixedLengthInputFormat { @BeforeClass public static void onlyOnce() { try { - LOG = LogFactory.getLog(TestFixedLengthInputFormat.class.getName()); defaultConf = new Configuration(); defaultConf.set("fs.defaultFS", "file:///"); localFs = FileSystem.getLocal(defaultConf); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobCleanup.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobCleanup.java index bf762d93d92..13f2301b9f7 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobCleanup.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobCleanup.java @@ -22,9 +22,6 @@ import java.io.DataOutputStream; import java.io.File; import java.io.IOException; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.logging.Log; - import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; @@ -36,6 +33,9 @@ import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.LoggerFactory; +import org.slf4j.Logger; + import static org.junit.Assert.*; /** @@ -54,7 +54,8 @@ public class TestJobCleanup { private static Path emptyInDir = null; private static int outDirs = 0; - private static Log LOG = LogFactory.getLog(TestJobCleanup.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestJobCleanup.class); @BeforeClass public static void setUp() throws IOException { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java index 3dbc5777bd5..9a5ca075e3f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java @@ -21,8 +21,6 @@ package org.apache.hadoop.mapred; import java.io.DataOutputStream; import java.io.IOException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -34,13 +32,15 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A JUnit test to test Job System Directory with Mini-DFS. */ public class TestJobSysDirWithDFS { - private static final Log LOG = - LogFactory.getLog(TestJobSysDirWithDFS.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestJobSysDirWithDFS.class); static final int NUM_MAPS = 10; static final int NUM_SAMPLES = 100000; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java index bacc196008e..0991ae0b38b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java @@ -21,19 +21,21 @@ package org.apache.hadoop.mapred; import java.io.*; import java.util.*; -import org.apache.commons.logging.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.*; import org.apache.hadoop.io.compress.*; import org.apache.hadoop.util.LineReader; import org.apache.hadoop.util.ReflectionUtils; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; public class TestKeyValueTextInputFormat { - private static final Log LOG = - LogFactory.getLog(TestKeyValueTextInputFormat.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestKeyValueTextInputFormat.class); private static int MAX_LENGTH = 10000; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRTimelineEventHandling.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRTimelineEventHandling.java index 19313d3c8d5..a23caa56290 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRTimelineEventHandling.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRTimelineEventHandling.java @@ -31,8 +31,6 @@ import java.util.List; import java.util.Set; import org.apache.commons.io.FileUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -59,14 +57,16 @@ import org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter; import org.apache.hadoop.yarn.util.timeline.TimelineUtils; import org.junit.Assert; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.collect.Sets; public class TestMRTimelineEventHandling { private static final String TIMELINE_AUX_SERVICE_NAME = "timeline_collector"; - private static final Log LOG = - LogFactory.getLog(TestMRTimelineEventHandling.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRTimelineEventHandling.class); @Test public void testTimelineServiceStartInMiniCluster() throws Exception { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java index b8ff016d6af..f364c18c0d6 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java @@ -22,8 +22,6 @@ import java.io.File; import java.io.IOException; import java.util.List; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.ipc.ProtocolSignature; @@ -39,6 +37,9 @@ import org.apache.hadoop.mapreduce.split.JobSplitWriter; import org.apache.hadoop.mapreduce.split.SplitMetaInfoReader; import org.apache.hadoop.util.ReflectionUtils; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.assertTrue; /** @@ -56,7 +57,8 @@ import static org.junit.Assert.assertTrue; * validated here. */ public class TestMapProgress { - public static final Log LOG = LogFactory.getLog(TestMapProgress.class); + public static final Logger LOG = + LoggerFactory.getLogger(TestMapProgress.class); private static String TEST_ROOT_DIR; static { String root = new File(System.getProperty("test.build.data", "/tmp")) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRChildTask.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRChildTask.java index 51f0120d73f..340cba84a8f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRChildTask.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRChildTask.java @@ -27,8 +27,6 @@ import java.io.File; import java.io.IOException; import java.util.Iterator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -46,6 +44,8 @@ import org.apache.hadoop.util.Shell; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Class to test mapred task's @@ -53,8 +53,8 @@ import org.junit.Test; * - child env */ public class TestMiniMRChildTask { - private static final Log LOG = - LogFactory.getLog(TestMiniMRChildTask.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestMiniMRChildTask.class); private final static String OLD_CONFIGS = "test.old.configs"; private final static String TASK_OPTS_VAL = "-Xmx200m"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java index 1bd29542fcd..3a02f4cbe1f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java @@ -21,13 +21,14 @@ import java.io.IOException; import java.util.BitSet; import java.util.HashMap; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -35,7 +36,8 @@ public class TestMultiFileInputFormat { private static JobConf job = new JobConf(); - private static final Log LOG = LogFactory.getLog(TestMultiFileInputFormat.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestMultiFileInputFormat.class); private static final int MAX_SPLIT_COUNT = 10000; private static final int SPLIT_COUNT_INCR = 6000; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java index 03dc6a69003..ec538926432 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java @@ -18,8 +18,8 @@ package org.apache.hadoop.mapred; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.io.IOException; +import java.util.Random; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.BooleanWritable; @@ -31,17 +31,16 @@ import org.apache.hadoop.io.FloatWritable; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.SequenceFile.CompressionType; import org.junit.Test; - -import java.io.IOException; -import java.util.Random; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; public class TestSequenceFileAsBinaryOutputFormat { - private static final Log LOG = - LogFactory.getLog(TestSequenceFileAsBinaryOutputFormat.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestSequenceFileAsBinaryOutputFormat.class); private static final int RECORDS = 10000; // A random task attempt id for testing. private static final String attempt = "attempt_200707121733_0001_m_000000_0"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSortedRanges.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSortedRanges.java index 82d1d2d09a1..ffa42e4f4e8 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSortedRanges.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSortedRanges.java @@ -17,18 +17,18 @@ */ package org.apache.hadoop.mapred; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.mapred.SortedRanges.Range; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Iterator; import static org.junit.Assert.assertEquals; public class TestSortedRanges { - private static final Log LOG = - LogFactory.getLog(TestSortedRanges.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestSortedRanges.class); @Test public void testAdd() { @@ -56,7 +56,7 @@ public class TestSortedRanges { sr.add(new Range(21,50)); assertEquals(70, sr.getIndicesCount()); - LOG.debug(sr); + LOG.debug(sr.toString()); Iterator it = sr.skipRangeIterator(); int i = 0; @@ -96,7 +96,7 @@ public class TestSortedRanges { sr.remove(new SortedRanges.Range(5,1)); assertEquals(3, sr.getIndicesCount()); - LOG.debug(sr); + LOG.debug(sr.toString()); } } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java index b9e32759fa4..5b4a14131fd 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSpecialCharactersInOutputPath.java @@ -18,8 +18,9 @@ package org.apache.hadoop.mapred; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.URI; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -30,10 +31,8 @@ import org.apache.hadoop.mapred.lib.IdentityMapper; import org.apache.hadoop.mapred.lib.IdentityReducer; import org.apache.hadoop.util.Progressable; import org.junit.Test; - -import java.io.DataOutputStream; -import java.io.IOException; -import java.net.URI; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -42,8 +41,8 @@ import static org.junit.Assert.fail; * A JUnit test to test that jobs' output filenames are not HTML-encoded (cf HADOOP-1795). */ public class TestSpecialCharactersInOutputPath { - private static final Log LOG = - LogFactory.getLog(TestSpecialCharactersInOutputPath.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestSpecialCharactersInOutputPath.class); private static final String OUTPUT_FILENAME = "result[0]"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTaskStatus.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTaskStatus.java index e71103d1da8..94299b6363d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTaskStatus.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTaskStatus.java @@ -17,13 +17,11 @@ */ package org.apache.hadoop.mapred; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.junit.Test; + import static org.junit.Assert.*; public class TestTaskStatus { - private static final Log LOG = LogFactory.getLog(TestTaskStatus.class); @Test public void testMapTaskStatusStartAndFinishTimes() { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTextInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTextInputFormat.java index 11f0bb5f5c9..0ea1d6dbb7d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTextInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestTextInputFormat.java @@ -38,16 +38,15 @@ import org.apache.hadoop.io.Text; import org.apache.hadoop.io.compress.*; import org.apache.hadoop.util.LineReader; import org.apache.hadoop.util.ReflectionUtils; - import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.*; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - public class TestTextInputFormat { - private static final Log LOG = - LogFactory.getLog(TestTextInputFormat.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestTextInputFormat.class); private static int MAX_LENGTH = 10000; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java index 378363b4b0f..10d4c21374d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestYARNRunner.java @@ -48,8 +48,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; -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.CommonConfigurationKeysPublic; @@ -117,7 +115,6 @@ import org.apache.log4j.Appender; import org.apache.log4j.AppenderSkeleton; import org.apache.log4j.Layout; import org.apache.log4j.Level; -import org.apache.log4j.Logger; import org.apache.log4j.SimpleLayout; import org.apache.log4j.WriterAppender; import org.apache.log4j.spi.LoggingEvent; @@ -128,6 +125,8 @@ import org.junit.BeforeClass; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.collect.ImmutableList; @@ -136,7 +135,8 @@ import com.google.common.collect.ImmutableList; * fine */ public class TestYARNRunner { - private static final Log LOG = LogFactory.getLog(TestYARNRunner.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestYARNRunner.class); private static final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null); // prefix before /profile.out @@ -574,7 +574,8 @@ public class TestYARNRunner { } @Test(timeout=20000) public void testWarnCommandOpts() throws Exception { - Logger logger = Logger.getLogger(YARNRunner.class); + org.apache.log4j.Logger logger = + org.apache.log4j.Logger.getLogger(YARNRunner.class); ByteArrayOutputStream bout = new ByteArrayOutputStream(); Layout layout = new SimpleLayout(); @@ -1006,7 +1007,8 @@ public class TestYARNRunner { MRJobConfig.RESOURCE_TYPE_NAME_MEMORY, MRJobConfig.RESOURCE_TYPE_ALTERNATIVE_NAME_MEMORY)) { TestAppender testAppender = new TestAppender(); - Logger logger = Logger.getLogger(YARNRunner.class); + org.apache.log4j.Logger logger = + org.apache.log4j.Logger.getLogger(YARNRunner.class); logger.addAppender(testAppender); try { JobConf jobConf = new JobConf(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ThreadedMapBenchmark.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ThreadedMapBenchmark.java index c607bfb060e..68fe1a0198d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ThreadedMapBenchmark.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ThreadedMapBenchmark.java @@ -22,8 +22,6 @@ import java.io.IOException; import java.io.File; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -36,6 +34,8 @@ import org.apache.hadoop.mapred.lib.IdentityMapper; import org.apache.hadoop.mapred.lib.IdentityReducer; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Distributed threaded map benchmark. @@ -52,7 +52,8 @@ import org.apache.hadoop.util.ToolRunner; public class ThreadedMapBenchmark extends Configured implements Tool { - private static final Log LOG = LogFactory.getLog(ThreadedMapBenchmark.class); + private static final Logger LOG = + LoggerFactory.getLogger(ThreadedMapBenchmark.class); private static Path BASE_DIR = new Path(System.getProperty("test.build.data", File.separator + "benchmarks" + File.separator diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/UtilsForTests.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/UtilsForTests.java index 935c175e70e..89ac3ea2edc 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/UtilsForTests.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/UtilsForTests.java @@ -34,8 +34,6 @@ import java.util.Properties; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeoutException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -60,6 +58,8 @@ import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.base.Supplier; @@ -69,7 +69,7 @@ import com.google.common.base.Supplier; */ public class UtilsForTests { - static final Log LOG = LogFactory.getLog(UtilsForTests.class); + static final Logger LOG = LoggerFactory.getLogger(UtilsForTests.class); final static long KB = 1024L * 1; final static long MB = 1024L * KB; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/jobcontrol/TestLocalJobControl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/jobcontrol/TestLocalJobControl.java index 07b1306513c..3cd9c24db2d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/jobcontrol/TestLocalJobControl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/jobcontrol/TestLocalJobControl.java @@ -21,13 +21,14 @@ package org.apache.hadoop.mapred.jobcontrol; import java.io.IOException; import java.util.ArrayList; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapred.HadoopTestCase; import org.apache.hadoop.mapred.JobConf; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.assertEquals; /** @@ -35,8 +36,8 @@ import static org.junit.Assert.assertEquals; */ public class TestLocalJobControl extends HadoopTestCase { - public static final Log LOG = LogFactory.getLog(TestLocalJobControl.class - .getName()); + public static final Logger LOG = + LoggerFactory.getLogger(TestLocalJobControl.class); /** * Initialises a new instance of this test case to use a Local MR cluster and diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/pipes/TestPipes.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/pipes/TestPipes.java index 84b491a79ec..f7ef958a443 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/pipes/TestPipes.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/pipes/TestPipes.java @@ -23,8 +23,6 @@ import java.io.IOException; import java.util.List; import java.util.ArrayList; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.fs.FileUtil; @@ -45,14 +43,16 @@ import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.ToolRunner; import org.junit.Ignore; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; @Ignore public class TestPipes { - private static final Log LOG = - LogFactory.getLog(TestPipes.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(TestPipes.class); private static Path cppExamples = new Path(System.getProperty("install.c++.examples")); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/GrowingSleepJob.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/GrowingSleepJob.java index 55740f71311..92b72ccad96 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/GrowingSleepJob.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/GrowingSleepJob.java @@ -17,20 +17,20 @@ */ package org.apache.hadoop.mapreduce; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.io.IOException; +import java.util.ArrayList; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.util.ToolRunner; - -import java.io.IOException; -import java.util.ArrayList; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A sleep job whose mappers create 1MB buffer for every record. */ public class GrowingSleepJob extends SleepJob { - private static final Log LOG = LogFactory.getLog(GrowingSleepJob.class); + private static final Logger LOG = + LoggerFactory.getLogger(GrowingSleepJob.class); public static class GrowingSleepMapper extends SleepMapper { private final int MB = 1024 * 1024; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileParser.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileParser.java index 5d9dc0b88eb..37834663997 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileParser.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileParser.java @@ -20,19 +20,20 @@ package org.apache.hadoop.mapreduce; 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.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser; import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.JobInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Used to parse job history and configuration files. */ class JobHistoryFileParser { - private static final Log LOG = LogFactory.getLog(JobHistoryFileParser.class); + private static final Logger LOG = + LoggerFactory.getLogger(JobHistoryFileParser.class); private final FileSystem fs; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayHelper.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayHelper.java index 8acd26eae5d..4b47b430777 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayHelper.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayHelper.java @@ -24,19 +24,18 @@ import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocatedFileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RemoteIterator; import org.apache.hadoop.mapreduce.Mapper.Context; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; class JobHistoryFileReplayHelper { - private static final Log LOG = - LogFactory.getLog(JobHistoryFileReplayHelper.class); + private static final Logger LOG = + LoggerFactory.getLogger(JobHistoryFileReplayHelper.class); static final String PROCESSING_PATH = "processing path"; static final String REPLAY_MODE = "replay mode"; static final int WRITE_ALL_AT_ONCE = 1; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayMapperV1.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayMapperV1.java index d553596b2fa..1d0896f66c6 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayMapperV1.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayMapperV1.java @@ -23,8 +23,6 @@ import java.util.Collection; import java.util.Set; import java.util.concurrent.TimeUnit; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; @@ -38,7 +36,8 @@ import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.timeline.TimelineEntity; import org.apache.hadoop.yarn.client.api.TimelineClient; import org.apache.hadoop.yarn.exceptions.YarnException; - +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Mapper for TimelineServicePerformanceV1 that replays job history files to the @@ -48,8 +47,8 @@ import org.apache.hadoop.yarn.exceptions.YarnException; class JobHistoryFileReplayMapperV1 extends org.apache.hadoop.mapreduce. Mapper { - private static final Log LOG = - LogFactory.getLog(JobHistoryFileReplayMapperV1.class); + private static final Logger LOG = + LoggerFactory.getLogger(JobHistoryFileReplayMapperV1.class); public void map(IntWritable key, IntWritable val, Context context) throws IOException { // collect the apps it needs to process diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayMapperV2.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayMapperV2.java index 2ec48336e7f..f8e6ca00a82 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayMapperV2.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/JobHistoryFileReplayMapperV2.java @@ -23,8 +23,6 @@ import java.util.Collection; import java.util.List; import java.util.concurrent.TimeUnit; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapred.JobID; import org.apache.hadoop.mapreduce.JobHistoryFileReplayHelper.JobFiles; @@ -38,6 +36,8 @@ import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity; import org.apache.hadoop.yarn.server.timelineservice.collector.AppLevelTimelineCollector; import org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext; import org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Mapper for TimelineServicePerformance that replays job history files to the @@ -45,8 +45,8 @@ import org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollector * */ class JobHistoryFileReplayMapperV2 extends EntityWriterV2 { - private static final Log LOG = - LogFactory.getLog(JobHistoryFileReplayMapperV2.class); + private static final Logger LOG = + LoggerFactory.getLogger(JobHistoryFileReplayMapperV2.class); @Override protected void writeEntities(Configuration tlConf, diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MapReduceTestUtil.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MapReduceTestUtil.java index 8351b53a0ed..2f30bb5ec0c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MapReduceTestUtil.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MapReduceTestUtil.java @@ -31,8 +31,6 @@ import java.util.Iterator; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configurable; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; @@ -46,22 +44,19 @@ import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.mapred.TaskLog; import org.apache.hadoop.mapred.Utils; -import org.apache.hadoop.mapred.TaskLog.LogName; -import org.apache.hadoop.mapred.TaskLog.Reader; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.mapreduce.Mapper; -import org.apache.hadoop.mapreduce.Reducer; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl; import org.apache.hadoop.util.ReflectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Utility methods used in various Job Control unit tests. */ public class MapReduceTestUtil { - public static final Log LOG = - LogFactory.getLog(MapReduceTestUtil.class.getName()); + public static final Logger LOG = + LoggerFactory.getLogger(MapReduceTestUtil.class); static private Random rand = new Random(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MiniHadoopClusterManager.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MiniHadoopClusterManager.java index 324f0ca0322..b89cdc01180 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MiniHadoopClusterManager.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MiniHadoopClusterManager.java @@ -34,8 +34,6 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.StartupOption; @@ -46,6 +44,8 @@ import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.server.MiniYARNCluster; import org.eclipse.jetty.util.ajax.JSON; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class drives the creation of a mini-cluster on the local machine. By @@ -60,8 +60,8 @@ import org.eclipse.jetty.util.ajax.JSON; * To shutdown the cluster, kill the process. */ public class MiniHadoopClusterManager { - private static final Log LOG = LogFactory - .getLog(MiniHadoopClusterManager.class); + private static final Logger LOG = + LoggerFactory.getLogger(MiniHadoopClusterManager.class); private MiniMRClientCluster mr; private MiniDFSCluster dfs; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/SimpleEntityWriterV1.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/SimpleEntityWriterV1.java index 6d6151fa6a1..219f5523edf 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/SimpleEntityWriterV1.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/SimpleEntityWriterV1.java @@ -22,8 +22,6 @@ import java.io.IOException; import java.util.Random; import java.util.concurrent.TimeUnit; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Writable; @@ -32,6 +30,8 @@ import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.yarn.api.records.timeline.TimelineEntity; import org.apache.hadoop.yarn.api.records.timeline.TimelineEvent; import org.apache.hadoop.yarn.client.api.TimelineClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Adds simple entities with random string payload, events, metrics, and @@ -41,7 +41,8 @@ class SimpleEntityWriterV1 extends org.apache.hadoop.mapreduce.Mapper implements SimpleEntityWriterConstants { - private static final Log LOG = LogFactory.getLog(SimpleEntityWriterV1.class); + private static final Logger LOG = + LoggerFactory.getLogger(SimpleEntityWriterV1.class); public void map(IntWritable key, IntWritable val, Context context) throws IOException { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/SimpleEntityWriterV2.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/SimpleEntityWriterV2.java index d66deb0e73c..93633a06b5c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/SimpleEntityWriterV2.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/SimpleEntityWriterV2.java @@ -22,8 +22,6 @@ import java.io.IOException; import java.util.Random; import java.util.concurrent.TimeUnit; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapreduce.TimelineServicePerformance.PerfCounters; import org.apache.hadoop.security.UserGroupInformation; @@ -35,6 +33,8 @@ import org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric; import org.apache.hadoop.yarn.server.timelineservice.collector.AppLevelTimelineCollector; import org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext; import org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Adds simple entities with random string payload, events, metrics, and @@ -42,7 +42,8 @@ import org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollector */ class SimpleEntityWriterV2 extends EntityWriterV2 implements SimpleEntityWriterConstants { - private static final Log LOG = LogFactory.getLog(SimpleEntityWriterV2.class); + private static final Logger LOG = + LoggerFactory.getLogger(SimpleEntityWriterV2.class); protected void writeEntities(Configuration tlConf, TimelineCollectorManager manager, Context context) throws IOException { @@ -128,4 +129,4 @@ class SimpleEntityWriterV2 extends EntityWriterV2 manager.remove(appId); } } -} \ No newline at end of file +} diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java index 83d689c1e9b..8c79435251f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java @@ -19,20 +19,19 @@ package org.apache.hadoop.mapreduce; import java.util.Random; -import org.junit.Test; -import static org.junit.Assert.*; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.mapreduce.counters.LimitExceededException; import org.apache.hadoop.mapreduce.counters.Limits; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.junit.Test; +import static org.junit.Assert.*; /** * TestCounters checks the sanity and recoverability of {@code Counters} */ public class TestCounters { - static final Log LOG = LogFactory.getLog(TestCounters.class); + static final Logger LOG = LoggerFactory.getLogger(TestCounters.class); /** * Verify counter value works diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestLocalRunner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestLocalRunner.java index 8177ecd405b..7630e850794 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestLocalRunner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestLocalRunner.java @@ -17,8 +17,6 @@ */ package org.apache.hadoop.mapreduce; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileStatus; @@ -33,6 +31,8 @@ import org.apache.hadoop.mapreduce.lib.input.FileSplit; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.util.ReflectionUtils; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -54,7 +54,8 @@ import static org.junit.Assert.assertTrue; */ public class TestLocalRunner { - private static final Log LOG = LogFactory.getLog(TestLocalRunner.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestLocalRunner.class); private static int INPUT_SIZES[] = new int[] { 50000, 500, 500, 20, 5000, 500}; @@ -330,9 +331,9 @@ public class TestLocalRunner { try { job.waitForCompletion(true); } catch (InterruptedException ie) { - LOG.fatal("Interrupted while waiting for job completion", ie); + LOG.error("Interrupted while waiting for job completion", ie); for (int i = 0; i < 10; i++) { - LOG.fatal("Dumping stacks"); + LOG.error("Dumping stacks"); ReflectionUtils.logThreadInfo(LOG, "multimap threads", 0); Thread.sleep(1000); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java index 3a33bb145c7..f4ccc569af9 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java @@ -17,8 +17,6 @@ */ package org.apache.hadoop.mapreduce; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocatedFileStatus; @@ -33,6 +31,8 @@ import org.apache.hadoop.util.ToolRunner; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.ByteArrayInputStream; @@ -60,7 +60,8 @@ import static org.junit.Assert.fail; */ public class TestMRJobClient extends ClusterMapReduceTestCase { - private static final Log LOG = LogFactory.getLog(TestMRJobClient.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRJobClient.class); private Job runJob(Configuration conf) throws Exception { String input = "hello1\nhello2\nhello3\n"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapCollection.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapCollection.java index afe4a102961..b6ec12077e4 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapCollection.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapCollection.java @@ -24,22 +24,21 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; -import org.junit.Test; -import static org.junit.Assert.*; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configurable; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.*; import org.apache.hadoop.mapreduce.lib.output.NullOutputFormat; -import org.apache.hadoop.mapreduce.MRConfig; import org.apache.hadoop.util.ReflectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.junit.Test; + +import static org.junit.Assert.*; public class TestMapCollection { - private static final Log LOG = LogFactory.getLog( + private static final Logger LOG = LoggerFactory.getLogger( TestMapCollection.class.getName()); public static abstract class FillWritable implements Writable, Configurable { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestValueIterReset.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestValueIterReset.java index b757fb2c34f..4bcacd8ec48 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestValueIterReset.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestValueIterReset.java @@ -27,8 +27,6 @@ import java.io.Writer; import java.util.ArrayList; import java.util.StringTokenizer; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileUtil; @@ -42,6 +40,8 @@ import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.Assert.assertTrue; @@ -66,8 +66,8 @@ public class TestValueIterReset { } } - private static final Log LOG = - LogFactory.getLog(TestValueIterReset.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestValueIterReset.class); public static class TestMapper extends Mapper { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TimelineEntityConverterV1.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TimelineEntityConverterV1.java index dcc3ce014b7..a6fc58e5e24 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TimelineEntityConverterV1.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TimelineEntityConverterV1.java @@ -22,17 +22,17 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.JobInfo; import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskAttemptInfo; import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskInfo; import org.apache.hadoop.yarn.api.records.timeline.TimelineEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; class TimelineEntityConverterV1 { - private static final Log LOG = - LogFactory.getLog(TimelineEntityConverterV1.class); + private static final Logger LOG = + LoggerFactory.getLogger(TimelineEntityConverterV1.class); static final String JOB = "MAPREDUCE_JOB"; static final String TASK = "MAPREDUCE_TASK"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TimelineEntityConverterV2.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TimelineEntityConverterV2.java index 45812fe7dac..48c470bbd19 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TimelineEntityConverterV2.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TimelineEntityConverterV2.java @@ -24,8 +24,8 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.JobInfo; import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskAttemptInfo; @@ -34,8 +34,8 @@ import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity; import org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric; class TimelineEntityConverterV2 { - private static final Log LOG = - LogFactory.getLog(TimelineEntityConverterV2.class); + private static final Logger LOG = + LoggerFactory.getLogger(TimelineEntityConverterV2.class); static final String JOB = "MAPREDUCE_JOB"; static final String TASK = "MAPREDUCE_TASK"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java index 81a32498d6c..39b63d5e7cf 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/db/TestDataDrivenDBInputFormat.java @@ -18,8 +18,6 @@ package org.apache.hadoop.mapreduce.lib.db; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -36,6 +34,8 @@ import org.hsqldb.server.Server; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.DataInput; import java.io.DataOutput; @@ -58,7 +58,7 @@ import static org.junit.Assert.assertTrue; */ public class TestDataDrivenDBInputFormat extends HadoopTestCase { - private static final Log LOG = LogFactory.getLog( + private static final Logger LOG = LoggerFactory.getLogger( TestDataDrivenDBInputFormat.class); private static final String DB_NAME = "dddbif"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestCombineSequenceFileInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestCombineSequenceFileInputFormat.java index cb541588c60..dbbdc3d44c1 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestCombineSequenceFileInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestCombineSequenceFileInputFormat.java @@ -27,8 +27,6 @@ import java.util.BitSet; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -44,10 +42,12 @@ import org.apache.hadoop.mapreduce.RecordReader; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.task.MapContextImpl; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestCombineSequenceFileInputFormat { - private static final Log LOG = - LogFactory.getLog(TestCombineSequenceFileInputFormat.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestCombineSequenceFileInputFormat.class); private static Configuration conf = new Configuration(); private static FileSystem localFs = null; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestCombineTextInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestCombineTextInputFormat.java index cb1dffcdd05..3dd2333d7c3 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestCombineTextInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestCombineTextInputFormat.java @@ -32,8 +32,6 @@ import java.util.BitSet; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -51,10 +49,12 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.task.MapContextImpl; import org.apache.hadoop.util.ReflectionUtils; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestCombineTextInputFormat { - private static final Log LOG = - LogFactory.getLog(TestCombineTextInputFormat.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestCombineTextInputFormat.class); private static Configuration defaultConf = new Configuration(); private static FileSystem localFs = null; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestFixedLengthInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestFixedLengthInputFormat.java index b82b495f1cb..684d3e13d1f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestFixedLengthInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestFixedLengthInputFormat.java @@ -26,8 +26,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -41,16 +39,19 @@ import org.apache.hadoop.mapreduce.MapReduceTestUtil; import org.apache.hadoop.mapreduce.RecordReader; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.task.MapContextImpl; - import org.apache.hadoop.util.ReflectionUtils; - import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.*; public class TestFixedLengthInputFormat { - private static Log LOG; + private static final Logger LOG = + LoggerFactory.getLogger(TestFixedLengthInputFormat.class); + private static Configuration defaultConf; private static FileSystem localFs; private static Path workDir; @@ -62,7 +63,6 @@ public class TestFixedLengthInputFormat { @BeforeClass public static void onlyOnce() { try { - LOG = LogFactory.getLog(TestFixedLengthInputFormat.class.getName()); defaultConf = new Configuration(); defaultConf.set("fs.defaultFS", "file:///"); localFs = FileSystem.getLocal(defaultConf); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java index f181c9c5456..537d23c5f0e 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRKeyValueTextInputFormat.java @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import org.apache.commons.logging.*; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.*; @@ -42,16 +41,15 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.task.MapContextImpl; import org.apache.hadoop.util.LineReader; import org.apache.hadoop.util.ReflectionUtils; - import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.junit.Assert.*; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - public class TestMRKeyValueTextInputFormat { - private static final Log LOG = - LogFactory.getLog(TestMRKeyValueTextInputFormat.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRKeyValueTextInputFormat.class); private static Configuration defaultConf = new Configuration(); private static FileSystem localFs = null; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java index 89aa7b23057..178eb50408a 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/input/TestMRSequenceFileInputFilter.java @@ -18,8 +18,6 @@ package org.apache.hadoop.mapreduce.lib.input; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -35,6 +33,8 @@ import org.apache.hadoop.mapreduce.RecordReader; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.task.MapContextImpl; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.Random; @@ -42,8 +42,8 @@ import java.util.Random; import static org.junit.Assert.assertEquals; public class TestMRSequenceFileInputFilter { - private static final Log LOG = - LogFactory.getLog(TestMRSequenceFileInputFilter.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRSequenceFileInputFilter.class); private static final int MAX_LENGTH = 15000; private static final Configuration conf = new Configuration(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java index da011a28854..534593e8840 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java @@ -22,17 +22,17 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapred.HadoopTestCase; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.MapReduceTestUtil; +import org.junit.Assert; 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.assertFalse; @@ -43,8 +43,8 @@ import static org.junit.Assert.assertFalse; */ public class TestMapReduceJobControl extends HadoopTestCase { - public static final Log LOG = - LogFactory.getLog(TestMapReduceJobControl.class.getName()); + public static final Logger LOG = + LoggerFactory.getLogger(TestMapReduceJobControl.class); static Path rootDataDir = new Path( System.getProperty("test.build.data", "."), "TestData"); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java index 5a8aeda83be..ad213d34ac0 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestMRSequenceFileAsBinaryOutputFormat.java @@ -18,8 +18,6 @@ package org.apache.hadoop.mapreduce.lib.output; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -44,6 +42,8 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat; import org.apache.hadoop.mapreduce.task.MapContextImpl; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.Random; @@ -53,8 +53,8 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; public class TestMRSequenceFileAsBinaryOutputFormat { - private static final Log LOG = - LogFactory.getLog(TestMRSequenceFileAsBinaryOutputFormat.class.getName()); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRSequenceFileAsBinaryOutputFormat.class); private static final int RECORDS = 10000; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/partition/TestKeyFieldHelper.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/partition/TestKeyFieldHelper.java index 4d05d13d445..54c4cc30961 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/partition/TestKeyFieldHelper.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/partition/TestKeyFieldHelper.java @@ -17,15 +17,17 @@ */ package org.apache.hadoop.mapreduce.lib.partition; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class TestKeyFieldHelper { - private static final Log LOG = LogFactory.getLog(TestKeyFieldHelper.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestKeyFieldHelper.class); + /** * Test is key-field-helper's parse option. */ @@ -427,4 +429,4 @@ public class TestKeyFieldHelper { } return true; } -} \ No newline at end of file +} diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java index 387e2027c80..d8c4b2a3841 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java @@ -28,8 +28,6 @@ import java.security.PrivilegedExceptionAction; import org.junit.Assert; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeysPublic; import org.apache.hadoop.mapred.JobConf; @@ -54,17 +52,19 @@ import org.apache.hadoop.yarn.util.ConverterUtils; import org.apache.hadoop.yarn.util.Records; import org.apache.log4j.Level; import org.apache.log4j.LogManager; -import org.apache.log4j.Logger; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestJHSSecurity { - private static final Log LOG = LogFactory.getLog(TestJHSSecurity.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestJHSSecurity.class); @Test public void testDelegationToken() throws IOException, InterruptedException { - Logger rootLogger = LogManager.getRootLogger(); + org.apache.log4j.Logger rootLogger = LogManager.getRootLogger(); rootLogger.setLevel(Level.DEBUG); final YarnConfiguration conf = new YarnConfiguration(new JobConf()); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/util/MRAsyncDiskService.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/util/MRAsyncDiskService.java index be4638579ea..0c7a173cdef 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/util/MRAsyncDiskService.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/util/MRAsyncDiskService.java @@ -24,8 +24,6 @@ import java.util.Date; import java.util.List; import java.util.concurrent.atomic.AtomicLong; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -34,6 +32,8 @@ import org.apache.hadoop.util.AsyncDiskService; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class is a container of multiple thread pools, each for a volume, @@ -53,7 +53,8 @@ import org.apache.hadoop.classification.InterfaceStability; @InterfaceStability.Unstable public class MRAsyncDiskService { - public static final Log LOG = LogFactory.getLog(MRAsyncDiskService.class); + public static final Logger LOG = + LoggerFactory.getLogger(MRAsyncDiskService.class); AsyncDiskService asyncDiskService; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/util/TestMRAsyncDiskService.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/util/TestMRAsyncDiskService.java index 07b5d8b9f50..fbccd9f9f07 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/util/TestMRAsyncDiskService.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/util/TestMRAsyncDiskService.java @@ -20,16 +20,14 @@ package org.apache.hadoop.mapreduce.util; import java.io.File; 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.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.FileUtil; -import org.apache.hadoop.mapreduce.util.MRAsyncDiskService; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -42,7 +40,8 @@ import static org.junit.Assert.fail; */ public class TestMRAsyncDiskService { - public static final Log LOG = LogFactory.getLog(TestMRAsyncDiskService.class); + public static final Logger LOG = + LoggerFactory.getLogger(TestMRAsyncDiskService.class); private static String TEST_ROOT_DIR = new Path(System.getProperty( "test.build.data", "/tmp")).toString(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java index 06e37dd0f0e..289c17e3549 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java @@ -24,8 +24,6 @@ import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; @@ -53,6 +51,8 @@ import org.apache.hadoop.yarn.server.MiniYARNCluster; import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor; import org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor; import org.apache.hadoop.yarn.webapp.util.WebAppUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Configures and starts the MR-specific components in the YARN cluster. @@ -64,7 +64,8 @@ public class MiniMRYarnCluster extends MiniYARNCluster { public static final String APPJAR = JarFinder.getJar(LocalContainerLauncher.class); - private static final Log LOG = LogFactory.getLog(MiniMRYarnCluster.class); + private static final Logger LOG = + LoggerFactory.getLogger(MiniMRYarnCluster.class); private JobHistoryServer historyServer; private JobHistoryServerWrapper historyServerWrapper; private static final String TIMELINE_AUX_SERVICE_NAME = "timeline_collector"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRAMWithNonNormalizedCapabilities.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRAMWithNonNormalizedCapabilities.java index 7aaaa1b8d93..8eb673ccf6a 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRAMWithNonNormalizedCapabilities.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRAMWithNonNormalizedCapabilities.java @@ -23,8 +23,6 @@ import java.io.IOException; import org.junit.Assert; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.mapreduce.SleepJob; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; @@ -37,9 +35,12 @@ import org.apache.hadoop.mapreduce.v2.MiniMRYarnCluster; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestMRAMWithNonNormalizedCapabilities { - private static final Log LOG = LogFactory.getLog(TestMRAMWithNonNormalizedCapabilities.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRAMWithNonNormalizedCapabilities.class); private static FileSystem localFs; protected static MiniMRYarnCluster mrCluster = null; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRAppWithCombiner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRAppWithCombiner.java index a96befaee68..0f3916824ae 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRAppWithCombiner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRAppWithCombiner.java @@ -23,8 +23,6 @@ import java.io.File; import java.io.IOException; import java.util.Iterator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.CustomOutputCommitter; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; @@ -47,6 +45,8 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings("deprecation") public class TestMRAppWithCombiner { @@ -54,7 +54,8 @@ public class TestMRAppWithCombiner { protected static MiniMRYarnCluster mrCluster; private static Configuration conf = new Configuration(); private static FileSystem localFs; - private static final Log LOG = LogFactory.getLog(TestMRAppWithCombiner.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRAppWithCombiner.class); static { try { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java index 6e280addc24..c8b40037d51 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java @@ -36,8 +36,6 @@ import java.util.jar.JarOutputStream; import java.util.zip.ZipEntry; import org.apache.commons.io.FileUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.FailingMapper; import org.apache.hadoop.RandomTextWriterJob; import org.apache.hadoop.RandomTextWriterJob.RandomInputFormat; @@ -104,10 +102,12 @@ import org.junit.Assert; import org.junit.Assume; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestMRJobs { - private static final Log LOG = LogFactory.getLog(TestMRJobs.class); + private static final Logger LOG = LoggerFactory.getLogger(TestMRJobs.class); private static final EnumSet TERMINAL_RM_APP_STATES = EnumSet.of(RMAppState.FINISHED, RMAppState.FAILED, RMAppState.KILLED); private static final int NUM_NODE_MGRS = 3; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java index 98a6de2ce0c..64cb253d9c5 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java @@ -26,8 +26,6 @@ import java.util.List; import org.junit.Assert; import org.apache.avro.AvroRemoteException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.mapreduce.SleepJob; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; @@ -52,11 +50,13 @@ import org.apache.hadoop.yarn.util.Records; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestMRJobsWithHistoryService { - private static final Log LOG = - LogFactory.getLog(TestMRJobsWithHistoryService.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRJobsWithHistoryService.class); private static final EnumSet TERMINAL_RM_APP_STATES = EnumSet.of(RMAppState.FINISHED, RMAppState.FAILED, RMAppState.KILLED); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithProfiler.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithProfiler.java index cbf1f39b9d4..9fa88287717 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithProfiler.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithProfiler.java @@ -27,8 +27,6 @@ import java.util.regex.Pattern; import org.junit.AfterClass; import org.junit.Assert; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.mapreduce.SleepJob; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.*; @@ -42,11 +40,13 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestMRJobsWithProfiler { - private static final Log LOG = - LogFactory.getLog(TestMRJobsWithProfiler.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestMRJobsWithProfiler.class); private static final EnumSet TERMINAL_RM_APP_STATES = EnumSet.of(RMAppState.FINISHED, RMAppState.FAILED, RMAppState.KILLED); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java index 7af592297b6..92c65e74993 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java @@ -22,8 +22,6 @@ import java.io.DataOutputStream; import java.io.File; import java.io.IOException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.CustomOutputCommitter; import org.apache.hadoop.FailMapper; import org.apache.hadoop.conf.Configuration; @@ -46,10 +44,13 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestMROldApiJobs { - private static final Log LOG = LogFactory.getLog(TestMROldApiJobs.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestMROldApiJobs.class); protected static MiniMRYarnCluster mrCluster; private static Configuration conf = new Configuration(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestRMNMInfo.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestRMNMInfo.java index 0e55529f39e..efea709e9fb 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestRMNMInfo.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestRMNMInfo.java @@ -26,8 +26,6 @@ import java.util.concurrent.ConcurrentMap; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -42,10 +40,13 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import static org.mockito.Mockito.*; public class TestRMNMInfo { - private static final Log LOG = LogFactory.getLog(TestRMNMInfo.class); + private static final Logger LOG = LoggerFactory.getLogger(TestRMNMInfo.class); private static final int NUMNODEMANAGERS = 4; protected static MiniMRYarnCluster mrCluster; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestSpeculativeExecution.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestSpeculativeExecution.java index 17d82d6dacc..fe21f075243 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestSpeculativeExecution.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestSpeculativeExecution.java @@ -21,8 +21,6 @@ package org.apache.hadoop.mapreduce.v2; import java.io.File; 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.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; @@ -48,6 +46,8 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestSpeculativeExecution { @@ -82,7 +82,8 @@ public class TestSpeculativeExecution { } } - private static final Log LOG = LogFactory.getLog(TestSpeculativeExecution.class); + private static final Logger LOG = + LoggerFactory.getLogger(TestSpeculativeExecution.class); protected static MiniMRYarnCluster mrCluster; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestUberAM.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestUberAM.java index e198f994a3e..24192eaa9ae 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestUberAM.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestUberAM.java @@ -21,8 +21,6 @@ package org.apache.hadoop.mapreduce.v2; import java.io.File; import java.io.IOException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.mapreduce.Counters; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.JobCounter; @@ -35,10 +33,12 @@ import org.apache.hadoop.mapreduce.TaskType; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestUberAM extends TestMRJobs { - private static final Log LOG = LogFactory.getLog(TestUberAM.class); + private static final Logger LOG = LoggerFactory.getLogger(TestUberAM.class); @BeforeClass public static void setup() throws IOException { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/testjar/UserNamePermission.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/testjar/UserNamePermission.java index 8ca2e162b4b..f339edbe1e0 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/testjar/UserNamePermission.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/testjar/UserNamePermission.java @@ -21,28 +21,23 @@ package testjar; import java.io.IOException; import java.util.Iterator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapred.JobConf; -import org.apache.hadoop.mapred.OutputCollector; -import org.apache.hadoop.mapred.Reporter; - import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Reducer; -import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserNamePermission { + private static final Logger LOG = + LoggerFactory.getLogger(UserNamePermission.class); - private static final Log LOG = LogFactory.getLog(UserNamePermission.class); //This mapper will read the user name and pass in to the reducer public static class UserNameMapper extends Mapper {