accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [06/26] git commit: More String UTF8 charsets and add Serializable to the Comparator to make sure the TreeMap is thus also serializable.
Date Sat, 01 Feb 2014 03:23:05 GMT
More String UTF8 charsets and add Serializable to the Comparator to make sure the TreeMap is
thus also serializable.


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

Branch: refs/heads/2292-findbugs
Commit: c4781bbd127a53ef568907c3450edfb1c505abe6
Parents: dcaae30
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jan 30 17:37:37 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Jan 31 22:18:52 2014 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/core/client/impl/Tables.java | 6 +++---
 .../apache/accumulo/core/client/impl/TabletLocatorImpl.java    | 5 ++++-
 .../main/java/org/apache/accumulo/core/client/impl/Writer.java | 3 ++-
 3 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/c4781bbd/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
index d1b10d4..07f75e0 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
@@ -53,9 +53,9 @@ public class Tables {
       byte[] tblPath = zc.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId
+ Constants.ZTABLE_NAME);
       if (tblPath != null) {
         if (nameAsKey)
-          tableMap.put(new String(tblPath), tableId);
+          tableMap.put(new String(tblPath, Constants.UTF8), tableId);
         else
-          tableMap.put(tableId, new String(tblPath));
+          tableMap.put(tableId, new String(tblPath, Constants.UTF8));
       }
     }
     
@@ -112,7 +112,7 @@ public class Tables {
     if (state == null)
       return TableState.UNKNOWN;
     
-    return TableState.valueOf(new String(state));
+    return TableState.valueOf(new String(state, Constants.UTF8));
   }
   
   public static long getCacheResetCount() {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/c4781bbd/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
index ea9c73d..f510549 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.client.impl;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -57,8 +58,10 @@ public class TabletLocatorImpl extends TabletLocator {
   // putting null, put MAX_TEXT
   static final Text MAX_TEXT = new Text();
   
-  private static class EndRowComparator implements Comparator<Text> {
+  private static class EndRowComparator implements Comparator<Text>, Serializable {
     
+    private static final long serialVersionUID = 1L;
+
     public int compare(Text o1, Text o2) {
       
       int ret;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/c4781bbd/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
index cec700d..7353e54 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.core.client.impl;
 
 import org.apache.accumulo.trace.instrument.Tracer;
+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.Instance;
@@ -87,7 +88,7 @@ public class Writer {
       TabletLocation tabLoc = TabletLocator.getInstance(instance, table).locateTablet(new
Text(m.getRow()), false, true, credentials);
       
       if (tabLoc == null) {
-        log.trace("No tablet location found for row " + new String(m.getRow()));
+        log.trace("No tablet location found for row " + new String(m.getRow(), Constants.UTF8));
         UtilWaitThread.sleep(500);
         continue;
       }


Mime
View raw message