HBASE-27485 HBaseTestingUtility minicluster requires log4j2 (#4941)

Signed-off-by: Rajeshbabu Chintaguntla <rajeshbabu@apache.org>
Reviewed-by: SiCheng-Zheng <643463623@qq.com>
This commit is contained in:
Duo Zhang 2023-01-04 11:06:47 +08:00 committed by GitHub
parent c8eb1963a6
commit 3f1087fe82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 26 deletions

View File

@ -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

View File

@ -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(),

View File

@ -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(),