accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1405202 [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 Fri, 02 Nov 2012 22:50:02 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,8 +16,6 @@
  */
 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;
@@ -32,8 +30,6 @@ 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.
@@ -47,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(utf8),
+    ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(),
         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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -21,7 +21,6 @@ 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;
@@ -42,8 +41,6 @@ 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;
@@ -121,7 +118,7 @@ public class TServerInstance implements 
   }
   
   public Value asMutationValue() {
-    return new Value(org.apache.accumulo.core.util.AddressUtil.toString(getLocation()).getBytes(utf8));
+    return new Value(org.apache.accumulo.core.util.AddressUtil.toString(getLocation()).getBytes());
   }
   
   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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -17,7 +17,6 @@
 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;
@@ -48,8 +47,6 @@ 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;
@@ -96,7 +93,7 @@ public class TabletStateChangeIterator e
     try {
       Map<Text,MergeInfo> result = new HashMap<Text,MergeInfo>();
       DataInputBuffer buffer = new DataInputBuffer();
-      byte[] data = Base64.decodeBase64(merges.getBytes(utf8));
+      byte[] data = Base64.decodeBase64(merges.getBytes());
       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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -18,7 +18,6 @@ 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;
@@ -34,8 +33,6 @@ 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;
@@ -126,7 +123,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(utf8));
+    store.put(Constants.ZROOT_TABLET_FUTURE_LOCATION, value.getBytes());
   }
   
   @Override
@@ -137,8 +134,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(utf8));
-    store.put(Constants.ZROOT_TABLET_LAST_LOCATION, value.getBytes(utf8));
+    store.put(Constants.ZROOT_TABLET_LOCATION, value.getBytes());
+    store.put(Constants.ZROOT_TABLET_LAST_LOCATION, value.getBytes());
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,7 +16,6 @@
  */
 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;
@@ -54,8 +53,6 @@ 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 {
@@ -64,10 +61,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(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);
+    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);
   }
   
   public synchronized static TableManager getInstance() {
@@ -115,7 +112,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(utf8), ZooUtil.PUBLIC, new Mutator() {
+      ZooReaderWriter.getRetryingInstance().mutate(statePath, (byte[]) newState.name().getBytes(), ZooUtil.PUBLIC, new Mutator() {
         @Override
         public byte[] mutate(byte[] oldData) throws Exception {
           TableState oldState = TableState.UNKNOWN;
@@ -142,7 +139,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(utf8);
+          return newState.name().getBytes();
         }
       });
     } 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -22,7 +22,6 @@ 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;
@@ -334,8 +333,6 @@ 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;
@@ -430,7 +427,7 @@ class CopyFailed extends MasterRepo {
         if (fs.exists(dest))
           continue;
         
-        bifCopyQueue.addWork(orig.getName(), (failure + "," + dest).getBytes(utf8));
+        bifCopyQueue.addWork(orig.getName(), (failure + "," + dest).getBytes());
         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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.master.tableOps;
 
-import java.nio.charset.Charset;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
@@ -186,8 +185,6 @@ 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;
@@ -242,7 +239,7 @@ public class CompactRange extends Master
             encodedIterators.append(new String(hex.encode(IteratorUtil.encodeIteratorSettings(iterators))));
           }
           
-          return ("" + flushID + encodedIterators).getBytes(utf8);
+          return ("" + flushID + encodedIterators).getBytes();
         }
       });
       
@@ -275,7 +272,7 @@ public class CompactRange extends Master
           encodedIterators.append(tokens[i]);
         }
         
-        return ("" + flushID + encodedIterators).getBytes(utf8);
+        return ("" + flushID + encodedIterators).getBytes();
       }
     });
 

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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -24,7 +24,6 @@ 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;
@@ -171,8 +170,6 @@ 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;
@@ -249,14 +246,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(utf8))));
+              Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes())));
               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(utf8))));
+              Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes())));
             }
             
             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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,8 +16,6 @@
  */
 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;
@@ -39,8 +37,6 @@ 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 {
@@ -74,7 +70,7 @@ public class RenameTable extends MasterR
             throw new ThriftTableOperationException(null, oldTableName, TableOperation.RENAME, TableOperationExceptionType.NOTFOUND,
                 "Name changed while processing");
           }
-          return newTableName.getBytes(utf8);
+          return newTableName.getBytes();
         }
       });
       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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -17,7 +17,6 @@
 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;
 
@@ -40,8 +39,6 @@ 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 {
     
@@ -57,12 +54,12 @@ public class Utils {
     try {
       IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
       final String ntp = ZooUtil.getRoot(instance) + Constants.ZTABLES;
-      byte[] nid = zoo.mutate(ntp, "0".getBytes(utf8), ZooUtil.PUBLIC, new Mutator() {
+      byte[] nid = zoo.mutate(ntp, "0".getBytes(), 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(utf8);
+          return nextId.toString(Character.MAX_RADIX).getBytes();
         }
       });
       return new String(nid);
@@ -98,7 +95,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(utf8)));
+    String resvPath = ZooUtil.getRoot(instance) + Constants.ZHDFS_RESERVATIONS + "/" + new String(Base64.encodeBase64(directory.getBytes()));
     
     IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance();
     
@@ -110,12 +107,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(utf8)));
+    String resvPath = ZooUtil.getRoot(instance) + Constants.ZHDFS_RESERVATIONS + "/" + new String(Base64.encodeBase64(directory.getBytes()));
     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(utf8);
+    byte[] lockData = String.format("%016x", tid).getBytes();
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,8 +16,6 @@
  */
 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;
@@ -41,8 +39,6 @@ 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;
@@ -63,7 +59,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(utf8), NodeExistsPolicy.OVERWRITE);
+      zoo.putPersistentData(path, "forced down".getBytes(), 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -17,7 +17,6 @@
 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;
@@ -53,14 +52,12 @@ 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>();
@@ -104,14 +101,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(utf8)));
+        createEvent.put(prevRow, new Text(String.format("%020d", timestamp)), new Value(metaTablet.toString().getBytes()));
         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(utf8)));
-      tabletEvent.put(new Text(String.format("%020d", timestamp)), new Text("log"), new Value(logFile.getBytes(utf8)));
+      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()));
       context.write(TABLET_EVENTS_TABLE, tabletEvent);
     }
   }
@@ -149,7 +146,7 @@ public class IndexMeta extends Configure
     
     job.setOutputFormatClass(AccumuloOutputFormat.class);
     AccumuloOutputFormat.setZooKeeperInstance(job.getConfiguration(), instance, zookeepers);
-    AccumuloOutputFormat.setOutputInfo(job.getConfiguration(), user, pass.getBytes(utf8), false, null);
+    AccumuloOutputFormat.setOutputInfo(job.getConfiguration(), user, pass.getBytes(), 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -17,7 +17,6 @@
 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;
@@ -36,8 +35,6 @@ 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;
@@ -83,7 +80,7 @@ public class ZooKeeperStatus implements 
             addr = new InetSocketAddress(parts[0], 2181);
           
           transport = TTimeoutTransport.create(addr, 10 * 1000l);
-          transport.write("stat\n".getBytes(utf8), 0, 5);
+          transport.write("stat\n".getBytes(), 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -22,7 +22,6 @@ 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;
@@ -65,8 +64,6 @@ 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) {
@@ -93,7 +90,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(utf8));
+    		  out.write(("could not get resource " + path + "").getBytes());
     	  }
       } 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.monitor.servlets.trace;
 
-import java.nio.charset.Charset;
 import java.util.Date;
 
 import javax.servlet.http.HttpServletRequest;
@@ -37,8 +36,6 @@ 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);
@@ -68,7 +65,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(utf8);
+    byte[] passwd = conf.get(Property.TRACE_PASSWORD).getBytes();
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -22,7 +22,6 @@ 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;
@@ -40,8 +39,6 @@ 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()
@@ -57,8 +54,8 @@ public class SecurityConstants {
   }
   
   private static byte[] makeSystemPassword() {
-    byte[] version = Constants.VERSION.getBytes(utf8);
-    byte[] inst = HdfsZooInstance.getInstance().getInstanceID().getBytes(utf8);
+    byte[] version = Constants.VERSION.getBytes();
+    byte[] inst = HdfsZooInstance.getInstance().getInstanceID().getBytes();
     try {
       confChecksum = getSystemConfigChecksum();
     } catch (NoSuchAlgorithmException e) {
@@ -100,10 +97,10 @@ public class SecurityConstants {
     try {
       byte[] buff = new byte[in.readInt()];
       in.readFully(buff);
-      versionFails = !Arrays.equals(buff, Constants.VERSION.getBytes(utf8));
+      versionFails = !Arrays.equals(buff, Constants.VERSION.getBytes());
       buff = new byte[in.readInt()];
       in.readFully(buff);
-      instanceFails = !Arrays.equals(buff, HdfsZooInstance.getInstance().getInstanceID().getBytes(utf8));
+      instanceFails = !Arrays.equals(buff, HdfsZooInstance.getInstance().getInstanceID().getBytes());
       buff = new byte[in.readInt()];
       in.readFully(buff);
       confFails = !Arrays.equals(buff, getSystemConfigChecksum());
@@ -134,14 +131,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(utf8));
-      md.update(HdfsZooInstance.getInstance().getInstanceID().getBytes(utf8));
+      md.update(Constants.VERSION.getBytes());
+      md.update(HdfsZooInstance.getInstance().getInstanceID().getBytes());
       
       for (Entry<String,String> entry : ServerConfiguration.getSiteConfiguration()) {
         // only include instance properties
         if (entry.getKey().startsWith(Property.INSTANCE_PREFIX.toString())) {
-          md.update(entry.getKey().getBytes(utf8));
-          md.update(entry.getValue().getBytes(utf8));
+          md.update(entry.getKey().getBytes());
+          md.update(entry.getValue().getBytes());
         }
       }
       

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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -22,7 +22,6 @@ 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;
@@ -57,8 +56,6 @@ 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";
@@ -125,7 +122,7 @@ public final class ZKAuthenticator imple
         }
         
         // prep parent node of users with root username
-        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(utf8), NodeExistsPolicy.FAIL);
+        zoo.putPersistentData(ZKUserPath, rootuser.getBytes(), 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -24,7 +24,6 @@ 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;
@@ -146,8 +145,6 @@ 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
@@ -2177,7 +2174,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;
@@ -2408,7 +2405,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(utf8)));
+        List<IteratorSetting> iters = IteratorUtil.decodeIteratorSettings(hex.decode(tokens[i].split("=")[1].getBytes()));
         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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -28,7 +28,6 @@ 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;
@@ -235,8 +234,6 @@ 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();
@@ -2700,7 +2697,7 @@ public class TabletServer extends Abstra
         }
       };
       
-      byte[] lockContent = new ServerServices(getClientAddressString(), Service.TSERV_CLIENT).toString().getBytes(utf8);
+      byte[] lockContent = new ServerServices(getClientAddressString(), Service.TSERV_CLIENT).toString().getBytes();
       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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.tabletserver;
 
-import java.nio.charset.Charset;
 import java.util.Random;
 
 import org.apache.accumulo.core.Constants;
@@ -37,8 +36,6 @@ 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;
@@ -55,7 +52,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(utf8);
+            return Long.toString(l, Character.MAX_RADIX).getBytes();
           }
         });
         

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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -19,7 +19,6 @@ 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;
 
@@ -77,8 +76,6 @@ 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));
   }
@@ -124,7 +121,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(utf8)));
+      indexMutation.put(new Text(s.description), new Text(s.sender), new Value((idString + ":" + Long.toHexString(diff)).getBytes()));
       ByteArrayTransport transport = new ByteArrayTransport();
       TCompactProtocol protocol = new TCompactProtocol(transport);
       s.write(protocol);
@@ -160,7 +157,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(utf8));
+        connector = serverConfiguration.getInstance().getConnector(conf.get(Property.TRACE_USER), conf.get(Property.TRACE_PASSWORD).getBytes());
         if (!connector.tableOperations().exists(table)) {
           connector.tableOperations().create(table);
         }
@@ -224,7 +221,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(utf8));
+    String path = zoo.putEphemeralSequential(root + "/trace-", name.getBytes());
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.util;
 
-import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Map.Entry;
@@ -48,8 +47,6 @@ 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
@@ -121,7 +118,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(utf8)));
+        m.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(filename), new Value(value.getBytes()));
         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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -21,7 +21,6 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
 
 import jline.ConsoleReader;
 
@@ -48,8 +47,6 @@ 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");
@@ -67,7 +64,7 @@ public class Admin {
       args = cl.getArgs();
       
       user = cl.hasOption("u") ? cl.getOptionValue("u") : "root";
-      pass = cl.hasOption("p") ? cl.getOptionValue("p").getBytes(utf8) : null;
+      pass = cl.hasOption("p") ? cl.getOptionValue("p").getBytes() : null;
       force = cl.hasOption("f");
       
       if (!((cl.getArgs().length == 1 && (args[0].equalsIgnoreCase("stopMaster") || args[0].equalsIgnoreCase("stopAll"))) || (cl.getArgs().length == 2 && args[0]
@@ -101,7 +98,7 @@ public class Admin {
         } else {
           if (pass == null) {
             try {
-              pass = new ConsoleReader().readLine("Enter current password for '" + user + "': ", '*').getBytes(utf8);
+              pass = new ConsoleReader().readLine("Enter current password for '" + user + "': ", '*').getBytes();
             } 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -17,7 +17,6 @@
 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;
@@ -39,8 +38,6 @@ 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;
@@ -133,7 +130,7 @@ public class ChangeSecret {
     });
     String path = "/accumulo/instances/" + inst.getInstanceName();
     orig.recursiveDelete(path, NodeMissingPolicy.SKIP);
-    new_.putPersistentData(path, newInstanceId.getBytes(utf8), NodeExistsPolicy.OVERWRITE);
+    new_.putPersistentData(path, newInstanceId.getBytes(), 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -17,7 +17,6 @@
 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;
@@ -217,8 +216,7 @@ public class CheckForMetadataProblems {
   }
   
   public static void main(String[] args) throws Exception {
-   final Charset utf8 = Charset.forName("UTF8");
-   args = processOptions(args);
+    args = processOptions(args);
     
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     Instance instance = HdfsZooInstance.getInstance();
@@ -226,7 +224,7 @@ public class CheckForMetadataProblems {
 
     if (args.length == 2) {
       user = args[0];
-      pass = args[1].getBytes(utf8);
+      pass = args[1].getBytes();
       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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -17,7 +17,6 @@
 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;
@@ -38,9 +37,6 @@ 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);
@@ -48,7 +44,7 @@ public class CleanZookeeper {
     String root = Constants.ZROOT;
     IZooReaderWriter zk = ZooReaderWriter.getInstance();
     if (args.length == 2) {
-      zk.getZooKeeper().addAuthInfo("digest", args[1].getBytes(utf8));
+      zk.getZooKeeper().addAuthInfo("digest", args[1].getBytes());
     }
     
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -18,7 +18,6 @@ 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;
@@ -109,8 +108,6 @@ 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(""))
@@ -266,7 +263,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(utf8)));
+      mfw.append(rootDirKey, new Value("/root_tablet".getBytes()));
       
       // root's prev row
       Key rootPrevRowKey = new Key(rootExtent, Constants.METADATA_PREV_ROW_COLUMN.getColumnFamily(), Constants.METADATA_PREV_ROW_COLUMN.getColumnQualifier(), 0);
@@ -277,11 +274,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(utf8)));
+      mfw.append(tableDirKey, new Value(Constants.TABLE_TABLET_LOCATION.getBytes()));
       
       // 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(utf8)));
+      mfw.append(tableTimeKey, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes()));
       
       // table tablet's prevrow
       Key tablePrevRowKey = new Key(tableExtent, Constants.METADATA_PREV_ROW_COLUMN.getColumnFamily(), Constants.METADATA_PREV_ROW_COLUMN.getColumnQualifier(),
@@ -294,11 +291,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(utf8)));
+      mfw.append(defaultDirKey, new Value(Constants.DEFAULT_TABLET_LOCATION.getBytes()));
       
       // 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(utf8)));
+      mfw.append(defaultTimeKey, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes()));
       
       // default's prevrow
       Key defaultPrevRowKey = new Key(defaultExtent, Constants.METADATA_PREV_ROW_COLUMN.getColumnFamily(),
@@ -347,7 +344,7 @@ public class Initialize {
     // setup instance name
     if (clearInstanceName)
       zoo.recursiveDelete(instanceNamePath, NodeMissingPolicy.SKIP);
-    zoo.putPersistentData(instanceNamePath, uuid.getBytes(utf8), NodeExistsPolicy.FAIL);
+    zoo.putPersistentData(instanceNamePath, uuid.getBytes(), NodeExistsPolicy.FAIL);
     
     // setup the instance
     String zkInstanceRoot = Constants.ZROOT + "/" + uuid;
@@ -361,7 +358,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(utf8), NodeExistsPolicy.FAIL);
+    zoo.putPersistentData(zkInstanceRoot + Constants.ZMASTER_GOAL_STATE, MasterGoalState.NORMAL.toString().getBytes(), 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);
@@ -405,7 +402,7 @@ public class Initialize {
   
   private static byte[] getRootPassword() throws IOException {
     if (cliPassword != null) {
-      return cliPassword.getBytes(utf8);
+      return cliPassword.getBytes();
     }
     String rootpass;
     String confirmpass;
@@ -419,7 +416,7 @@ public class Initialize {
       if (!rootpass.equals(confirmpass))
         log.error("Passwords do not match");
     } while (!rootpass.equals(confirmpass));
-    return rootpass.getBytes(utf8);
+    return rootpass.getBytes();
   }
   
   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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -17,7 +17,6 @@
 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;
@@ -38,8 +37,6 @@ 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) {
@@ -48,7 +45,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(utf8));
+    Connector connector = instance.getConnector(args[2], args[3].getBytes());
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -20,7 +20,6 @@
 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;
@@ -99,8 +98,6 @@ 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() {
     
@@ -116,7 +113,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(utf8)));
+    Constants.METADATA_LOCK_COLUMN.put(m, new Value(zooLock.getLockID().serialize(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + "/").getBytes()));
   }
   
   public static void update(AuthInfo credentials, Mutation m) {
@@ -195,7 +192,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(utf8)));
+      Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes()));
       // stuff in this location
       TServerInstance self = getTServerInstance(address, zooLock);
       self.putLastLocation(m);
@@ -210,12 +207,12 @@ public class MetadataTable extends org.a
     }
     
     for (String scanFile : filesInUseByScans)
-      m.put(Constants.METADATA_SCANFILE_COLUMN_FAMILY, new Text(scanFile), new Value("".getBytes(utf8)));
+      m.put(Constants.METADATA_SCANFILE_COLUMN_FAMILY, new Text(scanFile), new Value("".getBytes()));
     
     if (mergeFile != null)
       m.putDelete(Constants.METADATA_DATAFILE_COLUMN_FAMILY, new Text(mergeFile));
     
-    Constants.METADATA_FLUSH_COLUMN.put(m, new Value((flushId + "").getBytes(utf8)));
+    Constants.METADATA_FLUSH_COLUMN.put(m, new Value((flushId + "").getBytes()));
     
     update(credentials, zooLock, m);
     
@@ -237,7 +234,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(utf8)));
+      Constants.METADATA_FLUSH_COLUMN.put(m, new Value((flushID + "").getBytes()));
       update(credentials, zooLock, m);
     }
   }
@@ -245,29 +242,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(utf8)));
+      Constants.METADATA_COMPACT_COLUMN.put(m, new Value((compactID + "").getBytes()));
       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(utf8);
+    byte[] tidBytes = Long.toString(tid).getBytes();
     
     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(utf8)));
+    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes()));
     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(utf8)));
-    Constants.METADATA_TIME_COLUMN.put(m, new Value((timeType + "0").getBytes(utf8)));
+    Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(path.getBytes()));
+    Constants.METADATA_TIME_COLUMN.put(m, new Value((timeType + "0").getBytes()));
     
     update(credentials, lock, m);
   }
@@ -347,7 +344,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(utf8), NodeExistsPolicy.OVERWRITE);
+        zoo.putPersistentData(zRootLocPath, address.getBytes(), NodeExistsPolicy.OVERWRITE);
         return true;
       } catch (Exception e) {
         log.error("Master: unable to save root tablet location in zookeeper. exception: " + e, e);
@@ -384,12 +381,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(utf8)));
-    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes(utf8)));
+    Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(path.getBytes()));
+    Constants.METADATA_TIME_COLUMN.put(m, new Value(time.getBytes()));
     if (lastFlushID > 0)
-      Constants.METADATA_FLUSH_COLUMN.put(m, new Value(("" + lastFlushID).getBytes(utf8)));
+      Constants.METADATA_FLUSH_COLUMN.put(m, new Value(("" + lastFlushID).getBytes()));
     if (lastCompactID > 0)
-      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(("" + lastCompactID).getBytes(utf8)));
+      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(("" + lastCompactID).getBytes()));
     
     if (location != null) {
       m.put(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY, location.asColumnQualifier(), location.asMutationValue());
@@ -401,7 +398,7 @@ public class MetadataTable extends org.a
     }
     
     for (Entry<String,Long> entry : bulkLoadedFiles.entrySet()) {
-      byte[] tidBytes = Long.toString(entry.getValue()).getBytes(utf8);
+      byte[] tidBytes = Long.toString(entry.getValue()).getBytes();
       m.put(Constants.METADATA_BULKFILE_COLUMN_FAMILY, new Text(entry.getKey()), new Value(tidBytes));
     }
 
@@ -411,7 +408,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(utf8)));
+    Constants.METADATA_SPLIT_RATIO_COLUMN.put(m, new Value(Double.toString(splitRatio).getBytes()));
     
     Constants.METADATA_OLD_PREV_ROW_COLUMN.put(m, KeyExtent.encodePrevEndRow(oldPrevEndRow));
     Constants.METADATA_CHOPPED_COLUMN.putDelete(m);
@@ -461,13 +458,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(utf8)));
+      m.put(Constants.METADATA_SCANFILE_COLUMN_FAMILY, new Text(scanFile), new Value("".getBytes()));
     
     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(utf8)));
+      Constants.METADATA_COMPACT_COLUMN.put(m, new Value(("" + compactionId).getBytes()));
     
     TServerInstance self = getTServerInstance(address, zooLock);
     self.putLastLocation(m);
@@ -794,7 +791,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(utf8)));
+      m.put(Constants.METADATA_LOG_COLUMN_FAMILY, new Text(entry.server + "/" + entry.filename), new Value(value.getBytes()));
       update(credentials, zooLock, m);
     }
   }
@@ -1108,7 +1105,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(utf8)));
+        m.put(Constants.METADATA_CLONED_COLUMN_FAMILY, new Text(""), new Value("OK".getBytes()));
         bw.addMutation(m);
       }
     }
@@ -1163,7 +1160,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(utf8))));
+      Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes())));
       bw.addMutation(m);
     }
     
@@ -1173,7 +1170,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(utf8)));
+    Constants.METADATA_CHOPPED_COLUMN.put(m, new Value("chopped".getBytes()));
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.util;
 
-import java.nio.charset.Charset;
 import java.util.Iterator;
 import java.util.Random;
 
@@ -82,14 +81,13 @@ 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(utf8));
+      Connector connector = HdfsZooInstance.getInstance().getConnector(args[0], args[1].getBytes());
       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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.util;
 
-import java.nio.charset.Charset;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.Constants;
@@ -44,14 +43,13 @@ 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(utf8));
+    Connector connector = instance.getConnector(args[2], args[3].getBytes());
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -18,7 +18,6 @@ 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;
@@ -38,8 +37,6 @@ 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;
@@ -77,9 +74,9 @@ public class RestoreZookeeper {
     }
     
     private void create(String path, String value, String encoding) {
-      byte[] data = value.getBytes(utf8);
+      byte[] data = value.getBytes();
       if ("base64".equals(encoding))
-        data = Base64.decodeBase64(value.getBytes(utf8));
+        data = Base64.decodeBase64(value.getBytes());
       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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -25,7 +25,6 @@ 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;
@@ -71,8 +70,6 @@ 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 {
     
@@ -138,7 +135,7 @@ public class SendLogToChainsaw extends X
                 out = convertLine(line, threadName);
                 if (null != out) {
                   if (socket != null && socket.isConnected())
-                    socket.getOutputStream().write(out.getBytes(utf8));
+                    socket.getOutputStream().write(out.getBytes());
                   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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,8 +16,6 @@
  */
 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;
@@ -28,9 +26,6 @@ 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))
@@ -38,7 +33,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(utf8), NodeExistsPolicy.OVERWRITE);
+    ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(), 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,8 +16,6 @@
  */
 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;
@@ -28,9 +26,6 @@ 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;
@@ -41,7 +36,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(utf8), NodeExistsPolicy.OVERWRITE);
+    ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(), 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -18,7 +18,6 @@ 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;
@@ -71,8 +70,6 @@ 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();
@@ -132,7 +129,7 @@ public class VerifyTabletAssignments {
       System.exit(1);
     }
     
-    Connector conn = instance.getConnector(user, passw.getBytes(utf8));
+    Connector conn = instance.getConnector(user, passw.getBytes());
     ServerConfiguration conf = new ServerConfiguration(instance);
     for (String table : conn.tableOperations().list())
       checkTable(conf.getConfiguration(), user, passw, table, null, cl.hasOption(verboseOption.getOpt()));
@@ -152,7 +149,7 @@ public class VerifyTabletAssignments {
     SortedSet<KeyExtent> tablets = new TreeSet<KeyExtent>();
     
     MetadataTable.getEntries(HdfsZooInstance.getInstance(),
-        new AuthInfo(user, ByteBuffer.wrap(pass.getBytes(utf8)), HdfsZooInstance.getInstance().getInstanceID()), table, false, locations, tablets);
+        new AuthInfo(user, ByteBuffer.wrap(pass.getBytes()), HdfsZooInstance.getInstance().getInstanceID()), table, false, locations, tablets);
     
     final HashSet<KeyExtent> failures = new HashSet<KeyExtent>();
     
@@ -183,7 +180,7 @@ public class VerifyTabletAssignments {
         @Override
         public void run() {
           try {
-            checkTabletServer(conf, user, ByteBuffer.wrap(pass.getBytes(utf8)), entry, failures);
+            checkTabletServer(conf, user, ByteBuffer.wrap(pass.getBytes()), 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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.server.zookeeper;
 
-import java.nio.charset.Charset;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 
@@ -24,8 +23,6 @@ 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);
@@ -33,8 +30,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(utf8));
-    DistributedReadWriteLock wlocker = new DistributedReadWriteLock(lock, "wlocker".getBytes(utf8));
+    DistributedReadWriteLock rlocker = new DistributedReadWriteLock(lock, "reader".getBytes());
+    DistributedReadWriteLock wlocker = new DistributedReadWriteLock(lock, "wlocker".getBytes());
     Lock readLock = rlocker.readLock();
     readLock.lock();
     Lock readLock2 = rlocker.readLock();
@@ -47,7 +44,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(utf8));
+    Lock writeLock2 = DistributedReadWriteLock.recoverLock(lock, "wlocker".getBytes());
     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=1405202&r1=1405201&r2=1405202&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 Fri Nov  2 22:49:59 2012
@@ -20,7 +20,6 @@ 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;
@@ -35,11 +34,9 @@ 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(utf8));
+    super(string, timeInMillis, SCHEME, (USER + ":" + secret).getBytes());
   }
   
   public static synchronized ZooReaderWriter getInstance() {



Mime
View raw message