akka.persistence.r2dbc.state.scaladsl
R2dbcDurableStateStore
Companion object R2dbcDurableStateStore
class R2dbcDurableStateStore[A] extends DurableStateUpdateWithChangeEventStore[A] with DurableStateStoreBySliceQuery[A] with DurableStateStorePagedPersistenceIdsQuery[A]
- Alphabetic
- By Inheritance
- R2dbcDurableStateStore
- DurableStateStorePagedPersistenceIdsQuery
- DurableStateStoreBySliceQuery
- DurableStateUpdateWithChangeEventStore
- DurableStateUpdateStore
- DurableStateStore
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new R2dbcDurableStateStore(system: ExtendedActorSystem, config: Config, cfgPath: String)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def changesBySlices(entityType: String, minSlice: Int, maxSlice: Int, offset: Offset): Source[DurableStateChange[A], NotUsed]
- Definition Classes
- R2dbcDurableStateStore → DurableStateStoreBySliceQuery
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def currentChangesBySlices(entityType: String, minSlice: Int, maxSlice: Int, offset: Offset): Source[DurableStateChange[A], NotUsed]
- Definition Classes
- R2dbcDurableStateStore → DurableStateStoreBySliceQuery
- def currentPersistenceIds(): Source[String, NotUsed]
- def currentPersistenceIds(entityType: String, afterId: Option[String], limit: Long): Source[String, NotUsed]
Get the current persistence ids.
Get the current persistence ids.
Note: to reuse existing index, the actual query filters entity types based on persistence_id column and sql LIKE operator. Hence the persistenceId must start with an entity type followed by default separator ("|") from akka.persistence.typed.PersistenceId.
- entityType
The entity type name.
- afterId
The ID to start returning results from, or None to return all ids. This should be an id returned from a previous invocation of this command. Callers should not assume that ids are returned in sorted order.
- limit
The maximum results to return. Use Long.MaxValue to return all results. Must be greater than zero.
- returns
A source containing all the persistence ids, limited as specified.
- def currentPersistenceIds(afterId: Option[String], limit: Long): Source[String, NotUsed]
Note: If you have configured
custom-table
this query will look in both the default table and the custom tables.Note: If you have configured
custom-table
this query will look in both the default table and the custom tables. If you are only interested in ids for a specific entity type it's more efficient to usecurrentPersistenceIds
withentityType
parameter.- Definition Classes
- R2dbcDurableStateStore → DurableStateStorePagedPersistenceIdsQuery
- def deleteObject(persistenceId: String, revision: Long, changeEvent: Any): Future[Done]
Delete the value, which will fail with
IllegalStateException
if the existing storedrevision
+ 1 isn't equal to the givenrevision
.Delete the value, which will fail with
IllegalStateException
if the existing storedrevision
+ 1 isn't equal to the givenrevision
. This optimistic locking check can be disabled with configurationassert-single-writer
. The stored revision for the persistenceId is updated and next call to getObject will return the revision, but with no value.If the given revision is
0
it will fully delete the value and revision from the database without any optimistic locking check. Next call to getObject will then return revision 0 and no value.The
changeEvent
is written to the event journal in the same transaction as the DurableState upsert. SamepersistenceId
is used in the journal and therevision
is used assequenceNr
.- Definition Classes
- R2dbcDurableStateStore → DurableStateUpdateWithChangeEventStore
- def deleteObject(persistenceId: String, revision: Long): Future[Done]
Delete the value, which will fail with
IllegalStateException
if the existing storedrevision
+ 1 isn't equal to the givenrevision
.Delete the value, which will fail with
IllegalStateException
if the existing storedrevision
+ 1 isn't equal to the givenrevision
. This optimistic locking check can be disabled with configurationassert-single-writer
. The stored revision for the persistenceId is updated and next call to getObject will return the revision, but with no value.If the given revision is
0
it will fully delete the value and revision from the database without any optimistic locking check. Next call to getObject will then return revision 0 and no value.- Definition Classes
- R2dbcDurableStateStore → DurableStateUpdateStore
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getObject(persistenceId: String): Future[GetObjectResult[A]]
- Definition Classes
- R2dbcDurableStateStore → DurableStateStore
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def sliceForPersistenceId(persistenceId: String): Int
- Definition Classes
- R2dbcDurableStateStore → DurableStateStoreBySliceQuery
- def sliceRanges(numberOfRanges: Int): Seq[Range]
- Definition Classes
- R2dbcDurableStateStore → DurableStateStoreBySliceQuery
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def upsertObject(persistenceId: String, revision: Long, value: A, tag: String, changeEvent: Any): Future[Done]
Insert the value if
revision
is 1, which will fail withIllegalStateException
if there is already a stored value for the givenpersistenceId
.Insert the value if
revision
is 1, which will fail withIllegalStateException
if there is already a stored value for the givenpersistenceId
. Otherwise update the value, which will fail withIllegalStateException
if the existing storedrevision
+ 1 isn't equal to the givenrevision
. This optimistic locking check can be disabled with configurationassert-single-writer
.The
changeEvent
is written to the event journal in the same transaction as the DurableState upsert. SamepersistenceId
is used in the journal and therevision
is used assequenceNr
.- Definition Classes
- R2dbcDurableStateStore → DurableStateUpdateWithChangeEventStore
- def upsertObject(persistenceId: String, revision: Long, value: A, tag: String): Future[Done]
Insert the value if
revision
is 1, which will fail withIllegalStateException
if there is already a stored value for the givenpersistenceId
.Insert the value if
revision
is 1, which will fail withIllegalStateException
if there is already a stored value for the givenpersistenceId
. Otherwise update the value, which will fail withIllegalStateException
if the existing storedrevision
+ 1 isn't equal to the givenrevision
. This optimistic locking check can be disabled with configurationassert-single-writer
.- Definition Classes
- R2dbcDurableStateStore → DurableStateUpdateStore
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def deleteObject(persistenceId: String): Future[Done]
- Definition Classes
- R2dbcDurableStateStore → DurableStateUpdateStore
- Annotations
- @deprecated
- Deprecated
(Since version 1.0.0) Use the deleteObject overload with revision instead.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)