Search code examples
cassandradatastaxdatastax-enterprisecassandra-2.1

How to getendpoints of a composite partition key which has blob datatype in it


I have a select query which is timing out, so i tried querying it using consistency all with tracing enabled, so that read_repair will fix it but that didn't helped much and at consistency all i was getting 3 responses out of 9; so i have decided to identify partition and run a repair on it but when i ran getendpoints on composite partition key which has blob datatype it is throwing an exception "java.lang.NumberFormatException: Non-hex characters" i also tried using token from cql select statement which also timing out. How can i identify the partition and repair it ??


Solution

  • If you just run a repair all partitions will be fixed. To repair an individual partition just read it with CL.ALL and read repairs will fix any differences.

    That said.

    nodetool getendpoints takes a token not a partition key. The murmur3 partitioner expects a long token so a large blob wont work. You can get it with CQL with something like a

    select token(k1, k2 ...) from table where ...
    

    and it will give you the token. Alternatively you can get the token from most of the drivers (java driver: cluster.getMetadata().newToken(string)) or from the Cassandra's java api itself (new Murmur3Partitioner().getToken(bytebuffer))