Package io.aeron.archive.client
Class ReplayParams
java.lang.Object
io.aeron.archive.client.ReplayParams
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 -
Method Summary
Modifier and TypeMethodDescriptionintGets the counterId specified for the bounding the replay.boundingLimitCounterId(int boundingLimitCounterId) Sets the counter id to be used for bounding the replay.intGets 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.booleanDetermines if the parameter setup has requested a bounded replay.longlength()Length of the recording to replay.length(long length) The length of the recorded stream to replay.longposition()Position to start the replay at.position(long position) Set the position to start the replay.longGet 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()Reset all value to "null", allows for an instance to be reused.longGet the subscription registration id to be used when doing a start replay using response channels and the response subscription is already created.voidsubscriptionRegistrationId(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.
-
Constructor Details
-
ReplayParams
public ReplayParams()Default, initialise all values to "null".
-
-
Method Details
-
reset
Reset all value to "null", allows for an instance to be reused.- Returns:
- this for a fluent API
-
position
Set the position to start the replay. If set toAeronArchive.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
The length of the recorded stream to replay. If set toAeronArchive.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 toAeronArchive.REPLAY_ALL_AND_STOPit will replay up the limit calculated when the replay request is received then stop the replay, thereby ending the stream.AeronArchive.REPLAY_ALL_AND_FOLLOWretains the same behaviour as usingAeronArchive.NULL_LENGTHorLong.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
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. ReturnsAeron.NULL_VALUEif unspecified.- Returns:
- the counter id to bound the replay.
-
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 toAeron.NULL_VALUEif 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
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).
-