Skip to content
Permalink
Browse files
HBASE-22997 Move to SLF4J (#25)
Signed-off-by: Michael Stack <stack@apache.org>
  • Loading branch information
petersomogyi committed Sep 10, 2019
1 parent eafb31c commit 0e9635146298af033052779dc77356279aaa3dcb
Showing 6 changed files with 26 additions and 16 deletions.
@@ -162,10 +162,9 @@
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-1.2-api -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
@@ -29,8 +29,8 @@
import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
import org.apache.hadoop.hbase.util.CommonFSUtils;
import org.apache.hadoop.hbase.util.FSUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Closeable;
import java.io.IOException;
@@ -51,7 +51,7 @@
* meta information found on HDFS region dirs as the valid ones.
*/
public class FsRegionsMetaRecoverer implements Closeable {
private static final Logger LOG = LogManager.getLogger(FsRegionsMetaRecoverer.class);
private static final Logger LOG = LoggerFactory.getLogger(FsRegionsMetaRecoverer.class);
private final FileSystem fs;
private final Connection conn;
private final Configuration config;
@@ -95,7 +95,7 @@ public Map<TableName,List<Path>> reportTablesMissingRegions(final List<String> n
result.put(tableName,
findMissingRegionsInMETA(tableName.getNameWithNamespaceInclAsString()));
} catch (Exception e) {
LOG.warn(e);
LOG.warn("Can't get missing regions from meta", e);
}
});
return result;
@@ -58,10 +58,9 @@
import org.apache.hadoop.hbase.util.Pair;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configurator;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
import org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineParser;
@@ -73,6 +72,7 @@

import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;


/**
* HBase fixup tool version 2, for hbase-2.0.0+ clusters.
* Supercedes hbck1.
@@ -83,7 +83,7 @@
// then add a hbase-site.xml onto CLASSPATH for this tool to pick up.
// + Add --version
public class HBCK2 extends Configured implements org.apache.hadoop.util.Tool {
private static final Logger LOG = LogManager.getLogger(HBCK2.class);
private static final Logger LOG = LoggerFactory.getLogger(HBCK2.class);
private static final int EXIT_SUCCESS = 0;
static final int EXIT_FAILURE = 1;
// Commands
@@ -42,14 +42,14 @@
import org.apache.hadoop.hbase.master.RegionState;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Threads;
import org.apache.logging.log4j.LogManager;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.OutputStream;
import java.io.PrintStream;
@@ -63,7 +63,7 @@
* @see TestHBCKCommandLineParsing
*/
public class TestHBCK2 {
private static final org.apache.logging.log4j.Logger LOG = LogManager.getLogger(TestHBCK2.class);
private static final Logger LOG = LoggerFactory.getLogger(TestHBCK2.class);
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
private static final TableName TABLE_NAME = TableName.valueOf(TestHBCK2.class.getSimpleName());
private static final TableName REGION_STATES_TABLE_NAME = TableName.
@@ -28,7 +28,6 @@
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.logging.log4j.LogManager;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
@@ -43,7 +42,6 @@
*/
public class TestHBCKMetaTableAccessor {

private static final org.apache.logging.log4j.Logger LOG = LogManager.getLogger(TestHBCK2.class);
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();

@Rule
15 pom.xml
@@ -132,6 +132,8 @@
<maven.checkstyle.version>3.0.0</maven.checkstyle.version>
<hbase.checkstyle.version>2.2.0</hbase.checkstyle.version>
<commons-lang3.version>3.9</commons-lang3.version>
<enforcer.version>3.0.0-M2</enforcer.version>
<extra.enforcer.version>1.0-beta-9</extra.enforcer.version>
</properties>
<dependencyManagement>
<dependencies>
@@ -414,6 +416,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${enforcer.version}</version>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>${extra.enforcer.version}</version>
</dependency>
</dependencies>
<configuration>
<rules>
<enforceBytecodeVersion>
@@ -424,7 +434,10 @@
either "mvn -version" or "mvn enforcer:display-info" to verify what version is active.
Non-release builds can temporarily build with a newer JDK version by setting the
'compileSource' property (eg. mvn -DcompileSource=1.8 clean package).
</message>
</message>
<ignoreClasses>
<ignoreClass>module-info</ignoreClass>
</ignoreClasses>
</enforceBytecodeVersion>
</rules>
</configuration>

0 comments on commit 0e96351

Please sign in to comment.