accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [12/48] ACCUMULO-2292 Massive amount of fixes for findbugs warnings.
Date Tue, 04 Feb 2014 17:54:41 GMT
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/Master.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/Master.java b/server/src/main/java/org/apache/accumulo/server/master/Master.java
index 396c219..ccb8622 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/Master.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/Master.java
@@ -286,7 +286,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
         
         for (String id : Tables.getIdToNameMap(instance).keySet()) {
           
-          zoo.putPersistentData(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + id + Constants.ZTABLE_COMPACT_CANCEL_ID, "0".getBytes(),
+          zoo.putPersistentData(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + id + Constants.ZTABLE_COMPACT_CANCEL_ID, "0".getBytes(Constants.UTF8),
               NodeExistsPolicy.SKIP);
         }
       } catch (Exception ex) {
@@ -499,9 +499,9 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
         fid = zoo.mutate(zTablePath, null, null, new Mutator() {
           @Override
           public byte[] mutate(byte[] currentValue) throws Exception {
-            long flushID = Long.parseLong(new String(currentValue));
+            long flushID = Long.parseLong(new String(currentValue, Constants.UTF8));
             flushID++;
-            return ("" + flushID).getBytes();
+            return Long.toString(flushID).getBytes(Constants.UTF8);
           }
         });
       } catch (NoNodeException nne) {
@@ -510,7 +510,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
         log.warn(e.getMessage(), e);
         throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.OTHER, null);
       }
-      return Long.parseLong(new String(fid));
+      return Long.parseLong(new String(fid, Constants.UTF8));
     }
     
     @Override
@@ -1110,7 +1110,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
   
   private void setMasterGoalState(MasterGoalState state) {
     try {
-      ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(instance) + Constants.ZMASTER_GOAL_STATE, state.name().getBytes(),
+      ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(instance) + Constants.ZMASTER_GOAL_STATE, state.name().getBytes(Constants.UTF8),
           NodeExistsPolicy.OVERWRITE);
     } catch (Exception ex) {
       log.error("Unable to set master goal state in zookeeper");
@@ -1121,7 +1121,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
     while (true)
       try {
         byte[] data = ZooReaderWriter.getInstance().getData(ZooUtil.getRoot(instance) + Constants.ZMASTER_GOAL_STATE, null);
-        return MasterGoalState.valueOf(new String(data));
+        return MasterGoalState.valueOf(new String(data, Constants.UTF8));
       } catch (Exception e) {
         log.error("Problem getting real goal state: " + e);
         UtilWaitThread.sleep(1000);
@@ -1742,7 +1742,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
         }
         
         if (maxLogicalTime != null)
-          Constants.METADATA_TIME_COLUMN.put(m, new Value(maxLogicalTime.getBytes()));
+          Constants.METADATA_TIME_COLUMN.put(m, new Value(maxLogicalTime.getBytes(Constants.UTF8)));
         
         if (!m.getUpdates().isEmpty()) {
           bw.addMutation(m);
@@ -2176,7 +2176,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
     InetSocketAddress sock = org.apache.accumulo.core.util.AddressUtil.parseAddress(hostname, serverPort.port);
     String address = org.apache.accumulo.core.util.AddressUtil.toString(sock);
     log.info("Setting master lock data to " + address);
-    masterLock.replaceLockData(address.getBytes());
+    masterLock.replaceLockData(address.getBytes(Constants.UTF8));
     
     while (!clientService.isServing()) {
       UtilWaitThread.sleep(100);
@@ -2267,7 +2267,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
       
       MasterLockWatcher masterLockWatcher = new MasterLockWatcher();
       masterLock = new ZooLock(zMasterLoc);
-      masterLock.lockAsync(masterLockWatcher, masterClientAddress.getBytes());
+      masterLock.lockAsync(masterLockWatcher, masterClientAddress.getBytes(Constants.UTF8));
 
       masterLockWatcher.waitForChange();
       

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java b/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
index d6e9717..78e2e5b 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoveryManager.java
@@ -110,7 +110,7 @@ public class RecoveryManager {
   
   private void initiateSort(String host, final String file) throws KeeperException, InterruptedException {
     String source = getSource(host, file).toString();
-    new DistributedWorkQueue(ZooUtil.getRoot(master.getInstance()) + Constants.ZRECOVERY).addWork(file, source.getBytes());
+    new DistributedWorkQueue(ZooUtil.getRoot(master.getInstance()) + Constants.ZRECOVERY).addWork(file, source.getBytes(Constants.UTF8));
     
     synchronized (this) {
       sortsQueued.add(file);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java b/server/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
index b2ea7d6..72fe94b 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/DeadServerList.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.server.master.state;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.master.thrift.DeadServer;
 import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
 import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
@@ -50,7 +51,7 @@ public class DeadServerList {
         for (String child : children) {
           Stat stat = new Stat();
           byte[] data = zoo.getData(path + "/" + child, stat);
-          DeadServer server = new DeadServer(child, stat.getMtime(), new String(data));
+          DeadServer server = new DeadServer(child, stat.getMtime(), new String(data, Constants.UTF8));
           result.add(server);
         }
       }
@@ -72,7 +73,7 @@ public class DeadServerList {
   public void post(String server, String cause) {
     IZooReaderWriter zoo = ZooReaderWriter.getInstance();
     try {
-      zoo.putPersistentData(path + "/" + server, cause.getBytes(), NodeExistsPolicy.SKIP);
+      zoo.putPersistentData(path + "/" + server, cause.getBytes(Constants.UTF8), NodeExistsPolicy.SKIP);
     } catch (Exception ex) {
       log.error(ex, ex);
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java b/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
index 7984a83..e11ba69 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
@@ -243,9 +243,9 @@ public class MergeStats {
     
     Connector conn = opts.getConnector();
     Map<String,String> tableIdMap = conn.tableOperations().tableIdMap();
-    for (String table : tableIdMap.keySet()) {
-      String tableId = tableIdMap.get(table);
-      String path = ZooUtil.getRoot(conn.getInstance().getInstanceID()) + Constants.ZTABLES + "/" + tableId.toString() + "/merge";
+    for (Entry<String,String> entry : tableIdMap.entrySet()) {
+      final String table = entry.getKey(), tableId = entry.getValue();
+      String path = ZooUtil.getRoot(conn.getInstance().getInstanceID()) + Constants.ZTABLES + "/" + tableId + "/merge";
       MergeInfo info = new MergeInfo();
       if (ZooReaderWriter.getInstance().exists(path)) {
         byte[] data = ZooReaderWriter.getInstance().getData(path, new Stat());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java b/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
index 1bddb4b..4ef16bf 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
@@ -91,7 +91,7 @@ public class MetaDataTableScanner implements Iterator<TabletLocationState> {
     }
   }
   
-  public void finalize() {
+  protected void finalize() {
     close();
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java b/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java
index 816d8f9..cafe62b 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java
@@ -43,7 +43,7 @@ public class SetGoalState {
 
     FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), ServerConfiguration.getSiteConfiguration());
     Accumulo.waitForZookeeperAndHdfs(fs);
-    ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(),
+    ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(Constants.UTF8),
         NodeExistsPolicy.OVERWRITE);
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java b/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
index d829144..fedfd76 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
@@ -54,7 +54,7 @@ public class TServerInstance implements Comparable<TServerInstance>, Serializabl
   }
   
   public TServerInstance(Value address, Text session) {
-    this(AddressUtil.parseAddress(new String(address.get()), Property.TSERV_CLIENTPORT), session.toString());
+    this(AddressUtil.parseAddress(new String(address.get(), Constants.UTF8), Property.TSERV_CLIENTPORT), session.toString());
   }
   
   public void putLocation(Mutation m) {
@@ -115,7 +115,7 @@ public class TServerInstance implements Comparable<TServerInstance>, Serializabl
   }
   
   public Value asMutationValue() {
-    return new Value(org.apache.accumulo.core.util.AddressUtil.toString(getLocation()).getBytes());
+    return new Value(org.apache.accumulo.core.util.AddressUtil.toString(getLocation()).getBytes(Constants.UTF8));
   }
   
   public InetSocketAddress getLocation() {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java b/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
index 6e1096d..71bddad 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Key;
@@ -94,7 +95,7 @@ public class TabletStateChangeIterator extends SkippingIterator {
     try {
       Map<Text,MergeInfo> result = new HashMap<Text,MergeInfo>();
       DataInputBuffer buffer = new DataInputBuffer();
-      byte[] data = Base64.decodeBase64(merges.getBytes());
+      byte[] data = Base64.decodeBase64(merges.getBytes(Constants.UTF8));
       buffer.reset(data, data.length);
       while (buffer.available() > 0) {
         MergeInfo mergeInfo = new MergeInfo();
@@ -182,7 +183,7 @@ public class TabletStateChangeIterator extends SkippingIterator {
     } catch (Exception ex) {
       throw new RuntimeException(ex);
     }
-    String encoded = new String(Base64.encodeBase64(Arrays.copyOf(buffer.getData(), buffer.getLength())));
+    String encoded = new String(Base64.encodeBase64(Arrays.copyOf(buffer.getData(), buffer.getLength())), Constants.UTF8);
     cfg.addOption(MERGES_OPTION, encoded);
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/ZooStore.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/ZooStore.java b/server/src/main/java/org/apache/accumulo/server/master/state/ZooStore.java
index bce6681..b0ed03f 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/ZooStore.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/ZooStore.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.server.master.state;
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
 import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
@@ -74,7 +75,7 @@ public class ZooStore implements DistributedStore {
       path = relative(path);
       ZooReaderWriter.getInstance().putPersistentData(path, bs, NodeExistsPolicy.OVERWRITE);
       cache.clear();
-      log.debug("Wrote " + new String(bs) + " to " + path);
+      log.debug("Wrote " + new String(bs, Constants.UTF8) + " to " + path);
     } catch (Exception ex) {
       throw new DistributedStoreException(ex);
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java b/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java
index 496caa8..486c664 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java
@@ -104,7 +104,7 @@ public class ZooTabletStateStore extends TabletStateStore {
   }
   
   protected TServerInstance parse(byte[] current) {
-    String str = new String(current);
+    String str = new String(current, Constants.UTF8);
     String[] parts = str.split("[|]", 2);
     InetSocketAddress address = AddressUtil.parseAddress(parts[0], 0);
     if (parts.length > 1 && parts[1] != null && parts[1].length() > 0) {
@@ -128,7 +128,7 @@ public class ZooTabletStateStore extends TabletStateStore {
     if (current.current != null) {
       throw new IllegalDSException("Trying to set the root tablet location: it is already set to " + current.current);
     }
-    store.put(Constants.ZROOT_TABLET_FUTURE_LOCATION, value.getBytes());
+    store.put(Constants.ZROOT_TABLET_FUTURE_LOCATION, value.getBytes(Constants.UTF8));
   }
   
   @Override
@@ -147,8 +147,8 @@ public class ZooTabletStateStore extends TabletStateStore {
     if (!current.future.equals(assignment.server)) {
       throw new IllegalDSException("Root tablet is already assigned to " + current.future);
     }
-    store.put(Constants.ZROOT_TABLET_LOCATION, value.getBytes());
-    store.put(Constants.ZROOT_TABLET_LAST_LOCATION, value.getBytes());
+    store.put(Constants.ZROOT_TABLET_LOCATION, value.getBytes(Constants.UTF8));
+    store.put(Constants.ZROOT_TABLET_LAST_LOCATION, value.getBytes(Constants.UTF8));
     // Make the following unnecessary by making the entire update atomic 
     store.remove(Constants.ZROOT_TABLET_FUTURE_LOCATION);
     log.debug("Put down root tablet location");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java b/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java
index fedbc96..574959e 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java
@@ -49,6 +49,8 @@ public class TableManager {
   private static final Set<TableObserver> observers = Collections.synchronizedSet(new HashSet<TableObserver>());
   private static final Map<String,TableState> tableStateCache = Collections.synchronizedMap(new HashMap<String,TableState>());
   
+  private static final byte[] ZERO_BYTE = "0".getBytes(Constants.UTF8); 
+  
   private static TableManager tableManager = null;
   
   private final Instance instance;
@@ -61,11 +63,11 @@ public class TableManager {
     IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
     zoo.putPersistentData(zTablePath, new byte[0], existsPolicy);
     zoo.putPersistentData(zTablePath + Constants.ZTABLE_CONF, new byte[0], existsPolicy);
-    zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAME, tableName.getBytes(), existsPolicy);
-    zoo.putPersistentData(zTablePath + Constants.ZTABLE_STATE, state.name().getBytes(), existsPolicy);
-    zoo.putPersistentData(zTablePath + Constants.ZTABLE_FLUSH_ID, "0".getBytes(), existsPolicy);
-    zoo.putPersistentData(zTablePath + Constants.ZTABLE_COMPACT_ID, "0".getBytes(), existsPolicy);
-    zoo.putPersistentData(zTablePath + Constants.ZTABLE_COMPACT_CANCEL_ID, "0".getBytes(), existsPolicy);
+    zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAME, tableName.getBytes(Constants.UTF8), existsPolicy);
+    zoo.putPersistentData(zTablePath + Constants.ZTABLE_STATE, state.name().getBytes(Constants.UTF8), existsPolicy);
+    zoo.putPersistentData(zTablePath + Constants.ZTABLE_FLUSH_ID, ZERO_BYTE, existsPolicy);
+    zoo.putPersistentData(zTablePath + Constants.ZTABLE_COMPACT_ID, ZERO_BYTE, existsPolicy);
+    zoo.putPersistentData(zTablePath + Constants.ZTABLE_COMPACT_CANCEL_ID, ZERO_BYTE, existsPolicy);
   }
   
   public synchronized static TableManager getInstance() {
@@ -113,12 +115,12 @@ public class TableManager {
     String statePath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE;
     
     try {
-      ZooReaderWriter.getRetryingInstance().mutate(statePath, (byte[]) newState.name().getBytes(), ZooUtil.PUBLIC, new Mutator() {
+      ZooReaderWriter.getRetryingInstance().mutate(statePath, (byte[]) newState.name().getBytes(Constants.UTF8), ZooUtil.PUBLIC, new Mutator() {
         @Override
         public byte[] mutate(byte[] oldData) throws Exception {
           TableState oldState = TableState.UNKNOWN;
           if (oldData != null)
-            oldState = TableState.valueOf(new String(oldData));
+            oldState = TableState.valueOf(new String(oldData, Constants.UTF8));
           boolean transition = true;
           // +--------+
           // v |
@@ -140,7 +142,7 @@ public class TableManager {
           if (!transition)
             throw new IllegalTableTransitionException(oldState, newState);
           log.debug("Transitioning state for table " + tableId + " from " + oldState + " to " + newState);
-          return newState.name().getBytes();
+          return newState.name().getBytes(Constants.UTF8);
         }
       });
     } catch (Exception e) {
@@ -162,7 +164,7 @@ public class TableManager {
       TableState tState = TableState.UNKNOWN;
       byte[] data = zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE);
       if (data != null) {
-        String sState = new String(data);
+        String sState = new String(data, Constants.UTF8);
         try {
           tState = TableState.valueOf(sState);
         } catch (IllegalArgumentException e) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
index 27f4202..5e85277 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
@@ -378,7 +378,7 @@ class CopyFailed extends MasterRepo {
     HashMap<String,String> loadedFailures = new HashMap<String,String>();
     
     FSDataInputStream failFile = fs.open(new Path(error, BulkImport.FAILURES_TXT));
-    BufferedReader in = new BufferedReader(new InputStreamReader(failFile));
+    BufferedReader in = new BufferedReader(new InputStreamReader(failFile, Constants.UTF8));
     try {
       String line = null;
       while ((line = in.readLine()) != null) {
@@ -432,7 +432,7 @@ class CopyFailed extends MasterRepo {
         if (fs.exists(dest))
           continue;
         
-        bifCopyQueue.addWork(orig.getName(), (failure + "," + dest).getBytes());
+        bifCopyQueue.addWork(orig.getName(), (failure + "," + dest).getBytes(Constants.UTF8));
         workIds.add(orig.getName());
         log.debug("tid " + tid + " added to copyq: " + orig + " to " + dest + ": failed");
       }
@@ -567,7 +567,7 @@ class LoadFiles extends MasterRepo {
     }
     
     FSDataOutputStream failFile = fs.create(new Path(errorDir, BulkImport.FAILURES_TXT), true);
-    BufferedWriter out = new BufferedWriter(new OutputStreamWriter(failFile));
+    BufferedWriter out = new BufferedWriter(new OutputStreamWriter(failFile, Constants.UTF8));
     try {
       for (String f : filesToLoad) {
         out.write(f);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/tableOps/CancelCompactions.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/CancelCompactions.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/CancelCompactions.java
index efddc79..e67cfe3 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/CancelCompactions.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/CancelCompactions.java
@@ -72,19 +72,19 @@ public class CancelCompactions extends MasterRepo {
     
     byte[] currentValue = zoo.getData(zCompactID, null);
     
-    String cvs = new String(currentValue);
+    String cvs = new String(currentValue, Constants.UTF8);
     String[] tokens = cvs.split(",");
-    final long flushID = Long.parseLong(new String(tokens[0]));
+    final long flushID = Long.parseLong(tokens[0]);
     
     zoo.mutate(zCancelID, null, null, new Mutator() {
       @Override
       public byte[] mutate(byte[] currentValue) throws Exception {
-        long cid = Long.parseLong(new String(currentValue));
+        long cid = Long.parseLong(new String(currentValue, Constants.UTF8));
         
         if (cid < flushID)
-          return (flushID + "").getBytes();
+          return Long.toString(flushID).getBytes(Constants.UTF8);
         else
-          return (cid + "").getBytes();
+          return Long.toString(cid).getBytes(Constants.UTF8);
 
       }
     });

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
index 36a0c5e..4bca64a 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
@@ -307,9 +307,9 @@ public class CompactRange extends MasterRepo {
       cid = zoo.mutate(zTablePath, null, null, new Mutator() {
         @Override
         public byte[] mutate(byte[] currentValue) throws Exception {
-          String cvs = new String(currentValue);
+          String cvs = new String(currentValue, Constants.UTF8);
           String[] tokens = cvs.split(",");
-          long flushID = Long.parseLong(new String(tokens[0]));
+          long flushID = Long.parseLong(tokens[0]);
           flushID++;
           
           String txidString = String.format("%016x", tid);
@@ -329,14 +329,14 @@ public class CompactRange extends MasterRepo {
             encodedIterators.append(",");
             encodedIterators.append(txidString);
             encodedIterators.append("=");
-            encodedIterators.append(new String(hex.encode(iterators)));
+            encodedIterators.append(new String(hex.encode(iterators), Constants.UTF8));
           }
           
-          return ("" + flushID + encodedIterators).getBytes();
+          return (Long.toString(flushID) + encodedIterators).getBytes(Constants.UTF8);
         }
       });
       
-      return new CompactionDriver(Long.parseLong(new String(cid).split(",")[0]), tableId, startRow, endRow);
+      return new CompactionDriver(Long.parseLong(new String(cid, Constants.UTF8).split(",")[0]), tableId, startRow, endRow);
     } catch (NoNodeException nne) {
       throw new ThriftTableOperationException(tableId, null, TableOperation.COMPACT, TableOperationExceptionType.NOTFOUND, null);
     }
@@ -351,9 +351,9 @@ public class CompactRange extends MasterRepo {
     zoo.mutate(zTablePath, null, null, new Mutator() {
       @Override
       public byte[] mutate(byte[] currentValue) throws Exception {
-        String cvs = new String(currentValue);
+        String cvs = new String(currentValue, Constants.UTF8);
         String[] tokens = cvs.split(",");
-        long flushID = Long.parseLong(new String(tokens[0]));
+        long flushID = Long.parseLong(tokens[0]);
 
         String txidString = String.format("%016x", txid);
         
@@ -365,7 +365,7 @@ public class CompactRange extends MasterRepo {
           encodedIterators.append(tokens[i]);
         }
         
-        return ("" + flushID + encodedIterators).getBytes();
+        return (Long.toString(flushID) + encodedIterators).getBytes(Constants.UTF8);
       }
     });
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/tableOps/ExportTable.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/ExportTable.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/ExportTable.java
index 6a3ebc5..b7e250b 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/ExportTable.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/ExportTable.java
@@ -153,7 +153,7 @@ class WriteExportFiles extends MasterRepo {
     try {
       
       zipOut.putNextEntry(new ZipEntry(Constants.EXPORT_INFO_FILE));
-      OutputStreamWriter osw = new OutputStreamWriter(dataOut);
+      OutputStreamWriter osw = new OutputStreamWriter(dataOut, Constants.UTF8);
       osw.append(ExportTable.EXPORT_VERSION_PROP + ":" + ExportTable.VERSION + "\n");
       osw.append("srcInstanceName:" + conn.getInstance().getInstanceName() + "\n");
       osw.append("srcInstanceID:" + conn.getInstance().getInstanceID() + "\n");
@@ -183,7 +183,7 @@ class WriteExportFiles extends MasterRepo {
   }
   
   private static void createDistcpFile(FileSystem fs, String exportDir, Path exportMetaFilePath, Map<String,String> uniqueFiles) throws IOException {
-    BufferedWriter distcpOut = new BufferedWriter(new OutputStreamWriter(fs.create(new Path(exportDir, "distcp.txt"), false)));
+    BufferedWriter distcpOut = new BufferedWriter(new OutputStreamWriter(fs.create(new Path(exportDir, "distcp.txt"), false), Constants.UTF8));
     
     try {
       URI uri = fs.getUri();
@@ -264,7 +264,7 @@ class WriteExportFiles extends MasterRepo {
     
     TableConfiguration tableConfig = ServerConfiguration.getTableConfiguration(conn.getInstance(), tableID);
     
-    OutputStreamWriter osw = new OutputStreamWriter(dataOut);
+    OutputStreamWriter osw = new OutputStreamWriter(dataOut, Constants.UTF8);
     
     // only put props that are different than defaults and higher level configurations
     zipOut.putNextEntry(new ZipEntry(Constants.EXPORT_TABLE_CONFIG_FILE));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
index b54e543..9f01734 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
@@ -176,7 +176,7 @@ class PopulateMetadataTable extends MasterRepo {
   }
   
   static Map<String,String> readMappingFile(FileSystem fs, ImportedTableInfo tableInfo) throws Exception {
-    BufferedReader in = new BufferedReader(new InputStreamReader(fs.open(new Path(tableInfo.importDir, "mappings.txt"))));
+    BufferedReader in = new BufferedReader(new InputStreamReader(fs.open(new Path(tableInfo.importDir, "mappings.txt")), Constants.UTF8));
     
     try {
       Map<String,String> map = new HashMap<String,String>();
@@ -250,14 +250,14 @@ class PopulateMetadataTable extends MasterRepo {
             
             if (m == null) {
               m = new Mutation(metadataRow);
-              Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes())));
+              Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes(Constants.UTF8))));
               currentRow = metadataRow;
             }
             
             if (!currentRow.equals(metadataRow)) {
               mbw.addMutation(m);
               m = new Mutation(metadataRow);
-              Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes())));
+              Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes(Constants.UTF8))));
             }
             
             m.put(key.getColumnFamily(), cq, val);
@@ -324,7 +324,7 @@ class MapImportFileNames extends MasterRepo {
       
       UniqueNameAllocator namer = UniqueNameAllocator.getInstance();
       
-      mappingsWriter = new BufferedWriter(new OutputStreamWriter(fs.create(path)));
+      mappingsWriter = new BufferedWriter(new OutputStreamWriter(fs.create(path), Constants.UTF8));
       
       for (FileStatus fileStatus : files) {
         String fileName = fileStatus.getPath().getName();
@@ -553,7 +553,7 @@ public class ImportTable extends MasterRepo {
       ZipEntry zipEntry;
       while ((zipEntry = zis.getNextEntry()) != null) {
         if (zipEntry.getName().equals(Constants.EXPORT_INFO_FILE)) {
-          BufferedReader in = new BufferedReader(new InputStreamReader(zis));
+          BufferedReader in = new BufferedReader(new InputStreamReader(zis, Constants.UTF8));
           String line = null;
           while ((line = in.readLine()) != null) {
             String sa[] = line.split(":", 2);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java
index 0ca29cd..b38e841 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java
@@ -62,14 +62,14 @@ public class RenameTable extends MasterRepo {
       
       zoo.mutate(tap, null, null, new Mutator() {
         public byte[] mutate(byte[] current) throws Exception {
-          final String currentName = new String(current);
+          final String currentName = new String(current, Constants.UTF8);
           if (currentName.equals(newTableName))
             return null; // assume in this case the operation is running again, so we are done
           if (!currentName.equals(oldTableName)) {
             throw new ThriftTableOperationException(null, oldTableName, TableOperation.RENAME, TableOperationExceptionType.NOTFOUND,
                 "Name changed while processing");
           }
-          return newTableName.getBytes();
+          return newTableName.getBytes(Constants.UTF8);
         }
       });
       Tables.clearCache(instance);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java
index d467119..bb2a222 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java
@@ -39,6 +39,7 @@ import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
 
 public class Utils {
+  private static final byte[] ZERO_BYTE = "0".getBytes(Constants.UTF8);
   
   static void checkTableDoesNotExist(Instance instance, String tableName, String tableId, TableOperation operation) throws ThriftTableOperationException {
     
@@ -54,15 +55,15 @@ public class Utils {
     try {
       IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
       final String ntp = ZooUtil.getRoot(instance) + Constants.ZTABLES;
-      byte[] nid = zoo.mutate(ntp, "0".getBytes(), ZooUtil.PUBLIC, new Mutator() {
+      byte[] nid = zoo.mutate(ntp, ZERO_BYTE, ZooUtil.PUBLIC, new Mutator() {
         @Override
         public byte[] mutate(byte[] currentValue) throws Exception {
-          BigInteger nextId = new BigInteger(new String(currentValue), Character.MAX_RADIX);
+          BigInteger nextId = new BigInteger(new String(currentValue, Constants.UTF8), Character.MAX_RADIX);
           nextId = nextId.add(BigInteger.ONE);
-          return nextId.toString(Character.MAX_RADIX).getBytes();
+          return nextId.toString(Character.MAX_RADIX).getBytes(Constants.UTF8);
         }
       });
-      return new String(nid);
+      return new String(nid, Constants.UTF8);
     } catch (Exception e1) {
       Logger.getLogger(CreateTable.class).error("Failed to assign tableId to " + tableName, e1);
       throw new ThriftTableOperationException(tableId, tableName, TableOperation.CREATE, TableOperationExceptionType.OTHER, e1.getMessage());
@@ -94,9 +95,10 @@ public class Utils {
   
   public static long reserveHdfsDirectory(String directory, long tid) throws KeeperException, InterruptedException {
     Instance instance = HdfsZooInstance.getInstance();
-    
-    String resvPath = ZooUtil.getRoot(instance) + Constants.ZHDFS_RESERVATIONS + "/" + new String(Base64.encodeBase64(directory.getBytes()));
-    
+
+    String resvPath = ZooUtil.getRoot(instance) + Constants.ZHDFS_RESERVATIONS + "/"
+        + new String(Base64.encodeBase64(directory.getBytes(Constants.UTF8)), Constants.UTF8);
+
     IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance();
     
     if (ZooReservation.attempt(zk, resvPath, String.format("%016x", tid), "")) {
@@ -107,12 +109,13 @@ public class Utils {
   
   public static void unreserveHdfsDirectory(String directory, long tid) throws KeeperException, InterruptedException {
     Instance instance = HdfsZooInstance.getInstance();
-    String resvPath = ZooUtil.getRoot(instance) + Constants.ZHDFS_RESERVATIONS + "/" + new String(Base64.encodeBase64(directory.getBytes()));
+    String resvPath = ZooUtil.getRoot(instance) + Constants.ZHDFS_RESERVATIONS + "/"
+        + new String(Base64.encodeBase64(directory.getBytes(Constants.UTF8)), Constants.UTF8);
     ZooReservation.release(ZooReaderWriter.getRetryingInstance(), resvPath, String.format("%016x", tid));
   }
   
   private static Lock getLock(String tableId, long tid, boolean writeLock) throws Exception {
-    byte[] lockData = String.format("%016x", tid).getBytes();
+    byte[] lockData = String.format("%016x", tid).getBytes(Constants.UTF8);
     ZooQueueLock qlock = new ZooQueueLock(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLE_LOCKS + "/" + tableId, false);
     Lock lock = DistributedReadWriteLock.recoverLock(qlock, lockData);
     if (lock == null) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java b/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java
index d411ac4..4e5f273 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java
@@ -59,7 +59,7 @@ public class ShutdownTServer extends MasterRepo {
       ZooLock.deleteLock(path);
       path = ZooUtil.getRoot(master.getInstance()) + Constants.ZDEADTSERVERS + "/" + tserver;
       IZooReaderWriter zoo = ZooReaderWriter.getInstance();
-      zoo.putPersistentData(path, "forced down".getBytes(), NodeExistsPolicy.OVERWRITE);
+      zoo.putPersistentData(path, "forced down".getBytes(Constants.UTF8), NodeExistsPolicy.OVERWRITE);
       return null;
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java b/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java
index 68a364a..de781fc 100644
--- a/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java
+++ b/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java
@@ -104,14 +104,14 @@ public class IndexMeta extends Configured implements Tool {
       
       if (prevRow != null) {
         Mutation createEvent = new Mutation(new Text(m.getRow()));
-        createEvent.put(prevRow, new Text(String.format("%020d", timestamp)), new Value(metaTablet.toString().getBytes()));
+        createEvent.put(prevRow, new Text(String.format("%020d", timestamp)), new Value(metaTablet.toString().getBytes(Constants.UTF8)));
         context.write(CREATE_EVENTS_TABLE, createEvent);
       }
       
       Mutation tabletEvent = new Mutation(new Text(m.getRow()));
       tabletEvent.put(new Text(String.format("%020d", timestamp)), new Text("mut"), new Value(serMut));
-      tabletEvent.put(new Text(String.format("%020d", timestamp)), new Text("mtab"), new Value(metaTablet.toString().getBytes()));
-      tabletEvent.put(new Text(String.format("%020d", timestamp)), new Text("log"), new Value(logFile.getBytes()));
+      tabletEvent.put(new Text(String.format("%020d", timestamp)), new Text("mtab"), new Value(metaTablet.toString().getBytes(Constants.UTF8)));
+      tabletEvent.put(new Text(String.format("%020d", timestamp)), new Text("log"), new Value(logFile.getBytes(Constants.UTF8)));
       context.write(TABLET_EVENTS_TABLE, tabletEvent);
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java b/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
index a047507..5a8ddec 100644
--- a/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
+++ b/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
@@ -17,8 +17,10 @@
 package org.apache.accumulo.server.metrics;
 
 import java.io.File;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
 import java.lang.management.ManagementFactory;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -28,6 +30,7 @@ import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.management.StandardMBean;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.commons.lang.builder.ToStringBuilder;
 import org.apache.commons.lang.time.DateUtils;
 
@@ -99,7 +102,7 @@ public abstract class AbstractMetricsImpl {
   
   private File logFile = null;
   
-  private FileWriter logWriter = null;
+  private Writer logWriter = null;
   
   private SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
   
@@ -176,7 +179,8 @@ public abstract class AbstractMetricsImpl {
       if (null != mDir) {
         File dir = new File(mDir);
         if (!dir.isDirectory())
-          dir.mkdir();
+          if (!dir.mkdir()) 
+            log.warn("Could not create log directory: " + dir);
         logDir = dir;
         // Create new log file
         startNewLog();
@@ -198,7 +202,7 @@ public abstract class AbstractMetricsImpl {
         return;
       }
     }
-    logWriter = new FileWriter(logFile, true);
+    logWriter = new OutputStreamWriter(new FileOutputStream(logFile, true), Constants.UTF8);
   }
   
   private void writeToLog(String name) throws IOException {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java b/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java
index ce5dab8..10ef9e4 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/LogService.java
@@ -82,7 +82,7 @@ public class LogService extends org.apache.log4j.AppenderSkeleton {
     try {
       SocketServer server = new SocketServer(conf.getPort(Property.MONITOR_LOG4J_PORT));
       ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(instanceId) + Constants.ZMONITOR_LOG4J_PORT,
-          Integer.toString(server.getLocalPort()).getBytes(), NodeExistsPolicy.OVERWRITE);
+          Integer.toString(server.getLocalPort()).getBytes(Constants.UTF8), NodeExistsPolicy.OVERWRITE);
       new Daemon(server).start();
     } catch (Throwable t) {
       log.info("Unable to listen to cluster-wide ports", t);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java b/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
index 3836916..dcb80fd 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
@@ -424,7 +424,7 @@ public class Monitor {
       List<String> locks = zk.getChildren(path, null);
       if (locks != null && locks.size() > 0) {
         Collections.sort(locks);
-        address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0), null))).getAddress(Service.GC_CLIENT);
+        address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0), null), Constants.UTF8)).getAddress(Service.GC_CLIENT);
         GCMonitorService.Client client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, config.getConfiguration());
         try {
           result = client.getStatus(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
@@ -489,7 +489,7 @@ public class Monitor {
       log.debug("Using " + hostname + " to advertise monitor location in ZooKeeper");
       
       String monitorAddress = org.apache.accumulo.core.util.AddressUtil.toString(new InetSocketAddress(hostname, server.getPort()));
-      ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(instance) + Constants.ZMONITOR, monitorAddress.getBytes(),
+      ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(instance) + Constants.ZMONITOR, monitorAddress.getBytes(Constants.UTF8),
           NodeExistsPolicy.OVERWRITE);
       log.info("Set monitor address in zookeeper to " + monitorAddress);
     } catch (Exception ex) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java b/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java
index c3ef3a0..1c84a1c 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.util.TTimeoutTransport;
 import org.apache.accumulo.core.util.UtilWaitThread;
@@ -98,14 +99,14 @@ public class ZooKeeperStatus implements Runnable {
             addr = new InetSocketAddress(parts[0], 2181);
           
           transport = TTimeoutTransport.create(addr, 10 * 1000l);
-          transport.write("stat\n".getBytes(), 0, 5);
+          transport.write("stat\n".getBytes(Constants.UTF8), 0, 5);
           StringBuilder response = new StringBuilder();
           try {
             transport.flush();
             byte[] buffer = new byte[1024 * 100];
             int n = 0;
             while ((n = transport.read(buffer, 0, buffer.length)) > 0) {
-              response.append(new String(buffer, 0, n));
+              response.append(new String(buffer, 0, n, Constants.UTF8));
             }
           } catch (TTransportException ex) {
             // happens at EOF

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
index 0bdd34d..b17868e 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
@@ -39,6 +39,7 @@ import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.file.FileUtil;
 import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
@@ -85,7 +86,7 @@ public class DefaultServlet extends BasicServlet {
           while ((n = data.read(buffer)) > 0)
             out.write(buffer, 0, n);
         } else {
-          out.write(("could not get resource " + path + "").getBytes());
+          out.write(("could not get resource " + path + "").getBytes(Constants.UTF8));
         }
       } finally {
         if (data != null)

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java
index fcb9742..be00aaa 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/LogServlet.java
@@ -68,11 +68,11 @@ public class LogServlet extends BasicServlet {
         }
         
       }
-      msg = text.toString();
+      StringBuilder builder = new StringBuilder(text.toString());
       if (ev.getThrowableStrRep() != null)
         for (String line : ev.getThrowableStrRep())
-          msg += "\n\t" + line;
-      msg = sanitize(msg.trim());
+          builder.append("\n\t").append(line);
+      msg = sanitize(builder.toString().trim());
       msg = "<pre class='logevent'>" + msg + "</pre>";
       logTable.addRow(ev.getTimeStamp(), application, dev.getCount(), ev.getLevel(), msg);
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ShellServlet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ShellServlet.java b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ShellServlet.java
index 07ecc3d..07cf029 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ShellServlet.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/ShellServlet.java
@@ -33,6 +33,7 @@ import javax.servlet.http.HttpSession;
 
 import jline.ConsoleReader;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.util.shell.Shell;
 
 public class ShellServlet extends BasicServlet {
@@ -225,8 +226,8 @@ public class ShellServlet extends BasicServlet {
       this.cmdIndex = 0;
       this.readWait = false;
       this.output = new StringBuilderOutputStream();
-      ConsoleReader reader = new ConsoleReader(this, new OutputStreamWriter(output));
-      this.shell = new Shell(reader, new PrintWriter(output));
+      ConsoleReader reader = new ConsoleReader(this, new OutputStreamWriter(output, Constants.UTF8));
+      this.shell = new Shell(reader, new PrintWriter(new OutputStreamWriter(output, Constants.UTF8)));
       shell.setLogErrorsToConsole();
       if (mock != null) {
         if (shell.config("--fake", "-u", username, "-p", password))

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java
index 095725e..487c61d 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java
@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.accumulo.trace.instrument.Tracer;
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.master.thrift.DeadServer;
 import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
@@ -167,7 +168,7 @@ public class TServersServlet extends BasicServlet {
       if (extent.getEndRow() != null && extent.getEndRow().getLength() > 0) {
         digester.update(extent.getEndRow().getBytes(), 0, extent.getEndRow().getLength());
       }
-      String obscuredExtent = new String(Base64.encodeBase64(digester.digest()));
+      String obscuredExtent = new String(Base64.encodeBase64(digester.digest()), Constants.UTF8);
       String displayExtent = String.format("<code>[%s]</code>", obscuredExtent);
       
       TableRow row = perTabletResults.prepareRow();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
index 74e6f0f..333eaf4 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
@@ -22,6 +22,7 @@ import java.util.Map.Entry;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
@@ -74,7 +75,7 @@ abstract class Basic extends BasicServlet {
     Map<String,String> loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX);
     if (loginMap.isEmpty()) {
       Property p = Property.TRACE_PASSWORD;
-      at = new PasswordToken(conf.get(p).getBytes());
+      at = new PasswordToken(conf.get(p).getBytes(Constants.UTF8));
     } else {
       Properties props = new Properties();
       int prefixLength = Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey().length() + 1;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
index 99a5571..cab2015 100644
--- a/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
+++ b/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/ListType.java
@@ -64,7 +64,7 @@ public class ListType extends Basic {
     for (Entry<Key,Value> entry : scanner) {
       RemoteSpan span = TraceFormatter.getRemoteSpan(entry);
       if (span.description.equals(type)) {
-        trace.addRow(span, new Long(span.stop - span.start), span.svc + ":" + span.sender);
+        trace.addRow(span, Long.valueOf(span.stop - span.start), span.svc + ":" + span.sender);
       }
     }
     trace.generate(req, sb);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java b/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java
index 60d3a68..a857a49 100644
--- a/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java
+++ b/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java
@@ -43,7 +43,7 @@ public class SecurityConstants {
   private static final AuthenticationToken SYSTEM_TOKEN = makeSystemPassword();
   private static final TCredentials systemCredentials = CredentialHelper.createSquelchError(SYSTEM_PRINCIPAL, SYSTEM_TOKEN, HdfsZooInstance.getInstance()
       .getInstanceID());
-  public static byte[] confChecksum = null;
+  static byte[] confChecksum = null;
   
   public static AuthenticationToken getSystemToken() {
     return SYSTEM_TOKEN;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java b/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
index 2c5aa7d..2d70796 100644
--- a/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
+++ b/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
@@ -56,7 +56,7 @@ public class SecurityOperation {
   private final ZooCache zooCache;
   private final String ZKUserPath;
 
-  protected static SecurityOperation instance;
+  static SecurityOperation instance;
 
   public static synchronized SecurityOperation getInstance() {
     String instanceId = HdfsZooInstance.getInstance().getInstanceID();
@@ -133,7 +133,7 @@ public class SecurityOperation {
 
   public synchronized String getRootUsername() {
     if (rootUserName == null)
-      rootUserName = new String(zooCache.get(ZKUserPath));
+      rootUserName = new String(zooCache.get(ZKUserPath), Constants.UTF8);
     return rootUserName;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java b/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java
index 3ea1c88..ebbe0dd 100644
--- a/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java
+++ b/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java
@@ -70,7 +70,7 @@ public final class ZKAuthenticator implements Authenticator {
         }
         
         // prep parent node of users with root username
-        zoo.putPersistentData(ZKUserPath, principal.getBytes(), NodeExistsPolicy.FAIL);
+        zoo.putPersistentData(ZKUserPath, principal.getBytes(Constants.UTF8), NodeExistsPolicy.FAIL);
         
         constructUser(principal, ZKSecurityTool.createPass(token));
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthorizor.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthorizor.java b/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthorizor.java
index 89ed3b2..36bd86a 100644
--- a/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthorizor.java
+++ b/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthorizor.java
@@ -87,7 +87,7 @@ public class ZKAuthorizor implements Authorizor {
     try {
       // prep parent node of users with root username
       if (!zoo.exists(ZKUserPath))
-        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(), NodeExistsPolicy.FAIL);
+        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(Constants.UTF8), NodeExistsPolicy.FAIL);
       
       initUser(rootuser);
       zoo.putPersistentData(ZKUserPath + "/" + rootuser + ZKUserAuths, ZKSecurityTool.convertAuthorizations(Constants.NO_AUTHS), NodeExistsPolicy.FAIL);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/security/handler/ZKPermHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/security/handler/ZKPermHandler.java b/server/src/main/java/org/apache/accumulo/server/security/handler/ZKPermHandler.java
index ff5ab01..4a05658 100644
--- a/server/src/main/java/org/apache/accumulo/server/security/handler/ZKPermHandler.java
+++ b/server/src/main/java/org/apache/accumulo/server/security/handler/ZKPermHandler.java
@@ -49,8 +49,8 @@ public class ZKPermHandler implements PermissionHandler {
   private String ZKUserPath;
   private String ZKTablePath;
   private final ZooCache zooCache;
-  private final String ZKUserSysPerms = "/System";
-  private final String ZKUserTablePerms = "/Tables";
+  private static final String ZKUserSysPerms = "/System";
+  private static final String ZKUserTablePerms = "/Tables";
   
   public static synchronized PermissionHandler getInstance() {
     if (zkPermHandlerInstance == null)
@@ -257,7 +257,7 @@ public class ZKPermHandler implements PermissionHandler {
     try {
       // prep parent node of users with root username
       if (!zoo.exists(ZKUserPath))
-        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(), NodeExistsPolicy.FAIL);
+        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(Constants.UTF8), NodeExistsPolicy.FAIL);
       
       initUser(rootuser);
       zoo.putPersistentData(ZKUserPath + "/" + rootuser + ZKUserSysPerms, ZKSecurityTool.convertSystemPermissions(rootPerms), NodeExistsPolicy.FAIL);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/tabletserver/BulkFailedCopyProcessor.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/BulkFailedCopyProcessor.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/BulkFailedCopyProcessor.java
index c543881..868f6a1 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/BulkFailedCopyProcessor.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/BulkFailedCopyProcessor.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.server.tabletserver;
 
 import java.io.IOException;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.trace.TraceFileSystem;
@@ -42,7 +43,7 @@ public class BulkFailedCopyProcessor implements Processor {
   @Override
   public void process(String workID, byte[] data) {
     
-    String paths[] = new String(data).split(",");
+    String paths[] = new String(data, Constants.UTF8).split(",");
     
     Path orig = new Path(paths[0]);
     Path dest = new Path(paths[1]);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java
index dbf0c3c..4437492 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/Compactor.java
@@ -152,7 +152,7 @@ public class Compactor implements Callable<CompactionStats> {
     entriesWritten.set(0);
   }
 
-  protected static Set<Compactor> runningCompactions = Collections.synchronizedSet(new HashSet<Compactor>());
+  protected static final Set<Compactor> runningCompactions = Collections.synchronizedSet(new HashSet<Compactor>());
   
   public static class CompactionInfo {
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java
index 57f36c3..f914c33 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/InMemoryMap.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.tabletserver;
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -64,8 +65,10 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.log4j.Logger;
 
-class MemKeyComparator implements Comparator<Key> {
+class MemKeyComparator implements Comparator<Key>, Serializable {
   
+  private static final long serialVersionUID = 1L;
+
   @Override
   public int compare(Key k1, Key k2) {
     int cmp = k1.compareTo(k2);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
index 3acf6f1..303449d 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
@@ -732,8 +732,8 @@ public class Tablet {
         computeNumEntries();
       }
       
-      for (Path tpath : paths.keySet()) {
-        log.log(TLevel.TABLET_HIST, extent + " import " + abs2rel(tpath) + " " + paths.get(tpath));
+      for (Entry<Path,DataFileValue> entry : paths.entrySet()) {
+        log.log(TLevel.TABLET_HIST, extent + " import " + abs2rel(entry.getKey()) + " " + entry.getValue());
       }
     }
     
@@ -2415,7 +2415,7 @@ public class Tablet {
     try {
       String zTablePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZTABLES + "/" + extent.getTableId()
           + Constants.ZTABLE_FLUSH_ID;
-      return Long.parseLong(new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null)));
+      return Long.parseLong(new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null), Constants.UTF8));
     } catch (InterruptedException e) {
       throw new RuntimeException(e);
     } catch (NumberFormatException nfe) {
@@ -2434,7 +2434,7 @@ public class Tablet {
         + Constants.ZTABLE_COMPACT_CANCEL_ID;
     
     try {
-      return Long.parseLong(new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null)));
+      return Long.parseLong(new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null), Constants.UTF8));
     } catch (KeeperException e) {
       throw new RuntimeException(e);
     } catch (InterruptedException e) {
@@ -2447,14 +2447,14 @@ public class Tablet {
       String zTablePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZTABLES + "/" + extent.getTableId()
           + Constants.ZTABLE_COMPACT_ID;
       
-      String[] tokens = new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null)).split(",");
+      String[] tokens = new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null), Constants.UTF8).split(",");
       long compactID = Long.parseLong(tokens[0]);
       
       CompactionIterators iters = new CompactionIterators();
 
       if (tokens.length > 1) {
         Hex hex = new Hex();
-        ByteArrayInputStream bais = new ByteArrayInputStream(hex.decode(tokens[1].split("=")[1].getBytes()));
+        ByteArrayInputStream bais = new ByteArrayInputStream(hex.decode(tokens[1].split("=")[1].getBytes(Constants.UTF8)));
         DataInputStream dis = new DataInputStream(bais);
         
         try {
@@ -3686,9 +3686,8 @@ public class Tablet {
   public void importMapFiles(long tid, Map<String,MapFileInfo> fileMap, boolean setTime) throws IOException {
     Map<String,DataFileValue> entries = new HashMap<String,DataFileValue>(fileMap.size());
     
-    for (String path : fileMap.keySet()) {
-      MapFileInfo mfi = fileMap.get(path);
-      entries.put(path, new DataFileValue(mfi.estimatedSize, 0l));
+    for (Entry<String,MapFileInfo> entry : fileMap.entrySet()) {
+      entries.put(entry.getKey(), new DataFileValue(entry.getValue().estimatedSize, 0l));
     }
     
     // Clients timeout and will think that this operation failed.

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
index 9943926..7f0fc88 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
@@ -499,7 +499,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
         
         ScanRunState srs = nbt.getScanRunState();
         
-        if (nbt == null || srs == ScanRunState.FINISHED)
+        if (srs == ScanRunState.FINISHED)
           continue;
         
         MapCounter<ScanRunState> stateCounts = counts.get(tableID);
@@ -1104,7 +1104,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
         throws NotServingTabletException, ThriftSecurityException, org.apache.accumulo.core.tabletserver.thrift.TooManyFilesException {
       
       Authorizations userauths = null;
-      if (!security.canScan(credentials, new String(textent.getTable())))
+      if (!security.canScan(credentials, new String(textent.getTable(), Constants.UTF8)))
         throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
       
       userauths = security.getUserAuthorizations(credentials);
@@ -1255,7 +1255,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
       // find all of the tables that need to be scanned
       HashSet<String> tables = new HashSet<String>();
       for (TKeyExtent keyExtent : tbatch.keySet()) {
-        tables.add(new String(keyExtent.getTable()));
+        tables.add(new String(keyExtent.getTable(), Constants.UTF8));
       }
       
       // check if user has permission to the tables
@@ -1650,7 +1650,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
     public void update(TInfo tinfo, TCredentials credentials, TKeyExtent tkeyExtent, TMutation tmutation) throws NotServingTabletException,
         ConstraintViolationException, ThriftSecurityException {
 
-      if (!security.canWrite(credentials, new String(tkeyExtent.getTable())))
+      if (!security.canWrite(credentials, new String(tkeyExtent.getTable(), Constants.UTF8)))
         throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
       KeyExtent keyExtent = new KeyExtent(tkeyExtent);
       Tablet tablet = onlineTablets.get(new KeyExtent(keyExtent));
@@ -1699,7 +1699,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
     public void splitTablet(TInfo tinfo, TCredentials credentials, TKeyExtent tkeyExtent, ByteBuffer splitPoint)
         throws NotServingTabletException, ThriftSecurityException {
       
-      String tableId = new String(ByteBufferUtil.toBytes(tkeyExtent.table));
+      String tableId = new String(ByteBufferUtil.toBytes(tkeyExtent.table), Constants.UTF8);
       if (!security.canSplitTablet(credentials, tableId))
         throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
       
@@ -2717,7 +2717,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
         }
       };
       
-      byte[] lockContent = new ServerServices(getClientAddressString(), Service.TSERV_CLIENT).toString().getBytes();
+      byte[] lockContent = new ServerServices(getClientAddressString(), Service.TSERV_CLIENT).toString().getBytes(Constants.UTF8);
       for (int i = 0; i < 120 / 5; i++) {
         zoo.putPersistentData(zPath, new byte[0], NodeExistsPolicy.SKIP);
         

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java
index 9629948..6baecfd 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java
@@ -50,13 +50,13 @@ public class UniqueNameAllocator {
       try {
         byte[] max = ZooReaderWriter.getRetryingInstance().mutate(nextNamePath, null, ZooUtil.PRIVATE, new ZooReaderWriter.Mutator() {
           public byte[] mutate(byte[] currentValue) throws Exception {
-            long l = Long.parseLong(new String(currentValue), Character.MAX_RADIX);
+            long l = Long.parseLong(new String(currentValue, Constants.UTF8), Character.MAX_RADIX);
             l += allocate;
-            return Long.toString(l, Character.MAX_RADIX).getBytes();
+            return Long.toString(l, Character.MAX_RADIX).getBytes(Constants.UTF8);
           }
         });
         
-        maxAllocated = Long.parseLong(new String(max), Character.MAX_RADIX);
+        maxAllocated = Long.parseLong(new String(max, Constants.UTF8), Character.MAX_RADIX);
         next = maxAllocated - allocate;
         
       } catch (Exception e) {
@@ -64,7 +64,7 @@ public class UniqueNameAllocator {
       }
     }
     
-    return new String(FastFormat.toZeroPaddedString(next++, 7, Character.MAX_RADIX, new byte[0]));
+    return new String(FastFormat.toZeroPaddedString(next++, 7, Character.MAX_RADIX, new byte[0]), Constants.UTF8);
   }
   
   private static UniqueNameAllocator instance = null;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java
index ded2962..64bac29 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java
@@ -32,6 +32,7 @@ import java.util.Collections;
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.CountDownLatch;
@@ -225,7 +226,7 @@ public class DfsLogger {
   public static FSDataInputStream readHeader(FileSystem fs, Path path, Map<String,String> opts) throws IOException {
     FSDataInputStream file = fs.open(path);
     try {
-      byte[] magic = LOG_FILE_HEADER_V2.getBytes();
+      byte[] magic = LOG_FILE_HEADER_V2.getBytes(Constants.UTF8);
       byte[] buffer = new byte[magic.length];
       file.readFully(buffer);
       if (Arrays.equals(buffer, magic)) {
@@ -286,13 +287,13 @@ public class DfsLogger {
           .getConfiguration().get(Property.CRYPTO_MODULE_CLASS));
 
       // Initialize the log file with a header and the crypto params used to set up this log file.
-      logFile.write(LOG_FILE_HEADER_V2.getBytes());
+      logFile.write(LOG_FILE_HEADER_V2.getBytes(Constants.UTF8));
       Map<String,String> cryptoOpts = conf.getConfiguration().getAllPropertiesWithPrefix(Property.CRYPTO_PREFIX);
 
       logFile.writeInt(cryptoOpts.size());
-      for (String key : cryptoOpts.keySet()) {
-        logFile.writeUTF(key);
-        logFile.writeUTF(cryptoOpts.get(key));
+      for (Entry<String,String> entry : cryptoOpts.entrySet()) {
+        logFile.writeUTF(entry.getKey());
+        logFile.writeUTF(entry.getValue());
       }
 
       @SuppressWarnings("deprecation")

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/tabletserver/metrics/TabletServerScanMetrics.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/metrics/TabletServerScanMetrics.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/metrics/TabletServerScanMetrics.java
index e2dad1b..801b441 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/metrics/TabletServerScanMetrics.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/metrics/TabletServerScanMetrics.java
@@ -26,7 +26,7 @@ public class TabletServerScanMetrics extends AbstractMetricsImpl implements Tabl
   
   public static final String METRICS_PREFIX = "tserver.scan";
   
-  public static ObjectName OBJECT_NAME = null;
+  static ObjectName OBJECT_NAME = null;
   
   public TabletServerScanMetrics() {
     super();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java b/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
index 116f134..ffab38c 100644
--- a/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
+++ b/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
@@ -128,7 +128,7 @@ public class TraceServer implements Watcher {
       Mutation spanMutation = new Mutation(new Text(idString));
       Mutation indexMutation = new Mutation(new Text("idx:" + s.svc + ":" + startString));
       long diff = s.stop - s.start;
-      indexMutation.put(new Text(s.description), new Text(s.sender), new Value((idString + ":" + Long.toHexString(diff)).getBytes()));
+      indexMutation.put(new Text(s.description), new Text(s.sender), new Value((idString + ":" + Long.toHexString(diff)).getBytes(Constants.UTF8)));
       ByteArrayTransport transport = new ByteArrayTransport();
       TCompactProtocol protocol = new TCompactProtocol(transport);
       s.write(protocol);
@@ -181,7 +181,7 @@ public class TraceServer implements Watcher {
         Map<String,String> loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX);
         if (loginMap.isEmpty()) {
           Property p = Property.TRACE_PASSWORD;
-          at = new PasswordToken(conf.get(p).getBytes());
+          at = new PasswordToken(conf.get(p).getBytes(Constants.UTF8));
         } else {
           Properties props = new Properties();
           AuthenticationToken token = AccumuloClassLoader.getClassLoader().loadClass(conf.get(Property.TRACE_TOKEN_TYPE)).asSubclass(AuthenticationToken.class)
@@ -281,7 +281,7 @@ public class TraceServer implements Watcher {
   private void registerInZooKeeper(String name) throws Exception {
     String root = ZooUtil.getRoot(serverConfiguration.getInstance()) + Constants.ZTRACERS;
     IZooReaderWriter zoo = ZooReaderWriter.getInstance();
-    String path = zoo.putEphemeralSequential(root + "/trace-", name.getBytes());
+    String path = zoo.putEphemeralSequential(root + "/trace-", name.getBytes(Constants.UTF8));
     zoo.exists(path, this);
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java b/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
index f7fb387..d018228 100644
--- a/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
+++ b/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
@@ -124,7 +124,7 @@ public class AddFilesWithMissingEntries {
         String size = Long.toString(file.getLen());
         String entries = "1"; // lie
         String value = size + "," + entries;
-        m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(filename), new Value(value.getBytes()));
+        m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(filename), new Value(value.getBytes(Constants.UTF8)));
         if (update) {
           writer.getBatchWriter(Constants.METADATA_TABLE_NAME).addMutation(m);
         }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java b/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
index 0fd1c78..ac13034 100644
--- a/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
+++ b/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
@@ -22,6 +22,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
@@ -137,7 +138,7 @@ public class ChangeSecret {
     });
     String path = "/accumulo/instances/" + inst.getInstanceName();
     orig.recursiveDelete(path, NodeMissingPolicy.SKIP);
-    new_.putPersistentData(path, newInstanceId.getBytes(), NodeExistsPolicy.OVERWRITE);
+    new_.putPersistentData(path, newInstanceId.getBytes(Constants.UTF8), NodeExistsPolicy.OVERWRITE);
     return newInstanceId;
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java b/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
index b7a90d3..f2074a1 100644
--- a/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
+++ b/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
@@ -53,7 +53,7 @@ public class CleanZookeeper {
     String root = Constants.ZROOT;
     IZooReaderWriter zk = ZooReaderWriter.getInstance();
     if (opts.auth != null) {
-      zk.getZooKeeper().addAuthInfo("digest", ("accumulo:"+opts.auth).getBytes());
+      zk.getZooKeeper().addAuthInfo("digest", ("accumulo:"+opts.auth).getBytes(Constants.UTF8));
     }
     
     try {
@@ -62,7 +62,7 @@ public class CleanZookeeper {
           for (String instanceName : zk.getChildren(root + Constants.ZINSTANCES)) {
             String instanceNamePath = root + Constants.ZINSTANCES + "/" + instanceName;
             byte[] id = zk.getData(instanceNamePath, null);
-            if (id != null && !new String(id).equals(HdfsZooInstance.getInstance().getInstanceID())) {
+            if (id != null && !new String(id, Constants.UTF8).equals(HdfsZooInstance.getInstance().getInstanceID())) {
               try {
                 zk.recursiveDelete(instanceNamePath, NodeMissingPolicy.SKIP);
               } catch (KeeperException.NoAuthException ex) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/util/DeleteZooInstance.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/util/DeleteZooInstance.java b/server/src/main/java/org/apache/accumulo/server/util/DeleteZooInstance.java
index a74f2b5..448da86 100644
--- a/server/src/main/java/org/apache/accumulo/server/util/DeleteZooInstance.java
+++ b/server/src/main/java/org/apache/accumulo/server/util/DeleteZooInstance.java
@@ -65,13 +65,13 @@ public class DeleteZooInstance {
       String path = Constants.ZROOT + Constants.ZINSTANCES + "/" + opts.instance;
       byte[] data = zk.getData(path, null);
       deleteRetry(zk, path);
-      deleteRetry(zk, Constants.ZROOT + "/" + new String(data));
+      deleteRetry(zk, Constants.ZROOT + "/" + new String(data, Constants.UTF8));
     } else if (uuids.contains(opts.instance)) {
       // look for the real instance name
       for (String instance : instances) {
         String path = Constants.ZROOT + Constants.ZINSTANCES + "/" + instance;
         byte[] data = zk.getData(path, null);
-        if (opts.instance.equals(new String(data)))
+        if (opts.instance.equals(new String(data, Constants.UTF8)))
           deleteRetry(zk, path);
       }
       deleteRetry(zk, Constants.ZROOT + "/" + opts.instance);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b11a0361/server/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java b/server/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
index d1858a1..95f6a32 100644
--- a/server/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
+++ b/server/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
@@ -60,8 +60,6 @@ public class DumpZookeeper {
     
     Logger.getRootLogger().setLevel(Level.WARN);
     PrintStream out = System.out;
-    if (args.length > 0)
-      opts.root = opts.root;
     try {
       zk = ZooReaderWriter.getInstance();
       


Mime
View raw message