mirror of https://github.com/apache/cassandra
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:
parent
9f5880cc59
commit
2e7ecdb681
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue