You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2023/01/04 03:06:53 UTC
[hbase] branch master updated: HBASE-27485 HBaseTestingUtility minicluster requires log4j2 (#4941)
This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new 3f1087fe822 HBASE-27485 HBaseTestingUtility minicluster requires log4j2 (#4941)
3f1087fe822 is described below
commit 3f1087fe822fee51719bb407eee851a33a2d94a2
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Wed Jan 4 11:06:47 2023 +0800
HBASE-27485 HBaseTestingUtility minicluster requires log4j2 (#4941)
Signed-off-by: Rajeshbabu Chintaguntla <ra...@apache.org>
Reviewed-by: SiCheng-Zheng <64...@qq.com>
---
hbase-logging/src/test/resources/log4j2.properties | 10 ++++++++--
.../test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java | 12 ------------
.../java/org/apache/hadoop/hbase/HBaseTestingUtility.java | 12 ------------
3 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/hbase-logging/src/test/resources/log4j2.properties b/hbase-logging/src/test/resources/log4j2.properties
index 67c5670effe..56d67c85aa1 100644
--- a/hbase-logging/src/test/resources/log4j2.properties
+++ b/hbase-logging/src/test/resources/log4j2.properties
@@ -46,11 +46,13 @@ logger.MetricsConfig.level = WARN
logger.MetricsSinkAdapter.name = org.apache.hadoop.metrics2.impl.MetricsSinkAdapter
logger.MetricsSinkAdapter.level = WARN
+# These two settings are workarounds against spurious logs from the minicluster.
+# See HBASE-4709
logger.MetricsSystemImpl.name = org.apache.hadoop.metrics2.impl.MetricsSystemImpl
-logger.MetricsSystemImpl.level = WARN
+logger.MetricsSystemImpl.level = ERROR
logger.MBeans.name = org.apache.hadoop.metrics2.util.MBeans
-logger.MBeans.level = WARN
+logger.MBeans.level = ERROR
logger.directory.name = org.apache.directory
logger.directory.level = WARN
@@ -68,3 +70,7 @@ logger.RSRpcServices.level = DEBUG
logger.TestJul2Slf4j.name = org.apache.hadoop.hbase.logging.TestJul2Slf4j
logger.TestJul2Slf4j.level = DEBUG
+
+# Avoid log flooded with chore execution time, see HBASE-24646 for more details.
+logger.ScheduledChore.name = org.apache.hadoop.hbase.ScheduledChore
+logger.ScheduledChore.level = INFO
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java
index 4c1c1a5be9b..5bf3ae93294 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java
@@ -96,7 +96,6 @@ import org.apache.hadoop.hbase.io.hfile.BlockCache;
import org.apache.hadoop.hbase.io.hfile.ChecksumUtil;
import org.apache.hadoop.hbase.io.hfile.HFile;
import org.apache.hadoop.hbase.ipc.RpcServerInterface;
-import org.apache.hadoop.hbase.logging.Log4jUtils;
import org.apache.hadoop.hbase.mapreduce.MapreduceTestingShim;
import org.apache.hadoop.hbase.master.HMaster;
import org.apache.hadoop.hbase.master.RegionState;
@@ -631,10 +630,6 @@ public class HBaseTestingUtil extends HBaseZKTestingUtil {
createDirsAndSetProperties();
EditLogFileOutputStream.setShouldSkipFsyncForTesting(true);
- // Error level to skip some warnings specific to the minicluster. See HBASE-4709
- Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR");
- Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(),
- "ERROR");
this.dfsCluster =
new MiniDFSCluster(0, this.conf, servers, true, true, true, null, racks, hosts, null);
this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster);
@@ -656,10 +651,6 @@ public class HBaseTestingUtil extends HBaseZKTestingUtil {
public MiniDFSCluster startMiniDFSClusterForTestWAL(int namenodePort) throws IOException {
createDirsAndSetProperties();
- // Error level to skip some warnings specific to the minicluster. See HBASE-4709
- Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR");
- Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(),
- "ERROR");
dfsCluster =
new MiniDFSCluster(namenodePort, conf, 5, false, true, true, null, null, null, null);
this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster);
@@ -884,9 +875,6 @@ public class HBaseTestingUtil extends HBaseZKTestingUtil {
conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, option.getNumRegionServers());
}
- // Avoid log flooded with chore execution time, see HBASE-24646 for more details.
- Log4jUtils.setLogLevel(org.apache.hadoop.hbase.ScheduledChore.class.getName(), "INFO");
-
Configuration c = new Configuration(this.conf);
this.hbaseCluster = new SingleProcessHBaseCluster(c, option.getNumMasters(),
option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(),
diff --git a/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
index 9b4fecf41f9..23467d78de5 100644
--- a/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
+++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
@@ -616,11 +616,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
createDirsAndSetProperties();
EditLogFileOutputStream.setShouldSkipFsyncForTesting(true);
- // Error level to skip some warnings specific to the minicluster. See HBASE-4709
- Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR");
- Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(),
- "ERROR");
-
this.dfsCluster =
new MiniDFSCluster(0, this.conf, servers, true, true, true, null, racks, hosts, null);
this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster);
@@ -642,10 +637,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
public MiniDFSCluster startMiniDFSClusterForTestWAL(int namenodePort) throws IOException {
createDirsAndSetProperties();
- // Error level to skip some warnings specific to the minicluster. See HBASE-4709
- Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR");
- Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(),
- "ERROR");
dfsCluster =
new MiniDFSCluster(namenodePort, conf, 5, false, true, true, null, null, null, null);
this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster);
@@ -1118,9 +1109,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility {
conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, option.getNumRegionServers());
}
- // Avoid log flooded with chore execution time, see HBASE-24646 for more details.
- Log4jUtils.setLogLevel(org.apache.hadoop.hbase.ScheduledChore.class.getName(), "INFO");
-
Configuration c = new Configuration(this.conf);
this.hbaseCluster = new MiniHBaseCluster(c, option.getNumMasters(),
option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(),