|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Recovery
Recovery state machine that loads snapshots and replays messages.
PersistentActor
,
PersistentView
Nested Class Summary | |
---|---|
static interface |
Recovery.State
INTERNAL API. |
Nested classes/interfaces inherited from interface akka.actor.Actor |
---|
Actor.emptyBehavior$ |
Method Summary | |
---|---|
Persistent |
_currentPersistent()
|
Recovery.State |
_currentState()
INTERNAL API. |
long |
_lastSequenceNr()
|
java.lang.Throwable |
_recoveryFailureCause()
|
Envelope |
_recoveryFailureMessage()
|
void |
aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
java.lang.Object message)
INTERNAL API. |
scala.Option<Persistent> |
currentPersistentMessage()
Returns the current persistent message if there is any. |
Persistence |
extension()
INTERNAL API. |
Persistent |
getCurrentPersistentMessage()
Java API: returns the current persistent message or null if there is none. |
ActorRef |
journal()
INTERNAL API. |
long |
lastSequenceNr()
Highest received sequence number so far or 0L if this actor hasn't received a persistent
message yet. |
void |
onReplayFailure(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
boolean awaitReplay,
java.lang.Throwable cause)
INTERNAL API. |
void |
onReplaySuccess(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
boolean awaitReplay)
INTERNAL API. |
java.lang.String |
persistenceId()
Id of the persistent entity for which messages should be replayed. |
java.lang.Object |
prepareRestart()
INTERNAL API. |
java.lang.String |
processorId()
Id of the processor for which messages should be replayed. |
StashSupport |
receiverStash()
INTERNAL API. |
java.lang.Object |
recoveryPending()
INTERNAL API. |
java.lang.Object |
recoveryStarted(long replayMax)
INTERNAL API. |
java.lang.Object |
replayFailed()
INTERNAL API. |
java.lang.Object |
replayStarted(boolean await)
INTERNAL API. |
void |
runReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
Persistent msg)
INTERNAL API. |
long |
snapshotSequenceNr()
Returns lastSequenceNr . |
void |
updateLastSequenceNr(long value)
INTERNAL API. |
void |
updateLastSequenceNr(Persistent persistent)
INTERNAL API. |
void |
withCurrentPersistent(Persistent persistent,
scala.Function1<Persistent,scala.runtime.BoxedUnit> body)
INTERNAL API |
Methods inherited from interface akka.persistence.Snapshotter |
---|
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot, snapshotStore, snapshotterId |
Methods inherited from interface akka.actor.UnrestrictedStash |
---|
postStop, preRestart |
Methods inherited from interface akka.actor.Actor |
---|
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, context, postRestart, preStart, receive, self, sender, supervisorStrategy, unhandled |
Methods inherited from interface akka.actor.StashSupport |
---|
actorCell, capacity, clearStash, context, enqueueFirst, mailbox, prepend, self, stash, theStash, unstash, unstashAll, unstashAll |
Methods inherited from interface akka.actor.StashFactory |
---|
createStash |
Method Detail |
---|
void runReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, Persistent msg)
This is used to deliver a persistent message to the actor’s behavior through withCurrentPersistent().
receive
- (undocumented)msg
- (undocumented)java.lang.Object recoveryPending()
Initial state, waits for Recover
request, submit a LoadSnapshot
request to the snapshot
store and changes to recoveryStarted
state.
java.lang.Object recoveryStarted(long replayMax)
Processes a loaded snapshot, if any. A loaded snapshot is offered with a SnapshotOffer
message to the actor's current behavior. Then initiates a message replay, either starting
from the loaded snapshot or from scratch, and switches to replayStarted
state.
replayMax
- maximum number of messages to replay.
java.lang.Object replayStarted(boolean await)
Processes replayed messages, if any. The actor's current behavior is invoked with the replayed
Persistent
messages. If processing of a replayed message fails, the exception is caught and
stored for being thrown later and state is changed to recoveryFailed
. If replay succeeds the
onReplaySuccess
method is called, otherwise onReplayFailure
.
await
- if true
processing of further messages will be delayed until replay completes,
otherwise, the actor's behavior is invoked immediately with these messages.
java.lang.Object replayFailed()
Consumes remaining replayed messages and then changes to prepareRestart
. The
message that caused the exception during replay, is re-added to the mailbox and
re-received in prepareRestart
.
java.lang.Object prepareRestart()
Re-receives the replayed message that caused an exception and re-throws that exception.
java.lang.Throwable _recoveryFailureCause()
Envelope _recoveryFailureMessage()
long _lastSequenceNr()
Persistent _currentPersistent()
java.lang.String processorId()
java.lang.String persistenceId()
void withCurrentPersistent(Persistent persistent, scala.Function1<Persistent,scala.runtime.BoxedUnit> body)
void updateLastSequenceNr(Persistent persistent)
void updateLastSequenceNr(long value)
scala.Option<Persistent> currentPersistentMessage()
Persistent getCurrentPersistentMessage()
null
if there is none.
long lastSequenceNr()
0L
if this actor hasn't received a persistent
message yet. Usually equal to the sequence number of currentPersistentMessage
(unless a
receiver implementation is about to re-order persistent messages using stash()
and unstash()
).
long snapshotSequenceNr()
lastSequenceNr
.
snapshotSequenceNr
in interface Snapshotter
Recovery.State _currentState()
void onReplaySuccess(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, boolean awaitReplay)
Called whenever a message replay succeeds.
receive
- the actor's current behavior.awaitReplay
- awaitReplay
value of the calling replayStarted
state.void onReplayFailure(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, boolean awaitReplay, java.lang.Throwable cause)
Called whenever a message replay fails.
receive
- the actor's current behavior.awaitReplay
- awaitReplay
value of the calling replayStarted
state.cause
- failure cause.Persistence extension()
ActorRef journal()
StashSupport receiverStash()
void aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, java.lang.Object message)
aroundReceive
in interface Actor
receive
- (undocumented)message
- (undocumented)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |