Class ReplayParams

java.lang.Object
io.aeron.archive.client.ReplayParams

public class ReplayParams extends Object
Fluent API for setting optional replay parameters. Allows the user to configure starting position, replay length, bounding counter (for a bounded replay) and the max length for file I/O operations.

Not threadsafe.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Default, initialise all values to "null".
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the counterId specified for the bounding the replay.
    boundingLimitCounterId(int boundingLimitCounterId)
    Sets the counter id to be used for bounding the replay.
    int
    Gets the maximum length for file IO operations in the replay.
    fileIoMaxLength(int fileIoMaxLength)
    The maximum size of a file operation when reading from the archive to execute the replay.
    boolean
    Determines if the parameter setup has requested a bounded replay.
    long
    Length of the recording to replay.
    length(long length)
    The length of the recorded stream to replay.
    long
    Position to start the replay at.
    position(long position)
    Set the position to start the replay.
    long
    Get a token used for replays when the initiating image is not the one used to create the archive connection/session.
    replayToken(long replayToken)
    Set a token used for replays when the initiating image is not the one used to create the archive connection/session.
    Reset all value to "null", allows for an instance to be reused.
    long
    Get the subscription registration id to be used when doing a start replay using response channels and the response subscription is already created.
    void
    subscriptionRegistrationId(long registrationId)
    Set the subscription registration id to be used when doing a start replay using response channels and the response subscription is already created.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReplayParams

      public ReplayParams()
      Default, initialise all values to "null".
  • Method Details

    • reset

      public ReplayParams reset()
      Reset all value to "null", allows for an instance to be reused.
      Returns:
      this for a fluent API
    • position

      public ReplayParams position(long position)
      Set the position to start the replay. If set to AeronArchive.NULL_POSITION (which is the default) then the stream will be replayed from the start.
      Parameters:
      position - to start the replay from.
      Returns:
      this for a fluent API.
    • position

      public long position()
      Position to start the replay at.
      Returns:
      position for the start of the replay.
      See Also:
    • length

      public ReplayParams length(long length)
      The length of the recorded stream to replay. If set to AeronArchive.REPLAY_ALL_AND_FOLLOW (the default) it will replay a whole stream of unknown length and then continue to follow the replay if it is live. If set to AeronArchive.REPLAY_ALL_AND_STOP it will replay up the limit calculated when the replay request is received then stop the replay, thereby ending the stream.

      AeronArchive.REPLAY_ALL_AND_FOLLOW retains the same behaviour as using AeronArchive.NULL_LENGTH or Long.MAX_VALUE.

      Parameters:
      length - of the recording to be replayed.
      Returns:
      this for a fluent API.
    • length

      public long length()
      Length of the recording to replay.
      Returns:
      length of the recording to replay.
      See Also:
    • boundingLimitCounterId

      public ReplayParams boundingLimitCounterId(int boundingLimitCounterId)
      Sets the counter id to be used for bounding the replay. Setting this value will trigger the sending of a bounded replay request instead of a normal replay.
      Parameters:
      boundingLimitCounterId - counter to use to bound the replay
      Returns:
      this for a fluent API
    • boundingLimitCounterId

      public int boundingLimitCounterId()
      Gets the counterId specified for the bounding the replay. Returns Aeron.NULL_VALUE if unspecified.
      Returns:
      the counter id to bound the replay.
    • fileIoMaxLength

      public ReplayParams fileIoMaxLength(int fileIoMaxLength)
      The maximum size of a file operation when reading from the archive to execute the replay. Will use the value defined in the context otherwise. This can be used reduce the size of file IO operations to lower the priority of some replays. Setting it to a value larger than the context value will have no affect.
      Parameters:
      fileIoMaxLength - maximum length of a replay file operation
      Returns:
      this for a fluent API
    • fileIoMaxLength

      public int fileIoMaxLength()
      Gets the maximum length for file IO operations in the replay. Defaults to Aeron.NULL_VALUE if not set, which will trigger the use of the Archive.Context default.
      Returns:
      maximum file length for IO operations during replay.
    • isBounded

      public boolean isBounded()
      Determines if the parameter setup has requested a bounded replay.
      Returns:
      true if the replay should be bounded, false otherwise.
    • replayToken

      public ReplayParams replayToken(long replayToken)
      Set a token used for replays when the initiating image is not the one used to create the archive connection/session.
      Parameters:
      replayToken - token to identify the replay
      Returns:
      this for a fluent API.
    • replayToken

      public long replayToken()
      Get a token used for replays when the initiating image is not the one used to create the archive connection/session.
      Returns:
      the replay token
    • subscriptionRegistrationId

      public void subscriptionRegistrationId(long registrationId)
      Set the subscription registration id to be used when doing a start replay using response channels and the response subscription is already created.
      Parameters:
      registrationId - of the subscription to receive the replay (should be set up with control-mode=response).
    • subscriptionRegistrationId

      public long subscriptionRegistrationId()
      Get the subscription registration id to be used when doing a start replay using response channels and the response subscription is already created.
      Returns:
      registrationId of the subscription to receive the replay (should be set up with control-mode=response).