Class Recovery
- java.lang.Object
-
- akka.persistence.Recovery
-
- All Implemented Interfaces:
java.io.Serializable
,scala.Equals
,scala.Product
public final class Recovery extends java.lang.Object implements scala.Product, java.io.Serializable
Recovery mode configuration object to be returned inPersistenceRecovery.recovery()
.By default recovers from latest snapshot replays through to the last available event (last sequenceId).
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 persistent actor 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
).param: fromSnapshot criteria for selecting a saved snapshot from which recovery should start. Default is latest (= youngest) snapshot. param: toSequenceNr upper sequence number bound (inclusive) for recovery. Default is no upper bound. param: replayMax maximum number of messages to replay. Default is no limit.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Recovery(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr, long replayMax)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SnapshotSelectionCriteria
$lessinit$greater$default$1()
static long
$lessinit$greater$default$2()
static long
$lessinit$greater$default$3()
static Recovery
apply(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr, long replayMax)
static SnapshotSelectionCriteria
apply$default$1()
static long
apply$default$2()
static long
apply$default$3()
boolean
canEqual(java.lang.Object x$1)
Recovery
copy(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr, long replayMax)
SnapshotSelectionCriteria
copy$default$1()
long
copy$default$2()
long
copy$default$3()
static Recovery
create()
Java APIstatic Recovery
create(long toSequenceNr)
Java APIstatic Recovery
create(SnapshotSelectionCriteria fromSnapshot)
Java APIstatic Recovery
create(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr)
Java APIstatic Recovery
create(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr, long replayMax)
Java APIboolean
equals(java.lang.Object x$1)
SnapshotSelectionCriteria
fromSnapshot()
int
hashCode()
static Recovery
none()
Convenience method for skipping recovery inPersistentActor
.int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
long
replayMax()
long
toSequenceNr()
java.lang.String
toString()
static scala.Option<scala.Tuple3<SnapshotSelectionCriteria,java.lang.Object,java.lang.Object>>
unapply(Recovery x$0)
-
-
-
Constructor Detail
-
Recovery
public Recovery(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr, long replayMax)
-
-
Method Detail
-
$lessinit$greater$default$1
public static SnapshotSelectionCriteria $lessinit$greater$default$1()
-
$lessinit$greater$default$2
public static long $lessinit$greater$default$2()
-
$lessinit$greater$default$3
public static long $lessinit$greater$default$3()
-
create
public static Recovery create(SnapshotSelectionCriteria fromSnapshot)
Java API- See Also:
Recovery
-
create
public static Recovery create(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr)
Java API- See Also:
Recovery
-
create
public static Recovery create(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr, long replayMax)
Java API- See Also:
Recovery
-
none
public static Recovery none()
Convenience method for skipping recovery inPersistentActor
.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.
- See Also:
Recovery
-
apply
public static Recovery apply(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr, long replayMax)
-
apply$default$1
public static SnapshotSelectionCriteria apply$default$1()
-
apply$default$2
public static long apply$default$2()
-
apply$default$3
public static long apply$default$3()
-
unapply
public static scala.Option<scala.Tuple3<SnapshotSelectionCriteria,java.lang.Object,java.lang.Object>> unapply(Recovery x$0)
-
fromSnapshot
public SnapshotSelectionCriteria fromSnapshot()
-
toSequenceNr
public long toSequenceNr()
-
replayMax
public long replayMax()
-
copy
public Recovery copy(SnapshotSelectionCriteria fromSnapshot, long toSequenceNr, long replayMax)
-
copy$default$1
public SnapshotSelectionCriteria copy$default$1()
-
copy$default$2
public long copy$default$2()
-
copy$default$3
public long copy$default$3()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-