Using java driver, both read and write will transfer to Statement. We use 
PrepareStatement like this:
public PreparedStatement getPrepareSTMT(String cql){
 PreparedStatement statement = session.prepare(cql);
 
statement.setConsistencyLevel(ConsistencyLevel.ONE).setRetryPolicy(FallthroughRetryPolicy.INSTANCE);
 return statement;
}
So that you can set ConsistencyLevel differently for read and write. 


Tks, qihuang.zheng




原始邮件
发件人:Ajay gargajaygargn...@gmail.com
收件人:useru...@cassandra.apache.org
发送时间:2015年10月27日(周二) 02:17
主题:Can consistency-levels be different for "read" and "write" inDatastax 
Java-Driver?


Right now, I have setup "LOCAL QUORUM" as the consistency level in the driver, 
but it seems that "SERIAL" is being used during writes, and I consistently get 
this error of type ::

Cassandra timeout during write query at consistency SERIAL (3 replica were 
required but only 0 acknowledged the write)



Am I missing something?



-- 

Regards,
Ajay

Reply via email to