accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [04/26] git commit: ACCUMULO-2292 Fix findbugs errors in trace module
Date Sat, 01 Feb 2014 03:23:03 GMT
ACCUMULO-2292 Fix findbugs errors in trace module


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

Branch: refs/heads/2292-findbugs
Commit: 4fb95e9fe7f5c534564c58dccff3c647f8615592
Parents: b76c8f4
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jan 30 15:29:40 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Jan 31 22:18:51 2014 -0500

----------------------------------------------------------------------
 .../org/apache/accumulo/trace/instrument/TraceRunnable.java | 9 +++++++++
 .../accumulo/trace/instrument/receivers/ZooSpanClient.java  | 4 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4fb95e9f/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
index a13f2be..41c765d 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/TraceRunnable.java
@@ -48,6 +48,15 @@ public class TraceRunnable implements Runnable, Comparable<TraceRunnable>
{
     }
   }
   
+  @Override
+  public boolean equals(Object o) {
+    if (o instanceof TraceRunnable) {
+      return 0 == this.compareTo((TraceRunnable) o);
+    }
+    
+    return false;
+  }
+  
   @SuppressWarnings({"rawtypes", "unchecked"})
   @Override
   public int compareTo(TraceRunnable o) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4fb95e9f/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java
b/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java
index d6db906..049b2a2 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.trace.instrument.receivers;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -38,6 +39,7 @@ public class ZooSpanClient extends SendSpansViaThrift {
   private static final Logger log = Logger.getLogger(ZooSpanClient.class);
   private static final int TOTAL_TIME_WAIT_CONNECT_MS = 10 * 1000;
   private static final int TIME_WAIT_CONNECT_CHECK_MS = 100;
+  private static final Charset UTF8 = Charset.forName("UTF-8");
   
   ZooKeeper zoo = null;
   final String path;
@@ -108,7 +110,7 @@ public class ZooSpanClient extends SendSpansViaThrift {
       List<String> hosts = new ArrayList<String>();
       for (String child : children) {
         byte[] data = zoo.getData(path + "/" + child, null, null);
-        hosts.add(new String(data));
+        hosts.add(new String(data, UTF8));
       }
       this.hosts.clear();
       this.hosts.addAll(hosts);


Mime
View raw message