Author: goffinet
Date: Thu Apr 7 19:40:33 2011
New Revision: 1089955
URL: http://svn.apache.org/viewvc?rev=1089955&view=rev
Log:
Support a byte[] key for getNaturalEndpoints so clustertool get_endpoints does
not throw exception
patch by goffinet; reviewed by stuhood for CASSANDRA-2437
Modified:
cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java
Modified:
cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL:
http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=1089955&r1=1089954&r2=1089955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
Thu Apr 7 19:40:33 2011
@@ -1543,6 +1543,11 @@ public class StorageService implements I
* @param key - key for which we need to find the endpoint return value -
* the endpoint responsible for this key
*/
+ public List<InetAddress> getNaturalEndpoints(String table, byte[] key)
+ {
+ return getNaturalEndpoints(table,
partitioner.getToken(ByteBuffer.wrap(key)));
+ }
+
public List<InetAddress> getNaturalEndpoints(String table, ByteBuffer key)
{
return getNaturalEndpoints(table, partitioner.getToken(key));
Modified:
cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
URL:
http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java?rev=1089955&r1=1089954&r2=1089955&view=diff
==============================================================================
---
cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
(original)
+++
cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
Thu Apr 7 19:40:33 2011
@@ -133,6 +133,7 @@ public interface StorageServiceMBean
* @param key - key for which we need to find the endpoint return value -
* the endpoint responsible for this key
*/
+ public List<InetAddress> getNaturalEndpoints(String table, byte[] key);
public List<InetAddress> getNaturalEndpoints(String table, ByteBuffer key);
/**
Modified: cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java
URL:
http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=1089955&r1=1089954&r2=1089955&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/tools/NodeProbe.java Thu Apr
7 19:40:33 2011
@@ -443,7 +443,7 @@ public class NodeProbe
public List<InetAddress> getEndpoints(String keyspace, String key)
{
// FIXME: string key
- return ssProxy.getNaturalEndpoints(keyspace,
ByteBuffer.wrap(key.getBytes(UTF_8)));
+ return ssProxy.getNaturalEndpoints(keyspace, key.getBytes(UTF_8));
}
public Set<InetAddress> getStreamDestinations()