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

Start to Refactor CassandraStorage #1294

Merged
merged 38 commits into from May 16, 2023

Conversation

Miles-Garnsey
Copy link
Contributor

This PR begins the refactoring process on CassandraStorage as discussed in #1265. The long term goals are:

  1. Split up the monolithic IStorage, IDistributedStorage interfaces and monolithic CassandraStorage and MemoryStorage classes so that we end up with smaller DAO classes mapping more closely to the types defined in core.
  2. Ensure return types are aligned with types from core where possible and are never ResultSets (which are almost untyped and hard to work with).
  3. Bring the codebase into a more manageable state where it is clear which types are collaborating with other types.

This PR is a very small step in that direction, and simply delegates many of the storage operations from CassandraStorage to DAO types.

Further steps need to be taken to reflect the broad cuts made here in the interfaces and in MemoryStorage, before creating smaller interfaces that the new DAO types adhere to and passing those interfaces (instead of e.g. the larger monolithic IStorage) to consumers.

@github-actions
Copy link

github-actions bot commented May 5, 2023

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

Copy link
Contributor

@adejanovski adejanovski left a comment

Choose a reason for hiding this comment

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

Couple of requested changes to unblock testing.

Miles-Garnsey and others added 2 commits May 10, 2023 10:25
…CassandraStorage.java


Ensure migrations completed before statement preparation.

Co-authored-by: Alexander Dejanovski <alex.dejanovski@datastax.com>
…RepairScheduleDao.java

Ensure ReairSchedule prepared statements are actually prepared.

Co-authored-by: Alexander Dejanovski <alex.dejanovski@datastax.com>
@Miles-Garnsey
Copy link
Contributor Author

@adejanovski thanks for the input, the tests now pass. Can you please complete your review, and especially take a look at what I've done with the acceptance tests? I've removed all references to Cassandra 2.x to get things running, but maybe we can leave the cases where the cluster to be repaired is Cassandra 2.x, as long as the backend is 3.x+?

I do note that the tests against trunk all seem to be failing, I'm not sure if that is a problem or not given that trunk is presumably often unstable (or API incompatible with Reaper perhaps? Not sure...)

adejanovski
adejanovski previously approved these changes May 10, 2023
Copy link
Contributor

@adejanovski adejanovski left a comment

Choose a reason for hiding this comment

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

Very nice refactorings!
There are some of the tests in the memory jobs that need to be re-introduced and a few comments that should be deleted.
Otherwise LGTM.
You can merge the PR once the above points have been addressed and CI passes.

@Miles-Garnsey Miles-Garnsey marked this pull request as ready for review May 11, 2023 01:08
@Miles-Garnsey
Copy link
Contributor Author

All changes made as requested, with removal of dateOf references to ensure compatibility with trunk. I'll merge once/if tests pass.

@adejanovski adejanovski merged commit aae9ec5 into thelastpickle:master May 16, 2023
22 checks passed
adejanovski pushed a commit that referenced this pull request Jun 22, 2023
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.

None yet

2 participants