accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From medi...@apache.org
Subject svn commit: r1403871 [2/2] - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/client/admin/ core/src/main/java/org/apache/accumulo/core/client/mapreduce/ core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/partition/ core/sr...
Date Tue, 30 Oct 2012 21:10:45 GMT
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/SetGoalState.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.master.state;
 
+import java.nio.charset.Charset;
+
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.file.FileUtil;
 import org.apache.accumulo.core.master.thrift.MasterGoalState;
@@ -30,6 +32,8 @@ import org.apache.accumulo.server.zookee
 import org.apache.hadoop.fs.FileSystem;
 
 public class SetGoalState {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   /**
    * Utility program that will change the goal state for the master from the command line.
@@ -43,7 +47,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(utf8),
         NodeExistsPolicy.OVERWRITE);
   }
   

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/TServerInstance.java Tue Oct 30 21:10:42 2012
@@ -21,6 +21,7 @@ package org.apache.accumulo.server.maste
 
 import java.io.Serializable;
 import java.net.InetSocketAddress;
+import java.nio.charset.Charset;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
@@ -41,6 +42,8 @@ public class TServerInstance implements 
   private InetSocketAddress location;
   private String session;
   private String cachedStringRepresentation;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public TServerInstance(InetSocketAddress address, String session) {
     this.location = address;
@@ -118,7 +121,7 @@ public class TServerInstance implements 
   }
   
   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(utf8));
   }
   
   public InetSocketAddress getLocation() {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java Tue Oct 30 21:10:42 2012
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.master.state;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -47,6 +48,8 @@ public class TabletStateChangeIterator e
   private static final String TABLES_OPTION = "tables";
   private static final String MERGES_OPTION = "merges";
   // private static final Logger log = Logger.getLogger(TabletStateChangeIterator.class);
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   Set<TServerInstance> current;
   Set<String> onlineTables;
@@ -93,7 +96,7 @@ public class TabletStateChangeIterator e
     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(utf8));
       buffer.reset(data, data.length);
       while (buffer.available() > 0) {
         MergeInfo mergeInfo = new MergeInfo();

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java Tue Oct 30 21:10:42 2012
@@ -18,6 +18,7 @@ package org.apache.accumulo.server.maste
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -33,6 +34,8 @@ public class ZooTabletStateStore extends
   
   private static final Logger log = Logger.getLogger(ZooTabletStateStore.class);
   final private DistributedStore store;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public ZooTabletStateStore(DistributedStore store) {
     this.store = store;
@@ -123,7 +126,7 @@ public class ZooTabletStateStore extends
     if (assignment.tablet.compareTo(Constants.ROOT_TABLET_EXTENT) != 0)
       throw new IllegalArgumentException("You can only store the root tablet location");
     String value = AddressUtil.toString(assignment.server.getLocation()) + "|" + assignment.server.getSession();
-    store.put(Constants.ZROOT_TABLET_FUTURE_LOCATION, value.getBytes());
+    store.put(Constants.ZROOT_TABLET_FUTURE_LOCATION, value.getBytes(utf8));
   }
   
   @Override
@@ -134,8 +137,8 @@ public class ZooTabletStateStore extends
     if (assignment.tablet.compareTo(Constants.ROOT_TABLET_EXTENT) != 0)
       throw new IllegalArgumentException("You can only store the root tablet location");
     String value = AddressUtil.toString(assignment.server.getLocation()) + "|" + assignment.server.getSession();
-    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(utf8));
+    store.put(Constants.ZROOT_TABLET_LAST_LOCATION, value.getBytes(utf8));
     store.remove(Constants.ZROOT_TABLET_FUTURE_LOCATION);
     log.debug("Put down root tablet location");
   }

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.master.state.tables;
 
+import java.nio.charset.Charset;
 import java.security.SecurityPermission;
 import java.util.Collections;
 import java.util.HashMap;
@@ -53,6 +54,8 @@ public class TableManager {
   
   private final Instance instance;
   private ZooCache zooStateCache;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public static void prepareNewTableState(String instanceId, String tableId, String tableName, TableState state, NodeExistsPolicy existsPolicy)
       throws KeeperException, InterruptedException {
@@ -61,10 +64,10 @@ 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_NAME, tableName.getBytes(utf8), existsPolicy);
+    zoo.putPersistentData(zTablePath + Constants.ZTABLE_STATE, state.name().getBytes(utf8), existsPolicy);
+    zoo.putPersistentData(zTablePath + Constants.ZTABLE_FLUSH_ID, "0".getBytes(utf8), existsPolicy);
+    zoo.putPersistentData(zTablePath + Constants.ZTABLE_COMPACT_ID, "0".getBytes(utf8), existsPolicy);
   }
   
   public synchronized static TableManager getInstance() {
@@ -112,7 +115,7 @@ 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(utf8), ZooUtil.PUBLIC, new Mutator() {
         @Override
         public byte[] mutate(byte[] oldData) throws Exception {
           TableState oldState = TableState.UNKNOWN;
@@ -139,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(utf8);
         }
       });
     } catch (Exception e) {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java Tue Oct 30 21:10:42 2012
@@ -22,6 +22,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -333,6 +334,8 @@ class CopyFailed extends MasterRepo {
   private String source;
   private String bulk;
   private String error;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public CopyFailed(String tableId, String source, String bulk, String error) {
     this.tableId = tableId;
@@ -427,7 +430,7 @@ class CopyFailed extends MasterRepo {
         if (fs.exists(dest))
           continue;
         
-        bifCopyQueue.addWork(orig.getName(), (failure + "," + dest).getBytes());
+        bifCopyQueue.addWork(orig.getName(), (failure + "," + dest).getBytes(utf8));
         workIds.add(orig.getName());
         log.debug("tid " + tid + " added to copyq: " + orig + " to " + dest + ": failed");
       }

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.master.tableOps;
 
+import java.nio.charset.Charset;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
@@ -185,6 +186,8 @@ public class CompactRange extends Master
   private byte[] startRow;
   private byte[] endRow;
   private IteratorConfig iterators;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public CompactRange(String tableId, byte[] startRow, byte[] endRow, List<IteratorSetting> iterators) throws ThriftTableOperationException {
     this.tableId = tableId;
@@ -239,7 +242,7 @@ public class CompactRange extends Master
             encodedIterators.append(new String(hex.encode(IteratorUtil.encodeIteratorSettings(iterators))));
           }
           
-          return ("" + flushID + encodedIterators).getBytes();
+          return ("" + flushID + encodedIterators).getBytes(utf8);
         }
       });
       
@@ -272,7 +275,7 @@ public class CompactRange extends Master
           encodedIterators.append(tokens[i]);
         }
         
-        return ("" + flushID + encodedIterators).getBytes();
+        return ("" + flushID + encodedIterators).getBytes(utf8);
       }
     });
 

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/ImportTable.java Tue Oct 30 21:10:42 2012
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.Serializable;
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -170,6 +171,8 @@ class PopulateMetadataTable extends Mast
   private static final long serialVersionUID = 1L;
   
   private ImportedTableInfo tableInfo;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   PopulateMetadataTable(ImportedTableInfo ti) {
     this.tableInfo = ti;
@@ -246,14 +249,14 @@ class PopulateMetadataTable extends Mast
             
             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(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(utf8))));
             }
             
             m.put(key.getColumnFamily(), cq, val);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/RenameTable.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.master.tableOps;
 
+import java.nio.charset.Charset;
+
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.impl.Tables;
@@ -37,6 +39,8 @@ public class RenameTable extends MasterR
   private String tableId;
   private String oldTableName;
   private String newTableName;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   @Override
   public long isReady(long tid, Master environment) throws Exception {
@@ -70,7 +74,7 @@ public class RenameTable extends MasterR
             throw new ThriftTableOperationException(null, oldTableName, TableOperation.RENAME, TableOperationExceptionType.NOTFOUND,
                 "Name changed while processing");
           }
-          return newTableName.getBytes();
+          return newTableName.getBytes(utf8);
         }
       });
       Tables.clearCache(instance);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/Utils.java Tue Oct 30 21:10:42 2012
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.master.tableOps;
 
 import java.math.BigInteger;
+import java.nio.charset.Charset;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
@@ -39,6 +40,8 @@ import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
 
 public class Utils {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   static void checkTableDoesNotExist(Instance instance, String tableName, String tableId, TableOperation operation) throws ThriftTableOperationException {
     
@@ -54,12 +57,12 @@ 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, "0".getBytes(utf8), ZooUtil.PUBLIC, new Mutator() {
         @Override
         public byte[] mutate(byte[] currentValue) throws Exception {
           BigInteger nextId = new BigInteger(new String(currentValue), Character.MAX_RADIX);
           nextId = nextId.add(BigInteger.ONE);
-          return nextId.toString(Character.MAX_RADIX).getBytes();
+          return nextId.toString(Character.MAX_RADIX).getBytes(utf8);
         }
       });
       return new String(nid);
@@ -95,7 +98,7 @@ 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(utf8)));
     
     IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance();
     
@@ -107,12 +110,12 @@ 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(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(utf8);
     ZooQueueLock qlock = new ZooQueueLock(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLE_LOCKS + "/" + tableId, false);
     Lock lock = DistributedReadWriteLock.recoverLock(qlock, lockData);
     if (lock == null) {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tserverOps/ShutdownTServer.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.master.tserverOps;
 
+import java.nio.charset.Charset;
+
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.master.thrift.TabletServerStatus;
 import org.apache.accumulo.core.util.AddressUtil;
@@ -39,6 +41,8 @@ public class ShutdownTServer extends Mas
   private static final Logger log = Logger.getLogger(ShutdownTServer.class);
   private TServerInstance server;
   private boolean force;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public ShutdownTServer(TServerInstance server, boolean force) {
     this.server = server;
@@ -59,7 +63,7 @@ public class ShutdownTServer extends Mas
       ZooLock.deleteLock(path);
       path = ZooUtil.getRoot(m.getInstance()) + Constants.ZDEADTSERVERS + "/" + tserver;
       IZooReaderWriter zoo = ZooReaderWriter.getInstance();
-      zoo.putPersistentData(path, "forced down".getBytes(), NodeExistsPolicy.OVERWRITE);
+      zoo.putPersistentData(path, "forced down".getBytes(utf8), NodeExistsPolicy.OVERWRITE);
       return null;
     }
     

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/metanalysis/IndexMeta.java Tue Oct 30 21:10:42 2012
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.metanalysis;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -52,12 +53,14 @@ import org.apache.log4j.Logger;
 
 public class IndexMeta extends Configured implements Tool {
   
+  private static final Charset utf8 = Charset.forName("UTF8");
+    
   public static class IndexMapper extends Mapper<LogFileKey,LogFileValue,Text,Mutation> {
     private static final Text CREATE_EVENTS_TABLE = new Text("createEvents");
     private static final Text TABLET_EVENTS_TABLE = new Text("tabletEvents");
     private Map<Integer,KeyExtent> tabletIds = new HashMap<Integer,KeyExtent>();
     private String uuid = null;
-    
+
     @Override
     protected void setup(Context context) throws java.io.IOException, java.lang.InterruptedException {
       tabletIds = new HashMap<Integer,KeyExtent>();
@@ -101,14 +104,14 @@ public class IndexMeta extends Configure
       
       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(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(utf8)));
+      tabletEvent.put(new Text(String.format("%020d", timestamp)), new Text("log"), new Value(logFile.getBytes(utf8)));
       context.write(TABLET_EVENTS_TABLE, tabletEvent);
     }
   }
@@ -146,7 +149,7 @@ public class IndexMeta extends Configure
     
     job.setOutputFormatClass(AccumuloOutputFormat.class);
     AccumuloOutputFormat.setZooKeeperInstance(job.getConfiguration(), instance, zookeepers);
-    AccumuloOutputFormat.setOutputInfo(job.getConfiguration(), user, pass.getBytes(), false, null);
+    AccumuloOutputFormat.setOutputInfo(job.getConfiguration(), user, pass.getBytes(utf8), false, null);
     
     job.setMapperClass(IndexMapper.class);
 

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/ZooKeeperStatus.java Tue Oct 30 21:10:42 2012
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.monitor;
 
 import java.net.InetSocketAddress;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -35,6 +36,8 @@ public class ZooKeeperStatus implements 
   private static final Logger log = Logger.getLogger(ZooKeeperStatus.class);
   
   private volatile boolean stop = false;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public static class ZooKeeperState {
     public final String keeper;
@@ -80,7 +83,7 @@ public class ZooKeeperStatus implements 
             addr = new InetSocketAddress(parts[0], 2181);
           
           transport = TTimeoutTransport.create(addr, 10 * 1000l);
-          transport.write("stat\n".getBytes(), 0, 5);
+          transport.write("stat\n".getBytes(utf8), 0, 5);
           StringBuilder response = new StringBuilder();
           try {
             transport.flush();

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java Tue Oct 30 21:10:42 2012
@@ -22,6 +22,7 @@ import java.io.FilePermission;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetSocketAddress;
+import java.nio.charset.Charset;
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.PermissionCollection;
@@ -64,6 +65,8 @@ import org.apache.hadoop.mapred.JobTrack
 public class DefaultServlet extends BasicServlet {
   
   private static final long serialVersionUID = 1L;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   @Override
   protected String getTitle(HttpServletRequest req) {
@@ -90,7 +93,7 @@ public class DefaultServlet extends Basi
     		  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(utf8));
     	  }
       } finally {
     	  data.close();

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.monitor.servlets.trace;
 
+import java.nio.charset.Charset;
 import java.util.Date;
 
 import javax.servlet.http.HttpServletRequest;
@@ -36,6 +37,8 @@ import org.apache.accumulo.server.monito
 abstract class Basic extends BasicServlet {
   
   private static final long serialVersionUID = 1L;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public static String getStringParameter(HttpServletRequest req, String name, String defaultValue) {
     String result = req.getParameter(name);
@@ -65,7 +68,7 @@ abstract class Basic extends BasicServle
   protected Scanner getScanner(StringBuilder sb) throws AccumuloException {
     AccumuloConfiguration conf = Monitor.getSystemConfiguration();
     String user = conf.get(Property.TRACE_USER);
-    byte[] passwd = conf.get(Property.TRACE_PASSWORD).getBytes();
+    byte[] passwd = conf.get(Property.TRACE_PASSWORD).getBytes(utf8);
     String table = conf.get(Property.TRACE_TABLE);
     try {
       Connector conn = HdfsZooInstance.getInstance().getConnector(user, passwd);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java Tue Oct 30 21:10:42 2012
@@ -22,6 +22,7 @@ import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecurityPermission;
@@ -39,6 +40,8 @@ import org.apache.commons.codec.binary.B
 public class SecurityConstants {
   private static SecurityPermission SYSTEM_CREDENTIALS_PERMISSION = new SecurityPermission("systemCredentialsPermission");
   
+  private static final Charset utf8 = Charset.forName("UTF8");
+  
   public static final String SYSTEM_USERNAME = "!SYSTEM";
   private static final byte[] SYSTEM_PASSWORD = makeSystemPassword();
   private static final AuthInfo systemCredentials = new AuthInfo(SYSTEM_USERNAME, ByteBuffer.wrap(SYSTEM_PASSWORD), HdfsZooInstance.getInstance()
@@ -54,8 +57,8 @@ public class SecurityConstants {
   }
   
   private static byte[] makeSystemPassword() {
-    byte[] version = Constants.VERSION.getBytes();
-    byte[] inst = HdfsZooInstance.getInstance().getInstanceID().getBytes();
+    byte[] version = Constants.VERSION.getBytes(utf8);
+    byte[] inst = HdfsZooInstance.getInstance().getInstanceID().getBytes(utf8);
     try {
       confChecksum = getSystemConfigChecksum();
     } catch (NoSuchAlgorithmException e) {
@@ -97,10 +100,10 @@ public class SecurityConstants {
     try {
       byte[] buff = new byte[in.readInt()];
       in.readFully(buff);
-      versionFails = !Arrays.equals(buff, Constants.VERSION.getBytes());
+      versionFails = !Arrays.equals(buff, Constants.VERSION.getBytes(utf8));
       buff = new byte[in.readInt()];
       in.readFully(buff);
-      instanceFails = !Arrays.equals(buff, HdfsZooInstance.getInstance().getInstanceID().getBytes());
+      instanceFails = !Arrays.equals(buff, HdfsZooInstance.getInstance().getInstanceID().getBytes(utf8));
       buff = new byte[in.readInt()];
       in.readFully(buff);
       confFails = !Arrays.equals(buff, getSystemConfigChecksum());
@@ -131,14 +134,14 @@ public class SecurityConstants {
       
       // seed the config with the version and instance id, so at least
       // it's not empty
-      md.update(Constants.VERSION.getBytes());
-      md.update(HdfsZooInstance.getInstance().getInstanceID().getBytes());
+      md.update(Constants.VERSION.getBytes(utf8));
+      md.update(HdfsZooInstance.getInstance().getInstanceID().getBytes(utf8));
       
       for (Entry<String,String> entry : ServerConfiguration.getSiteConfiguration()) {
         // only include instance properties
         if (entry.getKey().startsWith(Property.INSTANCE_PREFIX.toString())) {
-          md.update(entry.getKey().getBytes());
-          md.update(entry.getValue().getBytes());
+          md.update(entry.getKey().getBytes(utf8));
+          md.update(entry.getValue().getBytes(utf8));
         }
       }
       

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/ZKAuthenticator.java Tue Oct 30 21:10:42 2012
@@ -22,6 +22,7 @@ import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
@@ -56,6 +57,8 @@ public final class ZKAuthenticator imple
   private static final Logger log = Logger.getLogger(ZKAuthenticator.class);
   private static Authenticator zkAuthenticatorInstance = null;
   private static String rootUserName = null;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   private final String ZKUserAuths = "/Authorizations";
   private final String ZKUserSysPerms = "/System";
@@ -122,7 +125,7 @@ public final class ZKAuthenticator imple
         }
         
         // prep parent node of users with root username
-        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(), NodeExistsPolicy.FAIL);
+        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(utf8), NodeExistsPolicy.FAIL);
         
         // create the root user with all system privileges, no table privileges, and no record-level authorizations
         Set<SystemPermission> rootPerms = new TreeSet<SystemPermission>();

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java Tue Oct 30 21:10:42 2012
@@ -24,6 +24,7 @@ package org.apache.accumulo.server.table
  */
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -145,6 +146,8 @@ import org.apache.zookeeper.KeeperExcept
 
 public class Tablet {
   
+  private Charset utf8 = Charset.forName("UTF8");
+    
   enum MajorCompactionReason {
     // do not change the order, the order of this enum determines the order
     // in which queued major compactions are executed
@@ -2174,7 +2177,7 @@ public class Tablet {
     private DataFileValue stats;
     private String mergeFile;
     private long flushId;
-    
+
     MinorCompactionTask(String mergeFile, CommitSession commitSession, long flushId) {
       queued = System.currentTimeMillis();
       minorCompactionWaitingToStart = true;
@@ -2405,7 +2408,7 @@ public class Tablet {
       List<IteratorSetting> allIters = new ArrayList<IteratorSetting>();
       for (int i = 1; i < tokens.length; i++) {
         Hex hex = new Hex();
-        List<IteratorSetting> iters = IteratorUtil.decodeIteratorSettings(hex.decode(tokens[i].split("=")[1].getBytes()));
+        List<IteratorSetting> iters = IteratorUtil.decodeIteratorSettings(hex.decode(tokens[i].split("=")[1].getBytes(utf8)));
         allIters.addAll(iters);
       }
       

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java Tue Oct 30 21:10:42 2012
@@ -28,6 +28,7 @@ import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -234,6 +235,8 @@ public class TabletServer extends Abstra
   
   private ServerConfiguration serverConfig;
   private LogSorter logSorter = null;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public TabletServer(ServerConfiguration conf, FileSystem fs) {
     super();
@@ -2697,7 +2700,7 @@ public class TabletServer extends Abstra
         }
       };
       
-      byte[] lockContent = new ServerServices(getClientAddressString(), Service.TSERV_CLIENT).toString().getBytes();
+      byte[] lockContent = new ServerServices(getClientAddressString(), Service.TSERV_CLIENT).toString().getBytes(utf8);
       for (int i = 0; i < 120 / 5; i++) {
         zoo.putPersistentData(zPath, new byte[0], NodeExistsPolicy.SKIP);
         

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/UniqueNameAllocator.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.tabletserver;
 
+import java.nio.charset.Charset;
 import java.util.Random;
 
 import org.apache.accumulo.core.Constants;
@@ -36,6 +37,8 @@ public class UniqueNameAllocator {
   private long maxAllocated = 0;
   private String nextNamePath;
   private Random rand;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   private UniqueNameAllocator() {
     nextNamePath = Constants.ZROOT + "/" + HdfsZooInstance.getInstance().getInstanceID() + Constants.ZNEXT_FILE;
@@ -52,7 +55,7 @@ public class UniqueNameAllocator {
           public byte[] mutate(byte[] currentValue) throws Exception {
             long l = Long.parseLong(new String(currentValue), Character.MAX_RADIX);
             l += allocate;
-            return Long.toString(l, Character.MAX_RADIX).getBytes();
+            return Long.toString(l, Character.MAX_RADIX).getBytes(utf8);
           }
         });
         

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java Tue Oct 30 21:10:42 2012
@@ -19,6 +19,7 @@ package org.apache.accumulo.server.trace
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.nio.channels.ServerSocketChannel;
+import java.nio.charset.Charset;
 import java.util.TimerTask;
 import java.util.concurrent.TimeUnit;
 
@@ -76,6 +77,8 @@ public class TraceServer implements Watc
   private Connector connector;
   final String table;
 
+  private static final Charset utf8 = Charset.forName("UTF8");
+
   private static void put(Mutation m, String cf, String cq, byte[] bytes, int len) {
     m.put(new Text(cf), new Text(cq), new Value(bytes, 0, len));
   }
@@ -121,7 +124,7 @@ public class TraceServer implements Watc
       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(utf8)));
       ByteArrayTransport transport = new ByteArrayTransport();
       TCompactProtocol protocol = new TCompactProtocol(transport);
       s.write(protocol);
@@ -157,7 +160,7 @@ public class TraceServer implements Watc
     table = conf.get(Property.TRACE_TABLE);
     while (true) {
       try {
-        connector = serverConfiguration.getInstance().getConnector(conf.get(Property.TRACE_USER), conf.get(Property.TRACE_PASSWORD).getBytes());
+        connector = serverConfiguration.getInstance().getConnector(conf.get(Property.TRACE_USER), conf.get(Property.TRACE_PASSWORD).getBytes(utf8));
         if (!connector.tableOperations().exists(table)) {
           connector.tableOperations().create(table);
         }
@@ -221,7 +224,7 @@ public class TraceServer implements Watc
   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(utf8));
     zoo.exists(path, this);
   }
   

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/AddFilesWithMissingEntries.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.util;
 
+import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Map.Entry;
@@ -47,6 +48,8 @@ public class AddFilesWithMissingEntries 
   
   static final Logger log = Logger.getLogger(AddFilesWithMissingEntries.class);
   static boolean update = false;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   /**
    * @param args
@@ -118,7 +121,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(utf8)));
         if (update) {
           writer.getBatchWriter(Constants.METADATA_TABLE_NAME).addMutation(m);
         }

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Admin.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Admin.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Admin.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Admin.java Tue Oct 30 21:10:42 2012
@@ -21,6 +21,7 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 
 import jline.ConsoleReader;
 
@@ -47,6 +48,8 @@ public class Admin {
   public static void main(String[] args) {
     boolean everything;
     
+    final Charset utf8 = Charset.forName("UTF8");
+    
     CommandLine cl = null;
     Options opts = new Options();
     opts.addOption("u", true, "optional administrator user name");
@@ -64,7 +67,7 @@ public class Admin {
       args = cl.getArgs();
       
       user = cl.hasOption("u") ? cl.getOptionValue("u") : "root";
-      pass = cl.hasOption("p") ? cl.getOptionValue("p").getBytes() : null;
+      pass = cl.hasOption("p") ? cl.getOptionValue("p").getBytes(utf8) : null;
       force = cl.hasOption("f");
       
       if (!((cl.getArgs().length == 1 && (args[0].equalsIgnoreCase("stopMaster") || args[0].equalsIgnoreCase("stopAll"))) || (cl.getArgs().length == 2 && args[0]
@@ -98,7 +101,7 @@ public class Admin {
         } else {
           if (pass == null) {
             try {
-              pass = new ConsoleReader().readLine("Enter current password for '" + user + "': ", '*').getBytes();
+              pass = new ConsoleReader().readLine("Enter current password for '" + user + "': ", '*').getBytes(utf8);
             } catch (IOException ioe) {
               log.error("Password not specified and unable to prompt: " + ioe);
               System.exit(4);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/ChangeSecret.java Tue Oct 30 21:10:42 2012
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.util;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
@@ -38,6 +39,8 @@ import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Stat;
 
 public class ChangeSecret {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public static void main(String[] args) throws Exception {
     String oldPass = null;
@@ -130,7 +133,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(utf8), NodeExistsPolicy.OVERWRITE);
     return newInstanceId;
   }
   

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CheckForMetadataProblems.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CheckForMetadataProblems.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CheckForMetadataProblems.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CheckForMetadataProblems.java Tue Oct 30 21:10:42 2012
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.util;
 
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -216,7 +217,8 @@ public class CheckForMetadataProblems {
   }
   
   public static void main(String[] args) throws Exception {
-    args = processOptions(args);
+   final Charset utf8 = Charset.forName("UTF8");
+   args = processOptions(args);
     
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     Instance instance = HdfsZooInstance.getInstance();
@@ -224,7 +226,7 @@ public class CheckForMetadataProblems {
 
     if (args.length == 2) {
       user = args[0];
-      pass = args[1].getBytes();
+      pass = args[1].getBytes(utf8);
       checkMetadataTableEntries(conf, fs, offline, fix);
     } else if (args.length == 0 && offline) {
       checkMetadataTableEntries(conf, fs, offline, fix);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/CleanZookeeper.java Tue Oct 30 21:10:42 2012
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.util;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
@@ -37,6 +38,9 @@ public class CleanZookeeper {
    *           error connecting to accumulo or zookeeper
    */
   public static void main(String[] args) throws IOException {
+
+    final Charset utf8 = Charset.forName("UTF8");
+	  
     if (args.length < 1) {
       System.err.println("Usage: " + CleanZookeeper.class.getName() + " hostname[:port] [auth]");
       System.exit(1);
@@ -44,7 +48,7 @@ public class CleanZookeeper {
     String root = Constants.ZROOT;
     IZooReaderWriter zk = ZooReaderWriter.getInstance();
     if (args.length == 2) {
-      zk.getZooKeeper().addAuthInfo("digest", args[1].getBytes());
+      zk.getZooKeeper().addAuthInfo("digest", args[1].getBytes(utf8));
     }
     
     try {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java Tue Oct 30 21:10:42 2012
@@ -18,6 +18,7 @@ package org.apache.accumulo.server.util;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map.Entry;
@@ -108,6 +109,8 @@ public class Initialize {
     initialMetadataConf.put(Property.TABLE_INDEXCACHE_ENABLED.getKey(), "true");
     initialMetadataConf.put(Property.TABLE_BLOCKCACHE_ENABLED.getKey(), "true");
   }
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public static boolean doInit(Configuration conf, FileSystem fs) throws IOException {
     if (!ServerConfiguration.getSiteConfiguration().get(Property.INSTANCE_DFS_URI).equals(""))
@@ -263,7 +266,7 @@ public class Initialize {
       
       // root's directory
       Key rootDirKey = new Key(rootExtent, Constants.METADATA_DIRECTORY_COLUMN.getColumnFamily(), Constants.METADATA_DIRECTORY_COLUMN.getColumnQualifier(), 0);
-      mfw.append(rootDirKey, new Value("/root_tablet".getBytes()));
+      mfw.append(rootDirKey, new Value("/root_tablet".getBytes(utf8)));
       
       // root's prev row
       Key rootPrevRowKey = new Key(rootExtent, Constants.METADATA_PREV_ROW_COLUMN.getColumnFamily(), Constants.METADATA_PREV_ROW_COLUMN.getColumnQualifier(), 0);
@@ -274,11 +277,11 @@ public class Initialize {
       
       // table tablet's directory
       Key tableDirKey = new Key(tableExtent, Constants.METADATA_DIRECTORY_COLUMN.getColumnFamily(), Constants.METADATA_DIRECTORY_COLUMN.getColumnQualifier(), 0);
-      mfw.append(tableDirKey, new Value(Constants.TABLE_TABLET_LOCATION.getBytes()));
+      mfw.append(tableDirKey, new Value(Constants.TABLE_TABLET_LOCATION.getBytes(utf8)));
       
       // table tablet time
       Key tableTimeKey = new Key(tableExtent, Constants.METADATA_TIME_COLUMN.getColumnFamily(), Constants.METADATA_TIME_COLUMN.getColumnQualifier(), 0);
-      mfw.append(tableTimeKey, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes()));
+      mfw.append(tableTimeKey, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes(utf8)));
       
       // table tablet's prevrow
       Key tablePrevRowKey = new Key(tableExtent, Constants.METADATA_PREV_ROW_COLUMN.getColumnFamily(), Constants.METADATA_PREV_ROW_COLUMN.getColumnQualifier(),
@@ -291,11 +294,11 @@ public class Initialize {
       // default's directory
       Key defaultDirKey = new Key(defaultExtent, Constants.METADATA_DIRECTORY_COLUMN.getColumnFamily(),
           Constants.METADATA_DIRECTORY_COLUMN.getColumnQualifier(), 0);
-      mfw.append(defaultDirKey, new Value(Constants.DEFAULT_TABLET_LOCATION.getBytes()));
+      mfw.append(defaultDirKey, new Value(Constants.DEFAULT_TABLET_LOCATION.getBytes(utf8)));
       
       // default's time
       Key defaultTimeKey = new Key(defaultExtent, Constants.METADATA_TIME_COLUMN.getColumnFamily(), Constants.METADATA_TIME_COLUMN.getColumnQualifier(), 0);
-      mfw.append(defaultTimeKey, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes()));
+      mfw.append(defaultTimeKey, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes(utf8)));
       
       // default's prevrow
       Key defaultPrevRowKey = new Key(defaultExtent, Constants.METADATA_PREV_ROW_COLUMN.getColumnFamily(),
@@ -344,7 +347,7 @@ public class Initialize {
     // setup instance name
     if (clearInstanceName)
       zoo.recursiveDelete(instanceNamePath, NodeMissingPolicy.SKIP);
-    zoo.putPersistentData(instanceNamePath, uuid.getBytes(), NodeExistsPolicy.FAIL);
+    zoo.putPersistentData(instanceNamePath, uuid.getBytes(utf8), NodeExistsPolicy.FAIL);
     
     // setup the instance
     String zkInstanceRoot = Constants.ZROOT + "/" + uuid;
@@ -358,7 +361,7 @@ public class Initialize {
     zoo.putPersistentData(zkInstanceRoot + Constants.ZTRACERS, new byte[0], NodeExistsPolicy.FAIL);
     zoo.putPersistentData(zkInstanceRoot + Constants.ZMASTERS, new byte[0], NodeExistsPolicy.FAIL);
     zoo.putPersistentData(zkInstanceRoot + Constants.ZMASTER_LOCK, new byte[0], NodeExistsPolicy.FAIL);
-    zoo.putPersistentData(zkInstanceRoot + Constants.ZMASTER_GOAL_STATE, MasterGoalState.NORMAL.toString().getBytes(), NodeExistsPolicy.FAIL);
+    zoo.putPersistentData(zkInstanceRoot + Constants.ZMASTER_GOAL_STATE, MasterGoalState.NORMAL.toString().getBytes(utf8), NodeExistsPolicy.FAIL);
     zoo.putPersistentData(zkInstanceRoot + Constants.ZGC, new byte[0], NodeExistsPolicy.FAIL);
     zoo.putPersistentData(zkInstanceRoot + Constants.ZGC_LOCK, new byte[0], NodeExistsPolicy.FAIL);
     zoo.putPersistentData(zkInstanceRoot + Constants.ZCONFIG, new byte[0], NodeExistsPolicy.FAIL);
@@ -402,7 +405,7 @@ public class Initialize {
   
   private static byte[] getRootPassword() throws IOException {
     if (cliPassword != null) {
-      return cliPassword.getBytes();
+      return cliPassword.getBytes(utf8);
     }
     String rootpass;
     String confirmpass;
@@ -416,7 +419,7 @@ public class Initialize {
       if (!rootpass.equals(confirmpass))
         log.error("Passwords do not match");
     } while (!rootpass.equals(confirmpass));
-    return rootpass.getBytes();
+    return rootpass.getBytes(utf8);
   }
   
   private static void initSecurity(String iid, byte[] rootpass) throws AccumuloSecurityException {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java Tue Oct 30 21:10:42 2012
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.util;
 
 import java.net.InetSocketAddress;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
@@ -37,6 +38,8 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
 public class LocalityCheck {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public int run(String[] args) throws Exception {
     if (args.length < 4) {
@@ -45,7 +48,7 @@ public class LocalityCheck {
     }
     ZooKeeperInstance instance = new ZooKeeperInstance(args[0], args[1]);
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
-    Connector connector = instance.getConnector(args[2], args[3].getBytes());
+    Connector connector = instance.getConnector(args[2], args[3].getBytes(utf8));
     Scanner scanner = connector.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
     scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
     scanner.fetchColumnFamily(Constants.METADATA_DATAFILE_COLUMN_FAMILY);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java Tue Oct 30 21:10:42 2012
@@ -20,6 +20,7 @@
 package org.apache.accumulo.server.util;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -98,6 +99,8 @@ public class MetadataTable extends org.a
   private static final Logger log = Logger.getLogger(MetadataTable.class);
   
   private static final int SAVE_ROOT_TABLET_RETRIES = 3;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   private MetadataTable() {
     
@@ -113,7 +116,7 @@ public class MetadataTable extends org.a
   }
   
   public static void putLockID(ZooLock zooLock, Mutation m) {
-    Constants.METADATA_LOCK_COLUMN.put(m, new Value(zooLock.getLockID().serialize(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + "/").getBytes()));
+    Constants.METADATA_LOCK_COLUMN.put(m, new Value(zooLock.getLockID().serialize(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + "/").getBytes(utf8)));
   }
   
   public static void update(AuthInfo credentials, Mutation m) {
@@ -192,7 +195,7 @@ public class MetadataTable extends org.a
     
     if (dfv.getNumEntries() > 0) {
       m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(path), new Value(dfv.encode()));
-      Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes()));
+      Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes(utf8)));
       // stuff in this location
       TServerInstance self = getTServerInstance(address, zooLock);
       self.putLastLocation(m);
@@ -207,12 +210,12 @@ public class MetadataTable extends org.a
     }
     
     for (String scanFile : filesInUseByScans)
-      m.put(Constants.METADATA_SCANFILE_COLUMN_FAMILY, new Text(scanFile), new Value("".getBytes()));
+      m.put(Constants.METADATA_SCANFILE_COLUMN_FAMILY, new Text(scanFile), new Value("".getBytes(utf8)));
     
     if (mergeFile != null)
       m.putDelete(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(mergeFile));
     
-    Constants.METADATA_FLUSH_COLUMN.put(m, new Value((flushId + "").getBytes()));
+    Constants.METADATA_FLUSH_COLUMN.put(m, new Value((flushId + "").getBytes(utf8)));
     
     update(credentials, zooLock, m);
     
@@ -234,7 +237,7 @@ public class MetadataTable extends org.a
   public static void updateTabletFlushID(KeyExtent extent, long flushID, AuthInfo credentials, ZooLock zooLock) {
     if (!extent.isRootTablet()) {
       Mutation m = new Mutation(extent.getMetadataEntry());
-      Constants.METADATA_FLUSH_COLUMN.put(m, new Value((flushID + "").getBytes()));
+      Constants.METADATA_FLUSH_COLUMN.put(m, new Value((flushID + "").getBytes(utf8)));
       update(credentials, zooLock, m);
     }
   }
@@ -242,29 +245,29 @@ public class MetadataTable extends org.a
   public static void updateTabletCompactID(KeyExtent extent, long compactID, AuthInfo credentials, ZooLock zooLock) {
     if (!extent.isRootTablet()) {
       Mutation m = new Mutation(extent.getMetadataEntry());
-      Constants.METADATA_COMPACT_COLUMN.put(m, new Value((compactID + "").getBytes()));
+      Constants.METADATA_COMPACT_COLUMN.put(m, new Value((compactID + "").getBytes(utf8)));
       update(credentials, zooLock, m);
     }
   }
   
   public static void updateTabletDataFile(long tid, KeyExtent extent, Map<String,DataFileValue> estSizes, String time, AuthInfo credentials, ZooLock zooLock) {
     Mutation m = new Mutation(extent.getMetadataEntry());
-    byte[] tidBytes = Long.toString(tid).getBytes();
+    byte[] tidBytes = Long.toString(tid).getBytes(utf8);
     
     for (Entry<String,DataFileValue> entry : estSizes.entrySet()) {
       Text file = new Text(entry.getKey());
       m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, file, new Value(entry.getValue().encode()));
       m.put(Constants.METADATA_BULKFILE_COLUMN_FAMILY, file, new Value(tidBytes));
     }
-    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes()));
+    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes(utf8)));
     update(credentials, zooLock, m);
   }
   
   public static void addTablet(KeyExtent extent, String path, AuthInfo credentials, char timeType, ZooLock lock) {
     Mutation m = extent.getPrevRowUpdateMutation();
     
-    Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(path.getBytes()));
-    Constants.METADATA_TIME_COLUMN.put(m, new Value((timeType + "0").getBytes()));
+    Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(path.getBytes(utf8)));
+    Constants.METADATA_TIME_COLUMN.put(m, new Value((timeType + "0").getBytes(utf8)));
     
     update(credentials, lock, m);
   }
@@ -344,7 +347,7 @@ public class MetadataTable extends org.a
       try {
         log.info("trying to write root tablet location to ZooKeeper as " + address);
         String zRootLocPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZROOT_TABLET_LOCATION;
-        zoo.putPersistentData(zRootLocPath, address.getBytes(), NodeExistsPolicy.OVERWRITE);
+        zoo.putPersistentData(zRootLocPath, address.getBytes(utf8), NodeExistsPolicy.OVERWRITE);
         return true;
       } catch (Exception e) {
         log.error("Master: unable to save root tablet location in zookeeper. exception: " + e, e);
@@ -381,12 +384,12 @@ public class MetadataTable extends org.a
       Map<String,Long> bulkLoadedFiles, AuthInfo credentials, String time, long lastFlushID, long lastCompactID, ZooLock zooLock) {
     Mutation m = extent.getPrevRowUpdateMutation();
     
-    Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(path.getBytes()));
-    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes()));
+    Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(path.getBytes(utf8)));
+    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes(utf8)));
     if (lastFlushID > 0)
-      Constants.METADATA_FLUSH_COLUMN.put(m, new Value(("" + lastFlushID).getBytes()));
+      Constants.METADATA_FLUSH_COLUMN.put(m, new Value(("" + lastFlushID).getBytes(utf8)));
     if (lastCompactID > 0)
-      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(("" + lastCompactID).getBytes()));
+      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(("" + lastCompactID).getBytes(utf8)));
     
     if (location != null) {
       m.put(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY, location.asColumnQualifier(), location.asMutationValue());
@@ -398,7 +401,7 @@ public class MetadataTable extends org.a
     }
     
     for (Entry<String,Long> entry : bulkLoadedFiles.entrySet()) {
-      byte[] tidBytes = Long.toString(entry.getValue()).getBytes();
+      byte[] tidBytes = Long.toString(entry.getValue()).getBytes(utf8);
       m.put(Constants.METADATA_BULKFILE_COLUMN_FAMILY, new Text(entry.getKey()), new Value(tidBytes));
     }
 
@@ -408,7 +411,7 @@ public class MetadataTable extends org.a
   public static void splitTablet(KeyExtent extent, Text oldPrevEndRow, double splitRatio, AuthInfo credentials, ZooLock zooLock) {
     Mutation m = extent.getPrevRowUpdateMutation(); //
     
-    Constants.METADATA_SPLIT_RATIO_COLUMN.put(m, new Value(Double.toString(splitRatio).getBytes()));
+    Constants.METADATA_SPLIT_RATIO_COLUMN.put(m, new Value(Double.toString(splitRatio).getBytes(utf8)));
     
     Constants.METADATA_OLD_PREV_ROW_COLUMN.put(m, KeyExtent.encodePrevEndRow(oldPrevEndRow));
     Constants.METADATA_CHOPPED_COLUMN.putDelete(m);
@@ -458,13 +461,13 @@ public class MetadataTable extends org.a
       m.putDelete(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(pathToRemove));
     
     for (String scanFile : scanFiles)
-      m.put(Constants.METADATA_SCANFILE_COLUMN_FAMILY, new Text(scanFile), new Value("".getBytes()));
+      m.put(Constants.METADATA_SCANFILE_COLUMN_FAMILY, new Text(scanFile), new Value("".getBytes(utf8)));
     
     if (size.getNumEntries() > 0)
       m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(path), new Value(size.encode()));
     
     if (compactionId != null)
-      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(("" + compactionId).getBytes()));
+      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(("" + compactionId).getBytes(utf8)));
     
     TServerInstance self = getTServerInstance(address, zooLock);
     self.putLastLocation(m);
@@ -791,7 +794,7 @@ public class MetadataTable extends org.a
     } else {
       String value = StringUtil.join(entry.logSet, ";") + "|" + entry.tabletId;
       Mutation m = new Mutation(entry.extent.getMetadataEntry());
-      m.put(Constants.METADATA_LOG_COLUMN_FAMILY, new Text(entry.server + "/" + entry.filename), new Value(value.getBytes()));
+      m.put(Constants.METADATA_LOG_COLUMN_FAMILY, new Text(entry.server + "/" + entry.filename), new Value(value.getBytes(utf8)));
       update(credentials, zooLock, m);
     }
   }
@@ -1105,7 +1108,7 @@ public class MetadataTable extends org.a
       } else {
         // write out marker that this tablet was successfully cloned
         Mutation m = new Mutation(cloneTablet.keySet().iterator().next().getRow());
-        m.put(Constants.METADATA_CLONED_COLUMN_FAMILY, new Text(""), new Value("OK".getBytes()));
+        m.put(Constants.METADATA_CLONED_COLUMN_FAMILY, new Text(""), new Value("OK".getBytes(utf8)));
         bw.addMutation(m);
       }
     }
@@ -1160,7 +1163,7 @@ public class MetadataTable extends org.a
       Key k = entry.getKey();
       Mutation m = new Mutation(k.getRow());
       m.putDelete(k.getColumnFamily(), k.getColumnQualifier());
-      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(utf8))));
       bw.addMutation(m);
     }
     
@@ -1170,7 +1173,7 @@ public class MetadataTable extends org.a
   
   public static void chopped(KeyExtent extent, ZooLock zooLock) {
     Mutation m = new Mutation(extent.getMetadataEntry());
-    Constants.METADATA_CHOPPED_COLUMN.put(m, new Value("chopped".getBytes()));
+    Constants.METADATA_CHOPPED_COLUMN.put(m, new Value("chopped".getBytes(utf8)));
     update(SecurityConstants.getSystemCredentials(), zooLock, m);
   }
   

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RandomWriter.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RandomWriter.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RandomWriter.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.util;
 
+import java.nio.charset.Charset;
 import java.util.Iterator;
 import java.util.Random;
 
@@ -81,13 +82,14 @@ public class RandomWriter {
   
   public static void main(String[] args) throws MutationsRejectedException, AccumuloException, AccumuloSecurityException, TableNotFoundException {
     long start = System.currentTimeMillis();
+    final Charset utf8 = Charset.forName("UTF8");
     if (args.length != 3) {
       log.error("Usage: bin/accumulo " + RandomWriter.class.getName() + " <username> <password> <num_mutations_to_write>");
       return;
     }
     log.info("starting at " + start + " for user " + args[0]);
     try {
-      Connector connector = HdfsZooInstance.getInstance().getConnector(args[0], args[1].getBytes());
+      Connector connector = HdfsZooInstance.getInstance().getConnector(args[0], args[1].getBytes(utf8));
       BatchWriter bw = connector.createBatchWriter(table_name, new BatchWriterConfig());
       long num_mutations = Long.parseLong(args[2]);
       log.info("Writing " + num_mutations + " mutations...");

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.util;
 
+import java.nio.charset.Charset;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.Constants;
@@ -43,13 +44,14 @@ public class RemoveEntriesForMissingFile
   private static Logger log = Logger.getLogger(RemoveEntriesForMissingFiles.class);
   
   public static void main(String[] args) throws Exception {
+    final Charset utf8 = Charset.forName("UTF8");
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     if (args.length < 4) {
       System.err.println("Usage: accumulo.server.util.RemoveEntriesForMissingFiles instance zookeepers username password [delete]");
       System.exit(1);
     }
     Instance instance = new ZooKeeperInstance(args[0], args[1]);
-    Connector connector = instance.getConnector(args[2], args[3].getBytes());
+    Connector connector = instance.getConnector(args[2], args[3].getBytes(utf8));
     Scanner metadata = connector.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
     metadata.setBatchSize(1000 * 1000);
     metadata.setRange(Constants.METADATA_KEYSPACE);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RestoreZookeeper.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RestoreZookeeper.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RestoreZookeeper.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/RestoreZookeeper.java Tue Oct 30 21:10:42 2012
@@ -18,6 +18,7 @@ package org.apache.accumulo.server.util;
 
 import java.io.FileInputStream;
 import java.io.InputStream;
+import java.nio.charset.Charset;
 import java.util.Stack;
 
 import javax.xml.parsers.SAXParser;
@@ -37,6 +38,8 @@ import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
 public class RestoreZookeeper {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   private static class Restore extends DefaultHandler {
     ZooKeeper zk = null;
@@ -74,9 +77,9 @@ public class RestoreZookeeper {
     }
     
     private void create(String path, String value, String encoding) {
-      byte[] data = value.getBytes();
+      byte[] data = value.getBytes(utf8);
       if ("base64".equals(encoding))
-        data = Base64.decodeBase64(value.getBytes());
+        data = Base64.decodeBase64(value.getBytes(utf8));
       try {
         try {
           ZooUtil.putPersistentData(zk, path, data, overwrite ? NodeExistsPolicy.OVERWRITE : NodeExistsPolicy.FAIL);

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/SendLogToChainsaw.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/SendLogToChainsaw.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/SendLogToChainsaw.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/SendLogToChainsaw.java Tue Oct 30 21:10:42 2012
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.Socket;
 import java.net.URLEncoder;
+import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
@@ -70,6 +71,8 @@ public class SendLogToChainsaw extends X
   private LongRange dateFilter = null;
   
   private LevelRangeFilter levelFilter = null;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public SendLogToChainsaw(String directory, String fileNameFilter, String host, int port, Date start, Date end, String regex, String level) throws Exception {
     
@@ -135,7 +138,7 @@ public class SendLogToChainsaw extends X
                 out = convertLine(line, threadName);
                 if (null != out) {
                   if (socket != null && socket.isConnected())
-                    socket.getOutputStream().write(out.getBytes());
+                    socket.getOutputStream().write(out.getBytes(utf8));
                   else
                     System.err.println("Unable to send data to transport");
                 }

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.util;
 
+import java.nio.charset.Charset;
+
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
@@ -26,6 +28,9 @@ import org.apache.accumulo.server.zookee
 import org.apache.zookeeper.KeeperException;
 
 public class SystemPropUtil {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
+	
   public static boolean setSystemProperty(String property, String value) throws KeeperException, InterruptedException {
     Property p = Property.getPropertyByKey(property);
     if ((p != null && !p.getType().isValidFormat(value)) || !Property.isValidZooPropertyKey(property))
@@ -33,7 +38,7 @@ public class SystemPropUtil {
     
     // create the zk node for this property and set it's data to the specified value
     String zPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZCONFIG + "/" + property;
-    ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(), NodeExistsPolicy.OVERWRITE);
+    ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(utf8), NodeExistsPolicy.OVERWRITE);
     
     return true;
   }

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/TablePropUtil.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/TablePropUtil.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/TablePropUtil.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/TablePropUtil.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.util;
 
+import java.nio.charset.Charset;
+
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
@@ -26,6 +28,9 @@ import org.apache.accumulo.server.zookee
 import org.apache.zookeeper.KeeperException;
 
 public class TablePropUtil {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
+  
   public static boolean setTableProperty(String tableId, String property, String value) throws KeeperException, InterruptedException {
     if (!isPropertyValid(property, value))
       return false;
@@ -36,7 +41,7 @@ public class TablePropUtil {
     
     // create the zk node for this property and set it's data to the specified value
     String zPath = zkTablePath + "/" + property;
-    ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(), NodeExistsPolicy.OVERWRITE);
+    ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(utf8), NodeExistsPolicy.OVERWRITE);
     
     return true;
   }

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java Tue Oct 30 21:10:42 2012
@@ -18,6 +18,7 @@ package org.apache.accumulo.server.util;
 
 import java.io.PrintWriter;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
@@ -70,6 +71,8 @@ import org.apache.thrift.TException;
 import org.apache.thrift.TServiceClient;
 
 public class VerifyTabletAssignments {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public static void main(String[] args) throws Exception {
     Options opts = new Options();
@@ -129,7 +132,7 @@ public class VerifyTabletAssignments {
       System.exit(1);
     }
     
-    Connector conn = instance.getConnector(user, passw.getBytes());
+    Connector conn = instance.getConnector(user, passw.getBytes(utf8));
     ServerConfiguration conf = new ServerConfiguration(instance);
     for (String table : conn.tableOperations().list())
       checkTable(conf.getConfiguration(), user, passw, table, null, cl.hasOption(verboseOption.getOpt()));
@@ -149,7 +152,7 @@ public class VerifyTabletAssignments {
     SortedSet<KeyExtent> tablets = new TreeSet<KeyExtent>();
     
     MetadataTable.getEntries(HdfsZooInstance.getInstance(),
-        new AuthInfo(user, ByteBuffer.wrap(pass.getBytes()), HdfsZooInstance.getInstance().getInstanceID()), table, false, locations, tablets);
+        new AuthInfo(user, ByteBuffer.wrap(pass.getBytes(utf8)), HdfsZooInstance.getInstance().getInstanceID()), table, false, locations, tablets);
     
     final HashSet<KeyExtent> failures = new HashSet<KeyExtent>();
     
@@ -180,7 +183,7 @@ public class VerifyTabletAssignments {
         @Override
         public void run() {
           try {
-            checkTabletServer(conf, user, ByteBuffer.wrap(pass.getBytes()), entry, failures);
+            checkTabletServer(conf, user, ByteBuffer.wrap(pass.getBytes(utf8)), entry, failures);
           } catch (Exception e) {
             System.err.println("Failure on ts " + entry.getKey() + " " + e.getMessage());
             e.printStackTrace();

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooQueueLock.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooQueueLock.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooQueueLock.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooQueueLock.java Tue Oct 30 21:10:42 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.zookeeper;
 
+import java.nio.charset.Charset;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 
@@ -23,6 +24,8 @@ import org.apache.accumulo.fate.zookeepe
 import org.apache.zookeeper.KeeperException;
 
 public class ZooQueueLock extends org.apache.accumulo.fate.zookeeper.ZooQueueLock {
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public ZooQueueLock(String path, boolean ephemeral) throws KeeperException, InterruptedException {
     super(ZooReaderWriter.getRetryingInstance(), path, ephemeral);
@@ -30,8 +33,8 @@ public class ZooQueueLock extends org.ap
   
   public static void main(String args[]) throws InterruptedException, KeeperException {
     ZooQueueLock lock = new ZooQueueLock("/lock", true);
-    DistributedReadWriteLock rlocker = new DistributedReadWriteLock(lock, "reader".getBytes());
-    DistributedReadWriteLock wlocker = new DistributedReadWriteLock(lock, "wlocker".getBytes());
+    DistributedReadWriteLock rlocker = new DistributedReadWriteLock(lock, "reader".getBytes(utf8));
+    DistributedReadWriteLock wlocker = new DistributedReadWriteLock(lock, "wlocker".getBytes(utf8));
     Lock readLock = rlocker.readLock();
     readLock.lock();
     Lock readLock2 = rlocker.readLock();
@@ -44,7 +47,7 @@ public class ZooQueueLock extends org.ap
     writeLock.lock();
     if (readLock.tryLock(100, TimeUnit.MILLISECONDS))
       throw new RuntimeException("Read lock achieved during write lock!");
-    Lock writeLock2 = DistributedReadWriteLock.recoverLock(lock, "wlocker".getBytes());
+    Lock writeLock2 = DistributedReadWriteLock.recoverLock(lock, "wlocker".getBytes(utf8));
     writeLock2.unlock();
     readLock.lock();
     System.out.println("success");

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReaderWriter.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReaderWriter.java?rev=1403871&r1=1403870&r2=1403871&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReaderWriter.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReaderWriter.java Tue Oct 30 21:10:42 2012
@@ -20,6 +20,7 @@ import java.lang.reflect.InvocationHandl
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
+import java.nio.charset.Charset;
 
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
@@ -34,9 +35,11 @@ public class ZooReaderWriter extends org
   private static final String USER = "accumulo";
   private static ZooReaderWriter instance = null;
   private static IZooReaderWriter retryingInstance = null;
+
+  private static final Charset utf8 = Charset.forName("UTF8");
   
   public ZooReaderWriter(String string, int timeInMillis, String secret) {
-    super(string, timeInMillis, SCHEME, (USER + ":" + secret).getBytes());
+    super(string, timeInMillis, SCHEME, (USER + ":" + secret).getBytes(utf8));
   }
   
   public static synchronized ZooReaderWriter getInstance() {



Mime
View raw message