Support a byte[] key for getNaturalEndpoints so clustertool get_endpoints does not throw exception

patch by goffinet; reviewed by stuhood for CASSANDRA-2437



git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1089955 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris Goffinet 2011-04-07 19:40:33 +00:00
parent 9f5880cc59
commit 2e7ecdb681
3 changed files with 7 additions and 1 deletions

View File

@ -1543,6 +1543,11 @@ public class StorageService implements IEndpointStateChangeSubscriber, StorageSe
* @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));

View File

@ -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);
/**

View File

@ -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()