fix toString of hint destination tokens

patch by brandonwilliams; reviewed by jbellis for CASSANDRA-4568
This commit is contained in:
Jonathan Ellis 2012-08-28 09:25:26 -05:00
parent ec76baf0dd
commit 4764a379e2
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
1.0.12
* fix toString of hint destination tokens (CASSANDRA-4568)
* (Hadoop) fix setting key length for old-style mapred api (CASSANDRA-4534)
* (Hadoop) fix iterating through a resultset consisting entirely
of tombstoned rows (CASSANDRA-4466)

View File

@ -464,10 +464,15 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean
List<Row> rows = getHintsSlice(Integer.MAX_VALUE);
Map<String, Integer> result = new HashMap<String, Integer>();
Token.TokenFactory tokenFactory = StorageService.getPartitioner().getTokenFactory();
for (Row r : rows)
{
if (r.cf != null) //ignore removed rows
result.put(new String(r.key.key.array()), r.cf.getColumnCount());
if (r.cf == null) // ignore removed rows
continue;
int count = r.cf.getColumnCount();
if (count > 0)
result.put(tokenFactory.toString(r.key.token), count);
}
return result;
}