Skip to content
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

Refactor to add OperationAttempt #1434

Merged
merged 27 commits into from
Oct 1, 2024
Merged

Conversation

amorton
Copy link
Contributor

@amorton amorton commented Sep 19, 2024

Build a general OperationAttempt and a GenericOperation that can process any type of operation attempt.

Will eventually lead to a single Operation implementation, removing a lot of duplication between the different Operation classes in how they interact with the DB.

Guide:

  • most of the heavy lifting is in io.stargate.sgv2.jsonapi.service.operation where it defines the OperationAttempt and where uses it in GenericOperation
  • in io.stargate.sgv2.jsonapi.service.operation.tables; the tables code uses it, this has not been rolled out into Delete and Update operations yet. And no work has been done for Collections
  • no tests on the OperationAttempt code yet, but the tests for the parts the use it work. I am working on unit tests, but we want to get this code into main so others can use it.

Which issue(s) this PR fixes:
Fixes #1424

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

for #1424, will need tablemetadta on the collectionschema object

it was a giant mess, still is, but trying to cleanup gradually
runs, not all unit tests checked

Adds OperationAttempt as a base "task" that any operation runs,
example in InsertTableOperation and InsertManyCommandResolver

No tests written yet.
@amorton amorton changed the base branch from main to ajm/start-collection-refactor September 19, 2024 02:58
@amorton amorton marked this pull request as ready for review September 26, 2024 06:57
@amorton amorton requested a review from a team as a code owner September 26, 2024 06:57
@amorton amorton changed the title Refactor to add OperationAttempt fixes #1424 Refactor to add OperationAttempt Sep 26, 2024
Base automatically changed from ajm/start-collection-refactor to main September 26, 2024 23:30
Copy link
Contributor

@tatu-at-datastax tatu-at-datastax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, this is big enough that I couldn't dig very deep. But I trust the test coverage, plus ability to fix things post-merge.

And we need to get this merged to avoid blocking other PRs that come after wrt createTable(), codecs.

Copy link
Contributor

@maheshrajamani maheshrajamani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation Attempt and executor looks good.
LGTM

@amorton amorton merged commit 118d9f0 into main Oct 1, 2024
3 checks passed
@amorton amorton deleted the ajm/#1424-refactor-TableInsertAttempt branch October 1, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor table insert operation, move calling the driver to TableInsertAttempt
4 participants