Skip to content

Commit 2ca2974

Browse files
Apache9bbeaudreault
authored andcommitted
HubSpot Backport: HBASE-27485 HBaseTestingUtility minicluster requires log4j2 (apache#4941)
Signed-off-by: Rajeshbabu Chintaguntla <rajeshbabu@apache.org> Reviewed-by: SiCheng-Zheng <643463623@qq.com> (cherry picked from commit 3f1087f)
1 parent 8ae990f commit 2ca2974

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

hbase-logging/src/test/resources/log4j2.properties

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ logger.MetricsConfig.level = WARN
4646
logger.MetricsSinkAdapter.name = org.apache.hadoop.metrics2.impl.MetricsSinkAdapter
4747
logger.MetricsSinkAdapter.level = WARN
4848

49+
# These two settings are workarounds against spurious logs from the minicluster.
50+
# See HBASE-4709
4951
logger.MetricsSystemImpl.name = org.apache.hadoop.metrics2.impl.MetricsSystemImpl
50-
logger.MetricsSystemImpl.level = WARN
52+
logger.MetricsSystemImpl.level = ERROR
5153

5254
logger.MBeans.name = org.apache.hadoop.metrics2.util.MBeans
53-
logger.MBeans.level = WARN
55+
logger.MBeans.level = ERROR
5456

5557
logger.directory.name = org.apache.directory
5658
logger.directory.level = WARN
@@ -68,3 +70,7 @@ logger.RSRpcServices.level = DEBUG
6870

6971
logger.TestJul2Slf4j.name = org.apache.hadoop.hbase.logging.TestJul2Slf4j
7072
logger.TestJul2Slf4j.level = DEBUG
73+
74+
# Avoid log flooded with chore execution time, see HBASE-24646 for more details.
75+
logger.ScheduledChore.name = org.apache.hadoop.hbase.ScheduledChore
76+
logger.ScheduledChore.level = INFO

hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,6 @@ public MiniDFSCluster startMiniDFSCluster(int servers, final String racks[], Str
682682
createDirsAndSetProperties();
683683
EditLogFileOutputStream.setShouldSkipFsyncForTesting(true);
684684

685-
// Error level to skip some warnings specific to the minicluster. See HBASE-4709
686-
Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR");
687-
Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(),
688-
"ERROR");
689-
690685
this.dfsCluster =
691686
new MiniDFSCluster(0, this.conf, servers, true, true, true, null, racks, hosts, null);
692687
this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster);
@@ -708,10 +703,6 @@ public MiniDFSCluster startMiniDFSCluster(int servers, final String racks[], Str
708703

709704
public MiniDFSCluster startMiniDFSClusterForTestWAL(int namenodePort) throws IOException {
710705
createDirsAndSetProperties();
711-
// Error level to skip some warnings specific to the minicluster. See HBASE-4709
712-
Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR");
713-
Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(),
714-
"ERROR");
715706
dfsCluster =
716707
new MiniDFSCluster(namenodePort, conf, 5, false, true, true, null, null, null, null);
717708
this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster);
@@ -1184,9 +1175,6 @@ public MiniHBaseCluster startMiniHBaseCluster(StartMiniClusterOption option)
11841175
conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, option.getNumRegionServers());
11851176
}
11861177

1187-
// Avoid log flooded with chore execution time, see HBASE-24646 for more details.
1188-
Log4jUtils.setLogLevel(org.apache.hadoop.hbase.ScheduledChore.class.getName(), "INFO");
1189-
11901178
Configuration c = new Configuration(this.conf);
11911179
this.hbaseCluster = new MiniHBaseCluster(c, option.getNumMasters(),
11921180
option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(),

0 commit comments

Comments
 (0)