Class/Object

akka.persistence.couchbase.scaladsl

CouchbaseReadJournal

Related Docs: object CouchbaseReadJournal | package scaladsl

Permalink

final class CouchbaseReadJournal extends ReadJournal with AsyncCouchbaseSession with EventsByPersistenceIdQuery with CurrentEventsByPersistenceIdQuery with EventsByTagQuery with CurrentEventsByTagQuery with CurrentPersistenceIdsQuery with PersistenceIdsQuery with Queries

Scala API akka.persistence.query.scaladsl.ReadJournal implementation for Couchbase.

It is retrieved with:

val queries = PersistenceQuery(system).readJournalFor[CouchbaseReadJournal](CouchbaseReadJournal.Identifier)

Corresponding Java API is in akka.persistence.couchbase.javadsl.CouchbaseReadJournal.

Configuration settings can be defined in the configuration section with the absolute path corresponding to the identifier, which is "couchbase-journal.read" for the default CouchbaseReadJournal#Identifier. See reference.conf.

Linear Supertypes
Queries, PersistenceIdsQuery, CurrentPersistenceIdsQuery, CurrentEventsByTagQuery, EventsByTagQuery, CurrentEventsByPersistenceIdQuery, EventsByPersistenceIdQuery, AsyncCouchbaseSession, ReadJournal, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CouchbaseReadJournal
  2. Queries
  3. PersistenceIdsQuery
  4. CurrentPersistenceIdsQuery
  5. CurrentEventsByTagQuery
  6. EventsByTagQuery
  7. CurrentEventsByPersistenceIdQuery
  8. EventsByPersistenceIdQuery
  9. AsyncCouchbaseSession
  10. ReadJournal
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CouchbaseReadJournal(eas: ExtendedActorSystem, config: Config, configPath: String)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val asyncSession: Future[CouchbaseSession]

    Permalink

    Note: Implement with a val so that it doesn't get recreated on each access

    Note: Implement with a val so that it doesn't get recreated on each access

    Attributes
    protected
    Definition Classes
    CouchbaseReadJournal → AsyncCouchbaseSession
  6. def bucketName: String

    Permalink
    Attributes
    protected
    Definition Classes
    CouchbaseReadJournal → Queries
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  8. final def closeCouchbaseSession()(implicit ec: ExecutionContext): Future[Done]

    Permalink
    Definition Classes
    AsyncCouchbaseSession
  9. def currentEventsByPersistenceId(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long): Source[EventEnvelope, NotUsed]

    Permalink

    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
    CouchbaseReadJournal → CurrentEventsByPersistenceIdQuery
  10. def currentEventsByTag(tag: String, offset: Offset): Source[EventEnvelope, NotUsed]

    Permalink

    Same type of query as eventsByTag but the event stream is completed immediately when it reaches the end of the "result set" unless it has received as many events as it has requested.

    Same type of query as eventsByTag but the event stream is completed immediately when it reaches the end of the "result set" unless it has received as many events as it has requested. In that case it will request one more time before completing the 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 akka.persistence.couchbase.UUIDs.timeBasedUUIDFrom.

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

    Permalink

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

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

    Definition Classes
    CouchbaseReadJournal → CurrentPersistenceIdsQuery
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def eventsByPersistenceId(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long): Source[EventEnvelope, NotUsed]

    Permalink

    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.

    In addition to the offset the EventEnvelope 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.

    sequenceNr and offset are always the same for an event and they define ordering for events emitted by this query. Causality is guaranteed (sequenceNrs of events for a particular persistenceId are always ordered in a sequence monotonically increasing by one). Multiple executions of the same bounded stream are guaranteed to emit exactly the same stream of events.

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

    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
    CouchbaseReadJournal → EventsByPersistenceIdQuery
  15. def eventsByPersistenceIdQuery(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long, pageSize: Int): N1qlQuery

    Permalink
    Attributes
    protected
    Definition Classes
    Queries
  16. def eventsByTag(tag: String, offset: Offset): Source[EventEnvelope, NotUsed]

    Permalink

    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 akka.persistence.journal.EventAdapter that wraps the events in a akka.persistence.journal.Tagged with the given tags.

    You can use 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.

    For querying events that happened after a long unix timestamp you can use akka.persistence.couchbase.UUIDs.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 Couchbase Indexes that is eventually consistent, so different queries may see different events for the latest events, but eventually the result will be ordered by the timestamp based Couchbase ordering field. To compensate for the the eventual consistency the query is delayed to not read the latest events, see couchbase-journal.read.events-by-tag.eventual-consistency-delay in reference.conf. However, this is only best effort and in case of network partitions or other things that may delay the updates of the Couchbase indexes the events may be delivered in different order (not strictly by their timestamp).

    Deleted events are NOT deleted from the tagged 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 currentEventsByTag.

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

    Definition Classes
    CouchbaseReadJournal → EventsByTagQuery
  17. def eventsByTagQueryIds(tag: String, fromOffset: String, toOffset: String, pageSize: Int): N1qlQuery

    Permalink
    Attributes
    protected
    Definition Classes
    Queries
  18. implicit val executionContext: MessageDispatcher

    Permalink
    Attributes
    protected
  19. def firstNonDeletedEventFor(persistenceId: String, session: CouchbaseSession, readTimeout: FiniteDuration)(implicit ec: ExecutionContext): Future[Option[Long]]

    Permalink
    Attributes
    protected
    Definition Classes
    Queries
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  22. def highestSequenceNrQuery(persistenceId: String, fromSequenceNr: Long, params: N1qlParams): N1qlQuery

    Permalink
    Attributes
    protected
    Definition Classes
    Queries
  23. def highestTagSequenceNumberQuery(persistenceId: String, tag: String, params: N1qlParams): N1qlQuery

    Permalink
    Definition Classes
    Queries
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def mapHighestSequenceNr(option: Option[JsonObject]): Long

    Permalink
    Definition Classes
    Queries
  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  29. def persistenceIds(): Source[String, NotUsed]

    Permalink

    persistenceIds is used to retrieve a stream of persistenceIds.

    persistenceIds 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.

    Note the query is inefficient, especially for large numbers of persistenceIds, because of limitation of current internal implementation providing no information supporting ordering/offset queries. The query uses Couchbase's select distinct capabilities. More importantly the live query has to repeatedly execute the query each refresh-interval, because order is not defined and new persistenceIds may appear anywhere in the query results.

    Definition Classes
    CouchbaseReadJournal → PersistenceIdsQuery
  30. def persistenceIdsQuery(): N1qlQuery

    Permalink
    Attributes
    protected
    Definition Classes
    Queries
  31. def replayQuery(persistenceId: String, from: Long, to: Long, params: N1qlParams): N1qlQuery

    Permalink
    Attributes
    protected
    Definition Classes
    Queries
  32. val session: Future[CouchbaseSession]

    Permalink

    Data Access Object for arbitrary queries or updates.

  33. final def sourceWithCouchbaseSession[Out](f: (CouchbaseSession) ⇒ Source[Out, NotUsed])(implicit ec: ExecutionContext): Source[Out, NotUsed]

    Permalink
    Definition Classes
    AsyncCouchbaseSession
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  36. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def withCouchbaseSession[A](f: (CouchbaseSession) ⇒ Future[A])(implicit ec: ExecutionContext): Future[A]

    Permalink
    Definition Classes
    AsyncCouchbaseSession

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Queries

Inherited from PersistenceIdsQuery

Inherited from CurrentPersistenceIdsQuery

Inherited from CurrentEventsByTagQuery

Inherited from EventsByTagQuery

Inherited from CurrentEventsByPersistenceIdQuery

Inherited from EventsByPersistenceIdQuery

Inherited from AsyncCouchbaseSession

Inherited from ReadJournal

Inherited from AnyRef

Inherited from Any

Ungrouped