Persistence

org.apache.pekko.persistence.Persistence
See thePersistence companion object
class Persistence(val system: ExtendedActorSystem) extends Extension

Persistence extension.

Attributes

Companion
object
Source
Persistence.scala
Graph
Supertypes
trait Extension
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final def adaptersFor(journalPluginId: String): EventAdapters

Returns an pekko.persistence.journal.EventAdapters object which serves as a per-journal collection of bound event adapters. If no adapters are registered for a given journal the EventAdapters object will simply return the identity adapter for each class, otherwise the most specific adapter matching a given class will be returned.

Returns an pekko.persistence.journal.EventAdapters object which serves as a per-journal collection of bound event adapters. If no adapters are registered for a given journal the EventAdapters object will simply return the identity adapter for each class, otherwise the most specific adapter matching a given class will be returned.

Attributes

Source
Persistence.scala
final def adaptersFor(journalPluginId: String, journalPluginConfig: Config): EventAdapters

Returns an pekko.persistence.journal.EventAdapters object which serves as a per-journal collection of bound event adapters. If no adapters are registered for a given journal the EventAdapters object will simply return the identity adapter for each class, otherwise the most specific adapter matching a given class will be returned.

Returns an pekko.persistence.journal.EventAdapters object which serves as a per-journal collection of bound event adapters. If no adapters are registered for a given journal the EventAdapters object will simply return the identity adapter for each class, otherwise the most specific adapter matching a given class will be returned.

The provided journalPluginConfig will be used to configure the plugin instead of the actor system config.

Attributes

Source
Persistence.scala
final def getSliceRanges(numberOfRanges: Int): List[Pair[Integer, Integer]]

Java API: Split the total number of slices into ranges by the given numberOfRanges.

Java API: Split the total number of slices into ranges by the given numberOfRanges.

For example, numberOfSlices is 128 and given 4 numberOfRanges this method will return ranges (0 to 255), (256 to 511), (512 to 767) and (768 to 1023).

Attributes

Source
Persistence.scala
final def numberOfSlices: Int

A slice is deterministically defined based on the persistence id. numberOfSlices is not configurable because changing the value would result in different slice for a persistence id than what was used before, which would result in invalid eventsBySlices.

A slice is deterministically defined based on the persistence id. numberOfSlices is not configurable because changing the value would result in different slice for a persistence id than what was used before, which would result in invalid eventsBySlices.

numberOfSlices is 1024

Attributes

Source
Persistence.scala
def persistenceId(persistentActor: ActorRef): String

Creates a canonical persistent actor id from a persistent actor ref.

Creates a canonical persistent actor id from a persistent actor ref.

Attributes

Source
Persistence.scala
final def sliceForPersistenceId(persistenceId: String): Int

A slice is deterministically defined based on the persistence id. The purpose is to evenly distribute all persistence ids over the slices and be able to query the events for a range of slices.

A slice is deterministically defined based on the persistence id. The purpose is to evenly distribute all persistence ids over the slices and be able to query the events for a range of slices.

Attributes

Source
Persistence.scala
final def sliceRanges(numberOfRanges: Int): IndexedSeq[Range]

Scala API: Split the total number of slices into ranges by the given numberOfRanges.

Scala API: Split the total number of slices into ranges by the given numberOfRanges.

For example, numberOfSlices is 1024 and given 4 numberOfRanges this method will return ranges (0 to 255), (256 to 511), (512 to 767) and (768 to 1023).

Attributes

Source
Persistence.scala