Skip to content

Commit

Permalink
HBASE-27485 HBaseTestingUtility minicluster requires log4j2 (#4941)
Browse files Browse the repository at this point in the history
Signed-off-by: Rajeshbabu Chintaguntla <[email protected]>
Reviewed-by: SiCheng-Zheng <[email protected]>
(cherry picked from commit 3f1087f)
  • Loading branch information
Apache9 committed Jan 4, 2023
1 parent 3ffa435 commit 2fdefdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
10 changes: 8 additions & 2 deletions hbase-logging/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,6 @@ public MiniDFSCluster startMiniDFSCluster(int servers, final String racks[], Str
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);
Expand All @@ -707,10 +702,6 @@ public MiniDFSCluster startMiniDFSCluster(int servers, final String racks[], Str

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);
Expand Down Expand Up @@ -1183,9 +1174,6 @@ public MiniHBaseCluster startMiniHBaseCluster(StartMiniClusterOption option)
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(),
Expand Down

0 comments on commit 2fdefdc

Please sign in to comment.