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/trunk Commit: e752de96f7e3ae676b5dba0564e1321d6661a0cc Parents: 83b6f22 Author: Jonathan Ellis <jbel...@apache.org> Authored: Wed Sep 26 10:03:57 2012 -0500 Committer: Jonathan Ellis <jbel...@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; }