HDFS-15834. Remove the usage of org.apache.log4j.Level (#2696)

This commit is contained in:
Akira Ajisaka 2021-02-17 15:59:24 +09:00 committed by GitHub
parent 4cf3531583
commit 0ed9e36282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
76 changed files with 250 additions and 242 deletions

View File

@ -39,7 +39,6 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.LambdaTestUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
@ -57,6 +56,7 @@
import static org.mockito.Mockito.mock;
import org.apache.hadoop.thirdparty.com.google.common.collect.Lists;
import org.slf4j.event.Level;
public class TestRequestHedgingProxyProvider {

View File

@ -24,11 +24,11 @@
import org.apache.hadoop.hdfs.util.ByteArrayManager.ManagerMap;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.util.ArrayList;
import java.util.Collections;
@ -50,7 +50,7 @@
public class TestByteArrayManager {
static {
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(ByteArrayManager.class), Level.ALL);
LoggerFactory.getLogger(ByteArrayManager.class), Level.TRACE);
}
static final Logger LOG = LoggerFactory.getLogger(TestByteArrayManager.class);
@ -559,8 +559,8 @@ public synchronized int release(byte[] array) {
}
public static void main(String[] args) throws Exception {
GenericTestUtils.setLogLevel(LoggerFactory.getLogger(ByteArrayManager.class),
Level.OFF);
GenericTestUtils.disableLog(
LoggerFactory.getLogger(ByteArrayManager.class));
final int arrayLength = 64 * 1024; //64k
final int nThreads = 512;
final int nAllocations = 1 << 15;

View File

@ -21,7 +21,7 @@
import java.util.ArrayList;
import java.util.concurrent.atomic.*;
import org.apache.log4j.Level;
import org.slf4j.event.Level;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
@ -50,7 +50,7 @@ public class TestFuseDFS {
private static final Logger LOG = LoggerFactory.getLogger(TestFuseDFS.class);
{
GenericTestUtils.setLogLevel(LOG, Level.ALL);
GenericTestUtils.setLogLevel(LOG, Level.TRACE);
}
/** Dump the given intput stream to stderr */

View File

@ -54,14 +54,15 @@
import org.apache.hadoop.hdfs.server.federation.resolver.NamenodeStatusReport;
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport;
import org.apache.hadoop.http.HttpConfig;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
/**
* Test namenodes monitor behavior in the Router.
@ -300,7 +301,7 @@ private void verifyUrlSchemes(String scheme) {
final org.apache.log4j.Logger logger =
org.apache.log4j.Logger.getRootLogger();
logger.addAppender(appender);
logger.setLevel(Level.DEBUG);
GenericTestUtils.setRootLogLevel(Level.DEBUG);
// Setup and start the Router
Configuration conf = getNamenodesConfig();

View File

@ -38,10 +38,10 @@
import org.apache.hadoop.hdfs.web.WebHdfsTestUtil;
import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* Test symbolic links in Hdfs.
@ -49,7 +49,7 @@
abstract public class TestSymlinkHdfs extends SymlinkBaseTest {
{
GenericTestUtils.setLogLevel(NameNode.stateChangeLog, Level.ALL);
GenericTestUtils.setLogLevel(NameNode.stateChangeLog, Level.TRACE);
}
protected static MiniDFSCluster cluster;

View File

@ -190,12 +190,12 @@
import org.apache.hadoop.util.Time;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.VersionInfo;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Assume;
import org.apache.hadoop.util.ToolRunner;
import org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting;
import org.slf4j.event.Level;
/** Utilities for HDFS tests */
public class DFSTestUtil {
@ -1992,15 +1992,6 @@ public static void setNameNodeLogLevel(Level level) {
GenericTestUtils.setLogLevel(NameNode.blockStateChangeLog, level);
}
public static void setNameNodeLogLevel(org.slf4j.event.Level level) {
GenericTestUtils.setLogLevel(FSNamesystem.LOG, level);
GenericTestUtils.setLogLevel(BlockManager.LOG, level);
GenericTestUtils.setLogLevel(LeaseManager.LOG, level);
GenericTestUtils.setLogLevel(NameNode.LOG, level);
GenericTestUtils.setLogLevel(NameNode.stateChangeLog, level);
GenericTestUtils.setLogLevel(NameNode.blockStateChangeLog, level);
}
/**
* Get the NamenodeProtocol RPC proxy for the NN associated with this
* DFSClient object

View File

@ -45,13 +45,13 @@
import org.apache.hadoop.hdfs.server.namenode.NameNode;
import org.apache.hadoop.hdfs.server.namenode.TestFileTruncate;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.apache.hadoop.thirdparty.com.google.common.base.Preconditions;
import org.slf4j.event.Level;
/**
* Test randomly mixing append, snapshot and truncate operations.
@ -60,7 +60,7 @@
*/
public class TestAppendSnapshotTruncate {
static {
GenericTestUtils.setLogLevel(NameNode.stateChangeLog, Level.ALL);
GenericTestUtils.setLogLevel(NameNode.stateChangeLog, Level.TRACE);
}
private static final Logger LOG =
LoggerFactory.getLogger(TestAppendSnapshotTruncate.class);

View File

@ -90,7 +90,6 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@ -98,6 +97,7 @@
import org.mockito.internal.stubbing.answers.ThrowsException;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.slf4j.event.Level;
/**
@ -959,7 +959,7 @@ public void testNamenodeRestart() throws Exception {
public static void namenodeRestartTest(final Configuration conf,
final boolean isWebHDFS) throws Exception {
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
final List<Exception> exceptions = new ArrayList<Exception>();

View File

@ -20,12 +20,12 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo.DatanodeInfoBuilder;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.io.IOException;
import java.net.Socket;
@ -37,7 +37,7 @@ public class TestDFSClientSocketSize {
private static final Logger LOG = LoggerFactory.getLogger(
TestDFSClientSocketSize.class);
static {
GenericTestUtils.setLogLevel(DataStreamer.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataStreamer.LOG, Level.TRACE);
}
/**

View File

@ -40,7 +40,6 @@
import org.apache.commons.lang3.RandomStringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.log4j.Level;
import org.junit.Test;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.*;
@ -72,6 +71,7 @@
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Assert;
import org.slf4j.event.Level;
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_TRASH_INTERVAL_KEY;
import static org.apache.hadoop.fs.permission.AclEntryScope.ACCESS;
@ -1962,7 +1962,7 @@ public Object run() throws Exception {
@Test (timeout = 30000)
public void testGet() throws IOException {
GenericTestUtils.setLogLevel(FSInputChecker.LOG, Level.ALL);
GenericTestUtils.setLogLevel(FSInputChecker.LOG, Level.TRACE);
final String fname = "testGet.txt";
Path root = new Path("/test/get");

View File

@ -47,20 +47,20 @@
import org.apache.hadoop.io.erasurecode.ErasureCodeNative;
import org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawErasureCoderFactory;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import org.slf4j.event.Level;
public class TestDFSStripedOutputStream {
public static final Logger LOG = LoggerFactory.getLogger(
TestDFSStripedOutputStream.class);
static {
GenericTestUtils.setLogLevel(DFSOutputStream.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataStreamer.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSOutputStream.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DataStreamer.LOG, Level.TRACE);
}
private ErasureCodingPolicy ecPolicy;

View File

@ -34,19 +34,18 @@
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.hdfs.server.protocol.InterDatanodeProtocol;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* This class tests that pipelines survive data node death and recovery.
*/
public class TestDatanodeDeath {
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
GenericTestUtils.setLogLevel(InterDatanodeProtocol.LOG, org.slf4j
.event.Level.TRACE);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(InterDatanodeProtocol.LOG, Level.TRACE);
}
static final int blockSize = 8192;

View File

@ -73,13 +73,13 @@
import org.apache.hadoop.hdfs.tools.DFSAdmin;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.ToolRunner;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.eclipse.jetty.util.ajax.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
/**
* This class tests the decommissioning of nodes.
@ -1225,8 +1225,8 @@ public Boolean get() {
@Test(timeout=120000)
public void testBlocksPerInterval() throws Exception {
org.apache.log4j.Logger.getLogger(DatanodeAdminManager.class)
.setLevel(Level.TRACE);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(DatanodeAdminManager.class), Level.TRACE);
// Turn the blocks per interval way down
getConf().setInt(
DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_BLOCKS_PER_INTERVAL_KEY,
@ -1327,8 +1327,8 @@ public void testPendingNodeButDecommissioned() throws Exception {
@Test(timeout=120000)
public void testPendingNodes() throws Exception {
org.apache.log4j.Logger.getLogger(DatanodeAdminManager.class)
.setLevel(Level.TRACE);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(DatanodeAdminManager.class), Level.TRACE);
// Only allow one node to be decom'd at a time
getConf().setInt(
DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_MAX_CONCURRENT_TRACKED_NODES,

View File

@ -53,8 +53,6 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.GenericTestUtils.LogCapturer;
import org.apache.hadoop.hdfs.security.token.block.DataEncryptionKey;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@ -65,12 +63,15 @@
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.mockito.Mockito;
import org.slf4j.event.Level;
@RunWith(Parameterized.class)
public class TestEncryptedTransfer {
{
LogManager.getLogger(SaslDataTransferServer.class).setLevel(Level.DEBUG);
LogManager.getLogger(DataTransferSaslUtil.class).setLevel(Level.DEBUG);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(SaslDataTransferServer.class), Level.DEBUG);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(DataTransferSaslUtil.class), Level.DEBUG);
}
@Rule

View File

@ -43,6 +43,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.thirdparty.com.google.common.collect.Lists;
import org.apache.hadoop.conf.Configuration;
@ -103,8 +104,6 @@
import org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.DelegationTokenExtension;
import org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.CryptoExtension;
import org.apache.hadoop.io.Text;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@ -146,6 +145,9 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import org.xml.sax.InputSource;
import org.xml.sax.helpers.DefaultHandler;
@ -153,7 +155,7 @@
import javax.xml.parsers.SAXParserFactory;
public class TestEncryptionZones {
static final Logger LOG = Logger.getLogger(TestEncryptionZones.class);
static final Logger LOG = LoggerFactory.getLogger(TestEncryptionZones.class);
protected Configuration conf;
private FileSystemTestHelper fsHelper;
@ -197,7 +199,8 @@ public void setup() throws Exception {
2);
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
cluster.waitActive();
Logger.getLogger(EncryptionZoneManager.class).setLevel(Level.TRACE);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(EncryptionZoneManager.class), Level.TRACE);
fs = cluster.getFileSystem();
fsWrapper = new FileSystemTestWrapper(fs);
fcWrapper = new FileContextTestWrapper(

View File

@ -42,8 +42,8 @@
import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* This class tests the building blocks that are needed to
@ -52,9 +52,9 @@
public class TestFileAppend2 {
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
}
static final int numBlocks = 5;

View File

@ -46,20 +46,19 @@
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils;
import org.apache.hadoop.hdfs.server.protocol.InterDatanodeProtocol;
import org.apache.log4j.Level;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.event.Level;
/** This class implements some of tests posted in HADOOP-2658. */
public class TestFileAppend3 {
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
GenericTestUtils.setLogLevel(InterDatanodeProtocol.LOG, org.slf4j
.event.Level.TRACE);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(InterDatanodeProtocol.LOG, Level.TRACE);
}
static final long BLOCK_SIZE = 64 * 1024;

View File

@ -47,9 +47,9 @@
import org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException;
import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.event.Level;
/* File Append tests for HDFS-200 & HDFS-142, specifically focused on:
* using append()/sync() to recover block information
@ -67,9 +67,9 @@ public class TestFileAppend4 {
FSDataOutputStream stm;
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
}
@Before

View File

@ -38,11 +38,12 @@
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.StringUtils;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
@ -59,7 +60,7 @@ private enum SyncType {
private static final Logger LOG =
Logger.getLogger(TestFileConcurrentReader.class);
LoggerFactory.getLogger(TestFileConcurrentReader.class);
{
GenericTestUtils.setLogLevel(LeaseManager.LOG, Level.TRACE);

View File

@ -55,18 +55,18 @@
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorage;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.PathUtils;
import org.apache.log4j.Level;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.event.Level;
/**
* A JUnit test for corrupted file handling.
*/
public class TestFileCorruption {
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
}
static Logger LOG = NameNode.stateChangeLog;

View File

@ -24,12 +24,12 @@
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Level;
import org.junit.Test;
import org.slf4j.event.Level;
public class TestFileCreationDelete {
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
@Test

View File

@ -35,15 +35,15 @@
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Test;
import org.slf4j.event.Level;
/** Class contains a set of tests to verify the correctness of
* newly introduced {@link FSDataOutputStream#hflush()} method */
public class TestHFlush {
{
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
}
private final String fName = "hflushtest.dat";

View File

@ -35,11 +35,11 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.Whitebox;
import org.apache.hadoop.util.StringUtils;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.event.Level;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -71,7 +71,7 @@ public class TestLeaseRecoveryStriped {
private static final int bytesPerChecksum = 512;
static {
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSStripedOutputStream.LOG, Level.DEBUG);
GenericTestUtils.setLogLevel(BlockRecoveryWorker.LOG, Level.DEBUG);
GenericTestUtils.setLogLevel(DataStreamer.LOG, Level.DEBUG);

View File

@ -25,16 +25,16 @@
import java.nio.ByteBuffer;
import java.util.Random;
import org.apache.hadoop.test.GenericTestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.client.impl.BlockReaderTestUtil;
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* Driver class for testing the use of DFSInputStream by multiple concurrent
@ -57,8 +57,9 @@ public class TestParallelReadUtil {
static {
// The client-trace log ends up causing a lot of blocking threads
// in this when it's being used as a performance benchmark.
LogManager.getLogger(DataNode.class.getName() + ".clienttrace")
.setLevel(Level.WARN);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(DataNode.class.getName() + ".clienttrace"),
Level.WARN);
}
private class TestFileInfo {

View File

@ -35,10 +35,10 @@
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.hdfs.server.datanode.Replica;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.event.Level;
public class TestPipelines {
public static final Logger LOG = LoggerFactory.getLogger(TestPipelines.class);
@ -158,8 +158,8 @@ private static void setConfiguration() {
}
private static void initLoggers() {
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
}
}

View File

@ -50,7 +50,6 @@
import org.apache.hadoop.hdfs.server.datanode.SimulatedFSDataset;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@ -61,6 +60,7 @@
import java.util.function.Supplier;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.event.Level;
/**
* This class tests the DFS positional read functionality in a single node
@ -278,7 +278,7 @@ public void testPreadDFS() throws IOException {
@Test
public void testPreadDFSNoChecksum() throws IOException {
Configuration conf = new Configuration();
GenericTestUtils.setLogLevel(DataTransferProtocol.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataTransferProtocol.LOG, Level.TRACE);
dfsPreadTest(conf, false, false);
dfsPreadTest(conf, true, false);
}

View File

@ -66,11 +66,11 @@
import org.apache.hadoop.io.erasurecode.rawcoder.NativeRSRawErasureCoderFactory;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.LambdaTestUtils;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.event.Level;
public class TestReconstructStripedFile {
public static final Logger LOG =
@ -85,9 +85,9 @@ public class TestReconstructStripedFile {
private int dnNum;
static {
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockManager.blockLog, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(BlockManager.blockLog, Level.TRACE);
}
enum ReconstructionType {

View File

@ -27,13 +27,13 @@
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.server.namenode.FSEditLog;
import org.apache.log4j.Level;
import org.junit.Test;
import org.mockito.Mockito;
import org.slf4j.event.Level;
public class TestRenameWhileOpen {
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
//TODO: un-comment checkFullFile once the lease recovery is done

View File

@ -37,9 +37,9 @@
import org.apache.hadoop.hdfs.protocol.datatransfer.ReplaceDatanodeOnFailure.Policy;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* This class tests that data nodes are correctly replaced on failure.
@ -54,7 +54,7 @@ public class TestReplaceDatanodeOnFailure {
final private static String RACK1 = "/rack1";
{
GenericTestUtils.setLogLevel(DataTransferProtocol.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataTransferProtocol.LOG, Level.TRACE);
}
/** Test DEFAULT ReplaceDatanodeOnFailure policy. */

View File

@ -41,11 +41,12 @@
import org.apache.hadoop.hdfs.server.namenode.INodesInPath;
import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.hadoop.test.GenericTestUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import static org.apache.hadoop.hdfs.DFSTestUtil.verifyFilesEqual;
import static org.apache.hadoop.hdfs.DFSTestUtil.verifyFilesNotEqual;
@ -83,7 +84,8 @@ public void setup() throws Exception {
JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri()
);
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
Logger.getLogger(EncryptionZoneManager.class).setLevel(Level.TRACE);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(EncryptionZoneManager.class), Level.TRACE);
fs = cluster.getFileSystem();
fsWrapper = new FileSystemTestWrapper(cluster.getFileSystem());
fcWrapper = new FileContextTestWrapper(

View File

@ -26,10 +26,10 @@
import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
import org.apache.hadoop.hdfs.protocol.OpenFileEntry;
import org.apache.hadoop.hdfs.protocol.OpenFilesIterator.OpenFilesType;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.event.Level;
import java.io.IOException;
import java.util.ArrayList;
@ -50,7 +50,7 @@ public class TestStripedFileAppend {
public static final Log LOG = LogFactory.getLog(TestStripedFileAppend.class);
static {
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
private static final int NUM_DATA_BLOCKS =

View File

@ -34,11 +34,13 @@
import org.apache.hadoop.hdfs.client.HdfsAdmin;
import org.apache.hadoop.hdfs.server.namenode.EncryptionZoneManager;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.ToolRunner;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.io.File;
import java.security.PrivilegedExceptionAction;
@ -91,8 +93,8 @@ public void setup() throws Exception {
conf.setInt(DFSConfigKeys.DFS_NAMENODE_LIST_ENCRYPTION_ZONES_NUM_RESPONSES,
2);
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
org.apache.log4j.Logger
.getLogger(EncryptionZoneManager.class).setLevel(Level.TRACE);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(EncryptionZoneManager.class), Level.TRACE);
fs = cluster.getFileSystem();
fsWrapper = new FileSystemTestWrapper(fs);
dfsAdmin = new HdfsAdmin(cluster.getURI(), conf);

View File

@ -25,10 +25,10 @@
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.event.Level;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicInteger;
@ -41,8 +41,8 @@ public class TestWriteStripedFileWithFailure {
private Configuration conf = new HdfsConfiguration();
static {
GenericTestUtils.setLogLevel(DFSOutputStream.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataStreamer.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSOutputStream.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DataStreamer.LOG, Level.TRACE);
}
private final ErasureCodingPolicy ecPolicy =

View File

@ -59,8 +59,9 @@
import org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm;
import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.security.token.Token;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.hadoop.test.GenericTestUtils;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
/**
* A helper class to setup the cluster, and get to BlockReader and DataNode for a block.
@ -238,33 +239,27 @@ public DataNode getDataNode(LocatedBlock testBlock) {
}
public static void enableHdfsCachingTracing() {
LogManager.getLogger(CacheReplicationMonitor.class.getName()).setLevel(
Level.TRACE);
LogManager.getLogger(CacheManager.class.getName()).setLevel(
Level.TRACE);
LogManager.getLogger(FsDatasetCache.class.getName()).setLevel(
Level.TRACE);
enableTraceLog(CacheReplicationMonitor.class);
enableTraceLog(CacheManager.class);
enableTraceLog(FsDatasetCache.class);
}
public static void enableBlockReaderFactoryTracing() {
LogManager.getLogger(BlockReaderFactory.class.getName()).setLevel(
Level.TRACE);
LogManager.getLogger(ShortCircuitCache.class.getName()).setLevel(
Level.TRACE);
LogManager.getLogger(ShortCircuitReplica.class.getName()).setLevel(
Level.TRACE);
LogManager.getLogger(BlockReaderLocal.class.getName()).setLevel(
Level.TRACE);
enableTraceLog(BlockReaderFactory.class);
enableTraceLog(ShortCircuitCache.class);
enableTraceLog(ShortCircuitReplica.class);
enableTraceLog(BlockReaderLocal.class);
}
public static void enableShortCircuitShmTracing() {
LogManager.getLogger(DfsClientShmManager.class.getName()).setLevel(
Level.TRACE);
LogManager.getLogger(ShortCircuitRegistry.class.getName()).setLevel(
Level.TRACE);
LogManager.getLogger(ShortCircuitShm.class.getName()).setLevel(
Level.TRACE);
LogManager.getLogger(DataNode.class.getName()).setLevel(
Level.TRACE);
enableTraceLog(DfsClientShmManager.class);
enableTraceLog(ShortCircuitRegistry.class);
enableTraceLog(ShortCircuitShm.class);
enableTraceLog(DataNode.class);
}
private static void enableTraceLog(Class<?> clazz) {
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(clazz), Level.TRACE);
}
}

View File

@ -29,10 +29,10 @@
import org.apache.hadoop.hdfs.protocol.LocatedBlock;
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.event.Level;
public class TestClientBlockVerification {
@ -42,7 +42,7 @@ public class TestClientBlockVerification {
static LocatedBlock testBlock = null;
static {
GenericTestUtils.setLogLevel(BlockReaderRemote.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockReaderRemote.LOG, Level.TRACE);
}
@BeforeClass
public static void setupCluster() throws Exception {

View File

@ -53,7 +53,6 @@
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.ipc.ProtobufRpcEngine2;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@ -64,6 +63,7 @@
import org.apache.hadoop.thirdparty.com.google.common.base.Preconditions;
import org.apache.hadoop.thirdparty.com.google.common.collect.Maps;
import org.apache.hadoop.thirdparty.com.google.common.collect.Sets;
import org.slf4j.event.Level;
public class TestQJMWithFaults {
@ -225,7 +225,7 @@ public void testRandomized() throws Exception {
// If the user specifies a seed, then we should gather all the
// IPC trace information so that debugging is easier. This makes
// the test run about 25% slower otherwise.
GenericTestUtils.setLogLevel(ProtobufRpcEngine2.LOG, Level.ALL);
GenericTestUtils.setLogLevel(ProtobufRpcEngine2.LOG, Level.TRACE);
} else {
seed = new Random().nextLong();
}

View File

@ -60,7 +60,6 @@
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.ipc.ProtobufRpcEngine2;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@ -70,6 +69,7 @@
import org.mockito.stubbing.Stubber;
import org.apache.hadoop.thirdparty.com.google.common.collect.Lists;
import org.slf4j.event.Level;
/**
* Functional tests for QuorumJournalManager.
@ -87,7 +87,7 @@ public class TestQuorumJournalManager {
private final List<QuorumJournalManager> toClose = Lists.newLinkedList();
static {
GenericTestUtils.setLogLevel(ProtobufRpcEngine2.LOG, Level.ALL);
GenericTestUtils.setLogLevel(ProtobufRpcEngine2.LOG, Level.TRACE);
}
@Rule

View File

@ -87,7 +87,6 @@
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
@ -99,6 +98,7 @@
import org.apache.hadoop.thirdparty.protobuf.ServiceException;
import org.apache.hadoop.fs.StorageType;
import org.slf4j.event.Level;
/** Unit tests for block tokens */
public class TestBlockToken {
@ -107,11 +107,11 @@ public class TestBlockToken {
private static final String ADDRESS = "0.0.0.0";
static {
GenericTestUtils.setLogLevel(Client.LOG, Level.ALL);
GenericTestUtils.setLogLevel(Server.LOG, Level.ALL);
GenericTestUtils.setLogLevel(SaslRpcClient.LOG, Level.ALL);
GenericTestUtils.setLogLevel(SaslRpcServer.LOG, Level.ALL);
GenericTestUtils.setLogLevel(SaslInputStream.LOG, Level.ALL);
GenericTestUtils.setLogLevel(Client.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(Server.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(SaslRpcClient.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(SaslRpcServer.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(SaslInputStream.LOG, Level.TRACE);
}
/**

View File

@ -61,7 +61,7 @@ public class TestBalancerWithMultipleNameNodes {
static final Logger LOG = Balancer.LOG;
{
GenericTestUtils.setLogLevel(LOG, Level.TRACE);
DFSTestUtil.setNameNodeLogLevel(org.apache.log4j.Level.TRACE);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}

View File

@ -35,13 +35,13 @@
import org.apache.hadoop.net.Node;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.PathUtils;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.slf4j.event.Level;
abstract public class BaseReplicationPolicyTest {
{
GenericTestUtils.setLogLevel(BlockPlacementPolicy.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockPlacementPolicy.LOG, Level.TRACE);
}
protected NetworkTopology cluster;

View File

@ -31,11 +31,11 @@
import org.apache.hadoop.hdfs.protocol.DatanodeID;
import org.apache.hadoop.hdfs.server.protocol.BlockReportContext;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.event.Level;
import java.io.IOException;
import java.util.HashSet;
@ -60,8 +60,8 @@ public void restoreNormalBlockManagerFaultInjector() {
@BeforeClass
public static void raiseBlockManagerLogLevels() {
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockReportLeaseManager.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(BlockReportLeaseManager.LOG, Level.TRACE);
}
@Test(timeout=180000)

View File

@ -64,9 +64,9 @@
import org.apache.hadoop.net.ServerSocketUtil;
import org.apache.hadoop.security.token.Token;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.event.Level;
public class TestBlockTokenWithDFS {
@ -77,7 +77,7 @@ public class TestBlockTokenWithDFS {
private static final String FILE_TO_APPEND = "/fileToAppend.dat";
{
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DFSClient.LOG, Level.TRACE);
}
public static byte[] generateBytes(int fileSize){

View File

@ -45,9 +45,9 @@
import org.apache.hadoop.hdfs.server.protocol.SlowPeerReports;
import org.apache.hadoop.hdfs.server.protocol.StorageReport;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.event.Level;
import java.io.BufferedReader;
import java.io.BufferedWriter;
@ -319,7 +319,7 @@ public void testRenamingStorageIds() throws Exception {
.Builder(conf).numDataNodes(1)
.storagesPerDatanode(1)
.build();
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.TRACE);
try {
cluster.waitActive();
final Path TEST_PATH = new Path("/foo1");

View File

@ -32,12 +32,12 @@
import org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.Whitebox;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.slf4j.event.Level;
import java.util.function.Supplier;
@ -47,7 +47,7 @@
*/
public class TestPendingInvalidateBlock {
{
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.DEBUG);
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.TRACE);
}
private static final int BLOCKSIZE = 1024;

View File

@ -59,10 +59,10 @@
import org.apache.hadoop.metrics2.MetricsRecordBuilder;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.GenericTestUtils.LogCapturer;
import org.apache.log4j.Level;
import org.junit.Test;
import org.mockito.Mockito;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
/**
* This class tests the internals of PendingReconstructionBlocks.java, as well

View File

@ -35,13 +35,13 @@
import org.apache.hadoop.net.NetworkTopology;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.Whitebox;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.io.IOException;
import java.util.Arrays;
@ -53,9 +53,9 @@ public class TestReconstructStripedBlocksWithRackAwareness {
TestReconstructStripedBlocksWithRackAwareness.class);
static {
GenericTestUtils.setLogLevel(BlockPlacementPolicy.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockManager.blockLog, Level.ALL);
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockPlacementPolicy.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(BlockManager.blockLog, Level.TRACE);
GenericTestUtils.setLogLevel(BlockManager.LOG, Level.TRACE);
}
private final ErasureCodingPolicy ecPolicy =

View File

@ -69,13 +69,13 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.GenericTestUtils.DelayAnswer;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.slf4j.event.Level;
/**
* This is the base class for simulating a variety of situations
@ -877,9 +877,9 @@ public boolean accept(File file, String s) {
}
private static void initLoggers() {
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockReportTestBase.LOG, org.slf4j.event.Level.DEBUG);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(BlockReportTestBase.LOG, Level.DEBUG);
}
private Block findBlock(Path path, long size) throws IOException {

View File

@ -86,7 +86,6 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.PathUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@ -97,6 +96,7 @@
import java.util.function.Supplier;
import org.apache.hadoop.thirdparty.com.google.common.collect.Lists;
import org.apache.hadoop.thirdparty.com.google.common.collect.Maps;
import org.slf4j.event.Level;
public class TestBPOfferService {
@ -114,7 +114,7 @@ public class TestBPOfferService {
private long nextFullBlockReportLeaseId = 1L;
static {
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
}
private DatanodeProtocolClientSideTranslatorPB mockNN1;

View File

@ -62,12 +62,12 @@
import org.apache.hadoop.hdfs.server.datanode.VolumeScanner.Statistics;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
public class TestBlockScanner {
public static final Logger LOG =
@ -76,9 +76,9 @@ public class TestBlockScanner {
@Before
public void before() {
BlockScanner.Conf.allowUnitTestSettings = true;
GenericTestUtils.setLogLevel(BlockScanner.LOG, Level.ALL);
GenericTestUtils.setLogLevel(VolumeScanner.LOG, Level.ALL);
GenericTestUtils.setLogLevel(FsVolumeImpl.LOG, Level.ALL);
GenericTestUtils.setLogLevel(BlockScanner.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(VolumeScanner.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(FsVolumeImpl.LOG, Level.TRACE);
}
private static void disableBlockScanner(Configuration conf) {
@ -899,7 +899,7 @@ public Boolean get() {
*/
@Test(timeout=120000)
public void testAppendWhileScanning() throws Exception {
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
Configuration conf = new Configuration();
// throttle the block scanner: 1MB per second
conf.setLong(DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND, 1048576);

View File

@ -57,8 +57,6 @@
import org.apache.hadoop.hdfs.server.protocol.StorageReport;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@ -70,6 +68,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.util.function.Supplier;
@ -82,7 +81,7 @@ public class TestDataNodeLifeline {
TestDataNodeLifeline.class);
static {
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
}
@Rule

View File

@ -75,7 +75,6 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.AutoCloseableLock;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.apache.log4j.SimpleLayout;
import org.apache.log4j.WriterAppender;
import org.junit.Before;
@ -83,6 +82,7 @@
import org.mockito.Mockito;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
/**
* Tests {@link DirectoryScanner} handling of differences between blocks on the
@ -410,7 +410,7 @@ public void testScanDirectoryStructureWarn() throws Exception {
ByteArrayOutputStream loggerStream = new ByteArrayOutputStream();
org.apache.log4j.Logger rootLogger =
org.apache.log4j.Logger.getRootLogger();
rootLogger.setLevel(Level.INFO);
GenericTestUtils.setRootLogLevel(Level.INFO);
WriterAppender writerAppender =
new WriterAppender(new SimpleLayout(), loggerStream);
rootLogger.addAppender(writerAppender);

View File

@ -36,11 +36,11 @@
import org.apache.hadoop.hdfs.server.protocol.DatanodeRegistration;
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorage;
import org.apache.hadoop.hdfs.server.protocol.StorageBlockReport;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* Tests that very large block reports can pass through the RPC server and

View File

@ -38,9 +38,9 @@
import org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetTestUtil;
import org.apache.hadoop.hdfs.server.protocol.DatanodeRegistration;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.event.Level;
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_DATA_WRITE_BANDWIDTHPERSEC_KEY;
@ -50,7 +50,7 @@ public class TestTransferRbw {
LoggerFactory.getLogger(TestTransferRbw.class);
{
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
}
private static final Random RAN = new Random();

View File

@ -46,7 +46,7 @@
import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.DataChecksum;
import org.apache.log4j.Level;
import org.slf4j.event.Level;
import java.io.DataOutputStream;
import java.io.File;
@ -500,7 +500,6 @@ public void verifyBlockPoolMissing(String bpid) throws IOException {
* @param level the level to set
*/
public static void setFsDatasetImplLogLevel(Level level) {
GenericTestUtils.setLogLevel(FsDatasetImpl.LOG,
org.slf4j.event.Level.valueOf(level.toString()));
GenericTestUtils.setLogLevel(FsDatasetImpl.LOG, level);
}
}

View File

@ -45,13 +45,13 @@
import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.Daemon;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mockito;
import org.slf4j.event.Level;
import java.io.IOException;
import java.io.OutputStream;
@ -101,8 +101,8 @@ private void initConfig(int blockSize) {
}
static {
GenericTestUtils.setLogLevel(FsDatasetImpl.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL);
GenericTestUtils.setLogLevel(FsDatasetImpl.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(DataNode.LOG, Level.TRACE);
}
/**

View File

@ -23,13 +23,13 @@
import org.apache.hadoop.hdfs.HdfsConfiguration;
import org.apache.hadoop.metrics2.lib.MetricsTestHelper;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.util.Map;
import java.util.Random;
@ -67,8 +67,8 @@ public class TestDataNodeOutlierDetectionViaMetrics {
@Before
public void setup() {
GenericTestUtils.setLogLevel(DataNodePeerMetrics.LOG, Level.ALL);
GenericTestUtils.setLogLevel(OutlierDetector.LOG, Level.ALL);
GenericTestUtils.setLogLevel(DataNodePeerMetrics.LOG, Level.TRACE);
GenericTestUtils.setLogLevel(OutlierDetector.LOG, Level.TRACE);
conf = new HdfsConfiguration();
}

View File

@ -23,13 +23,13 @@
import org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableSet;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.util.ArrayList;
import java.util.Collections;
@ -239,7 +239,7 @@ public class TestSlowNodeDetector {
public void setup() {
slowNodeDetector = new OutlierDetector(MIN_OUTLIER_DETECTION_PEERS,
(long) LOW_THRESHOLD);
GenericTestUtils.setLogLevel(OutlierDetector.LOG, Level.ALL);
GenericTestUtils.setLogLevel(OutlierDetector.LOG, Level.TRACE);
}
@Test

View File

@ -85,8 +85,7 @@
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.hadoop.util.VersionInfo;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.slf4j.event.Level;
/**
* Main class for a series of name-node benchmarks.
@ -150,9 +149,9 @@ static void setNameNodeLoggingLevel(Level logLevel) {
LOG.info("Log level = " + logLevel.toString());
// change log level to NameNode logs
DFSTestUtil.setNameNodeLogLevel(logLevel);
GenericTestUtils.setLogLevel(LogManager.getLogger(
GenericTestUtils.setLogLevel(LoggerFactory.getLogger(
NetworkTopology.class.getName()), logLevel);
GenericTestUtils.setLogLevel(LogManager.getLogger(
GenericTestUtils.setLogLevel(LoggerFactory.getLogger(
Groups.class.getName()), logLevel);
}
@ -353,7 +352,7 @@ protected boolean verifyOpArgument(List<String> args) {
if(llIndex >= 0) {
if(args.size() <= llIndex + 1)
printUsage();
logLevel = Level.toLevel(args.get(llIndex+1), Level.ERROR);
logLevel = Level.valueOf(args.get(llIndex+1));
args.remove(llIndex+1);
args.remove(llIndex);
}

View File

@ -26,10 +26,10 @@
import org.apache.hadoop.hdfs.HdfsConfiguration;
import org.apache.hadoop.hdfs.server.namenode.FSNamesystem.FSNamesystemAuditLogger;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import org.slf4j.event.Level;
import java.net.Inet4Address;
import java.util.Arrays;

View File

@ -39,7 +39,6 @@
import org.apache.hadoop.security.authorize.ProxyUsers;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.GenericTestUtils.LogCapturer;
import org.apache.log4j.Level;
import org.junit.Before;
import org.junit.Test;
@ -48,6 +47,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.io.IOException;
import java.net.HttpURLConnection;
@ -85,7 +85,7 @@ public class TestAuditLogger {
private static final Logger LOG = LoggerFactory.getLogger(
TestAuditLogger.class);
static {
GenericTestUtils.setLogLevel(LOG, Level.ALL);
GenericTestUtils.setLogLevel(LOG, Level.TRACE);
}
private static final short TEST_PERMISSION = (short) 0654;

View File

@ -47,6 +47,7 @@
import org.apache.hadoop.hdfs.web.WebHdfsFileSystem;
import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.PathUtils;
import org.apache.log4j.Appender;
import org.apache.log4j.AsyncAppender;
@ -61,6 +62,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.slf4j.LoggerFactory;
/**
* A JUnit test that audit logs are generated
@ -297,11 +299,11 @@ private void configureAuditLogs() throws IOException {
if (file.exists()) {
assertTrue(file.delete());
}
Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
// disable logging while the cluster startup preps files
logger.setLevel(Level.OFF);
disableAuditLog();
PatternLayout layout = new PatternLayout("%m%n");
RollingFileAppender appender = new RollingFileAppender(layout, auditLogFile);
Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
logger.addAppender(appender);
}
@ -314,10 +316,10 @@ private void verifyAuditLogs(boolean expectSuccess) throws IOException {
private void verifyAuditLogsRepeat(boolean expectSuccess, int ndupe)
throws IOException {
// Turn off the logs
Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
logger.setLevel(Level.OFF);
disableAuditLog();
// Close the appenders and force all logs to be flushed
Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
Enumeration<?> appenders = logger.getAllAppenders();
while (appenders.hasMoreElements()) {
Appender appender = (Appender)appenders.nextElement();
@ -347,10 +349,10 @@ private void verifyAuditLogsRepeat(boolean expectSuccess, int ndupe)
private void verifyAuditLogsCheckPattern(boolean expectSuccess, int ndupe, Pattern pattern)
throws IOException {
// Turn off the logs
Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
logger.setLevel(Level.OFF);
disableAuditLog();
// Close the appenders and force all logs to be flushed
Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
Enumeration<?> appenders = logger.getAllAppenders();
while (appenders.hasMoreElements()) {
Appender appender = (Appender)appenders.nextElement();
@ -376,4 +378,10 @@ private void verifyAuditLogsCheckPattern(boolean expectSuccess, int ndupe, Patte
reader.close();
}
}
private void disableAuditLog() {
GenericTestUtils.disableLog(LoggerFactory.getLogger(
FSNamesystem.class.getName() + ".audit"));
}
}

View File

@ -57,11 +57,12 @@
import org.apache.hadoop.hdfs.tools.DFSAdmin;
import org.apache.hadoop.hdfs.util.HostsFileWriter;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
/**
* This class tests the decommissioning of nodes.
@ -107,8 +108,9 @@ protected Configuration setupConfig() throws Exception {
conf.setInt(DFSConfigKeys.DFS_NAMENODE_REDUNDANCY_INTERVAL_SECONDS_KEY, 1);
conf.setInt(DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_INTERVAL_KEY, 1);
conf.setLong(DFSConfigKeys.DFS_DATANODE_BALANCE_BANDWIDTHPERSEC_KEY, 1);
Logger.getLogger(DatanodeAdminManager.class).setLevel(Level.DEBUG);
LOG = Logger.getLogger(TestDecommissioningStatus.class);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(DatanodeAdminManager.class), Level.DEBUG);
LOG = LoggerFactory.getLogger(TestDecommissioningStatus.class);
return conf;
}
@ -388,8 +390,8 @@ public void testDecommissionStatusAfterDNRestart() throws Exception {
*/
@Test(timeout=120000)
public void testDecommissionDeadDN() throws Exception {
Logger log = Logger.getLogger(DatanodeAdminManager.class);
log.setLevel(Level.DEBUG);
Logger log = LoggerFactory.getLogger(DatanodeAdminManager.class);
GenericTestUtils.setLogLevel(log, Level.DEBUG);
DatanodeID dnID = cluster.getDataNodes().get(0).getDatanodeId();
String dnName = dnID.getXferAddr();
DataNodeProperties stoppedDN = cluster.stopDataNode(0);

View File

@ -91,7 +91,6 @@
import org.apache.hadoop.util.ExitUtil.ExitException;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Level;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.LogManager;
import org.apache.log4j.spi.LoggingEvent;
@ -100,6 +99,7 @@
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.mockito.Mockito;
import org.slf4j.event.Level;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
@ -113,7 +113,7 @@
public class TestEditLog {
static {
GenericTestUtils.setLogLevel(FSEditLog.LOG, Level.ALL);
GenericTestUtils.setLogLevel(FSEditLog.LOG, Level.TRACE);
}
@Parameters

View File

@ -20,11 +20,12 @@
import org.apache.hadoop.HadoopIllegalArgumentException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.HAUtil;
import org.apache.log4j.Level;
import org.apache.hadoop.test.GenericTestUtils;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
public class TestFsImageValidation {
static final Logger LOG = LoggerFactory.getLogger(
@ -32,9 +33,11 @@ public class TestFsImageValidation {
static {
final Level t = Level.TRACE;
FsImageValidation.Util.setLogLevel(FsImageValidation.class, t);
FsImageValidation.Util.setLogLevel(INodeReferenceValidation.class, t);
FsImageValidation.Util.setLogLevel(INode.class, t);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(FsImageValidation.class), t);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(INodeReferenceValidation.class), t);
GenericTestUtils.setLogLevel(LoggerFactory.getLogger(INode.class), t);
}
/**

View File

@ -264,8 +264,8 @@ private void setupAuditLogs() throws IOException {
private void verifyAuditLogs() throws IOException {
// Turn off the logs
Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
logger.setLevel(Level.OFF);
GenericTestUtils.disableLog(LoggerFactory.getLogger(
FSNamesystem.class.getName() + ".audit"));
BufferedReader reader = null;
try {
@ -292,6 +292,7 @@ private void verifyAuditLogs() throws IOException {
if (reader != null) {
reader.close();
}
Logger logger = ((Log4JLogger) FSNamesystem.auditLog).getLogger();
if (logger != null) {
logger.removeAllAppenders();
}

View File

@ -36,9 +36,9 @@
import org.apache.hadoop.hdfs.MiniDFSNNTopology;
import org.apache.hadoop.hdfs.protocol.ClientProtocol;
import org.apache.hadoop.hdfs.server.balancer.TestBalancer;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* Test fsck with multiple NameNodes
@ -47,7 +47,7 @@ public class TestFsckWithMultipleNameNodes {
static final Logger LOG =
LoggerFactory.getLogger(TestFsckWithMultipleNameNodes.class);
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}

View File

@ -32,12 +32,13 @@
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.ToolRunner;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import java.io.File;
@ -103,7 +104,8 @@ public void setup() throws Exception {
// enable trash for testing
conf.setLong(DFSConfigKeys.FS_TRASH_INTERVAL_KEY, 1);
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
Logger.getLogger(EncryptionZoneManager.class).setLevel(Level.TRACE);
GenericTestUtils.setLogLevel(
LoggerFactory.getLogger(EncryptionZoneManager.class), Level.TRACE);
fs = cluster.getFileSystem();
setProvider();

View File

@ -58,12 +58,12 @@
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.GenericTestUtils.DelayAnswer;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.slf4j.event.Level;
public class TestDNFencing {
@ -79,7 +79,7 @@ public class TestDNFencing {
private FileSystem fs;
static {
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
@Before

View File

@ -32,9 +32,9 @@
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.MultithreadedTestUtil.RepeatingTestThread;
import org.apache.hadoop.test.MultithreadedTestUtil.TestContext;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.event.Level;
import java.util.function.Supplier;
@ -46,8 +46,8 @@
public class TestDNFencingWithReplication {
static {
GenericTestUtils.setLogLevel(FSNamesystem.auditLog, Level.WARN);
GenericTestUtils.setLogLevel(Server.LOG, Level.FATAL);
GenericTestUtils.setLogLevel(RetryInvocationHandler.LOG, Level.FATAL);
GenericTestUtils.setLogLevel(Server.LOG, Level.ERROR);
GenericTestUtils.setLogLevel(RetryInvocationHandler.LOG, Level.ERROR);
}
private static final int NUM_THREADS = 20;

View File

@ -88,7 +88,7 @@ public class TestHASafeMode {
private MiniDFSCluster cluster;
static {
DFSTestUtil.setNameNodeLogLevel(org.apache.log4j.Level.TRACE);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
GenericTestUtils.setLogLevel(FSImage.LOG, Level.TRACE);
}

View File

@ -58,9 +58,9 @@
import org.apache.hadoop.test.MultithreadedTestUtil.TestContext;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.Shell.ShellCommandExecutor;
import org.apache.log4j.Level;
import org.junit.Test;
import org.mockito.Mockito;
import org.slf4j.event.Level;
import java.util.function.Supplier;
@ -69,9 +69,9 @@
*/
public class TestPipelinesFailover {
static {
GenericTestUtils.setLogLevel(LoggerFactory.getLogger(RetryInvocationHandler
.class), org.slf4j.event.Level.DEBUG);
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
GenericTestUtils.setLogLevel(LoggerFactory.getLogger(
RetryInvocationHandler.class), Level.DEBUG);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
protected static final Logger LOG = LoggerFactory.getLogger(

View File

@ -29,8 +29,8 @@
import org.apache.hadoop.hdfs.MiniDFSNNTopology;
import org.apache.hadoop.hdfs.server.blockmanagement.BlockManagerTestUtil;
import org.apache.hadoop.hdfs.server.namenode.NameNode;
import org.apache.log4j.Level;
import org.junit.Test;
import org.slf4j.event.Level;
import static org.junit.Assert.assertEquals;
@ -46,7 +46,7 @@ public class TestStandbyBlockManagement {
private static final Path TEST_FILE_PATH = new Path(TEST_FILE);
static {
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
@Test(timeout=60000)

View File

@ -39,9 +39,9 @@
import org.apache.hadoop.hdfs.server.namenode.NameNode;
import org.apache.hadoop.hdfs.server.namenode.NameNodeAdapter;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.event.Level;
import java.util.function.Supplier;
@ -57,7 +57,7 @@ public class TestStandbyIsHot {
private static final Path TEST_FILE_PATH = new Path(TEST_FILE);
static {
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
@Test(timeout=60000)

View File

@ -28,11 +28,11 @@
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols;
import org.apache.hadoop.hdfs.web.WebHdfsTestUtil;
import org.apache.log4j.Level;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.event.Level;
/**
* Test WebHDFS files/directories creation to make sure it follows same rules
@ -42,7 +42,7 @@ public class TestWebHdfsCreatePermissions {
static final Logger LOG =
LoggerFactory.getLogger(TestWebHdfsCreatePermissions.class);
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
private MiniDFSCluster cluster;

View File

@ -45,11 +45,11 @@
import org.apache.hadoop.hdfs.web.resources.GetOpParam;
import org.apache.hadoop.hdfs.web.resources.PostOpParam;
import org.apache.hadoop.hdfs.web.resources.PutOpParam;
import org.apache.log4j.Level;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.slf4j.event.Level;
/**
* Test WebHDFS which provides data locality using HTTP redirection.
@ -58,7 +58,7 @@ public class TestWebHdfsDataLocality {
static final Logger LOG =
LoggerFactory.getLogger(TestWebHdfsDataLocality.class);
{
DFSTestUtil.setNameNodeLogLevel(Level.ALL);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
private static final String RACK0 = "/rack0";

View File

@ -48,7 +48,7 @@ static private void setLogLevel() {
GenericTestUtils.setLogLevel(LOG, Level.TRACE);
GenericTestUtils.setLogLevel(NamenodeWebHdfsMethods.LOG, Level.TRACE);
DFSTestUtil.setNameNodeLogLevel(org.apache.log4j.Level.TRACE);
DFSTestUtil.setNameNodeLogLevel(Level.TRACE);
}
private static final Configuration conf = new HdfsConfiguration();