accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cjno...@apache.org
Subject git commit: ACCUMULO-2628 Do not call printStackTrace
Date Fri, 13 Jun 2014 04:43:06 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 16d1f3b56 -> 7efff5138


ACCUMULO-2628 Do not call printStackTrace

We call Exception.printStackTrace rather than logging exception details.

Signed-off-by: Corey J. Nolet <cjnolet@gmail.com>


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

Branch: refs/heads/master
Commit: 7efff513887e666782ecffc900074d74ab6852ae
Parents: 16d1f3b
Author: David Protzman <dmp250net@gmail.com>
Authored: Thu Jun 12 22:35:35 2014 -0400
Committer: Corey J. Nolet <cjnolet@gmail.com>
Committed: Fri Jun 13 00:41:20 2014 -0400

----------------------------------------------------------------------
 .../accumulo/core/bloomfilter/BloomFilter.java  |  5 +++--
 .../core/client/impl/ThriftTransportPool.java   |  2 +-
 .../client/mock/MockInstanceOperations.java     |  4 +++-
 .../client/mock/MockNamespaceOperations.java    |  5 ++++-
 .../core/client/mock/MockTableOperations.java   |  4 +++-
 .../accumulo/core/conf/ConfigurationDocGen.java |  2 +-
 .../apache/accumulo/core/file/rfile/RFile.java  |  2 +-
 .../core/iterators/user/RegExFilter.java        |  7 +++++--
 .../iterators/aggregation/NumSummationTest.java |  6 +++++-
 .../iterators/user/VersioningIteratorTest.java  | 10 ++++++----
 .../examples/simple/dirlist/Viewer.java         |  4 ++--
 .../simple/isolation/InterferenceTest.java      |  2 +-
 .../simple/mapreduce/TokenFileWordCount.java    |  5 ++++-
 .../examples/simple/mapreduce/WordCount.java    |  5 ++++-
 .../examples/simple/reservations/ARS.java       |  5 ++++-
 .../examples/simple/dirlist/CountTest.java      |  6 +++++-
 .../org/apache/accumulo/fate/AdminUtil.java     |  6 ++++--
 .../accumulo/fate/zookeeper/ZooCache.java       |  2 +-
 .../client/mapred/AccumuloOutputFormat.java     |  4 ++--
 .../client/mapreduce/AccumuloOutputFormat.java  |  2 +-
 .../minicluster/MiniAccumuloRunner.java         | 20 ++++++++++++++++----
 .../impl/MiniAccumuloClusterImpl.java           |  6 +++---
 .../accumulo/server/client/BulkImporter.java    |  6 +++---
 .../master/balancer/ChaoticLoadBalancer.java    |  7 +++++--
 .../accumulo/server/util/ListInstances.java     |  2 +-
 .../server/util/TNonblockingServerSocket.java   |  2 +-
 .../server/util/VerifyTabletAssignments.java    |  5 +++--
 .../org/apache/accumulo/server/util/ZooZap.java |  6 ++++--
 .../security/handler/ZKAuthenticatorTest.java   |  6 ++++--
 .../accumulo/shell/commands/MaxRowCommand.java  |  5 ++++-
 .../java/org/apache/accumulo/start/Main.java    | 11 ++++++-----
 .../org/apache/accumulo/test/CreateRFiles.java  |  5 ++++-
 .../accumulo/test/NativeMapConcurrencyTest.java |  5 ++++-
 .../accumulo/test/NativeMapStressTest.java      |  6 +++---
 .../accumulo/test/QueryMetadataTable.java       | 11 +++++++----
 .../continuous/ContinuousStatsCollector.java    |  6 ++++--
 .../test/continuous/PrintScanTimeHistogram.java |  3 +--
 .../metadata/MetadataBatchScanTest.java         |  5 ++++-
 .../performance/scan/CollectTabletStats.java    |  6 +++---
 .../apache/accumulo/test/randomwalk/Module.java |  5 ++++-
 .../accumulo/test/scalability/Ingest.java       | 20 +++++++++-----------
 .../apache/accumulo/test/scalability/Run.java   | 12 ++++++------
 .../accumulo/test/ConditionalWriterIT.java      |  2 +-
 .../test/functional/GarbageCollectorIT.java     |  2 +-
 44 files changed, 161 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java b/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java
index 65ed300..0cef8d3 100644
--- a/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java
@@ -59,6 +59,7 @@ import java.io.ObjectOutputStream;
 import java.util.BitSet;
 
 import org.apache.hadoop.util.bloom.Key;
+import org.apache.log4j.Logger;
 
 /**
  * Implements a <i>Bloom filter</i>, as defined by Bloom in 1970.
@@ -78,7 +79,7 @@ import org.apache.hadoop.util.bloom.Key;
  * @see <a href="http://portal.acm.org/citation.cfm?id=362692&dl=ACM&coll=portal">Space/Time Trade-Offs in Hash Coding with Allowable Errors</a>
  */
 public class BloomFilter extends Filter {
-  
+  private static final Logger log = Logger.getLogger(BloomFilter.class);
   private static final byte[] bitvalues = new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x04, (byte) 0x08, (byte) 0x10, (byte) 0x20, (byte) 0x40, (byte) 0x80};
   
   /** The bit vector. */
@@ -217,7 +218,7 @@ public class BloomFilter extends Filter {
       try {
         bits = (BitSet) ois.readObject();
       } catch (ClassNotFoundException e) {
-        e.printStackTrace();
+        log.error("BloomFilter tried to deserialize as bitset", e);
         throw new IOException("BloomFilter tried to deserialize as bitset: " + e);
       }
       // can not close ois, it would close in

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
index 3fef7b9..4f3c661 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftTransportPool.java
@@ -136,7 +136,7 @@ public class ThriftTransportPool {
         try {
           Thread.sleep(500);
         } catch (InterruptedException e) {
-          e.printStackTrace();
+          log.debug("Sleep interrupted in closeConnections()", e);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java
index 89bf39c..8f01813 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstanceOperations.java
@@ -26,8 +26,10 @@ import org.apache.accumulo.core.client.admin.ActiveCompaction;
 import org.apache.accumulo.core.client.admin.ActiveScan;
 import org.apache.accumulo.core.client.admin.InstanceOperations;
 import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
+import org.apache.log4j.Logger;
 
 class MockInstanceOperations implements InstanceOperations {
+  private static final Logger log = Logger.getLogger(MockInstanceOperations.class);
   MockAccumulo acu;
 
   public MockInstanceOperations(MockAccumulo acu) {
@@ -69,7 +71,7 @@ class MockInstanceOperations implements InstanceOperations {
     try {
       AccumuloVFSClassLoader.loadClass(className, Class.forName(asTypeName));
     } catch (ClassNotFoundException e) {
-      e.printStackTrace();
+      log.warn("Could not find class named '"+className+"' in testClassLoad.", e);
       return false;
     }
     return true;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/main/java/org/apache/accumulo/core/client/mock/MockNamespaceOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockNamespaceOperations.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockNamespaceOperations.java
index 77a9cb1..7e7eecb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockNamespaceOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockNamespaceOperations.java
@@ -31,9 +31,12 @@ import org.apache.accumulo.core.client.impl.NamespaceOperationsHelper;
 import org.apache.accumulo.core.client.impl.Namespaces;
 import org.apache.accumulo.core.client.impl.Tables;
 import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
+import org.apache.log4j.Logger;
 
 class MockNamespaceOperations extends NamespaceOperationsHelper {
 
+  private static final Logger log = Logger.getLogger(MockNamespaceOperations.class);
+  
   final private MockAccumulo acu;
   final private String username;
 
@@ -122,7 +125,7 @@ class MockNamespaceOperations extends NamespaceOperationsHelper {
     try {
       AccumuloVFSClassLoader.loadClass(className, Class.forName(asTypeName));
     } catch (ClassNotFoundException e) {
-      e.printStackTrace();
+      log.warn("Could not load class '"+className+"' with type name '"+asTypeName+"' in testClassLoad()", e);
       return false;
     }
     return true;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
index b1bba45..08750fe 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
@@ -59,8 +59,10 @@ 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;
 
 class MockTableOperations extends TableOperationsHelper {
+  private static final Logger log = Logger.getLogger(MockTableOperations.class);
   private static final byte[] ZERO = {0};
   private final MockAccumulo acu;
   private final String username;
@@ -440,7 +442,7 @@ class MockTableOperations extends TableOperationsHelper {
     try {
       AccumuloVFSClassLoader.loadClass(className, Class.forName(asTypeName));
     } catch (ClassNotFoundException e) {
-      e.printStackTrace();
+      log.warn("Could not load class '"+className+"' with type name '"+asTypeName+"' in testClassLoad().", e);
       return false;
     }
     return true;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java b/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java
index 6cf9c77..d90ce98 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java
@@ -324,7 +324,7 @@ class ConfigurationDocGen {
         while ((n = data.read(buffer)) > 0)
           doc.print(new String(buffer, 0, n, StandardCharsets.UTF_8));
       } catch (IOException e) {
-        e.printStackTrace();
+        log.debug("Encountered IOException while reading InputStream in appendResource().", e);
         return;
       } finally {
         try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
index da5a3ea..f8f543f 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
@@ -874,7 +874,7 @@ public class RFile {
         try {
           lgr.close();
         } catch (IOException e) {
-          e.printStackTrace();
+          log.warn("Errored out attempting to close LocalityGroupReader.", e);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
index 5669fde..9aff04f 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
@@ -30,12 +30,15 @@ import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.Filter;
 import org.apache.accumulo.core.iterators.IteratorEnvironment;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
+import org.apache.log4j.Logger;
 
 /**
  * A Filter that matches entries based on Java regular expressions.
  */
 public class RegExFilter extends Filter {
   
+  private static final Logger log = Logger.getLogger(RegExFilter.class);
+  
   @Override
   public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) {
     RegExFilter result = (RegExFilter) super.deepCopy(env);
@@ -79,7 +82,7 @@ public class RegExFilter extends Filter {
         matcher.reset(new String(bs.getBackingArray(), bs.offset(), bs.length(), encoding));
         return matchSubstring ? matcher.find() : matcher.matches();
       } catch (UnsupportedEncodingException e) {
-        e.printStackTrace();
+        log.debug("Could not create a String for the provided ByteSequence.", e);
       }
     }
     return !orFields;
@@ -91,7 +94,7 @@ public class RegExFilter extends Filter {
         matcher.reset(new String(data, offset, len, encoding));
         return matchSubstring ? matcher.find() : matcher.matches();
       } catch (UnsupportedEncodingException e) {
-        e.printStackTrace();
+        log.warn("Could not create a String from the provided byte array.", e);
       }
     }
     return !orFields;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java
index 61e18b8..d08c31b 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java
@@ -19,12 +19,16 @@ package org.apache.accumulo.core.iterators.aggregation;
 import junit.framework.TestCase;
 
 import org.apache.accumulo.core.data.Value;
+import org.apache.log4j.Logger;
 
 /**
  * @deprecated since 1.4
  */
 @Deprecated
 public class NumSummationTest extends TestCase {
+  
+  private static final Logger log = Logger.getLogger(NumSummationTest.class);
+  
   public byte[] init(int n) {
     byte[] b = new byte[n];
     for (int i = 0; i < b.length; i++)
@@ -64,7 +68,7 @@ public class NumSummationTest extends TestCase {
       la = NumArraySummation.bytesToLongArray(nas.aggregate().get());
       assertTrue(la.length == 0);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error(e);
       assertTrue(false);
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
index 972b103..04190d1 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
@@ -34,12 +34,14 @@ import org.apache.accumulo.core.iterators.LongCombiner;
 import org.apache.accumulo.core.iterators.SortedMapIterator;
 import org.apache.accumulo.core.iterators.TypedValueCombiner.Encoder;
 import org.apache.hadoop.io.Text;
+import org.apache.log4j.Logger;
 import org.junit.Test;
 
 public class VersioningIteratorTest {
   // add test for seek function
   private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
   private static final Encoder<Long> encoder = LongCombiner.FIXED_LEN_ENCODER;
+  private static final Logger log = Logger.getLogger(VersioningIteratorTest.class);
   
   void createTestData(TreeMap<Key,Value> tm, Text colf, Text colq) {
     for (int i = 0; i < 2; i++) {
@@ -88,7 +90,7 @@ public class VersioningIteratorTest {
     } catch (IOException e) {
       assertFalse(true);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error(e);
       assertFalse(true);
     }
   }
@@ -124,7 +126,7 @@ public class VersioningIteratorTest {
     } catch (IOException e) {
       assertFalse(true);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error(e);
       assertFalse(true);
     }
   }
@@ -173,7 +175,7 @@ public class VersioningIteratorTest {
     } catch (IOException e) {
       assertFalse(true);
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error(e);
       assertFalse(true);
     }
   }
@@ -201,7 +203,7 @@ public class VersioningIteratorTest {
       } catch (IOException e) {
         assertFalse(true);
       } catch (Exception e) {
-        e.printStackTrace();
+        log.error(e);
         assertFalse(true);
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
index 6481cdf..172ba58 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Viewer.java
@@ -165,7 +165,7 @@ public class Viewer extends JFrame implements TreeSelectionListener, TreeExpansi
     try {
       populateChildren((DefaultMutableTreeNode) event.getPath().getLastPathComponent());
     } catch (TableNotFoundException e) {
-      e.printStackTrace();
+      log.error("Could not find table.", e);
     }
   }
   
@@ -196,7 +196,7 @@ public class Viewer extends JFrame implements TreeSelectionListener, TreeExpansi
         data.setText("");
       }
     } catch (IOException e1) {
-      e1.printStackTrace();
+      log.error("Could not get data from FileDataQuery.", e1);
     }
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java
index db8c139..fd6d159 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java
@@ -78,7 +78,7 @@ public class InterferenceTest {
         try {
           bw.addMutation(m);
         } catch (MutationsRejectedException e) {
-          e.printStackTrace();
+          log.error("Mutation was rejected.", e);
           System.exit(-1);
         }
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TokenFileWordCount.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TokenFileWordCount.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TokenFileWordCount.java
index c3f6cdb..7bb7e69 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TokenFileWordCount.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TokenFileWordCount.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
+import org.apache.log4j.Logger;
 
 /**
  * A simple map reduce job that inserts word counts into accumulo. See the README for instructions on how to run this. This version does not use the ClientOpts
@@ -38,6 +39,8 @@ import org.apache.hadoop.util.ToolRunner;
  * 
  */
 public class TokenFileWordCount extends Configured implements Tool {
+  
+  private static final Logger log = Logger.getLogger(TokenFileWordCount.class);
 
   public static class MapClass extends Mapper<LongWritable,Text,Text,Mutation> {
     @Override
@@ -52,7 +55,7 @@ public class TokenFileWordCount extends Configured implements Tool {
         try {
           output.write(null, mutation);
         } catch (InterruptedException e) {
-          e.printStackTrace();
+          log.error("Could not write to Context.", e);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/WordCount.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/WordCount.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/WordCount.java
index f114a24..4f1f861 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/WordCount.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/WordCount.java
@@ -34,6 +34,7 @@ import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
 
 import com.beust.jcommander.Parameter;
+import org.apache.log4j.Logger;
 
 /**
  * A simple map reduce job that inserts word counts into accumulo. See the README for instructions on how to run this.
@@ -41,6 +42,8 @@ import com.beust.jcommander.Parameter;
  */
 public class WordCount extends Configured implements Tool {
 
+  private static final Logger log = Logger.getLogger(WordCount.class);
+  
   static class Opts extends MapReduceClientOnRequiredTable {
     @Parameter(names = "--input", description = "input directory")
     String inputDirectory;
@@ -59,7 +62,7 @@ public class WordCount extends Configured implements Tool {
         try {
           output.write(null, mutation);
         } catch (InterruptedException e) {
-          e.printStackTrace();
+          log.error("Could not write mutation to Context.", e);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java
index 2df1834..e9dc2aa 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java
@@ -38,6 +38,7 @@ import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
+import org.apache.log4j.Logger;
 
 /**
  * Accumulo Reservation System : An example reservation system using Accumulo. Supports atomic reservations of a resource at a date. Wait list are also
@@ -52,6 +53,8 @@ import org.apache.hadoop.io.Text;
 
 public class ARS {
   
+  private static final Logger log = Logger.getLogger(ARS.class);
+  
   private Connector conn;
   private String rTable;
   
@@ -260,7 +263,7 @@ public class ARS {
               try {
                 reader.println("  " + String.format("%20s", tokens[whoIndex]) + " : " + fars.reserve(tokens[1], tokens[2], tokens[whoIndex]));
               } catch (Exception e) {
-                e.printStackTrace();
+                log.warn("Could not write to the ConsoleReader.", e);
               }
             }
           };

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
index f5f5d02..8bc363c 100644
--- a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
+++ b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
@@ -37,8 +37,12 @@ import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.accumulo.examples.simple.dirlist.FileCount.Opts;
 import org.apache.hadoop.io.Text;
+import org.apache.log4j.Logger;
 
 public class CountTest extends TestCase {
+  
+  private static Logger log = Logger.getLogger(CountTest.class);
+  
   {
     try {
       Connector conn = new MockInstance("counttest").getConnector("root", new PasswordToken(""));
@@ -57,7 +61,7 @@ public class CountTest extends TestCase {
       bw.addMutation(Ingest.buildMutation(cv, "/local/user1/file2", false, false, false, 1028, 23456, null));
       bw.close();
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error("Could not add mutations in initializer.", e);
     }
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java b/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java
index 1f8c32d..8884cd9 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java
@@ -31,6 +31,7 @@ import org.apache.accumulo.fate.ReadOnlyTStore.TStatus;
 import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
 import org.apache.accumulo.fate.zookeeper.ZooLock;
 import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
+import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
 
 /**
@@ -38,6 +39,7 @@ import org.apache.zookeeper.KeeperException;
  */
 public class AdminUtil<T> {
   private static final Charset UTF8 = Charset.forName("UTF-8");
+  private static final Logger log = Logger.getLogger(AdminUtil.class);
   
   private boolean exitOnError = false;
   
@@ -108,13 +110,13 @@ public class AdminUtil<T> {
             tables.add(lda[0].charAt(0) + ":" + id);
             
           } catch (Exception e) {
-            e.printStackTrace();
+            log.error(e);
           }
           pos++;
         }
         
       } catch (Exception e) {
-        e.printStackTrace();
+        log.error("Failed to read locks for "+id+" continuing.", e);
         fmt.format("Failed to read locks for %s continuing", id);
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
index d9eb243..c93d766 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
@@ -168,7 +168,7 @@ public class ZooCache {
         // do not hold lock while sleeping
         wait(sleepTime);
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.debug("Wait in retry() was interrupted.", e);
       }
       if (sleepTime < 10000)
         sleepTime = (int) (sleepTime + sleepTime * Math.random());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java b/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
index 122b4cd..eba340b 100644
--- a/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
+++ b/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
@@ -408,8 +408,8 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation> {
       if (!bws.containsKey(table))
         try {
           addTable(table);
-        } catch (Exception e) {
-          e.printStackTrace();
+        } catch (final Exception e) {
+          log.error("Could not add table '"+table.toString()+"'", e);
           throw new IOException(e);
         }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java b/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
index af9bbae..cfe36c4 100644
--- a/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
+++ b/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
@@ -410,7 +410,7 @@ public class AccumuloOutputFormat extends OutputFormat<Text,Mutation> {
         try {
           addTable(table);
         } catch (Exception e) {
-          e.printStackTrace();
+          log.error("Could not add table '"+table+"'", e);
           throw new IOException(e);
         }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
index a7e2a3c..5feb7df 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
@@ -34,6 +34,7 @@ import org.apache.commons.io.FileUtils;
 import com.beust.jcommander.IStringConverter;
 import com.beust.jcommander.Parameter;
 import com.google.common.io.Files;
+import org.apache.log4j.Logger;
 
 /**
  * A runner for starting up a {@link MiniAccumuloCluster} from the command line using an optional configuration properties file. An example property file looks
@@ -59,6 +60,8 @@ import com.google.common.io.Files;
  * @since 1.6.0
  */
 public class MiniAccumuloRunner {
+  private static final Logger log = Logger.getLogger(MiniAccumuloRunner.class);
+  
   private static final String ROOT_PASSWORD_PROP = "rootPassword";
   private static final String SHUTDOWN_PORT_PROP = "shutdownPort";
   private static final String DEFAULT_MEMORY_PROP = "defaultMemory";
@@ -188,13 +191,22 @@ public class MiniAccumuloRunner {
       public void run() {
         try {
           accumulo.stop();
-          FileUtils.deleteDirectory(miniDir);
-          System.out.println("\nShut down gracefully on " + new Date());
         } catch (IOException e) {
-          e.printStackTrace();
+          log.error("IOException attempting to stop Accumulo.", e);
+          return;
         } catch (InterruptedException e) {
-          e.printStackTrace();
+          log.error("InterruptedException attempting to stop Accumulo.", e);
+          return;
+        }
+        
+        try {
+          FileUtils.deleteDirectory(miniDir);
+        } catch (IOException e) {
+          log.error("IOException attempting to clean up miniDir.", e);
+          return;
         }
+        
+        System.out.println("\nShut down gracefully on " + new Date());
       }
     });
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index 6eae19c..dd27ec1 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -110,7 +110,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
           try {
             flush();
           } catch (IOException e) {
-            e.printStackTrace();
+            log.error("Exception while attempting to flush.", e);
           }
         }
       }, 1000, 1000);
@@ -446,9 +446,9 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
           try {
             MiniAccumuloClusterImpl.this.stop();
           } catch (IOException e) {
-            e.printStackTrace();
+            log.error("IOException while attempting to stop the MiniAccumuloCluster.", e);
           } catch (InterruptedException e) {
-            e.printStackTrace();
+            log.error("The stopping of MiniAccumuloCluster was interrupted.", e);
           }
         }
       });

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
index 27ab078..6ff5774 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
@@ -399,7 +399,7 @@ public class BulkImporter {
       try {
         threadPool.awaitTermination(60, TimeUnit.SECONDS);
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.error("Encountered InterruptedException while waiting for the threadPool to terminate.", e);
         throw new RuntimeException(e);
       }
     }
@@ -575,7 +575,7 @@ public class BulkImporter {
       try {
         threadPool.awaitTermination(60, TimeUnit.SECONDS);
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.error("Encountered InterruptedException while waiting for the thread pool to terminate.", e);
         throw new RuntimeException(e);
       }
     }
@@ -611,7 +611,7 @@ public class BulkImporter {
     } catch (ThriftSecurityException e) {
       throw new AccumuloSecurityException(e.user, e.code, e);
     } catch (Throwable t) {
-      t.printStackTrace();
+      log.error("Encountered unknown exception in assignMapFiles.", t);
       throw new AccumuloException(t);
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
index ec3371c..006fab7 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
@@ -34,6 +34,7 @@ import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
 import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.master.state.TServerInstance;
 import org.apache.accumulo.server.master.state.TabletMigration;
+import org.apache.log4j.Logger;
 import org.apache.thrift.TException;
 
 /**
@@ -41,6 +42,8 @@ import org.apache.thrift.TException;
  * designed for performance, do not use on production systems. I'm calling it the LokiLoadBalancer.
  */
 public class ChaoticLoadBalancer extends TabletBalancer {
+  private static final Logger log = Logger.getLogger(ChaoticLoadBalancer.class);
+  
   Random r = new Random();
   
   @Override
@@ -124,10 +127,10 @@ public class ChaoticLoadBalancer extends TabletBalancer {
           }
         } catch (ThriftSecurityException e1) {
           // Shouldn't happen, but carry on if it does
-          e1.printStackTrace();
+          log.debug("Encountered ThriftSecurityException.  This should not happen.  Carrying on anyway.", e1);
         } catch (TException e1) {
           // Shouldn't happen, but carry on if it does
-          e1.printStackTrace();
+          log.debug("Encountered TException.  This should not happen.  Carrying on anyway.", e1);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/server/base/src/main/java/org/apache/accumulo/server/util/ListInstances.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/ListInstances.java b/server/base/src/main/java/org/apache/accumulo/server/util/ListInstances.java
index 78a2947..b959159 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/ListInstances.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/ListInstances.java
@@ -218,7 +218,7 @@ public class ListInstances {
   
   private static void handleException(Exception e, boolean printErrors) {
     if (printErrors) {
-      e.printStackTrace();
+      log.error(e);
     }
     
     errors++;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/server/base/src/main/java/org/apache/accumulo/server/util/TNonblockingServerSocket.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/TNonblockingServerSocket.java b/server/base/src/main/java/org/apache/accumulo/server/util/TNonblockingServerSocket.java
index 4154d9d..d1cdd8e 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/TNonblockingServerSocket.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/TNonblockingServerSocket.java
@@ -100,7 +100,7 @@ public class TNonblockingServerSocket extends TNonblockingServerTransport {
       try {
         serverSocket_.setSoTimeout(0);
       } catch (SocketException sx) {
-        sx.printStackTrace();
+        log.error("SocketException caused by serverSocket in listen()", sx);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java b/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
index 5938bc0..3aa3b2c 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
@@ -58,8 +58,10 @@ import org.apache.thrift.TException;
 import org.apache.thrift.TServiceClient;
 
 import com.beust.jcommander.Parameter;
+import org.apache.log4j.Logger;
 
 public class VerifyTabletAssignments {
+  private static final Logger log = Logger.getLogger(VerifyTabletAssignments.class);
   
   static class Opts extends ClientOpts {
     @Parameter(names = {"-v", "--verbose"}, description = "verbose mode (prints locations of tablets)")
@@ -126,8 +128,7 @@ public class VerifyTabletAssignments {
           try {
             checkTabletServer(inst, conf.getConfiguration(), new Credentials(opts.principal, opts.getToken()), entry, failures);
           } catch (Exception e) {
-            System.err.println("Failure on ts " + entry.getKey() + " " + e.getMessage());
-            e.printStackTrace();
+            log.error("Failure on tablet server '"+entry.getKey()+".", e);
             failures.addAll(entry.getValue());
           }
         }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java b/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
index 489d4bc..ab69628 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/ZooZap.java
@@ -27,8 +27,10 @@ import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 
 import com.beust.jcommander.JCommander;
 import com.beust.jcommander.Parameter;
+import org.apache.log4j.Logger;
 
 public class ZooZap {
+  private static final Logger log = Logger.getLogger(ZooZap.class);
   
   static boolean verbose = false;
   
@@ -89,7 +91,7 @@ public class ZooZap {
           }
         }
       } catch (Exception e) {
-        e.printStackTrace();
+        log.error(e);
       }
     }
     
@@ -108,7 +110,7 @@ public class ZooZap {
         zoo.recursiveDelete(path + "/" + child, NodeMissingPolicy.SKIP);
       }
     } catch (Exception e) {
-      e.printStackTrace();
+      log.error("Exception running zapDirectory.", e);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/server/base/src/test/java/org/apache/accumulo/server/security/handler/ZKAuthenticatorTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/security/handler/ZKAuthenticatorTest.java b/server/base/src/test/java/org/apache/accumulo/server/security/handler/ZKAuthenticatorTest.java
index 9700c8a..2f01e6e 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/security/handler/ZKAuthenticatorTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/security/handler/ZKAuthenticatorTest.java
@@ -24,11 +24,13 @@ import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.SystemPermission;
 import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.core.util.ByteArraySet;
-import org.apache.accumulo.server.security.handler.ZKSecurityTool;
 
 import junit.framework.TestCase;
+import org.apache.log4j.Logger;
 
 public class ZKAuthenticatorTest extends TestCase {
+  private static final Logger log = Logger.getLogger(ZKAuthenticatorTest.class);
+  
   public void testPermissionIdConversions() {
     for (SystemPermission s : SystemPermission.values())
       assertTrue(s.equals(SystemPermission.getPermissionById(s.getId())));
@@ -80,7 +82,7 @@ public class ZKAuthenticatorTest extends TestCase {
       storedBytes = ZKSecurityTool.createPass(rawPass);
       assertTrue(ZKSecurityTool.checkPass(rawPass, storedBytes));
     } catch (AccumuloException e) {
-      e.printStackTrace();
+      log.error(e);
       assertTrue(false);
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
index 1794b57..7118b7e 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
@@ -22,9 +22,12 @@ import org.apache.accumulo.core.util.interpret.ScanInterpreter;
 import org.apache.accumulo.shell.Shell;
 import org.apache.commons.cli.CommandLine;
 import org.apache.hadoop.io.Text;
+import org.apache.log4j.Logger;
 
 public class MaxRowCommand extends ScanCommand {
   
+  private static final Logger log = Logger.getLogger(MaxRowCommand.class);
+  
   public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
     final String tableName = OptUtil.getTableOpt(cl, shellState);
     
@@ -42,7 +45,7 @@ public class MaxRowCommand extends ScanCommand {
         shellState.getReader().println(max.toString());
       }
     } catch (Exception e) {
-      e.printStackTrace();
+      log.debug("Could not get shell state.", e);
     }
     
     return 0;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/start/src/main/java/org/apache/accumulo/start/Main.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/Main.java b/start/src/main/java/org/apache/accumulo/start/Main.java
index 77a0463..06ea686 100644
--- a/start/src/main/java/org/apache/accumulo/start/Main.java
+++ b/start/src/main/java/org/apache/accumulo/start/Main.java
@@ -24,8 +24,11 @@ import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 
 import org.apache.accumulo.start.classloader.AccumuloClassLoader;
+import org.apache.log4j.Logger;
 
 public class Main {
+  
+  private static final Logger log = Logger.getLogger(Main.class);
 
   public static void main(String[] args) {
     Runnable r = null;
@@ -133,7 +136,7 @@ public class Main {
       try {
         main = runTMP.getMethod("main", args.getClass());
       } catch (Throwable t) {
-        t.printStackTrace();
+        log.error("Could not run main method on '"+runTMP.getName()+"'.", t);
       }
       if (main == null || !Modifier.isPublic(main.getModifiers()) || !Modifier.isStatic(main.getModifiers())) {
         System.out.println(args[0] + " must implement a public static void main(String args[]) method");
@@ -175,8 +178,7 @@ public class Main {
       t.setContextClassLoader(cl);
       t.start();
     } catch (Throwable t) {
-      System.err.println("Uncaught exception: " + t);
-      t.printStackTrace(System.err);
+      log.error("Uncaught exception", t);
       System.exit(1);
     }
   }
@@ -188,8 +190,7 @@ public class Main {
    *          The {@link Throwable} containing a stack trace to print.
    */
   private static void die(Throwable t) {
-    System.err.println("Thread \"" + Thread.currentThread().getName() + "\" died " + t.getMessage());
-    t.printStackTrace(System.err);
+    log.error("Thread '"+Thread.currentThread().getName()+"' died.", t);
     System.exit(1);
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/CreateRFiles.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/CreateRFiles.java b/test/src/main/java/org/apache/accumulo/test/CreateRFiles.java
index 82f9b6b..c113b87 100644
--- a/test/src/main/java/org/apache/accumulo/test/CreateRFiles.java
+++ b/test/src/main/java/org/apache/accumulo/test/CreateRFiles.java
@@ -23,9 +23,12 @@ import java.util.concurrent.TimeUnit;
 import org.apache.accumulo.core.cli.Help;
 
 import com.beust.jcommander.Parameter;
+import org.apache.log4j.Logger;
 
 public class CreateRFiles {
   
+  private static final Logger log = Logger.getLogger(CreateRFiles.class);
+  
   static class Opts extends Help {
     
     @Parameter(names="--output", description="the destiation directory")
@@ -67,7 +70,7 @@ public class CreateRFiles {
           try {
             TestIngest.main(tia.split(" "));
           } catch (Exception e) {
-            e.printStackTrace();
+            log.error("Could not run "+TestIngest.class.getName()+".main using the input '"+tia+"'", e);
           }
         }
         

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/NativeMapConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/NativeMapConcurrencyTest.java b/test/src/main/java/org/apache/accumulo/test/NativeMapConcurrencyTest.java
index 5f51830..abf31d2 100644
--- a/test/src/main/java/org/apache/accumulo/test/NativeMapConcurrencyTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/NativeMapConcurrencyTest.java
@@ -29,9 +29,12 @@ import org.apache.hadoop.io.Text;
 
 import com.beust.jcommander.JCommander;
 import com.beust.jcommander.Parameter;
+import org.apache.log4j.Logger;
 
 public class NativeMapConcurrencyTest {
   
+  private static final Logger log = Logger.getLogger(NativeMapConcurrencyTest.class);
+  
   private static final byte ROW_PREFIX[] = new byte[] {'r'};
   private static final byte COL_PREFIX[] = new byte[] {'c'};
   
@@ -177,7 +180,7 @@ public class NativeMapConcurrencyTest {
       try {
         thread.join();
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.error("Could not join thread '"+thread.getName()+"'", e);
       }
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/NativeMapStressTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/NativeMapStressTest.java b/test/src/main/java/org/apache/accumulo/test/NativeMapStressTest.java
index 2236e89..a73199c 100644
--- a/test/src/main/java/org/apache/accumulo/test/NativeMapStressTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/NativeMapStressTest.java
@@ -137,7 +137,7 @@ public class NativeMapStressTest {
       try {
         thread.join();
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.error("Could not join thread '"+thread.getName()+"'.", e);
         throw new RuntimeException(e);
       }
     }
@@ -199,7 +199,7 @@ public class NativeMapStressTest {
       try {
         thread.join();
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.error("Could not join thread '"+thread.getName()+"'.", e);
         throw new RuntimeException(e);
       }
     }
@@ -260,7 +260,7 @@ public class NativeMapStressTest {
       try {
         thread.join();
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.error("Could not join thread '"+thread.getName()+"'.", e);
         throw new RuntimeException(e);
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java b/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
index 45cc557..b6a9bda 100644
--- a/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
@@ -43,8 +43,11 @@ import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.hadoop.io.Text;
 
 import com.beust.jcommander.Parameter;
+import org.apache.log4j.Logger;
 
 public class QueryMetadataTable {
+  private static final Logger log = Logger.getLogger(QueryMetadataTable.class);
+  
   private static String principal;
   private static AuthenticationToken token;
   
@@ -74,13 +77,13 @@ public class QueryMetadataTable {
         }
         
       } catch (TableNotFoundException e) {
-        e.printStackTrace();
+        log.error("Table '"+MetadataTable.NAME+"' not found.", e);
         throw new RuntimeException(e);
       } catch (AccumuloException e) {
-        e.printStackTrace();
+        log.error("AccumuloException encountered.", e);
         throw new RuntimeException(e);
       } catch (AccumuloSecurityException e) {
-        e.printStackTrace();
+        log.error("AccumuloSecurityException encountered.", e);
         throw new RuntimeException(e);
       }
     }
@@ -143,7 +146,7 @@ public class QueryMetadataTable {
     try {
       tp.awaitTermination(1, TimeUnit.HOURS);
     } catch (InterruptedException e) {
-      e.printStackTrace();
+      log.error("Failed while awaiting the ExcecutorService to terminate.", e);
       throw new RuntimeException(e);
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
index 458afe0..b36dbeb 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousStatsCollector.java
@@ -53,9 +53,12 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.ClusterStatus;
 import org.apache.hadoop.mapred.JobClient;
+import org.apache.log4j.Logger;
 
 public class ContinuousStatsCollector {
   
+  private static final Logger log = Logger.getLogger(ContinuousStatsCollector.class);
+  
   static class StatsCollectionTask extends TimerTask {
     
     private final String tableId;
@@ -82,8 +85,7 @@ public class ContinuousStatsCollector {
         
         System.out.println(System.currentTimeMillis() + " " + acuStats + " " + fsStats + " " + mrStats + " " + tabletStats);
       } catch (Exception e) {
-        System.err.println(System.currentTimeMillis() + " Failed to collect stats : " + e.getMessage());
-        e.printStackTrace();
+        log.error(System.currentTimeMillis()+" - Failed to collect stats", e);
       }
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/continuous/PrintScanTimeHistogram.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/PrintScanTimeHistogram.java b/test/src/main/java/org/apache/accumulo/test/continuous/PrintScanTimeHistogram.java
index c19ca2e..82d8660 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/PrintScanTimeHistogram.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/PrintScanTimeHistogram.java
@@ -65,8 +65,7 @@ public class PrintScanTimeHistogram {
           fsrHist.addPoint(point);
         }
       } catch (Exception e) {
-        System.err.println("Failed to process line : " + line);
-        e.printStackTrace();
+        log.error("Failed to process line '"+line+"'.", e);
       }
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
index 39659e2..e404749 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
@@ -47,6 +47,7 @@ import org.apache.accumulo.server.security.SystemCredentials;
 import org.apache.hadoop.io.Text;
 
 import com.google.common.net.HostAndPort;
+import org.apache.log4j.Logger;
 
 /**
  * This little program can be used to write a lot of metadata entries and measure the performance of varying numbers of threads doing metadata
@@ -57,6 +58,8 @@ import com.google.common.net.HostAndPort;
 
 public class MetadataBatchScanTest {
   
+  private static final Logger log = Logger.getLogger(MetadataBatchScanTest.class);
+  
   public static void main(String[] args) throws Exception {
     
     final Connector connector = new ZooKeeperInstance(new ClientConfiguration().withInstance("acu14").withZkHosts("localhost")).getConnector(SystemCredentials.get().getPrincipal(), SystemCredentials.get()
@@ -140,7 +143,7 @@ public class MetadataBatchScanTest {
             try {
               System.out.println(runScanTest(connector, numLoop, ranges));
             } catch (Exception e) {
-              e.printStackTrace();
+              log.error("Exception while running scan test.", e);
             }
           }
         });

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java b/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
index 2195483..7e7e0a2 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
@@ -236,7 +236,7 @@ public class CollectTabletStats {
           try {
             calcTabletStats(conn, opts.getTableName(), opts.auths, scanOpts.scanBatchSize, ke, columns);
           } catch (Exception e) {
-            e.printStackTrace();
+            log.error("Failed to calculate tablet stats.", e);
           }
         }
       });
@@ -270,7 +270,7 @@ public class CollectTabletStats {
       try {
         startCdl.await();
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.error("startCdl.await() failed.", e);
       }
       
       t1 = System.currentTimeMillis();
@@ -278,7 +278,7 @@ public class CollectTabletStats {
       try {
         count = runTest();
       } catch (Exception e) {
-        e.printStackTrace();
+        log.error("runTest() failed.", e);
       }
       
       t2 = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
index 0f59b7c..d2c87fd 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
@@ -38,6 +38,7 @@ import javax.xml.validation.SchemaFactory;
 
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -47,6 +48,8 @@ import org.w3c.dom.NodeList;
  */
 public class Module extends Node {
   
+  private static final Logger log = Logger.getLogger(Module.class);
+  
   private class Dummy extends Node {
     
     String name;
@@ -339,7 +342,7 @@ public class Module extends Node {
       try {
         timer.join();
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        log.error("Failed to join timer '"+timer.getName()+"'.", e);
       }
     }
     if (runningLong.get())

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java b/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java
index 3abdef8..76a20a0 100644
--- a/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java
+++ b/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java
@@ -20,7 +20,6 @@ import java.nio.charset.StandardCharsets;
 import java.util.Random;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
-
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
@@ -29,9 +28,12 @@ import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.test.continuous.ContinuousIngest;
+import org.apache.log4j.Logger;
 
 public class Ingest extends ScaleTest {
   
+  private static final Logger log = Logger.getLogger(Ingest.class);
+  
   @Override
   public void setup() {
     
@@ -44,8 +46,7 @@ public class Ingest extends ScaleTest {
       try {
         conn.tableOperations().delete(tableName);
       } catch (Exception e) {
-        System.out.println("Failed to delete table: " + tableName);
-        e.printStackTrace();
+        log.error("Failed to delete table '"+tableName+"'.", e);
       }
     }
     
@@ -55,8 +56,7 @@ public class Ingest extends ScaleTest {
       conn.tableOperations().addSplits(tableName, calculateSplits());
       conn.tableOperations().setProperty(tableName, "table.split.threshold", "256M");
     } catch (Exception e) {
-      System.out.println("Failed to create table: " + tableName);
-      e.printStackTrace();
+      log.error("Failed to create table '"+tableName+"'.", e);
     }
     
   }
@@ -78,8 +78,7 @@ public class Ingest extends ScaleTest {
       bw = conn.createBatchWriter(tableName, new BatchWriterConfig().setMaxMemory(maxMemory).setMaxLatency(maxLatency, TimeUnit.MILLISECONDS)
           .setMaxWriteThreads(maxWriteThreads));
     } catch (TableNotFoundException e) {
-      System.out.println("Table not found: " + tableName);
-      e.printStackTrace();
+      log.error("Table '"+tableName+"' not found.", e);
     }
     
     // configure writing
@@ -107,7 +106,7 @@ public class Ingest extends ScaleTest {
       try {
         bw.addMutation(m);
       } catch (MutationsRejectedException e) {
-        e.printStackTrace();
+        log.error("Mutations rejected.", e);
         System.exit(-1);
       }
     }
@@ -116,7 +115,7 @@ public class Ingest extends ScaleTest {
     try {
       bw.close();
     } catch (MutationsRejectedException e) {
-      e.printStackTrace();
+      log.error("Could not close BatchWriter due to mutations being rejected.", e);
       System.exit(-1);
     }
     
@@ -133,8 +132,7 @@ public class Ingest extends ScaleTest {
     try {
       conn.tableOperations().delete(tableName);
     } catch (Exception e) {
-      System.out.println("Failed to delete table: " + tableName);
-      e.printStackTrace();
+      log.error("Failed to delete table '"+tableName+"'", e);
     }
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/scalability/Run.java b/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
index 8c3e371..015f33b 100644
--- a/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
+++ b/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
@@ -16,20 +16,21 @@
  */
 package org.apache.accumulo.test.scalability;
 
+import com.beust.jcommander.Parameter;
 import java.io.FileInputStream;
-import java.util.Properties;
 import java.net.InetAddress;
-
+import java.util.Properties;
 import org.apache.accumulo.core.cli.Help;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-
-import com.beust.jcommander.Parameter;
+import org.apache.log4j.Logger;
 
 public class Run {
   
+  private static final Logger log = Logger.getLogger(Run.class);
+  
   static class Opts extends Help {
     @Parameter(names="--testId", required=true)
     String testId;
@@ -63,8 +64,7 @@ public class Run {
       fis = new FileInputStream(testPath);
       testProps.load(fis);
     } catch (Exception e) {
-      System.out.println("Problem loading config file");
-      e.printStackTrace();
+      log.error("Error loading config file.", e);
     }
     
     ScaleTest test = (ScaleTest) Class.forName(String.format("org.apache.accumulo.test.scalability.%s", opts.testId)).newInstance();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
index 15c1fd3..1ec1a11 100644
--- a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
@@ -917,7 +917,7 @@ public class ConditionalWriterIT extends SimpleMacIT {
         }
 
       } catch (Exception e) {
-        e.printStackTrace();
+        log.error(e);
         failed.set(true);
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7efff513/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java b/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
index f04f196..f2abd30 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
@@ -208,7 +208,7 @@ public class GarbageCollectorIT extends ConfigurableMacIT {
         try {
           output = FunctionalTestUtils.readAll(cluster, SimpleGarbageCollector.class, gc);
         } catch (IOException ioe) {
-          ioe.printStackTrace();
+          log.error("Could not read all from cluster.", ioe);
         }
       }
     } finally {


Mime
View raw message