Class ReplicationParams

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

public class ReplicationParams extends Object
Contains the optional parameters that can be passed to a Replication Request. Controls the behaviour of the replication including tagging, stop position, extending destination recordings, live merging, and setting the maximum length of the file I/O operations.
  • Constructor Details

    • ReplicationParams

      public ReplicationParams()
      Initialise all parameters to defaults.
  • Method Details

    • reset

      public ReplicationParams reset()
      Reset the state of the parameters to the default for reuse.
      Returns:
      this for a fluent API.
    • stopPosition

      public ReplicationParams stopPosition(long stopPosition)
      Set the stop position for replication, default is AeronArchive.NULL_POSITION, which will continuously replicate.
      Parameters:
      stopPosition - position to stop the replication at.
      Returns:
      this for a fluent API
    • stopPosition

      public long stopPosition()
      The stop position for this replication request.
      Returns:
      stop position
    • dstRecordingId

      public ReplicationParams dstRecordingId(long dstRecordingId)
      The recording in the local archive to extend. Default is Aeron.NULL_VALUE which will trigger the creation of a new recording in the destination archive.
      Parameters:
      dstRecordingId - destination recording to extend.
      Returns:
      this for a fluent API.
    • dstRecordingId

      public long dstRecordingId()
      Destination recording id to extend.
      Returns:
      destination recording id.
    • liveDestination

      public ReplicationParams liveDestination(String liveChannel)
      Destination for the live stream if merge is required. Default is null for no merge.
      Parameters:
      liveChannel - for the live stream merge
      Returns:
      this for a fluent API.
    • liveDestination

      public String liveDestination()
      Gets the destination for the live stream merge.
      Returns:
      destination for live stream merge.
    • replicationChannel

      public String replicationChannel()
      Channel to use for replicating the recording, empty string will mean that the default channel is used.
      Returns:
      channel to replicate the recording.
    • replicationChannel

      public ReplicationParams replicationChannel(String replicationChannel)
      Channel use to replicate the recording. Default is null which will use the context's default replication channel
      Parameters:
      replicationChannel - to use for replicating the recording.
      Returns:
      this for a fluent API.
    • channelTagId

      public ReplicationParams channelTagId(long channelTagId)
      The channel used by the archive's subscription for replication will have the supplied channel tag applied to it. The default value for channelTagId is Aeron.NULL_VALUE
      Parameters:
      channelTagId - tag to apply to the archive's subscription.
      Returns:
      this for a fluent API
    • channelTagId

      public long channelTagId()
      Gets channel tag id for the archive subscription.
      Returns:
      channel tag id.
    • subscriptionTagId

      public ReplicationParams subscriptionTagId(long subscriptionTagId)
      The channel used by the archive's subscription for replication will have the supplied subscription tag applied to it. The default value for subscriptionTagId is Aeron.NULL_VALUE
      Parameters:
      subscriptionTagId - tag to apply to the archive's subscription.
      Returns:
      this for a fluent API
    • subscriptionTagId

      public long subscriptionTagId()
      Gets subscription tag id for the archive subscription.
      Returns:
      subscription tag id.
    • fileIoMaxLength

      public ReplicationParams fileIoMaxLength(int fileIoMaxLength)
      The maximum size of a file operation when reading from the archive to execute the replication. 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 file I/O 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 length of a file I/O operation.
    • replicationSessionId

      public ReplicationParams replicationSessionId(int replicationSessionId)
      Sets the session-id to be used for the replicated file instead of the session id from the source archive. This is useful in cases where we are replicating the same recording in multiple stages.
      Parameters:
      replicationSessionId - the session-id to be set for the received recording.
      Returns:
      this for fluent API
    • replicationSessionId

      public int replicationSessionId()
      The session-id to be used for the replicated recording.
      Returns:
      session-id to be useful for the replicated recording.
    • encodedCredentials

      public ReplicationParams encodedCredentials(byte[] encodedCredentials)
      Sets the encoded credentials that will be passed to the source archive for authentication. Currently only simple authentication (i.e. not challenge/response) is supported for replication.
      Parameters:
      encodedCredentials - credentials to be passed to the source archive.
      Returns:
      this for a fluent API.
    • encodedCredentials

      public byte[] encodedCredentials()
      Gets the encoded credentials that will be used to authenticate against the source archive.
      Returns:
      encoded credentials used for authentication.
    • srcResponseChannel

      public ReplicationParams srcResponseChannel(String responseChannel)
      Control address of the source archive to use response channels during replication.
      Parameters:
      responseChannel - control address of the response publication for the source archive.
      Returns:
      this for a fluent API.
    • srcResponseChannel

      public String srcResponseChannel()
      Control address of the source archive to use response channels during replication.
      Returns:
      control address of the response publication for the source archive.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object