Author: jbellis Date: Wed Dec 8 00:59:43 2010 New Revision: 1043258 URL: http://svn.apache.org/viewvc?rev=1043258&view=rev Log: expose getNaturalEndpoints in StorageServiceMBean taking byte[] key; RMI cannot serialize ByteBuffer patch by Kelvin Kakugawa; reviewed by jbellis for CASSANDRA-1833
Modified: cassandra/branches/cassandra-0.7/CHANGES.txt cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageService.java cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageServiceMBean.java cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java Modified: cassandra/branches/cassandra-0.7/CHANGES.txt URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1043258&r1=1043257&r2=1043258&view=diff ============================================================================== --- cassandra/branches/cassandra-0.7/CHANGES.txt (original) +++ cassandra/branches/cassandra-0.7/CHANGES.txt Wed Dec 8 00:59:43 2010 @@ -1,3 +1,7 @@ +dev + * expose getNaturalEndpoints in StorageServiceMBean taking byte[] + key; RMI cannot serialize ByteBuffer (CASSANDRA-1833) + 0.7.0-rc2 * fix live-column-count of slice ranges including tombstoned supercolumn with live subcolumn (CASSANDRA-1591) Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageService.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageService.java?rev=1043258&r1=1043257&r2=1043258&view=diff ============================================================================== --- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageService.java (original) +++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageService.java Wed Dec 8 00:59:43 2010 @@ -1400,6 +1400,11 @@ public class StorageService implements I return getNaturalEndpoints(table, partitioner_.getToken(key)); } + public List<InetAddress> getNaturalEndpoints(String table, byte[] key) + { + return getNaturalEndpoints(table, ByteBuffer.wrap(key)); + } + /** * This method returns the N endpoints that are responsible for storing the * specified key i.e for replication. Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageServiceMBean.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageServiceMBean.java?rev=1043258&r1=1043257&r2=1043258&view=diff ============================================================================== --- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageServiceMBean.java (original) +++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageServiceMBean.java Wed Dec 8 00:59:43 2010 @@ -128,7 +128,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, ByteBuffer key); + public List<InetAddress> getNaturalEndpoints(String table, byte[] key); /** * Forces major compaction (all sstable files compacted) Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java?rev=1043258&r1=1043257&r2=1043258&view=diff ============================================================================== --- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java (original) +++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/tools/NodeProbe.java Wed Dec 8 00:59:43 2010 @@ -401,8 +401,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, FBUtilities.hexToBytes(key)); } public Set<InetAddress> getStreamDestinations()