Class JournalPerfSpec.BenchActor

java.lang.Object
org.apache.pekko.persistence.journal.JournalPerfSpec.BenchActor
All Implemented Interfaces:
Actor, ActorLogging, Stash, StashFactory, StashSupport, UnrestrictedStash, RequiresMessageQueue<DequeBasedMessageQueueSemantics>, Eventsourced, PersistenceIdentity, PersistenceRecovery, PersistenceStash, PersistentActor, Snapshotter
Enclosing class:
JournalPerfSpec

public static class JournalPerfSpec.BenchActor extends Object implements PersistentActor, ActorLogging
  • Constructor Details

    • BenchActor

      public BenchActor(String persistenceId, ActorRef replyTo, int replyAfter)
  • Method Details

    • context

      public ActorContext context()
      Description copied from interface: Actor
      Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such as forward.

      WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!

      pekko.actor.ActorContext is the Scala API. getContext returns a pekko.actor.AbstractActor.ActorContext, which is the Java API of the actor context.

      Specified by:
      context in interface Actor
      Specified by:
      context in interface StashSupport
    • counter

      public int counter()
    • counter_$eq

      public void counter_$eq(int x$1)
    • journal

      protected ActorRef journal()
      Specified by:
      journal in interface Eventsourced
    • org$apache$pekko$actor$Actor$_setter_$context_$eq

      protected void org$apache$pekko$actor$Actor$_setter_$context_$eq(ActorContext x$1)
      Description copied from interface: Actor
      Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such as forward.

      WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!

      pekko.actor.ActorContext is the Scala API. getContext returns a pekko.actor.AbstractActor.ActorContext, which is the Java API of the actor context.

      Specified by:
      org$apache$pekko$actor$Actor$_setter_$context_$eq in interface Actor
    • org$apache$pekko$actor$Actor$_setter_$self_$eq

      protected final void org$apache$pekko$actor$Actor$_setter_$self_$eq(ActorRef x$1)
      Description copied from interface: Actor
      The 'self' field holds the ActorRef for this actor.

      Can be used to send messages to itself:
       self ! message
       
      Specified by:
      org$apache$pekko$actor$Actor$_setter_$self_$eq in interface Actor
    • org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq

      protected void org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1)
      Specified by:
      org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq in interface StashSupport
    • persistenceId

      public String persistenceId()
      Description copied from interface: PersistenceIdentity
      Id of the persistent entity for which messages should be replayed.
      Specified by:
      persistenceId in interface PersistenceIdentity
    • receiveCommand

      public scala.PartialFunction<Object,scala.runtime.BoxedUnit> receiveCommand()
      Description copied from interface: Eventsourced
      Command handler. Typically validates commands against current state (and/or by communication with other actors). On successful validation, one or more events are derived from a command and these events are then persisted by calling persist.
      Specified by:
      receiveCommand in interface Eventsourced
    • receiveRecover

      public scala.PartialFunction<Object,scala.runtime.BoxedUnit> receiveRecover()
      Description copied from interface: Eventsourced
      Recovery handler that receives persisted events during recovery. If a state snapshot has been captured and saved, this handler will receive a pekko.persistence.SnapshotOffer message followed by events that are younger than the offered snapshot.

      This handler must not have side-effects other than changing persistent actor state i.e. it should not perform actions that may fail, such as interacting with external services, for example.

      If there is a problem with recovering the state of the actor from the journal, the error will be logged and the actor will be stopped.

      Specified by:
      receiveRecover in interface Eventsourced
      See Also:
      • pekko.persistence.Recovery
    • self

      public final ActorRef self()
      Description copied from interface: Actor
      The 'self' field holds the ActorRef for this actor.

      Can be used to send messages to itself:
       self ! message
       
      Specified by:
      self in interface Actor
      Specified by:
      self in interface StashSupport
    • snapshotStore

      protected ActorRef snapshotStore()
      Description copied from interface: Snapshotter
      Snapshot store plugin actor.
      Specified by:
      snapshotStore in interface Eventsourced
      Specified by:
      snapshotStore in interface Snapshotter