You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "qihuang.zheng" <qi...@fraudmetrix.cn> on 2015/10/27 04:09:42 UTC

回复:Can consistency-levels be different for "read" and "write" inDatastax Java-Driver?

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 Gargajaygargnsit@gmail.com
收件人:useruser@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