-
Notifications
You must be signed in to change notification settings - Fork 642
CASSGO-7 Change Batch API to be consistent with Query() #1764
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
Conversation
5a44475 to
a6d1a09
Compare
|
@tengu-alt we should also add a new
|
@joao-r-reis I do not clearly understand. The |
|
The original issue mentions the rename |
|
global |
I see, thank you. Done, also I've changed the |
| func (b *Batch) Exec() error { | ||
| iter := b.session.executeBatch(b) | ||
| return iter.Close() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add a doc here because it is meant to be used by users. Maybe use the same description as for Session.ExecuteBatch().
Also, add a doc for Session.Batch() too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, done.
joao-r-reis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just 1 comment about the duplicate code in the new function
| spec: &NonSpeculativeExecution{}, | ||
| routingInfo: &queryRoutingInfo{}, | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate code (NewBatch)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the session.NewBatch and marked it as deprecated according to your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes thanks but please create a private function that both can call or make one of them call the other so we don't have the duplicate code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Fixed.
|
Please format your commit message following the rules stated in CONTRIBUTING.md and add this JIRA to the We need another committer +1 to merge this. |
bcfb3cc to
2c5b2be
Compare
2c5b2be to
e76de4f
Compare
e76de4f to
bdb9265
Compare
|
Sorry I merged another PR which is causing a git conflict on |
Exec() method for batch was added & Query() method was refactored. Batch for now behaves the same way as query. patch by Oleksandr Luzhniy; reviewed by João Reis, Danylo Savchenko, Bohdan Siryk, Jackson Fleming, for CASSGO-7
bdb9265 to
9007bd0
Compare
Fixed! Thank you for the hint. |
|
@tengu-alt we forgot to deprecate session.ExecuteBatch(), do you have some free time to work on this? I created https://issues.apache.org/jira/browse/CASSGO-57 for it |
|
Oh and there's a few other session methods to execute batches that should also be moved to the Batch type |
Got It I'll take it to work.
I'll mark them as deprecated and create similar methods for batch. (If I understand correctly - these methods: |
According to issue #1187, I have refactored the Query() method for the batch and implemented the Exec() method for the batch structure to save the general pattern of the query execution, and saved the older method (session.ExecuteBatch()) for backward compatibility.
This means the batch for now behaves the same way as query.