I managed to have my query sent to only one node by adding below statement to 
the CQL query:
        and token(pk)=0;

If I use consistency QUORUM then it is sent to a node that own the '0' token 
even if the node receiving the request is not the one owning 0.
Now I think it may be better to use a random number instead of 0 to load 
balance the search requests.
--
Jacques-Henri Berthemet

-----Original Message-----
From: Jacques-Henri Berthemet 
Sent: jeudi 27 novembre 2014 12:08
To: dev@cassandra.apache.org
Subject: Knowning which node received a search request.

Hi,

I'm implementing a PerRowSecondaryIndex, when receiving a search request on 
org.apache.cassandra.db.index.SecondaryIndexSearcher impl, is there a way to 
know if I'm the node that received the request or if it's a replica?

Currently the request is sent to all the nodes and then all results are 
aggregated so I have duplicates. Ideally I'd like the request to be sent only 
to one node, this may not be possible. So I'd like the other nodes to return 
nothing. In my implementation, a single node is needed to aggregate the results.

Thank you,
--
Jacques-Henri Berthemet



Reply via email to