Package akka.persistence
Class Persistence
- java.lang.Object
-
- akka.persistence.Persistence
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Persistence.PluginHolder$
-
Constructor Summary
Constructors Constructor Description Persistence(ExtendedActorSystem system)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EventAdapters
adaptersFor(java.lang.String journalPluginId)
Returns anEventAdapters
object which serves as a per-journal collection of bound event adapters.EventAdapters
adaptersFor(java.lang.String journalPluginId, com.typesafe.config.Config journalPluginConfig)
Returns anEventAdapters
object which serves as a per-journal collection of bound event adapters.static T
apply(ActorSystem system)
static T
apply(ClassicActorSystemProvider system)
static Persistence
createExtension(ExtendedActorSystem system)
StashOverflowStrategy
defaultInternalStashOverflowStrategy()
static boolean
equals(java.lang.Object other)
static Persistence
get(ActorSystem system)
Java API.static Persistence
get(ClassicActorSystemProvider system)
java.util.List<Pair<java.lang.Integer,java.lang.Integer>>
getSliceRanges(int numberOfRanges)
Java API: Split the total number of slices into ranges by the givennumberOfRanges
.static int
hashCode()
static java.lang.String
JournalFallbackConfigPath()
Config path to fall-back to if a setting is not defined in a specific plugin's config sectionstatic Persistence$
lookup()
int
numberOfSlices()
A slice is deterministically defined based on the persistence id.java.lang.String
persistenceId(ActorRef persistentActor)
Creates a canonical persistent actor id from a persistent actor ref.PersistenceSettings
settings()
int
sliceForPersistenceId(java.lang.String persistenceId)
A slice is deterministically defined based on the persistence id.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 java.lang.String
SnapshotStoreFallbackConfigPath()
Config path to fall-back to if a setting is not defined in a specific snapshot plugin's config sectionExtendedActorSystem
system()
-
-
-
Constructor Detail
-
Persistence
public Persistence(ExtendedActorSystem system)
-
-
Method Detail
-
get
public static Persistence get(ActorSystem system)
Java API.
-
get
public static Persistence get(ClassicActorSystemProvider system)
-
createExtension
public static Persistence createExtension(ExtendedActorSystem system)
-
lookup
public static Persistence$ lookup()
-
JournalFallbackConfigPath
public static java.lang.String JournalFallbackConfigPath()
Config path to fall-back to if a setting is not defined in a specific plugin's config section
-
SnapshotStoreFallbackConfigPath
public static java.lang.String SnapshotStoreFallbackConfigPath()
Config path to fall-back to if a setting is not defined in a specific snapshot plugin's config section
-
apply
public static T apply(ActorSystem system)
-
apply
public static T apply(ClassicActorSystemProvider system)
-
hashCode
public static final int hashCode()
-
equals
public static final boolean equals(java.lang.Object other)
-
system
public ExtendedActorSystem system()
-
defaultInternalStashOverflowStrategy
public StashOverflowStrategy defaultInternalStashOverflowStrategy()
-
settings
public PersistenceSettings settings()
-
adaptersFor
public final EventAdapters adaptersFor(java.lang.String journalPluginId)
Returns anEventAdapters
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.
-
adaptersFor
public final EventAdapters adaptersFor(java.lang.String journalPluginId, com.typesafe.config.Config journalPluginConfig)
Returns anEventAdapters
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.
-
persistenceId
public java.lang.String persistenceId(ActorRef persistentActor)
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.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
-
sliceForPersistenceId
public final int sliceForPersistenceId(java.lang.String persistenceId)
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,
numberOfSlices
is 1024 and given 4numberOfRanges
this method will return ranges (0 to 255), (256 to 511), (512 to 767) and (768 to 1023).
-
getSliceRanges
public final java.util.List<Pair<java.lang.Integer,java.lang.Integer>> getSliceRanges(int numberOfRanges)
Java API: Split the total number of slices into ranges by the givennumberOfRanges
.For example,
numberOfSlices
is 128 and given 4numberOfRanges
this method will return ranges (0 to 255), (256 to 511), (512 to 767) and (768 to 1023).
-
-