accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [20/26] UTF8 and Integer/Long fixes to the test module
Date Sat, 01 Feb 2014 03:23:19 GMT
http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
index 3b36e81..b882a3a 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.security.Authorizations;
@@ -45,10 +46,10 @@ public class ChangeAuthorizations extends Test {
       if (rand.nextBoolean()) {
         String authorization = String.format("a%d", rand.nextInt(5000));
         log.debug("adding authorization " + authorization);
-        auths.add(authorization.getBytes());
+        auths.add(authorization.getBytes(Constants.UTF8));
       } else {
         if (auths.size() > 0) {
-          log.debug("removing authorization " + new String(auths.remove(0)));
+          log.debug("removing authorization " + new String(auths.remove(0), Constants.UTF8));
         }
       }
       conn.securityOperations().changeUserAuthorizations(userName, new Authorizations(auths));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
index 8278843..698b0c0 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
@@ -49,7 +49,7 @@ public class CheckBalance extends Test {
       String location = entry.getKey().getColumnQualifier().toString();
       Long count = counts.get(location);
       if (count == null)
-        count = new Long(0);
+        count = Long.valueOf(0);
       counts.put(location, count + 1);
     }
     double total = 0.;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
index 609bbb0..de4961e 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
@@ -48,7 +48,7 @@ public class StopTabletServer extends Test {
           Collections.sort(children);
           Stat stat = new Stat();
           byte[] data = rdr.getData(base + "/" + child + "/" + children.get(0), stat);
-          if (!"master".equals(new String(data))) {
+          if (!"master".equals(new String(data, Constants.UTF8))) {
             result.add(new TServerInstance(AddressUtil.parseAddress(child, Property.TSERV_CLIENTPORT),
stat.getEphemeralOwner()));
           }
         }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
index 854ad0c..3a805ef 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
@@ -28,7 +28,7 @@ public class Commit extends Test {
     state.getMultiTableBatchWriter().flush();
     
     log.debug("Committed " + state.getLong("numWrites") + " writes.  Total writes: " + state.getLong("totalWrites"));
-    state.set("numWrites", new Long(0));
+    state.set("numWrites", Long.valueOf(0));
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
index 86df45d..a23426e 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
@@ -86,9 +86,9 @@ public class ImageFixture extends Fixture {
       log.debug("Configured locality groups for " + imageTableName + " groups = " + groups);
     }
     
-    state.set("numWrites", new Long(0));
-    state.set("totalWrites", new Long(0));
-    state.set("verified", new Integer(0));
+    state.set("numWrites", Long.valueOf(0));
+    state.set("totalWrites", Long.valueOf(0));
+    state.set("verified", Integer.valueOf(0));
     state.set("lastIndexRow", new Text(""));
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Verify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Verify.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Verify.java
index b8c05d3..ba0ed73 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Verify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Verify.java
@@ -18,11 +18,12 @@ package org.apache.accumulo.test.randomwalk.image;
 
 import java.security.MessageDigest;
 import java.util.Iterator;
+import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Random;
 import java.util.UUID;
-import java.util.Map.Entry;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.data.Key;
@@ -57,7 +58,7 @@ public class Verify extends Test {
     String uuid = UUID.randomUUID().toString();
     
     MessageDigest alg = MessageDigest.getInstance("SHA-1");
-    alg.update(uuid.getBytes());
+    alg.update(uuid.getBytes(Constants.UTF8));
     
     indexScanner.setRange(new Range(new Text(alg.digest()), null));
     indexScanner.setBatchSize(numVerifications);
@@ -86,7 +87,7 @@ public class Verify extends Test {
     
     int verified = ((Integer) state.get("verified")).intValue() + numVerifications;
     log.debug("Verified " + numVerifications + " - Total " + verified);
-    state.set("verified", new Integer(verified));
+    state.set("verified", Integer.valueOf(verified));
   }
   
   public void verifyRow(Scanner scanner, String row) throws Exception {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
index 4206148..32d3a72 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
@@ -21,6 +21,7 @@ import java.util.Properties;
 import java.util.Random;
 import java.util.UUID;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.MultiTableBatchWriter;
 import org.apache.accumulo.core.data.Mutation;
@@ -60,7 +61,7 @@ public class Write extends Test {
     m.put(CONTENT_COLUMN_FAMILY, IMAGE_COLUMN_QUALIFIER, new Value(imageBytes));
     
     // store size
-    m.put(META_COLUMN_FAMILY, new Text("size"), new Value(String.format("%d", numBytes).getBytes()));
+    m.put(META_COLUMN_FAMILY, new Text("size"), new Value(String.format("%d", numBytes).getBytes(Constants.UTF8)));
     
     // store hash
     MessageDigest alg = MessageDigest.getInstance("SHA-1");
@@ -74,7 +75,7 @@ public class Write extends Test {
     state.set("totalWrites", totalWrites);
     
     // set count
-    m.put(META_COLUMN_FAMILY, COUNT_COLUMN_QUALIFIER, new Value(String.format("%d", totalWrites).getBytes()));
+    m.put(META_COLUMN_FAMILY, COUNT_COLUMN_QUALIFIER, new Value(String.format("%d", totalWrites).getBytes(Constants.UTF8)));
     
     // add mutation
     imagesBW.addMutation(m);
@@ -82,7 +83,7 @@ public class Write extends Test {
     // now add mutation to index
     Text row = new Text(hash);
     m = new Mutation(row);
-    m.put(META_COLUMN_FAMILY, UUID_COLUMN_QUALIFIER, new Value(uuid.getBytes()));
+    m.put(META_COLUMN_FAMILY, UUID_COLUMN_QUALIFIER, new Value(uuid.getBytes(Constants.UTF8)));
     
     indexBW.addMutation(m);
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
index 341ac02..1153634 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
@@ -33,7 +33,7 @@ public class Commit extends Test {
     log.debug("Committed " + numWrites + " writes.  Total writes: " + totalWrites);
     
     state.set("totalWrites", totalWrites);
-    state.set("numWrites", new Long(0));
+    state.set("numWrites", Long.valueOf(0));
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
index acbb95d..5a2172d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
@@ -70,6 +70,6 @@ public class CopyTable extends Test {
     log.debug("dropped " + srcTableName);
     
     nextId++;
-    state.set("nextId", new Integer(nextId));
+    state.set("nextId", Integer.valueOf(nextId));
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
index e64b342..5f37913 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
@@ -45,6 +45,6 @@ public class CreateTable extends Test {
     }
     
     nextId++;
-    state.set("nextId", new Integer(nextId));
+    state.set("nextId", Integer.valueOf(nextId));
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
index ee0fff6..1755acc 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
@@ -34,9 +34,9 @@ public class MultiTableFixture extends Fixture {
     String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
     
     state.set("tableNamePrefix", String.format("multi_%s_%s_%d", hostname, state.getPid(),
System.currentTimeMillis()));
-    state.set("nextId", new Integer(0));
-    state.set("numWrites", new Long(0));
-    state.set("totalWrites", new Long(0));
+    state.set("nextId", Integer.valueOf(0));
+    state.set("numWrites", Long.valueOf(0));
+    state.set("totalWrites", Long.valueOf(0));
     state.set("tableList", new ArrayList<String>());
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
index cf23e32..0b9c062 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Write.java
@@ -22,6 +22,7 @@ import java.util.Properties;
 import java.util.Random;
 import java.util.UUID;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
@@ -70,7 +71,7 @@ public class Write extends Test {
     m.put(meta, new Text("payload"), new Value(payloadBytes));
     
     // store size
-    m.put(meta, new Text("size"), new Value(String.format("%d", numBytes).getBytes()));
+    m.put(meta, new Text("size"), new Value(String.format("%d", numBytes).getBytes(Constants.UTF8)));
     
     // store hash
     MessageDigest alg = MessageDigest.getInstance("SHA-1");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
index 685b05d..be9770c 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
@@ -76,7 +76,7 @@ public class SecurityHelper {
   }
   
   public static void setSysUserPass(State state, byte[] sysUserPass) {
-    log.debug("Setting system user pass to " + new String(sysUserPass));
+    log.debug("Setting system user pass to " + new String(sysUserPass, Constants.UTF8));
     state.set(masterPass, sysUserPass);
     state.set(masterPass + "time", System.currentTimeMillis());
     
@@ -91,7 +91,7 @@ public class SecurityHelper {
   }
   
   public static void setTabUserPass(State state, byte[] tabUserPass) {
-    log.debug("Setting table user pass to " + new String(tabUserPass));
+    log.debug("Setting table user pass to " + new String(tabUserPass, Constants.UTF8));
     state.set(tUserPass, tabUserPass);
     state.set(tUserPass + "time", System.currentTimeMillis());
   }
@@ -177,7 +177,7 @@ public class SecurityHelper {
   public static void increaseAuthMap(State state, String s, int increment) {
     Integer curVal = getAuthsMap(state).get(s);
     if (curVal == null) {
-      curVal = new Integer(0);
+      curVal = Integer.valueOf(0);
       getAuthsMap(state).put(s, curVal);
     }
     curVal += increment;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
index a636355..7524f92 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
@@ -24,6 +24,7 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.UUID;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriter;
@@ -89,7 +90,7 @@ public class TableOp extends Test {
           if (!canRead && !ambiguousZone)
             throw new AccumuloException("Was able to read when I shouldn't have had the perm
with connection user " + conn.whoami() + " table " + tableName);
           for (Entry<String,Integer> entry : WalkingSecurity.get(state).getAuthsMap().entrySet())
{
-            if (auths.contains(entry.getKey().getBytes()))
+            if (auths.contains(entry.getKey().getBytes(Constants.UTF8)))
               seen = seen - entry.getValue();
           }
           if (seen != 0 && !ambiguousAuths)
@@ -146,7 +147,7 @@ public class TableOp extends Test {
         String key = WalkingSecurity.get(state).getLastKey() + "1";
         Mutation m = new Mutation(new Text(key));
         for (String s : WalkingSecurity.get(state).getAuthsArray()) {
-          m.put(new Text(), new Text(), new ColumnVisibility(s), new Value("value".getBytes()));
+          m.put(new Text(), new Text(), new ColumnVisibility(s), new Value("value".getBytes(Constants.UTF8)));
         }
         BatchWriter writer = null;
         try {
@@ -204,7 +205,7 @@ public class TableOp extends Test {
         f.startDefaultLocalityGroup();
         fs.mkdirs(fail);
         for (Key k : keys)
-          f.append(k, new Value("Value".getBytes()));
+          f.append(k, new Value("Value".getBytes(Constants.UTF8)));
         f.close();
         try {
           conn.tableOperations().importDirectory(tableName, dir.toString(), fail.toString(),
true);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
index bd97dd4..992374a 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
@@ -363,7 +363,7 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor,
Au
   public void increaseAuthMap(String s, int increment) {
     Integer curVal = getAuthsMap().get(s);
     if (curVal == null) {
-      curVal = new Integer(0);
+      curVal = Integer.valueOf(0);
       getAuthsMap().put(s, curVal);
     }
     curVal += increment;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
index 8abfb39..cd1ccab 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
@@ -29,7 +29,7 @@ public class Commit extends Test {
     state.getMultiTableBatchWriter().flush();
     
     log.debug("Committed " + state.getLong("numWrites") + " writes.  Total writes: " + state.getLong("totalWrites"));
-    state.set("numWrites", new Long(0));
+    state.set("numWrites", Long.valueOf(0));
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
index eb45966..8a2f8f4 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
@@ -70,7 +70,7 @@ public class MapRedVerifyTool extends Configured implements Tool {
     
     public void writeMutation(Context output, int start, int end) throws IOException, InterruptedException
{
       Mutation m = new Mutation(new Text(String.format("%010d", start)));
-      m.put(new Text(String.format("%010d", end)), new Text(""), new Value("".getBytes()));
+      m.put(new Text(String.format("%010d", end)), new Text(""), new Value(new byte[0]));
       output.write(null, m);
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
index b7377b7..1573c3b 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
@@ -51,8 +51,8 @@ public class SequentialFixture extends Fixture {
     }
     conn.tableOperations().setProperty(seqTableName, "table.scan.max.memory", "1K");
     
-    state.set("numWrites", new Long(0));
-    state.set("totalWrites", new Long(0));
+    state.set("numWrites", Long.valueOf(0));
+    state.set("totalWrites", Long.valueOf(0));
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
index 671055b..1c3b882 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test.randomwalk.sequential;
 
 import java.util.Properties;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
@@ -41,7 +42,7 @@ public class Write extends Test {
     state.set("totalWrites", totalWrites);
     
     Mutation m = new Mutation(new Text(String.format("%010d", totalWrites)));
-    m.put(new Text("cf"), new Text("cq"), new Value(new String("val").getBytes()));
+    m.put(new Text("cf"), new Text("cq"), new Value("val".getBytes(Constants.UTF8)));
     bw.addMutation(m);
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
index b3bbb15..fb01058 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.MutationsRejectedException;
@@ -120,7 +121,7 @@ public class BulkInsert extends Test {
       log.debug("Bulk inserting document " + docID);
     }
     
-    state.set("nextDocID", new Long(nextDocID));
+    state.set("nextDocID", Long.valueOf(nextDocID));
     
     dataWriter.close();
     indexWriter.close();
@@ -161,13 +162,13 @@ public class BulkInsert extends Test {
   
   private void sort(State state, FileSystem fs, String tableName, String seqFile, String
outputDir, String workDir, int maxSplits) throws Exception {
     
-    PrintStream out = new PrintStream(new BufferedOutputStream(fs.create(new Path(workDir
+ "/splits.txt"))));
+    PrintStream out = new PrintStream(new BufferedOutputStream(fs.create(new Path(workDir
+ "/splits.txt"))), false, Constants.UTF8.name());
     
     Connector conn = state.getConnector();
     
     Collection<Text> splits = conn.tableOperations().listSplits(tableName, maxSplits);
     for (Text split : splits)
-      out.println(new String(Base64.encodeBase64(TextUtil.getBytes(split))));
+      out.println(new String(Base64.encodeBase64(TextUtil.getBytes(split)), Constants.UTF8));
     
     out.close();
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
index a47da30..fa55c53 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
@@ -66,7 +66,7 @@ public class ExportIndex extends Test {
     long t3 = System.currentTimeMillis();
 
     // copy files
-    BufferedReader reader = new BufferedReader(new InputStreamReader(fs.open(new Path(exportDir,
"distcp.txt"))));
+    BufferedReader reader = new BufferedReader(new InputStreamReader(fs.open(new Path(exportDir,
"distcp.txt")), Constants.UTF8));
     String file = null;
     while ((file = reader.readLine()) != null) {
       Path src = new Path(file);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
index 672dd2e..8e81acb 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
@@ -50,7 +50,7 @@ public class Insert extends Test {
     
     log.debug("Inserted document " + docID);
     
-    state.set("nextDocID", new Long(nextDocID));
+    state.set("nextDocID", Long.valueOf(nextDocID));
   }
   
   static String insertRandomDocument(long did, BatchWriter dataWriter, BatchWriter indexWriter,
String indexTableName, String dataTableName, int numPartitions,

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
index 97e33b4..996bd73 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
@@ -75,10 +75,10 @@ public class ShardFixture extends Fixture {
     
     state.set("indexTableName", String.format("ST_index_%s_%s_%d", hostname, pid, System.currentTimeMillis()));
     state.set("docTableName", String.format("ST_docs_%s_%s_%d", hostname, pid, System.currentTimeMillis()));
-    state.set("numPartitions", new Integer(numPartitions));
+    state.set("numPartitions", Integer.valueOf(numPartitions));
     state.set("cacheIndex", rand.nextDouble() < .5);
     state.set("rand", rand);
-    state.set("nextDocID", new Long(0));
+    state.set("nextDocID", Long.valueOf(0));
     
     Connector conn = state.getConnector();
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/990da6ae/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java b/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java
index d941283..f4d1219 100644
--- a/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java
+++ b/test/src/main/java/org/apache/accumulo/test/scalability/Ingest.java
@@ -20,6 +20,7 @@ import java.util.Random;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
@@ -101,7 +102,7 @@ public class Ingest extends ScaleTest {
     while (count < numIngestEntries) {
       count++;
       long rowId = ContinuousIngest.genLong(minRow, maxRow, r);
-      Mutation m = ContinuousIngest.genMutation(rowId, r.nextInt(maxColF), r.nextInt(maxColQ),
cv, ingestInstanceId.getBytes(), count, null, r, false);
+      Mutation m = ContinuousIngest.genMutation(rowId, r.nextInt(maxColF), r.nextInt(maxColQ),
cv, ingestInstanceId.getBytes(Constants.UTF8), count, null, r, false);
       totalBytes += m.numBytes();
       try {
         bw.addMutation(m);


Mime
View raw message