Class Recovery
Recovery mode configuration object to be return in Recovery
By default recovers from latest snapshot replays through to the last available event (last sequenceNr).
Recovery will start from a snapshot if the persistent actor has previously saved one or more snapshots and at least one of these snapshots matches the specified FromSnapshot criteria. Otherwise, recovery will start from scratch by replaying all stored events.
If recovery starts from a snapshot, the PersistentActor is offered that snapshot with a SnapshotOffer message, followed by replayed messages, if any, that are younger than the snapshot, up to the specified upper sequence number bound (ToSequenceNr).
Inherited Members
Namespace: Akka.Persistence
Assembly: Akka.Persistence.dll
Syntax
[Serializable]
public sealed class Recovery
Constructors
| Improve this Doc View SourceRecovery()
Initializes a new instance of the Recovery class.
Declaration
public Recovery()
Recovery(SnapshotSelectionCriteria)
Initializes a new instance of the Recovery class.
Declaration
public Recovery(SnapshotSelectionCriteria fromSnapshot)
Parameters
Type | Name | Description |
---|---|---|
SnapshotSelectionCriteria | fromSnapshot | Criteria for selecting a saved snapshot from which recovery should start. Default is latest(= youngest) snapshot. |
Recovery(SnapshotSelectionCriteria, Int64)
Initializes a new instance of the Recovery class.
Declaration
public Recovery(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr)
Parameters
Type | Name | Description |
---|---|---|
SnapshotSelectionCriteria | fromSnapshot | Criteria for selecting a saved snapshot from which recovery should start. Default is latest(= youngest) snapshot. |
Int64 | toSequenceNr | Upper, inclusive sequence number bound for recovery. Default is no upper bound. |
Recovery(SnapshotSelectionCriteria, Int64, Int64)
Initializes a new instance of the Recovery class.
Declaration
public Recovery(SnapshotSelectionCriteria fromSnapshot = null, long toSequenceNr = 9223372036854775807L, long replayMax = 9223372036854775807L)
Parameters
Type | Name | Description |
---|---|---|
SnapshotSelectionCriteria | fromSnapshot | Criteria for selecting a saved snapshot from which recovery should start. Default is latest(= youngest) snapshot. |
Int64 | toSequenceNr | Upper, inclusive sequence number bound for recovery. Default is no upper bound. |
Int64 | replayMax | Maximum number of messages to replay. Default is no limit. |
Properties
| Improve this Doc View SourceDefault
TBD
Declaration
public static Recovery Default { get; }
Property Value
Type | Description |
---|---|
Recovery |
FromSnapshot
Criteria for selecting a saved snapshot from which recovery should start. Default is latest (= youngest) snapshot.
Declaration
public SnapshotSelectionCriteria FromSnapshot { get; }
Property Value
Type | Description |
---|---|
SnapshotSelectionCriteria |
None
Convenience method for skipping recovery in PersistentActor.
It will still retrieve previously highest sequence number so that new events are persisted with higher sequence numbers rather than starting from 1 and assuming that there are no previous event with that sequence number.
Declaration
public static Recovery None { get; }
Property Value
Type | Description |
---|---|
Recovery |
ReplayMax
Maximum number of messages to replay. Default is no limit.
Declaration
public long ReplayMax { get; }
Property Value
Type | Description |
---|---|
Int64 |
ToSequenceNr
Upper, inclusive sequence number bound for recovery. Default is no upper bound.
Declaration
public long ToSequenceNr { get; }
Property Value
Type | Description |
---|---|
Int64 |