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

+per #16541 initial version of the Persistence Query module #18051

Merged
merged 4 commits into from
Aug 12, 2015

Conversation

ktoso
Copy link
Member

@ktoso ktoso commented Jul 22, 2015

Ladies and Gentlemen,
Thanks to the Akka Streams 1.0 release last week, we now would like to present this new experimental module for initial feedback, addressing a long history of discussions and awesome feedback we have gathered from the community (see the great summary: Akka Persistence on the Query Side: The Conclusion).

Introducing the Akka Streams based improved Query Side to Akka Persistence.
This is only the initial PR, more examples, polish and example implementations will be pushed soon.

The current form of the API is the culmination of these discussions with the community, a very long "maturing in the back of your mind" process and a few days spent together around ScalaDays for polishing and trying it out in various example/mock implementations with @patriknw and @dotta.

The API is intentionally very "open" (we provide the marker traits Query[T, M], Hint, and a number of basic case classes), because we do not want to restrict some of the great journals out there - instead, we want to encourage various implementations to expose that kind of API which is best suited for the underlying store. For example, SQL based journals may provide SqlQuery("SELECT * ...") if that's what they want to expose. Journals will have to document their behaviours very thoroughly.

Other important information:

  • this module (akka-persistence-query-experimental) will be (and stay) experimental in Akka 2.4
  • we'll provide a number of example ReadJournal implementations, however we currently do not intend to maintain one for production usage - we ask the community to help out, similarily like it has happened organically with Akka Persistence.
  • integration with the new EventAdapters known from the write-side in Akka 2.4 is under discussion/development Integrate EventAdapters to the Query side #18050

@ktoso
Copy link
Member Author

ktoso commented Jul 22, 2015

Refs #16541

@akka-ci akka-ci added the validating PR is currently being validated by Jenkins label Jul 22, 2015
@akka-ci akka-ci added needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed validating PR is currently being validated by Jenkins labels Jul 22, 2015
@akka-ci
Copy link

akka-ci commented Jul 22, 2015

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.akka.io/job/pr-validator-per-commit-jenkins/3269/

@jrudolph
Copy link
Member

Error lines in https://jenkins.akka.io/job/pr-validator-per-commit-jenkins/3269/:

  1659 Unable to find credentials for [Artifactory Realm @ proxy-ch.typesafe.com].
  1660 Unable to find credentials for [Artifactory Realm @ proxy-ch.typesafe.com].
 12321 (akka-docs/sphinx:generatePdf) Sphinx pdf generation failed.  See debug output for details.
 12322 Total time: 713 s, completed Jul 22, 2015 1:19:57 PM

query has an optionally supported offset parameter (of type ``Long``) which the journals can use to implement resumable-streams.
For example a journal may be able to use a WHERE clause to begin the read starting from a specific row, or in a datastore
that is able to order events by insertion time it could treat the Long as a timestamp and select only older events.
Again, specific sapabilities are specific to the journal you are using, so you have to

Choose a reason for hiding this comment

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

capabilities

@2m
Copy link
Member

2m commented Jul 24, 2015

LGTM. Very clean API!

//#events-by-tag-publisher
class MyEventsByTagPublisher(tag: String, offset: Long, refreshInterval: FiniteDuration)
extends ActorPublisher[EventEnvelope] {
import MyEventsByTagPublisher._
Copy link
Contributor

Choose a reason for hiding this comment

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

I’d declare the case object Continue in here to avoid having to pull the companion into the docs as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok


``EventsByPersistenceId`` is a query equivalent to replaying a :ref:`PersistentActor <event-sourcing>`,
however, since it is a stream it is possible to keep it alive and watch for additional incoming events persisted by the
persistent actor identified by the given ``persistenceId``. Most journal will have to revert to polling in order to achieve
Copy link
Member

Choose a reason for hiding this comment

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

s/journal/journals/

@patriknw
Copy link
Member

LGTM, after final touch

@ahjohannessen
Copy link

Gotta love collaboration, feedback is great 👍 😄

@ktoso ktoso force-pushed the wip-16541-persistence-query branch 2 times, most recently from 9b404d8 to e0c7aec Compare August 12, 2015 18:21
@akka-ci akka-ci added validating PR is currently being validated by Jenkins and removed needs-attention Indicates a PR validation failure (set by CI infrastructure) labels Aug 12, 2015
@ktoso
Copy link
Member Author

ktoso commented Aug 12, 2015

Addressed all feedback, merging after validation (failure was my javadoc mistake)

@akka-ci akka-ci added validating PR is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed validating PR is currently being validated by Jenkins labels Aug 12, 2015
@akka-ci
Copy link

akka-ci commented Aug 12, 2015

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.akka.io/job/pr-validator-per-commit-jenkins/3379/

@ktoso ktoso force-pushed the wip-16541-persistence-query branch from e0c7aec to 3314de4 Compare August 12, 2015 18:43
@akka-ci akka-ci added the needs-attention Indicates a PR validation failure (set by CI infrastructure) label Aug 12, 2015
@akka-ci
Copy link

akka-ci commented Aug 12, 2015

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.akka.io/job/pr-validator-per-commit-jenkins/3380/

@akka-ci akka-ci added validating PR is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed needs-attention Indicates a PR validation failure (set by CI infrastructure) validating PR is currently being validated by Jenkins labels Aug 12, 2015
@akka-ci
Copy link

akka-ci commented Aug 12, 2015

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.akka.io/job/pr-validator-per-commit-jenkins/3381/

ktoso added a commit that referenced this pull request Aug 12, 2015
+per #16541 initial version of the Persistence Query module
@ktoso ktoso merged commit 5a6ee8b into master Aug 12, 2015
lol
@@ -0,0 +1,172 @@
adoc-api/akka/persistence/query/scaladsl/ReadJournal.html...
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary log file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for noticing @xuwei-k, removed 9b6b433
(used this file to debug javadoc failure using ./scripts/find-javadoc-error.pl)

ktoso added a commit that referenced this pull request Aug 16, 2015
@rkuhn rkuhn deleted the wip-16541-persistence-query branch January 13, 2016 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:persistence-query tested PR that was successfully built and tested by Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants