Packages

class CassandraReadJournal extends ReadJournal with PersistenceIdsQuery with CurrentPersistenceIdsQuery with EventsByPersistenceIdQuery with CurrentEventsByPersistenceIdQuery with EventsByTagQuery with CurrentEventsByTagQuery

Java API: org.apache.pekko.persistence.query.javadsl.ReadJournal implementation for Cassandra.

It is retrieved with:

CassandraReadJournal queries =
  PersistenceQuery.get(system).getReadJournalFor(CassandraReadJournal.class, CassandraReadJournal.Identifier());

Corresponding Scala API is in pekko.persistence.cassandra.query.scaladsl.CassandraReadJournal.

Configuration settings can be defined in the configuration section with the absolute path corresponding to the identifier, which is "pekko.persistence.cassandra.query" for the default CassandraReadJournal#Identifier. See reference.conf.

Source
CassandraReadJournal.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CassandraReadJournal
  2. CurrentEventsByTagQuery
  3. EventsByTagQuery
  4. CurrentEventsByPersistenceIdQuery
  5. EventsByPersistenceIdQuery
  6. CurrentPersistenceIdsQuery
  7. PersistenceIdsQuery
  8. ReadJournal
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new CassandraReadJournal(scaladslReadJournal: scaladsl.CassandraReadJournal)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def currentEventsByPersistenceId(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long): Source[EventEnvelope, NotUsed]

    Same type of query as eventsByPersistenceId but the event stream is completed immediately when it reaches the end of the "result set".

    Same type of query as eventsByPersistenceId but the event stream is completed immediately when it reaches the end of the "result set". Events that are stored after the query is completed are not included in the event stream.

    Definition Classes
    CassandraReadJournal → CurrentEventsByPersistenceIdQuery
  7. def currentEventsByTag(tag: String, offset: Offset): Source[EventEnvelope, NotUsed]

    Same type of query as eventsByTag but the event stream is completed immediately when it reaches the end of the "result set".

    Same type of query as eventsByTag but the event stream is completed immediately when it reaches the end of the "result set". Events that are stored after the query is completed are not included in the event stream.

    Use NoOffset when you want all events from the beginning of time. To acquire an offset from a long unix timestamp to use with this query, you can use timeBasedUUIDFrom.

    Definition Classes
    CassandraReadJournal → CurrentEventsByTagQuery
  8. def currentPersistenceIds(): Source[String, NotUsed]

    Same type of query as allPersistenceIds but the event stream is completed immediately when it reaches the end of the "result set".

    Same type of query as allPersistenceIds but the event stream is completed immediately when it reaches the end of the "result set". Events that are stored after the query is completed are not included in the event stream.

    Definition Classes
    CassandraReadJournal → CurrentPersistenceIdsQuery
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def eventsByPersistenceId(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long): Source[EventEnvelope, NotUsed]

    eventsByPersistenceId is used to retrieve a stream of events for a particular persistenceId.

    eventsByPersistenceId is used to retrieve a stream of events for a particular persistenceId.

    The EventEnvelope contains the event and provides persistenceId and sequenceNr for each event. The sequenceNr is the sequence number for the persistent actor with the persistenceId that persisted the event. The persistenceId + sequenceNr is an unique identifier for the event.

    fromSequenceNr and toSequenceNr can be specified to limit the set of returned events. The fromSequenceNr and toSequenceNr are inclusive.

    The EventEnvelope also provides an offset, which is the same kind of offset as is used in the eventsByTag query. The Offset type is org.apache.pekko.persistence.query.TimeBasedUUID.

    The returned event stream is ordered by sequenceNr.

    Deleted events are also deleted from the event stream.

    The stream is not completed when it reaches the end of the currently stored events, but it continues to push new events when new events are persisted. Corresponding query that is completed when it reaches the end of the currently stored events is provided by currentEventsByPersistenceId.

    Definition Classes
    CassandraReadJournal → EventsByPersistenceIdQuery
  12. def eventsByTag(tag: String, offset: Offset): Source[EventEnvelope, NotUsed]

    eventsByTag is used for retrieving events that were marked with a given tag, e.g.

    eventsByTag is used for retrieving events that were marked with a given tag, e.g. all events of an Aggregate Root type.

    To tag events you create an org.apache.pekko.persistence.journal.EventAdapter that wraps the events in a org.apache.pekko.persistence.journal.Tagged with the given tags. The tags must be defined in the tags section of the pekko.persistence.cassandra configuration.

    You can use pekko.persistence.query.NoOffset to retrieve all events with a given tag or retrieve a subset of all events by specifying a TimeBasedUUID offset.

    The offset of each event is provided in the streamed envelopes returned, which makes it possible to resume the stream at a later point from a given offset. The offset parameter is exclusive, i.e. the event corresponding to the given offset parameter is not included in the stream. The Offset type is org.apache.pekko.persistence.query.TimeBasedUUID.

    For querying events that happened after a long unix timestamp you can use timeBasedUUIDFrom to create the offset to use with this method.

    In addition to the offset the envelope also provides persistenceId and sequenceNr for each event. The sequenceNr is the sequence number for the persistent actor with the persistenceId that persisted the event. The persistenceId + sequenceNr is an unique identifier for the event.

    The returned event stream is ordered by the offset (timestamp), which corresponds to the same order as the write journal stored the events, with inaccuracy due to clock skew between different nodes. The same stream elements (in same order) are returned for multiple executions of the query on a best effort basis. The query is using a batched writes to a separate table that so is eventually consistent. This means that different queries may see different events for the latest events, but eventually the result will be ordered by timestamp (Cassandra timeuuid column).

    However a strong guarantee is provided that events for a given persistenceId will be delivered in order, the eventual consistency is only for ordering of events from different persistenceIds.

    The stream is not completed when it reaches the end of the currently stored events, but it continues to push new events when new events are persisted. Corresponding query that is completed when it reaches the end of the currently stored events is provided by currentEventsByTag.

    The stream is completed with failure if there is a failure in executing the query in the backend journal.

    Definition Classes
    CassandraReadJournal → EventsByTagQuery
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. def firstOffset: UUID

    Use this as the UUID offset in eventsByTag queries when you want all events from the beginning of time.

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def initialize(): CompletionStage[Done]

    Initialize connection to Cassandra and prepared statements.

    Initialize connection to Cassandra and prepared statements. It is not required to do this and it will happen lazily otherwise. It is also not required to wait until this CompletionStage is complete to start using the read journal.

  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def offsetUuid(timestamp: Long): UUID

    Create a time based UUID that can be used as offset in eventsByTag queries.

    Create a time based UUID that can be used as offset in eventsByTag queries. The timestamp is a unix timestamp (as returned by System#currentTimeMillis).

  23. def persistenceIds(): Source[String, NotUsed]

    allPersistenceIds is used to retrieve a stream of persistenceIds.

    allPersistenceIds is used to retrieve a stream of persistenceIds.

    The stream emits persistenceId strings.

    The stream guarantees that a persistenceId is only emitted once and there are no duplicates. Order is not defined. Multiple executions of the same stream (even bounded) may emit different sequence of persistenceIds.

    The stream is not completed when it reaches the end of the currently known persistenceIds, but it continues to push new persistenceIds when new events are persisted. Corresponding query that is completed when it reaches the end of the currently known persistenceIds is provided by currentPersistenceIds.

    Definition Classes
    CassandraReadJournal → PersistenceIdsQuery
  24. def session: CassandraSession

    Data Access Object for arbitrary queries or updates.

  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def timeBasedUUIDFrom(timestamp: Long): Offset

    Create a time based UUID that can be used as offset in eventsByTag queries.

    Create a time based UUID that can be used as offset in eventsByTag queries. The timestamp is a unix timestamp (as returned by System#currentTimeMillis).

  27. def timestampFrom(offset: TimeBasedUUID): Long

    Convert a TimeBasedUUID to a unix timestamp (as returned by System#currentTimeMillis).

  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from EventsByTagQuery

Inherited from PersistenceIdsQuery

Inherited from ReadJournal

Inherited from AnyRef

Inherited from Any

Ungrouped