-
Notifications
You must be signed in to change notification settings - Fork 38
4.x: Allow BatchStatements to be LWT #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.x: Allow BatchStatements to be LWT #489
Conversation
Fixes #488 |
When I've checked the current implementation of BatchStatement it turned out that it already infers the routing information from the first query in a batch that has routing information. I've left that part as is and just added LWT support for batches according to suggestions. |
7de883d
to
a0427e5
Compare
core/src/main/java/com/datastax/oss/driver/api/core/cql/BatchStatementBuilder.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/datastax/oss/driver/internal/core/cql/DefaultBatchStatementTest.java
Outdated
Show resolved
Hide resolved
Previously all DefaultBatchStatements would always return `false` when `isLWT()` was called. This would cause the driver to route the batch based on the first non null routing information found in a batch but using regular rules rather than rules for LWT queries, even if a LWT query was inside the batch. Now LWT routing will be used for DefaultBatchStatements if somewhere along the way an LWT query was added to the batch. This can also be controlled explicitly regardless of batch contents with `BatchStatementBuilder#setIsLWT(boolean)`.
a0427e5
to
526519b
Compare
Adjusted integration test to have a batch with non-LWT and LWT query, added a few extra checks to unit test, adjusted docs and BatchStatement interface. |
526519b
to
2f81f24
Compare
I unfortunately still don't see an integration test that executes a batch with LWT and non-LWT statements. Could you add it in a separate PR? |
Previously all DefaultBatchStatements would always return
false
whenisLWT()
was called. This would cause the driver to route the batch based on the first non null routing information found in a batch but using regular rules rather than rules for LWT queries, even if a LWT query was inside the batch.Now LWT routing will be used for DefaultBatchStatements if somewhere along the way an LWT query was added to the batch. This can also be controlled explicitly regardless of batch contents with
BatchStatementBuilder#setIsLWT(boolean)
.Fixes: #488