Closed jaejinKim closed 6 years ago
Why would a good default for DefaultConsistencyLevel
be LOCAL_QUORUM
?
@beckje01
I set LOCAL_QUORUM in order to increase accuracy about the result.
If default ConsistencyLevel.ONE use, Cassandra sometimes return the result that is null when write and read.
For example, replica exists A,B,C. Client wirte a data then eplica A write operation is successful. Then client quickly read the wrote data. Then return null value from replica B or C because replica B and C does not copy the result not yet.
So I set LOCAL_QUORUM that number of replica / 2 + 1 are successful then return lthe recent result.
So it is more fastest than QUORUM because it does not read/write in Global Data center. It read/write in same local Data center.only.
Write and quickly read then result is null this issue occurs many times in real server environemnts.. not only Global Cassandra but also Local Cassandra.
CL.ONE is the better choice for defaults, generally you should be either tuning the cluster to work better or designing around the immediate write then read that shouldn't be needed. This library should embrace C* best practices
Ok I will modify to CL.ONE.
I modifyed your requirements. Please check again.
Ok I fixed some codes. Please check again.
Add the QueryOption for the statement's retry policy
Add the CustomRetryPolicy
Add the DefaultConsistencyLevel for result resond correctly
Code refactoring for extending subclass