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

Add slice queries to Persistence TestKit #30995

Merged
merged 3 commits into from
Dec 20, 2021
Merged

Conversation

patriknw
Copy link
Member

  • Add currentEventsBySlices to Persistence TestKit
  • Add DurableStateStoreBySliceQuery to Persistence TestKit
  • to make it feature comatible with corresponding tagged queries
  • simplifies some usage in downstream projects

Split in two commits if you prefer to review them separately.

* to make it feature comatible with currentEventsByTag
* simplifies some usage in downstream projects
* to make it feature comatible with the tagged queries
* simplifies some usage in downstream projects
@patriknw patriknw added this to the 2.6.18 milestone Dec 16, 2021
@patriknw patriknw added the 2 - pick next Used to mark issues which are next up in the queue to be worked on. The tag is non-binding label Dec 16, 2021
Copy link
Member

@jrudolph jrudolph left a comment

Choose a reason for hiding this comment

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

Don't know much about the DurableState part of it but at least the rest LGTM.

Copy link
Member

@johanandren johanandren left a comment

Choose a reason for hiding this comment

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

Mostly looks good but there is a concurrency issue.


Source(store.values.toVector.filter(bySliceFromOffset).sortBy(_.globalOffset))
.concat(changesSource)
.filter(bySliceFromOffsetNotDeleted)
Copy link
Member

Choose a reason for hiding this comment

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

This accesses mutable state from some other thread than the synchronized method call. Perhaps capturing the store as it was when the method was called is best? If not, make the store field volatile?

Copy link
Member Author

Choose a reason for hiding this comment

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

@johanandren thanks, fixed in b2bb9ef

@johanandren johanandren merged commit cc44647 into main Dec 20, 2021
@johanandren johanandren deleted the wip-slice-testkit-patriknw branch December 20, 2021 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - pick next Used to mark issues which are next up in the queue to be worked on. The tag is non-binding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants