public final class ArchiveProxy extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_RETRY_ATTEMPTS
Default number of retry attempts to be made when offering requests.
|
| Constructor and Description |
|---|
ArchiveProxy(Publication publication)
Create a proxy with a
Publication for sending control message requests. |
ArchiveProxy(Publication publication,
IdleStrategy retryIdleStrategy,
NanoClock nanoClock,
long connectTimeoutNs,
int retryAttempts,
CredentialsSupplier credentialsSupplier)
Create a proxy with a
Publication for sending control message requests. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
attachSegments(long recordingId,
long correlationId,
long controlSessionId)
Attach segments to the beginning of a recording to restore history that was previously detached.
|
boolean |
boundedReplay(long recordingId,
long position,
long length,
int limitCounterId,
String replayChannel,
int replayStreamId,
long correlationId,
long controlSessionId)
Replay a recording from a given position bounded by a position counter.
|
boolean |
closeSession(long controlSessionId)
Close this control session with the archive.
|
boolean |
connect(String responseChannel,
int responseStreamId,
long correlationId)
Connect to an archive on its control interface providing the response stream details.
|
boolean |
connect(String responseChannel,
int responseStreamId,
long correlationId,
AgentInvoker aeronClientInvoker)
Connect to an archive on its control interface providing the response stream details.
|
boolean |
deleteDetachedSegments(long recordingId,
long correlationId,
long controlSessionId)
Delete segments which have been previously detached from a recording.
|
boolean |
detachSegments(long recordingId,
long newStartPosition,
long correlationId,
long controlSessionId)
Detach segments from the beginning of a recording up to the provided new start position.
|
boolean |
extendRecording(String channel,
int streamId,
SourceLocation sourceLocation,
boolean autoStop,
long recordingId,
long correlationId,
long controlSessionId)
Extend an existing, non-active, recorded stream for the same channel and stream id.
|
boolean |
extendRecording(String channel,
int streamId,
SourceLocation sourceLocation,
long recordingId,
long correlationId,
long controlSessionId)
Extend an existing, non-active, recorded stream for the same channel and stream id.
|
boolean |
findLastMatchingRecording(long minRecordingId,
String channelFragment,
int streamId,
int sessionId,
long correlationId,
long controlSessionId)
Find the last recording that matches the given criteria.
|
boolean |
getRecordingPosition(long recordingId,
long correlationId,
long controlSessionId)
Get the recorded position of an active recording.
|
boolean |
getStartPosition(long recordingId,
long correlationId,
long controlSessionId)
Get the start position of a recording.
|
boolean |
getStopPosition(long recordingId,
long correlationId,
long controlSessionId)
Get the stop position of a recording.
|
boolean |
keepAlive(long controlSessionId,
long correlationId)
Keep this archive session alive by notifying the archive.
|
boolean |
listRecording(long recordingId,
long correlationId,
long controlSessionId)
List a recording descriptor for a given recording id.
|
boolean |
listRecordings(long fromRecordingId,
int recordCount,
long correlationId,
long controlSessionId)
List a range of recording descriptors.
|
boolean |
listRecordingsForUri(long fromRecordingId,
int recordCount,
String channelFragment,
int streamId,
long correlationId,
long controlSessionId)
List a range of recording descriptors which match a channel URI fragment and stream id.
|
boolean |
listRecordingSubscriptions(int pseudoIndex,
int subscriptionCount,
String channelFragment,
int streamId,
boolean applyStreamId,
long correlationId,
long controlSessionId)
List registered subscriptions in the archive which have been used to record streams.
|
boolean |
migrateSegments(long srcRecordingId,
long dstRecordingId,
long correlationId,
long controlSessionId)
Migrate segments from a source recording and attach them to the beginning or end of a destination recording.
|
Publication |
publication()
Get the
Publication used for sending control messages. |
boolean |
purgeRecording(long recordingId,
long correlationId,
long controlSessionId)
Purge a stopped recording, i.e.
|
boolean |
purgeSegments(long recordingId,
long newStartPosition,
long correlationId,
long controlSessionId)
Purge (detach and delete) segments from the beginning of a recording up to the provided new start position.
|
boolean |
replay(long recordingId,
long position,
long length,
String replayChannel,
int replayStreamId,
long correlationId,
long controlSessionId)
Replay a recording from a given position.
|
boolean |
replay(long recordingId,
String replayChannel,
int replayStreamId,
ReplayParams replayParams,
long correlationId,
long controlSessionId)
Replay a recording from a given position.
|
boolean |
replicate(long srcRecordingId,
int srcControlStreamId,
String srcControlChannel,
ReplicationParams replicationParams,
long correlationId,
long controlSessionId)
Replicate a recording from a source archive to a destination which can be considered a backup for a primary
archive.
|
boolean |
replicate(long srcRecordingId,
long dstRecordingId,
int srcControlStreamId,
String srcControlChannel,
String liveDestination,
long correlationId,
long controlSessionId)
Replicate a recording from a source archive to a destination which can be considered a backup for a primary
archive.
|
boolean |
replicate(long srcRecordingId,
long dstRecordingId,
long stopPosition,
int srcControlStreamId,
String srcControlChannel,
String liveDestination,
String replicationChannel,
long correlationId,
long controlSessionId)
Replicate a recording from a source archive to a destination which can be considered a backup for a primary
archive.
|
boolean |
startRecording(String channel,
int streamId,
SourceLocation sourceLocation,
boolean autoStop,
long correlationId,
long controlSessionId)
Start recording streams for a given channel and stream id pairing.
|
boolean |
startRecording(String channel,
int streamId,
SourceLocation sourceLocation,
long correlationId,
long controlSessionId)
Start recording streams for a given channel and stream id pairing.
|
boolean |
stopAllReplays(long recordingId,
long correlationId,
long controlSessionId)
Stop any existing replay sessions for recording id or all replay sessions regardless of recording id.
|
boolean |
stopRecording(long subscriptionId,
long correlationId,
long controlSessionId)
Stop a recording by the
Subscription.registrationId() it was registered with. |
boolean |
stopRecording(String channel,
int streamId,
long correlationId,
long controlSessionId)
Stop an active recording.
|
boolean |
stopRecordingByIdentity(long recordingId,
long correlationId,
long controlSessionId)
Stop an active recording by the recording id.
|
boolean |
stopReplay(long replaySessionId,
long correlationId,
long controlSessionId)
Stop an existing replay session.
|
boolean |
stopReplication(long replicationId,
long correlationId,
long controlSessionId)
Stop an active replication by the registration id it was registered with.
|
boolean |
taggedReplicate(long srcRecordingId,
long dstRecordingId,
long channelTagId,
long subscriptionTagId,
int srcControlStreamId,
String srcControlChannel,
String liveDestination,
long correlationId,
long controlSessionId)
Replicate a recording from a source archive to a destination which can be considered a backup for a primary
archive.
|
boolean |
taggedReplicate(long srcRecordingId,
long dstRecordingId,
long stopPosition,
long channelTagId,
long subscriptionTagId,
int srcControlStreamId,
String srcControlChannel,
String liveDestination,
String replicationChannel,
long correlationId,
long controlSessionId)
Replicate a recording from a source archive to a destination which can be considered a backup for a primary
archive.
|
boolean |
truncateRecording(long recordingId,
long position,
long correlationId,
long controlSessionId)
Truncate a stopped recording to a given position that is less than the stopped position.
|
boolean |
tryChallengeResponse(byte[] encodedCredentials,
long correlationId,
long controlSessionId)
Try and send a ChallengeResponse to an archive on its control interface providing the credentials.
|
boolean |
tryConnect(String responseChannel,
int responseStreamId,
long correlationId)
Try and connect to an archive on its control interface providing the response stream details.
|
public static final int DEFAULT_RETRY_ATTEMPTS
public ArchiveProxy(Publication publication)
Publication for sending control message requests.
This provides a default IdleStrategy of a YieldingIdleStrategy when offers are back pressured
with a defaults of AeronArchive.Configuration.MESSAGE_TIMEOUT_DEFAULT_NS and
DEFAULT_RETRY_ATTEMPTS.
publication - publication for sending control messages to an archive.public ArchiveProxy(Publication publication, IdleStrategy retryIdleStrategy, NanoClock nanoClock, long connectTimeoutNs, int retryAttempts, CredentialsSupplier credentialsSupplier)
Publication for sending control message requests.publication - publication for sending control messages to an archive.retryIdleStrategy - for what should happen between retry attempts at offering messages.nanoClock - to be used for calculating checking deadlines.connectTimeoutNs - for connection requests.retryAttempts - for offering control messages before giving up.credentialsSupplier - for the AuthConnectRequestpublic Publication publication()
Publication used for sending control messages.Publication used for sending control messages.public boolean connect(String responseChannel, int responseStreamId, long correlationId)
responseChannel - for the control message responses.responseStreamId - for the control message responses.correlationId - for this request.public boolean tryConnect(String responseChannel, int responseStreamId, long correlationId)
responseChannel - for the control message responses.responseStreamId - for the control message responses.correlationId - for this request.public boolean connect(String responseChannel, int responseStreamId, long correlationId, AgentInvoker aeronClientInvoker)
responseChannel - for the control message responses.responseStreamId - for the control message responses.correlationId - for this request.aeronClientInvoker - for aeron client conductor thread.public boolean keepAlive(long controlSessionId,
long correlationId)
controlSessionId - with the archive.correlationId - for this request.public boolean closeSession(long controlSessionId)
controlSessionId - with the archive.public boolean tryChallengeResponse(byte[] encodedCredentials,
long correlationId,
long controlSessionId)
encodedCredentials - to send.correlationId - for this response.controlSessionId - for this request.public boolean startRecording(String channel, int streamId, SourceLocation sourceLocation, long correlationId, long controlSessionId)
channel - to be recorded.streamId - to be recorded.sourceLocation - of the publication to be recorded.correlationId - for this request.controlSessionId - for this request.public boolean startRecording(String channel, int streamId, SourceLocation sourceLocation, boolean autoStop, long correlationId, long controlSessionId)
channel - to be recorded.streamId - to be recorded.sourceLocation - of the publication to be recorded.autoStop - if the recording should be automatically stopped when complete.correlationId - for this request.controlSessionId - for this request.public boolean stopRecording(String channel, int streamId, long correlationId, long controlSessionId)
channel - to be stopped.streamId - to be stopped.correlationId - for this request.controlSessionId - for this request.public boolean stopRecording(long subscriptionId,
long correlationId,
long controlSessionId)
Subscription.registrationId() it was registered with.subscriptionId - that identifies the subscription in the archive doing the recording.correlationId - for this request.controlSessionId - for this request.public boolean stopRecordingByIdentity(long recordingId,
long correlationId,
long controlSessionId)
Subscription.registrationId().recordingId - that identifies a recording in the archive.correlationId - for this request.controlSessionId - for this request.public boolean replay(long recordingId,
String replayChannel,
int replayStreamId,
ReplayParams replayParams,
long correlationId,
long controlSessionId)
ReplayParams to change the behaviour of the
replay. For example a bounded replay can be requested by specifying the boundingLimitCounterId. The ReplayParams
is free to be reused after this call completes.recordingId - to be replayed.replayChannel - to which the replay should be sent.replayStreamId - to which the replay should be sent.replayParams - optional parameters change the behaviour of the replay.correlationId - for this request.controlSessionId - for this request.ReplayParamspublic boolean replay(long recordingId,
long position,
long length,
String replayChannel,
int replayStreamId,
long correlationId,
long controlSessionId)
recordingId - to be replayed.position - from which the replay should be started.length - of the stream to be replayed. Use Long.MAX_VALUE to follow a live stream.replayChannel - to which the replay should be sent.replayStreamId - to which the replay should be sent.correlationId - for this request.controlSessionId - for this request.public boolean boundedReplay(long recordingId,
long position,
long length,
int limitCounterId,
String replayChannel,
int replayStreamId,
long correlationId,
long controlSessionId)
recordingId - to be replayed.position - from which the replay should be started.length - of the stream to be replayed. Use Long.MAX_VALUE to follow a live stream.limitCounterId - to use as the replay bound.replayChannel - to which the replay should be sent.replayStreamId - to which the replay should be sent.correlationId - for this request.controlSessionId - for this request.public boolean stopReplay(long replaySessionId,
long correlationId,
long controlSessionId)
replaySessionId - that should be stopped.correlationId - for this request.controlSessionId - for this request.public boolean stopAllReplays(long recordingId,
long correlationId,
long controlSessionId)
recordingId - that should be stopped.correlationId - for this request.controlSessionId - for this request.public boolean listRecordings(long fromRecordingId,
int recordCount,
long correlationId,
long controlSessionId)
fromRecordingId - at which to begin listing.recordCount - for the number of descriptors to be listed.correlationId - for this request.controlSessionId - for this request.public boolean listRecordingsForUri(long fromRecordingId,
int recordCount,
String channelFragment,
int streamId,
long correlationId,
long controlSessionId)
fromRecordingId - at which to begin listing.recordCount - for the number of descriptors to be listed.channelFragment - to match recordings on from the original channel URI in the archive descriptor.streamId - to match recordings on.correlationId - for this request.controlSessionId - for this request.public boolean listRecording(long recordingId,
long correlationId,
long controlSessionId)
recordingId - at which to begin listing.correlationId - for this request.controlSessionId - for this request.public boolean extendRecording(String channel, int streamId, SourceLocation sourceLocation, long recordingId, long correlationId, long controlSessionId)
The channel must be configured for the initial position from which it will be extended. This can be done
with ChannelUriStringBuilder.initialPosition(long, int, int). The details required to initialise can
be found by calling listRecording(long, long, long).
channel - to be recorded.streamId - to be recorded.sourceLocation - of the publication to be recorded.recordingId - to be extended.correlationId - for this request.controlSessionId - for this request.public boolean extendRecording(String channel, int streamId, SourceLocation sourceLocation, boolean autoStop, long recordingId, long correlationId, long controlSessionId)
The channel must be configured for the initial position from which it will be extended. This can be done
with ChannelUriStringBuilder.initialPosition(long, int, int). The details required to initialise can
be found by calling listRecording(long, long, long).
channel - to be recorded.streamId - to be recorded.sourceLocation - of the publication to be recorded.autoStop - if the recording should be automatically stopped when complete.recordingId - to be extended.correlationId - for this request.controlSessionId - for this request.public boolean getRecordingPosition(long recordingId,
long correlationId,
long controlSessionId)
recordingId - of the active recording that the position is being requested for.correlationId - for this request.controlSessionId - for this request.public boolean truncateRecording(long recordingId,
long position,
long correlationId,
long controlSessionId)
recordingId - of the stopped recording to be truncated.position - to which the recording will be truncated.correlationId - for this request.controlSessionId - for this request.public boolean purgeRecording(long recordingId,
long correlationId,
long controlSessionId)
RecordingState.INVALID
and delete the corresponding segment files. The space in the Catalog will be reclaimed upon compaction.recordingId - of the stopped recording to be purged.correlationId - for this request.controlSessionId - for this request.public boolean getStartPosition(long recordingId,
long correlationId,
long controlSessionId)
recordingId - of the recording that the position is being requested for.correlationId - for this request.controlSessionId - for this request.public boolean getStopPosition(long recordingId,
long correlationId,
long controlSessionId)
recordingId - of the recording that the stop position is being requested for.correlationId - for this request.controlSessionId - for this request.public boolean findLastMatchingRecording(long minRecordingId,
String channelFragment,
int streamId,
int sessionId,
long correlationId,
long controlSessionId)
minRecordingId - to search back to.channelFragment - for a contains match on the original channel stored with the archive descriptor.streamId - of the recording to match.sessionId - of the recording to match.correlationId - for this request.controlSessionId - for this request.public boolean listRecordingSubscriptions(int pseudoIndex,
int subscriptionCount,
String channelFragment,
int streamId,
boolean applyStreamId,
long correlationId,
long controlSessionId)
pseudoIndex - in the list of active recording subscriptions.subscriptionCount - for the number of descriptors to be listed.channelFragment - for a contains match on the stripped channel used with the registered subscription.streamId - for the subscription.applyStreamId - when matching.correlationId - for this request.controlSessionId - for this request.public boolean replicate(long srcRecordingId,
long dstRecordingId,
int srcControlStreamId,
String srcControlChannel,
String liveDestination,
long correlationId,
long controlSessionId)
Aeron.NULL_VALUE then a new destination recording is created,
otherwise the provided destination recording id will be extended. The details of the source recording
descriptor will be replicated.
For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with AeronArchive.pollForErrorResponse()
or AeronArchive.checkForErrorResponse().
srcRecordingId - recording id which must exist in the source archive.dstRecordingId - recording to extend in the destination, otherwise Aeron.NULL_VALUE.srcControlChannel - remote control channel for the source archive to instruct the replay on.srcControlStreamId - remote control stream id for the source archive to instruct the replay on.liveDestination - destination for the live stream if merge is required. Empty or null for no merge.correlationId - for this request.controlSessionId - for this request.public boolean replicate(long srcRecordingId,
long dstRecordingId,
long stopPosition,
int srcControlStreamId,
String srcControlChannel,
String liveDestination,
String replicationChannel,
long correlationId,
long controlSessionId)
Aeron.NULL_VALUE then a new destination recording is created,
otherwise the provided destination recording id will be extended. The details of the source recording
descriptor will be replicated.
For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with AeronArchive.pollForErrorResponse()
or AeronArchive.checkForErrorResponse().
srcRecordingId - recording id which must exist in the source archive.dstRecordingId - recording to extend in the destination, otherwise Aeron.NULL_VALUE.stopPosition - position to stop the replication. AeronArchive.NULL_POSITION to stop at end
of current recording.srcControlStreamId - remote control stream id for the source archive to instruct the replay on.srcControlChannel - remote control channel for the source archive to instruct the replay on.liveDestination - destination for the live stream if merge is required. Empty or null for no merge.replicationChannel - channel over which the replication will occur. Empty or null for default channel.correlationId - for this request.controlSessionId - for this request.public boolean taggedReplicate(long srcRecordingId,
long dstRecordingId,
long channelTagId,
long subscriptionTagId,
int srcControlStreamId,
String srcControlChannel,
String liveDestination,
long correlationId,
long controlSessionId)
Aeron.NULL_VALUE then a new destination recording is created,
otherwise the provided destination recording id will be extended. The details of the source recording
descriptor will be replicated. The subscription used in the archive will be tagged with the provided tags.
For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with AeronArchive.pollForErrorResponse()
or AeronArchive.checkForErrorResponse().
srcRecordingId - recording id which must exist in the source archive.dstRecordingId - recording to extend in the destination, otherwise Aeron.NULL_VALUE.channelTagId - used to tag the replication subscription.subscriptionTagId - used to tag the replication subscription.srcControlChannel - remote control channel for the source archive to instruct the replay on.srcControlStreamId - remote control stream id for the source archive to instruct the replay on.liveDestination - destination for the live stream if merge is required. Empty or null for no merge.correlationId - for this request.controlSessionId - for this request.public boolean taggedReplicate(long srcRecordingId,
long dstRecordingId,
long stopPosition,
long channelTagId,
long subscriptionTagId,
int srcControlStreamId,
String srcControlChannel,
String liveDestination,
String replicationChannel,
long correlationId,
long controlSessionId)
Aeron.NULL_VALUE then a new destination recording is created,
otherwise the provided destination recording id will be extended. The details of the source recording
descriptor will be replicated. The subscription used in the archive will be tagged with the provided tags.
For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with AeronArchive.pollForErrorResponse()
or AeronArchive.checkForErrorResponse().
srcRecordingId - recording id which must exist in the source archive.dstRecordingId - recording to extend in the destination, otherwise Aeron.NULL_VALUE.stopPosition - position to stop the replication. AeronArchive.NULL_POSITION to stop at end
of current recording.channelTagId - used to tag the replication subscription.subscriptionTagId - used to tag the replication subscription.srcControlChannel - remote control channel for the source archive to instruct the replay on.srcControlStreamId - remote control stream id for the source archive to instruct the replay on.liveDestination - destination for the live stream if merge is required. Empty or null for no merge.replicationChannel - channel over which the replication will occur. Empty or null for default channel.correlationId - for this request.controlSessionId - for this request.public boolean replicate(long srcRecordingId,
int srcControlStreamId,
String srcControlChannel,
ReplicationParams replicationParams,
long correlationId,
long controlSessionId)
ReplicationParams.
For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with AeronArchive.pollForErrorResponse()
or AeronArchive.checkForErrorResponse().
The ReplicationParams is free to be reused when this call completes.
srcRecordingId - recording id which must exist in the source archive.srcControlChannel - remote control channel for the source archive to instruct the replay on.srcControlStreamId - remote control stream id for the source archive to instruct the replay on.replicationParams - optional parameters to control the behaviour of the replication.correlationId - for this request.controlSessionId - for this request.ReplicationParamspublic boolean stopReplication(long replicationId,
long correlationId,
long controlSessionId)
replicationId - that identifies the session in the archive doing the replication.correlationId - for this request.controlSessionId - for this request.public boolean detachSegments(long recordingId,
long newStartPosition,
long correlationId,
long controlSessionId)
The new start position must be first byte position of a segment after the existing start position.
It is not possible to detach segments which are active for recording or being replayed.
recordingId - to which the operation applies.newStartPosition - for the recording after the segments are detached.correlationId - for this request.controlSessionId - for this request.AeronArchive.segmentFileBasePosition(long, long, int, int)public boolean deleteDetachedSegments(long recordingId,
long correlationId,
long controlSessionId)
recordingId - to which the operation applies.correlationId - for this request.controlSessionId - for this request.detachSegments(long, long, long, long)public boolean purgeSegments(long recordingId,
long newStartPosition,
long correlationId,
long controlSessionId)
The new start position must be first byte position of a segment after the existing start position.
It is not possible to purge segments which are active for recording or being replayed.
recordingId - to which the operation applies.newStartPosition - for the recording after the segments are detached.correlationId - for this request.controlSessionId - for this request.detachSegments(long, long, long, long),
deleteDetachedSegments(long, long, long),
AeronArchive.segmentFileBasePosition(long, long, int, int)public boolean attachSegments(long recordingId,
long correlationId,
long controlSessionId)
Segment files must match the existing recording and join exactly to the start position of the recording they are being attached to.
recordingId - to which the operation applies.correlationId - for this request.controlSessionId - for this request.detachSegments(long, long, long, long)public boolean migrateSegments(long srcRecordingId,
long dstRecordingId,
long correlationId,
long controlSessionId)
The source recording must match the destination recording for segment length, term length, mtu length, and stream id. The source recording must join to the destination recording on a segment boundary and without gaps, i.e., the stop position and term id of one must match the start position and term id of the other.
The source recording must be stopped. The destination recording must be stopped if migrating segments to the end of the destination recording.
The source recording will be effectively truncated back to its start position after the migration.
srcRecordingId - source recording from which the segments will be migrated.dstRecordingId - destination recording to which the segments will be attached.correlationId - for this request.controlSessionId - for this request.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.