cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject git commit: fix listEndpointsPendingHints to generate String representation of the tokens for which we have hints
Date Wed, 26 Sep 2012 15:06:03 GMT
Updated Branches:
  refs/heads/cassandra-1.1 83b6f2229 -> e752de96f


fix listEndpointsPendingHints to generate String representation of the tokens for which we
have hints


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

Branch: refs/heads/cassandra-1.1
Commit: e752de96f7e3ae676b5dba0564e1321d6661a0cc
Parents: 83b6f22
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Sep 26 10:03:57 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Sep 26 10:05:50 2012 -0500

----------------------------------------------------------------------
 .../apache/cassandra/db/HintedHandOffManager.java  |   19 +++++++--------
 1 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e752de96/src/java/org/apache/cassandra/db/HintedHandOffManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManager.java b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
index 3e5e2d5..a26894e 100644
--- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java
+++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
@@ -446,32 +446,31 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean
 
     public List<String> listEndpointsPendingHints()
     {
-        List<Row> rows = getHintsSlice(1);
+        Token.TokenFactory tokenFactory = StorageService.getPartitioner().getTokenFactory();
 
         // Extract the keys as strings to be reported.
         LinkedList<String> result = new LinkedList<String>();
-        for (Row r : rows)
+        for (Row row : getHintsSlice(1))
         {
-            if (r.cf != null) //ignore removed rows
-                result.addFirst(new String(r.key.key.array()));
+            if (row.cf != null) //ignore removed rows
+                result.addFirst(tokenFactory.toString(row.key.token));
         }
         return result;
     }
 
     public Map<String, Integer> countPendingHints()
     {
-        List<Row> rows = getHintsSlice(Integer.MAX_VALUE);
+        Token.TokenFactory tokenFactory = StorageService.getPartitioner().getTokenFactory();
 
         Map<String, Integer> result = new HashMap<String, Integer>();
-        Token.TokenFactory tokenFactory = StorageService.getPartitioner().getTokenFactory();
-        for (Row r : rows)
+        for (Row row : getHintsSlice(Integer.MAX_VALUE))
         {
-            if (r.cf == null) // ignore removed rows
+            if (row.cf == null) // ignore removed rows
                 continue;
 
-            int count = r.cf.getColumnCount();
+            int count = row.cf.getColumnCount();
             if (count > 0)
-                result.put(tokenFactory.toString(r.key.token), count);
+                result.put(tokenFactory.toString(row.key.token), count);
         }
         return result;
     }


Mime
View raw message