my partition keys are id(int) and name(text). Below command works fine until there is no space in name(text). nodetool getendpoints test testtable2 1:aaa;
if am using nodetool getendpoints test testtable2 3:aac cc; it throws an error as :nodetool: getendpoints requires keyspace, table and partition key arguments See 'nodetool help' or 'nodetool help '.
i got token by executing SELECT id,name, token(id,name) FROM test.testtable2 where name='aac cc'AND id=3; and tried to search nodetool getendpoints test testtable2 -7072928299163215694; error: For input string: "-7072928299163215694" -- StackTrace -- java.lang.NumberFormatException: For input string: "-7072928299163215694"
how can i search if partition key (name) has space?
Which Cassandra version you are using.
I have tested it from Cassandra 2.x and Cassandra 3.x version. It is working properly.
Updated Answer: Got the issue
Issue is generated for when 1st part of partition key is int.
But works properly for below input
From DataStax Doc:
nodetool getendpoints actually takes the value of the partition key as input. In this case '-7072928299163215694' it is parsing it as an Integer thus end up thowing exception. It is working for long or String (it is taking '-7072928299163215694' value as a String) cause it has taken this as value of the key not actual token. It is not parsing tokens. So providing tokens as an input will not work.
getendpoints generates tokens from the value of the key and provide you the endpoints (nodes) the key is residing.
Please check this link: What node does Cassandra store data on?
A patch has been provided for this:
https://issues.apache.org/jira/browse/CASSANDRA-4551
Hope this helps.
This is an issue of
nodetool
command.I have modified the
nodetool
script and creategetendpoints
script to support getendpoints with partition key has spaceHere is the
getendpoints
code :Put
getendpoints
file under$CASSANDRA_HOME/bin
directory.Now you can run this file with nodetool argument,along with below argument
Example :