accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [07/10] git commit: More String UTF8 charsets and add Serializable to the Comparator to make sure the TreeMap is thus also serializable.
Date Fri, 31 Jan 2014 04:01:59 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/6770ed97
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6770ed97
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6770ed97

Branch: refs/heads/2292-findbugs
Commit: 6770ed97233dc5d148764708a6d77216d1005119
Parents: 40c3319
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jan 30 17:37:37 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jan 30 17:37:37 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/6770ed97/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/6770ed97/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/6770ed97/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