Package org.apache.pekko.persistence
Class Persistence
java.lang.Object
org.apache.pekko.persistence.Persistence
- All Implemented Interfaces:
Extension
Persistence extension.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal EventAdaptersadaptersFor(String journalPluginId) Returns anpekko.persistence.journal.EventAdaptersobject which serves as a per-journal collection of bound event adapters.final EventAdaptersadaptersFor(String journalPluginId, com.typesafe.config.Config journalPluginConfig) Returns anpekko.persistence.journal.EventAdaptersobject which serves as a per-journal collection of bound event adapters.static Tapply(ActorSystem system) static Tapply(ClassicActorSystemProvider system) static PersistencecreateExtension(ExtendedActorSystem system) static final booleanstatic Persistenceget(ActorSystem system) Java API.static Persistenceget(ClassicActorSystemProvider system) getSliceRanges(int numberOfRanges) Java API: Split the total number of slices into ranges by the givennumberOfRanges.static final inthashCode()static StringConfig path to fall-back to if a setting is not defined in a specific plugin's config sectionstatic Persistence$lookup()final intA slice is deterministically defined based on the persistence id.persistenceId(ActorRef persistentActor) Creates a canonical persistent actor id from a persistent actor ref.settings()final intsliceForPersistenceId(String persistenceId) A slice is deterministically defined based on the persistence id.final scala.collection.immutable.IndexedSeq<scala.collection.immutable.Range>sliceRanges(int numberOfRanges) Scala API: Split the total number of slices into ranges by the givennumberOfRanges.static StringConfig path to fall-back to if a setting is not defined in a specific snapshot plugin's config sectionsystem()
-
Constructor Details
-
Persistence
-
-
Method Details
-
get
Java API. -
get
-
createExtension
-
lookup
-
JournalFallbackConfigPath
Config path to fall-back to if a setting is not defined in a specific plugin's config section -
SnapshotStoreFallbackConfigPath
Config path to fall-back to if a setting is not defined in a specific snapshot plugin's config section -
apply
-
apply
-
hashCode
public static final int hashCode() -
equals
-
system
-
defaultInternalStashOverflowStrategy
-
settings
-
adaptersFor
Returns anpekko.persistence.journal.EventAdaptersobject 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. -
adaptersFor
public final EventAdapters adaptersFor(String journalPluginId, com.typesafe.config.Config journalPluginConfig) Returns anpekko.persistence.journal.EventAdaptersobject 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.
-
persistenceId
Creates a canonical persistent actor id from a persistent actor ref. -
numberOfSlices
public final int numberOfSlices()A slice is deterministically defined based on the persistence id.numberOfSlicesis 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.numberOfSlicesis 1024 -
sliceForPersistenceId
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. -
sliceRanges
public final scala.collection.immutable.IndexedSeq<scala.collection.immutable.Range> sliceRanges(int numberOfRanges) Scala API: Split the total number of slices into ranges by the givennumberOfRanges.For example,
numberOfSlicesis 1024 and given 4numberOfRangesthis method will return ranges (0 to 255), (256 to 511), (512 to 767) and (768 to 1023). -
getSliceRanges
Java API: Split the total number of slices into ranges by the givennumberOfRanges.For example,
numberOfSlicesis 128 and given 4numberOfRangesthis method will return ranges (0 to 255), (256 to 511), (512 to 767) and (768 to 1023).
-