akka.persistence.journal.japi
Class AsyncWriteJournal

java.lang.Object
  extended by akka.persistence.journal.japi.AsyncRecovery
      extended by akka.persistence.journal.japi.AsyncWriteJournal
All Implemented Interfaces:
Actor, AsyncRecovery, AsyncWriteJournal

public abstract class AsyncWriteJournal
extends AsyncRecovery
implements AsyncWriteJournal

Java API: abstract journal, optimized for asynchronous, non-blocking writes.


Nested Class Summary
 
Nested classes/interfaces inherited from interface akka.persistence.journal.AsyncWriteJournal
AsyncWriteJournal.Desequenced, AsyncWriteJournal.Desequenced$, AsyncWriteJournal.Resequencer
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Constructor Summary
AsyncWriteJournal()
           
 
Method Summary
 scala.concurrent.Future<scala.runtime.BoxedUnit> asyncDeleteMessages(scala.collection.immutable.Seq<PersistentId> messageIds, boolean permanent)
          Plugin API: asynchronously deletes messages identified by messageIds from the journal.
 scala.concurrent.Future<scala.runtime.BoxedUnit> asyncDeleteMessagesTo(java.lang.String processorId, long toSequenceNr, boolean permanent)
          Plugin API: asynchronously deletes all persistent messages up to toSequenceNr (inclusive).
 scala.concurrent.Future<scala.runtime.BoxedUnit> asyncWriteConfirmations(scala.collection.immutable.Seq<PersistentConfirmation> confirmations)
          Plugin API: asynchronously writes a batch of delivery confirmations to the journal.
 scala.concurrent.Future<scala.runtime.BoxedUnit> asyncWriteMessages(scala.collection.immutable.Seq<PersistentRepr> messages)
          Plugin API: asynchronously writes a batch of persistent messages to the journal.
 scala.concurrent.Future<java.lang.Void> doAsyncDeleteMessages(java.lang.Iterable<PersistentId> messageIds, boolean permanent)
          Java API, Plugin API: synchronously deletes messages identified by `messageIds` from the journal.
 scala.concurrent.Future<java.lang.Void> doAsyncDeleteMessagesTo(java.lang.String processorId, long toSequenceNr, boolean permanent)
          Java API, Plugin API: synchronously deletes all persistent messages up to `toSequenceNr`.
 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.
 scala.concurrent.Future<java.lang.Void> doAsyncWriteConfirmations(java.lang.Iterable<PersistentConfirmation> confirmations)
          Java API, Plugin API: synchronously writes a batch of delivery confirmations to the journal.
 scala.concurrent.Future<java.lang.Void> doAsyncWriteMessages(java.lang.Iterable<PersistentRepr> messages)
          Java API, Plugin API: synchronously writes a batch of persistent messages to the journal.
 
Methods inherited from class akka.persistence.journal.japi.AsyncRecovery
asyncReadHighestSequenceNr, asyncReplayMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.persistence.journal.AsyncWriteJournal
extension, publish, receive, resequencer, resequencerCounter
 
Methods inherited from interface akka.actor.Actor
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, noSender, postRestart, postStop, preRestart, preStart, self, sender, supervisorStrategy, unhandled
 
Methods inherited from interface akka.persistence.journal.AsyncRecovery
asyncReadHighestSequenceNr, asyncReplayMessages
 

Constructor Detail

AsyncWriteJournal

public AsyncWriteJournal()
Method Detail

asyncWriteMessages

public final scala.concurrent.Future<scala.runtime.BoxedUnit> asyncWriteMessages(scala.collection.immutable.Seq<PersistentRepr> messages)
Description copied from interface: AsyncWriteJournal
Plugin API: asynchronously writes a batch of persistent messages to the journal. The batch write must be atomic i.e. either all persistent messages in the batch are written or none.

Specified by:
asyncWriteMessages in interface AsyncWriteJournal

asyncWriteConfirmations

public final scala.concurrent.Future<scala.runtime.BoxedUnit> asyncWriteConfirmations(scala.collection.immutable.Seq<PersistentConfirmation> confirmations)
Description copied from interface: AsyncWriteJournal
Plugin API: asynchronously writes a batch of delivery confirmations to the journal.

Specified by:
asyncWriteConfirmations in interface AsyncWriteJournal

asyncDeleteMessages

public final scala.concurrent.Future<scala.runtime.BoxedUnit> asyncDeleteMessages(scala.collection.immutable.Seq<PersistentId> messageIds,
                                                                                  boolean permanent)
Description copied from interface: AsyncWriteJournal
Plugin API: asynchronously deletes messages identified by messageIds from the journal. If permanent is set to false, the persistent messages are marked as deleted, otherwise they are permanently deleted.

Specified by:
asyncDeleteMessages in interface AsyncWriteJournal

asyncDeleteMessagesTo

public final scala.concurrent.Future<scala.runtime.BoxedUnit> asyncDeleteMessagesTo(java.lang.String processorId,
                                                                                    long toSequenceNr,
                                                                                    boolean permanent)
Description copied from interface: AsyncWriteJournal
Plugin API: asynchronously deletes all persistent messages up to toSequenceNr (inclusive). If permanent is set to false, the persistent messages are marked as deleted, otherwise they are permanently deleted.

Specified by:
asyncDeleteMessagesTo in interface AsyncWriteJournal

doAsyncWriteMessages

public scala.concurrent.Future<java.lang.Void> doAsyncWriteMessages(java.lang.Iterable<PersistentRepr> messages)
Java API, Plugin API: synchronously writes a batch of persistent messages to the journal. The batch write must be atomic i.e. either all persistent messages in the batch are written or none.


doAsyncWriteConfirmations

public scala.concurrent.Future<java.lang.Void> doAsyncWriteConfirmations(java.lang.Iterable<PersistentConfirmation> confirmations)
Java API, Plugin API: synchronously writes a batch of delivery confirmations to the journal.


doAsyncDeleteMessages

public scala.concurrent.Future<java.lang.Void> doAsyncDeleteMessages(java.lang.Iterable<PersistentId> messageIds,
                                                                     boolean permanent)
Java API, Plugin API: synchronously deletes messages identified by `messageIds` from the journal. If `permanent` is set to `false`, the persistent messages are marked as deleted, otherwise they are permanently deleted.


doAsyncDeleteMessagesTo

public scala.concurrent.Future<java.lang.Void> doAsyncDeleteMessagesTo(java.lang.String processorId,
                                                                       long toSequenceNr,
                                                                       boolean permanent)
Java API, Plugin API: synchronously deletes all persistent messages up to `toSequenceNr`. If `permanent` is set to `false`, the persistent messages are marked as deleted, otherwise they are permanently deleted.

See Also:
AsyncRecoveryPlugin

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.