Change Helenus Consistency Level in a CQL Query

I am doing some tests with Cassandra and its Node.JS driver, Helenus. Is there a way to change the level of query consistency using CQL?

The Helenus documentation only shows an example of this use with the Helenus Thrift connector, but I want to use a CQL connector.

I tried asking Cassandra like this

conn.cql(cqlRead, vals, {ConsistencyLevel:ANY, gzip:true}, cb); 

but node chose this error

 ReferenceError: ANY is not defined 

Then I changed "ANY" to "1" and node ran the code, but I did not notice any difference.

+7
source share
2 answers

The problem is that you cannot use CL.ANY for reading, only for writing. ANY means that the commit log entry is considered successful even if none of the replicas is available. Since commit logs are not readable on request, it makes no sense to use CL.ANY for reading, so Cassandra will not let you.

+3
source

I saw Helenus documentation and they set the sequence this way

 cf.get('foo', {consistency:helenus.ConsistencyLevel.ONE}, function(err, row){ // Your code here }) 

Have you tried with consistency: helenus.ConsistencyLevel.ANY. I think you are likely to get another difference from a ReferenceError

+1
source

All Articles