akka.persistence.journal.japi
Class AsyncRecovery

java.lang.Object
  extended by akka.persistence.journal.japi.AsyncRecovery
All Implemented Interfaces:
AsyncRecovery
Direct Known Subclasses:
AsyncWriteJournal, SyncWriteJournal

public abstract class AsyncRecovery
extends java.lang.Object
implements AsyncRecovery

Java API: asynchronous message replay and sequence number recovery interface.


Constructor Summary
AsyncRecovery()
           
 
Method Summary
 scala.concurrent.Future<java.lang.Object> asyncReadHighestSequenceNr(java.lang.String processorId, long fromSequenceNr)
          Plugin API: asynchronously reads the highest stored sequence number for the given processorId.
 scala.concurrent.Future<scala.runtime.BoxedUnit> asyncReplayMessages(java.lang.String processorId, long fromSequenceNr, long toSequenceNr, long max, scala.Function1<PersistentRepr,scala.runtime.BoxedUnit> replayCallback)
          Plugin API: asynchronously replays persistent messages.
 scala.concurrent.Future<java.lang.Long> doAsyncReadHighestSequenceNr(java.lang.String processorId, long fromSequenceNr)
          Java API, Plugin API: asynchronously reads the highest stored sequence number for the given `processorId`.
 scala.concurrent.Future<java.lang.Void> doAsyncReplayMessages(java.lang.String processorId, long fromSequenceNr, long toSequenceNr, long max, Procedure<PersistentRepr> replayCallback)
          Java API, Plugin API: asynchronously replays persistent messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncRecovery

public AsyncRecovery()
Method Detail

asyncReplayMessages

public final scala.concurrent.Future<scala.runtime.BoxedUnit> asyncReplayMessages(java.lang.String processorId,
                                                                                  long fromSequenceNr,
                                                                                  long toSequenceNr,
                                                                                  long max,
                                                                                  scala.Function1<PersistentRepr,scala.runtime.BoxedUnit> replayCallback)
Description copied from interface: AsyncRecovery
Plugin API: asynchronously replays persistent messages. Implementations replay a message by calling replayCallback. The returned future must be completed when all messages (matching the sequence number bounds) have been replayed. The future must be completed with a failure if any of the persistent messages could not be replayed.

The replayCallback must also be called with messages that have been marked as deleted. In this case a replayed message's deleted method must return true.

The channel ids of delivery confirmations that are available for a replayed message must be contained in that message's confirms sequence.

Specified by:
asyncReplayMessages in interface AsyncRecovery
Parameters:
processorId - processor id.
fromSequenceNr - sequence number where replay should start (inclusive).
toSequenceNr - sequence number where replay should end (inclusive).
max - maximum number of messages to be replayed.
replayCallback - called to replay a single message. Can be called from any thread.

See Also:
AsyncWriteJournal, SyncWriteJournal

asyncReadHighestSequenceNr

public final scala.concurrent.Future<java.lang.Object> asyncReadHighestSequenceNr(java.lang.String processorId,
                                                                                  long fromSequenceNr)
Description copied from interface: AsyncRecovery
Plugin API: asynchronously reads the highest stored sequence number for the given processorId.

Specified by:
asyncReadHighestSequenceNr in interface AsyncRecovery
Parameters:
processorId - processor id.
fromSequenceNr - hint where to start searching for the highest sequence number.

doAsyncReplayMessages

public scala.concurrent.Future<java.lang.Void> doAsyncReplayMessages(java.lang.String processorId,
                                                                     long fromSequenceNr,
                                                                     long toSequenceNr,
                                                                     long max,
                                                                     Procedure<PersistentRepr> replayCallback)
Java API, Plugin API: asynchronously replays persistent messages. Implementations replay a message by calling `replayCallback`. The returned future must be completed when all messages (matching the sequence number bounds) have been replayed. The future must be completed with a failure if any of the persistent messages could not be replayed. The `replayCallback` must also be called with messages that have been marked as deleted. In this case a replayed message's `deleted` method must return `true`. The channel ids of delivery confirmations that are available for a replayed message must be contained in that message's `confirms` sequence.

Parameters:
processorId - processor id.
fromSequenceNr - sequence number where replay should start (inclusive).
toSequenceNr - sequence number where replay should end (inclusive).
max - maximum number of messages to be replayed.
replayCallback - called to replay a single message. Can be called from any thread.

doAsyncReadHighestSequenceNr

public scala.concurrent.Future<java.lang.Long> doAsyncReadHighestSequenceNr(java.lang.String processorId,
                                                                            long fromSequenceNr)
Java API, Plugin API: asynchronously reads the highest stored sequence number for the given `processorId`.

Parameters:
processorId - processor id.
fromSequenceNr - hint where to start searching for the highest sequence number.