-
Notifications
You must be signed in to change notification settings - Fork 623
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
CASSGO-7 Change Batch API to be consistent with Query() #1764
base: trunk
Are you sure you want to change the base?
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.
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
session.go
Outdated
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. |
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 for CASSGO-7
bcfb3cc
to
2c5b2be
Compare
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.