accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwa...@apache.org
Subject accumulo-testing git commit: ACCUMULO-4566 Update logging to use slf4j
Date Tue, 10 Jan 2017 17:51:56 GMT
Repository: accumulo-testing
Updated Branches:
  refs/heads/master 4f8220640 -> c3c8ff14d


ACCUMULO-4566 Update logging to use slf4j

* Fixed dependencies after running 'mvn dependency:analyze'


Project: http://git-wip-us.apache.org/repos/asf/accumulo-testing/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo-testing/commit/c3c8ff14
Tree: http://git-wip-us.apache.org/repos/asf/accumulo-testing/tree/c3c8ff14
Diff: http://git-wip-us.apache.org/repos/asf/accumulo-testing/diff/c3c8ff14

Branch: refs/heads/master
Commit: c3c8ff14d806cf3b4a9d0c0502cad030744e0d59
Parents: 4f82206
Author: Mike Walch <mwalch@apache.org>
Authored: Tue Jan 10 12:45:38 2017 -0500
Committer: Mike Walch <mwalch@apache.org>
Committed: Tue Jan 10 12:49:22 2017 -0500

----------------------------------------------------------------------
 conf/.gitignore                                     |  1 +
 conf/log4j.properties.example                       |  2 +-
 core/pom.xml                                        | 14 +++-----------
 .../accumulo/testing/core/randomwalk/Fixture.java   |  5 +++--
 .../accumulo/testing/core/randomwalk/Framework.java |  5 +++--
 .../accumulo/testing/core/randomwalk/Module.java    | 16 +++++++++++-----
 .../accumulo/testing/core/randomwalk/Node.java      |  5 +++--
 .../testing/core/randomwalk/bulk/BulkPlusOne.java   |  2 +-
 .../testing/core/randomwalk/bulk/BulkTest.java      | 14 +++++---------
 .../core/randomwalk/multitable/CopyTool.java        |  5 +++--
 .../testing/core/randomwalk/security/Validate.java  |  2 +-
 .../core/randomwalk/sequential/BatchVerify.java     |  2 +-
 .../core/randomwalk/sequential/MapRedVerify.java    |  2 +-
 .../randomwalk/sequential/MapRedVerifyTool.java     |  5 +++--
 .../testing/core/randomwalk/shard/ShardFixture.java |  2 +-
 pom.xml                                             |  5 +++++
 16 files changed, 46 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/conf/.gitignore
----------------------------------------------------------------------
diff --git a/conf/.gitignore b/conf/.gitignore
index 336f891..7c4fb33 100644
--- a/conf/.gitignore
+++ b/conf/.gitignore
@@ -1,2 +1,3 @@
 /accumulo-testing.properties
 /accumulo-testing-env.sh
+/log4j.properties

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/conf/log4j.properties.example
----------------------------------------------------------------------
diff --git a/conf/log4j.properties.example b/conf/log4j.properties.example
index b03805e..726fb2c 100644
--- a/conf/log4j.properties.example
+++ b/conf/log4j.properties.example
@@ -16,7 +16,7 @@
 log4j.rootLogger=INFO, CA
 log4j.appender.CA=org.apache.log4j.ConsoleAppender
 log4j.appender.CA.layout=org.apache.log4j.PatternLayout
-log4j.appender.CA.layout.ConversionPattern=%d{ISO8601} [%c] %-5p: %m%n
+log4j.appender.CA.layout.ConversionPattern=%d{ISO8601} [%c{3}] %-5p: %m%n
 
 log4j.logger.org.apache.accumulo=WARN
 log4j.logger.org.apache.accumulo.testing=INFO

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index d5d9230..3f82d27 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -39,16 +39,12 @@
       <artifactId>commons-configuration</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.accumulo</groupId>
-      <artifactId>accumulo-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.accumulo</groupId>
-      <artifactId>accumulo-fate</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math3</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.accumulo</groupId>
-      <artifactId>accumulo-master</artifactId>
+      <artifactId>accumulo-core</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.accumulo</groupId>
@@ -67,10 +63,6 @@
       <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.zookeeper</groupId>
-      <artifactId>zookeeper</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Fixture.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Fixture.java b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Fixture.java
index 5ac280e..cfa0e52 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Fixture.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Fixture.java
@@ -16,11 +16,12 @@
  */
 package org.apache.accumulo.testing.core.randomwalk;
 
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public abstract class Fixture {
 
-  protected final Logger log = Logger.getLogger(this.getClass());
+  protected final Logger log = LoggerFactory.getLogger(this.getClass());
 
   public abstract void setUp(State state, Environment env) throws Exception;
 

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Framework.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Framework.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Framework.java
index a9f1d68..0b647bb 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Framework.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Framework.java
@@ -20,11 +20,12 @@ import java.io.FileInputStream;
 import java.util.HashMap;
 import java.util.Properties;
 
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class Framework {
 
-  private static final Logger log = Logger.getLogger(Framework.class);
+  private static final Logger log = LoggerFactory.getLogger(Framework.class);
   private HashMap<String,Node> nodes = new HashMap<>();
   private static final Framework INSTANCE = new Framework();
 

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Module.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Module.java b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Module.java
index 3206906..5cfa2e5 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Module.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Module.java
@@ -44,8 +44,8 @@ import javax.xml.validation.SchemaFactory;
 
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.util.SimpleThreadPool;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -55,7 +55,7 @@ import org.w3c.dom.NodeList;
  */
 public class Module extends Node {
 
-  private static final Logger log = Logger.getLogger(Module.class);
+  private static final Logger log = LoggerFactory.getLogger(Module.class);
 
   private class Dummy extends Node {
 
@@ -69,8 +69,14 @@ public class Module extends Node {
     public void visit(State state, Environment env, Properties props) {
       String print;
       if ((print = props.getProperty("print")) != null) {
-        Level level = Level.toLevel(print);
-        log.log(level, name);
+        switch (print) {
+          case "TRACE": log.trace(name); break;
+          case "DEBUG": log.debug(name); break;
+          case "INFO": log.info(name); break;
+          case "WARN": log.warn(name); break;
+          case "ERROR": log.error(name); break;
+          default: log.info(name); break;
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Node.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Node.java b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Node.java
index 296e974..ed6e82e 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Node.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/Node.java
@@ -18,14 +18,15 @@ package org.apache.accumulo.testing.core.randomwalk;
 
 import java.util.Properties;
 
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Represents a point in graph of RandomFramework
  */
 public abstract class Node {
 
-  protected final Logger log = Logger.getLogger(this.getClass());
+  protected final Logger log = LoggerFactory.getLogger(this.getClass());
   long progress = System.currentTimeMillis();
 
   /**

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkPlusOne.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkPlusOne.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkPlusOne.java
index 239e93e..32be88b 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkPlusOne.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkPlusOne.java
@@ -37,7 +37,7 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
 
 public class BulkPlusOne extends BulkImportTest {
 

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkTest.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkTest.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkTest.java
index dc11501..8695538 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkTest.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/bulk/BulkTest.java
@@ -26,16 +26,12 @@ public abstract class BulkTest extends Test {
 
   @Override
   public void visit(final State state, final Environment env, Properties props) throws Exception
{
-    Setup.run(state, new Runnable() {
-      @Override
-      public void run() {
-        try {
-          runLater(state, env);
-        } catch (Throwable ex) {
-          log.error(ex, ex);
-        }
+    Setup.run(state, () -> {
+      try {
+        runLater(state, env);
+      } catch (Throwable ex) {
+        log.error(ex.toString(), ex);
       }
-
     });
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/multitable/CopyTool.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/multitable/CopyTool.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/multitable/CopyTool.java
index 02da2e0..a89a3f5 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/multitable/CopyTool.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/multitable/CopyTool.java
@@ -39,10 +39,11 @@ import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.Tool;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class CopyTool extends Configured implements Tool {
-  protected final Logger log = Logger.getLogger(this.getClass());
+  protected final Logger log = LoggerFactory.getLogger(this.getClass());
 
   public static class SeqMapClass extends Mapper<Key,Value,Text,Mutation> {
     @Override

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/security/Validate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/security/Validate.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/security/Validate.java
index c28f28d..8ad104a 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/security/Validate.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/security/Validate.java
@@ -29,7 +29,7 @@ import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.testing.core.randomwalk.Environment;
 import org.apache.accumulo.testing.core.randomwalk.State;
 import org.apache.accumulo.testing.core.randomwalk.Test;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
 
 public class Validate extends Test {
 

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/BatchVerify.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/BatchVerify.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/BatchVerify.java
index ec50285..dc59b05 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/BatchVerify.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/BatchVerify.java
@@ -76,7 +76,7 @@ public class BatchVerify extends Test {
 
       log.debug(String.format("scanning %d rows in the following %d ranges:", count, ranges.size()));
       for (Range r : ranges) {
-        log.debug(r);
+        log.debug(r.toString());
       }
 
       scanner.setRanges(ranges);

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerify.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerify.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerify.java
index 09f4dce..e17c98d 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerify.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerify.java
@@ -60,7 +60,7 @@ public class MapRedVerify extends Test {
     for (Entry<Key,Value> entry : outputScanner) {
       Key current = entry.getKey();
       if (lastKey != null && lastKey.getColumnFamily().equals(current.getRow()))
{
-        log.info(entry.getKey());
+        log.info(entry.getKey().toString());
         count++;
       }
       lastKey = current;

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerifyTool.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerifyTool.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerifyTool.java
index 6f785ce..2ec8bd4 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerifyTool.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/sequential/MapRedVerifyTool.java
@@ -42,10 +42,11 @@ import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.hadoop.mapreduce.Reducer;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.Tool;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class MapRedVerifyTool extends Configured implements Tool {
-  protected final Logger log = Logger.getLogger(this.getClass());
+  protected final Logger log = LoggerFactory.getLogger(this.getClass());
 
   public static class SeqMapClass extends Mapper<Key,Value,NullWritable,IntWritable>
{
     @Override

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/ShardFixture.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/ShardFixture.java
b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/ShardFixture.java
index e20f64d..3462442 100644
--- a/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/ShardFixture.java
+++ b/core/src/main/java/org/apache/accumulo/testing/core/randomwalk/shard/ShardFixture.java
@@ -29,7 +29,7 @@ import org.apache.accumulo.testing.core.randomwalk.Environment;
 import org.apache.accumulo.testing.core.randomwalk.Fixture;
 import org.apache.accumulo.testing.core.randomwalk.State;
 import org.apache.hadoop.io.Text;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
 
 public class ShardFixture extends Fixture {
 

http://git-wip-us.apache.org/repos/asf/accumulo-testing/blob/c3c8ff14/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cea25b6..6c68e5a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,6 +60,11 @@
         <version>1.48</version>
       </dependency>
       <dependency>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-math3</artifactId>
+        <version>3.6.1</version>
+      </dependency>
+      <dependency>
         <groupId>org.apache.accumulo</groupId>
         <artifactId>accumulo-testing-core</artifactId>
         <version>${project.version}</version>


Mime
View raw message