Class Archive.Context
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- Archive
The context will be owned by ArchiveConductor after a successful
Archive.launch(Context) and closed via Archive.close().
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaeron()Aeronclient for communicating with the local Media Driver.Aeronclient for communicating with the local Media Driver.Get the top level Aeron directory used for communication between the Aeron client and Media Driver.aeronDirectoryName(String aeronDirectoryName) Set the top level Aeron directory used for communication between the Aeron client and Media Driver.Get theAeronArchive.Contextthat should be used for communicating with a remote archive for replication.archiveClientContext(AeronArchive.Context archiveContext) Set theAeronArchive.Contextthat should be used for communicating with a remote archive for replication.Get the directory in which the Archive will store recordings and theCatalog.archiveDir(File archiveDir) Set the directory in which the Archive will store recordings and theCatalog.Get theFileChannelfor the directory in which the Archive will store recordings and theCatalog.Get the directory name to be used to store recordings and theCatalog.archiveDirectoryName(String archiveDirectoryName) Set the directory name to be used for the archive to store recordings and theCatalog.Get theFileStorewhere the archive will record streams.archiveFileStore(FileStore fileStore) Set theFileStorewhere the archive will record streams.longGet the id of this Archive instance.archiveId(long archiveId) Set the id for this Archive instance.TheArchiveMarkFilefor the Archive.archiveMarkFile(ArchiveMarkFile archiveMarkFile) TheArchiveMarkFilefor the Archive.Get theAuthenticatorSupplierthat should be used for the Archive.authenticatorSupplier(AuthenticatorSupplier authenticatorSupplier) Set theAuthenticatorSupplierthat will be used for the Archive.Get theAuthorisationServiceSupplierthat should be used for the Archive.authorisationServiceSupplier(AuthorisationServiceSupplier authorisationServiceSupplier) Set theAuthorisationServiceSupplierthat will be used for the Archive.longCapacity in bytes of theCatalog.catalogCapacity(long catalogCapacity) Capacity in bytes of theCatalog.intGet level at which the catalog file should be sync'ed to disk.catalogFileSyncLevel(int syncLevel) Set level at which the catalog file should be sync'ed to disk.clone()Perform a shallow copy of the object.voidclose()Close the context and free applicable resources.voidconclude()Conclude the configuration parameters by resolving dependencies and null values to use defaults.longThreshold for the conductor work cycle time which when exceed it will increment the conductor cycle time exceeded count.conductorCycleThresholdNs(long thresholdNs) Set a threshold for the conductor work cycle time which when exceed it will increment the conductor cycle time exceeded count.The duty cycle tracker for the conductor.conductorDutyCycleTracker(DutyCycleTracker dutyCycleTracker) Set the duty cycle tracker for the conductor.longThe timeout in nanoseconds to wait for connection to be established.connectTimeoutNs(long connectTimeoutNs) The timeout in nanoseconds to wait for connection to be established.Get the channel URI on which the control request subscription will listen.controlChannel(String controlChannel) Set the channel URI on which the control request subscription will listen.booleanShould the UDP control channel be enabled.controlChannelEnabled(boolean controlChannelEnabled) Set if the UDP control channel should be enabled.intGet the MTU length for the control streams.controlMtuLength(int controlMtuLength) Set the MTU length for the control streams.Get the counter used to track the number of active control sessions.controlSessionsCounter(Counter controlSessionsCounter) Set the counter used to track the number of active control sessions.intGet the stream id on which the control request subscription will listen.controlStreamId(int controlStreamId) Set the stream id on which the control request subscription will listen.intGet the term buffer length for the control streams.controlTermBufferLength(int controlTermBufferLength) Set the term buffer length for the control streams.booleanShould the control streams use sparse file term buffers.controlTermBufferSparse(boolean controlTermBufferSparse) Should the control streams use sparse file term buffers.TheerrorHandler()that will incrementerrorCounter()by default.countedErrorHandler(CountedErrorHandler countedErrorHandler) Non-default for context.voidDeprecated.booleanShould an existing archive be deleted on start.deleteArchiveOnStart(boolean deleteArchiveOnStart) Should an existing archive be deleted on start.voidDelete the archive directory if thearchiveDir()value is not null.Get theEpochClockto used for tracking wall clock time.epochClock(EpochClock clock) Set theEpochClockto be used for tracking wall clock time.intThe error buffer length in bytes.errorBufferLength(int errorBufferLength) Set the error buffer length in bytes to use.Get the error counter that will record the number of errors observed.errorCounter(AtomicCounter errorCounter) Set the error counter that will record the number of errors observed.Get theErrorHandlerto be used by the Archive.errorHandler(ErrorHandler errorHandler) Set theErrorHandlerto be used by the Archive.intGet the max length of a file IO operation.fileIoMaxLength(int fileIoMaxLength) Set the max length of a file IO operation.intGet level at which files should be sync'ed to disk.fileSyncLevel(int syncLevel) Set level at which files should be sync'ed to disk.Get a newIdleStrategyfor idling the conductor or compositeAgent.idleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier) Provides anIdleStrategysupplier for idling the conductor or compositeAgent.booleanHas the context had theconclude()method called.Get the driver local channel URI on which the control request subscription will listen.localControlChannel(String controlChannel) Set the driver local channel URI on which the control request subscription will listen.intGet the local stream id on which the control request subscription will listen.localControlStreamId(int controlStreamId) Set the local stream id on which the control request subscription will listen.longThreshold below which the archive will reject new recording requests.lowStorageSpaceThreshold(long lowStorageSpaceThreshold) Threshold below which the archive will reject new recording requests.Get the directory in which the Archive will store mark file (i.e.markFileDir(File markFileDir) Set the directory in which the Archive will store mark file (i.e.longDeprecated.maxCatalogEntries(long maxCatalogEntries) Deprecated.This method was deprecated in favor ofcatalogCapacity(long)which works with bytes rather than number of entries.intGet the max number of concurrent recordings.maxConcurrentRecordings(int maxConcurrentRecordings) Set the max number of concurrent recordings.intGet the max number of concurrent replays.maxConcurrentReplays(int maxConcurrentReplays) Set the max number of concurrent replays.Get the counter used to track the max time used by the replayer to read a block of data.maxReadTimeCounter(Counter counter) Set the counter used to track the max time used by the replayer to read a block of data.Get the counter used to track the max time used by the recorder to write a block of data.maxWriteTimeCounter(Counter counter) Set the counter used to track the max time used by the recorder to write a block of data.Get theAgentInvokerthat should be used for the Media Driver if running in a lightweight mode.mediaDriverAgentInvoker(AgentInvoker mediaDriverAgentInvoker) Set theAgentInvokerthat should be used for the Media Driver if running in a lightweight mode.Get theNanoClockto used for tracking wall clock time.Set theNanoClockto be used for tracking wall clock time.booleanDoes this context own theaeron()client and this takes responsibility for closing it?ownsAeronClient(boolean ownsAeronClient) Does this context own theaeron()client and this takes responsibility for closing it?Get theChecksumfor checksum computation during recording.recordChecksum(Checksum recordChecksum) Provides an explicitChecksumfor checksum computation during recording.longThreshold for the recorder work cycle time which when exceed it will increment the recorder cycle time exceeded count.recorderCycleThresholdNs(long thresholdNs) Set a threshold for the recorder work cycle time which when exceed it will increment the recorder cycle time exceeded count.The duty cycle tracker for the recorder.recorderDutyCycleTracker(DutyCycleTracker dutyCycleTracker) Set the duty cycle tracker for the recorder.Get a newIdleStrategyfor idling the recorderAgent.recorderIdleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier) Provides anIdleStrategysupplier for idling the recorderAgent.Get the thread factory used for creating the recorder thread when running in DEDICATED threading mode.recorderThreadFactory(ThreadFactory threadFactory) Set the thread factory used for creating the recorder thread when running in DEDICATED threading mode.Get the channel URI on which the recording events publication will publish.recordingEventsChannel(String recordingEventsChannel) Set the channel URI on which the recording events publication will publish.booleanShould the recording events channel be enabled.recordingEventsEnabled(boolean recordingEventsEnabled) Set if the recording events channel should be enabled.intGet the stream id on which the recording events publication will publish.recordingEventsStreamId(int recordingEventsStreamId) Set the stream id on which the recording events publication will publish.Get the counter used to track the count of concurrent recording sessions.recordingSessionCounter(Counter counter) Set the counter used to track the count of concurrent recording sessions.Get theChecksumfor checksum computation during replay.replayChecksum(Checksum replayChecksum) TheChecksumfor checksum computation during replay.longThreshold for the replayer work cycle time which when exceed it will increment the replayer cycle time exceeded count.replayerCycleThresholdNs(long thresholdNs) Set a threshold for the replayer work cycle time which when exceed it will increment the replayer cycle time exceeded count.The duty cycle tracker for the replayer.replayerDutyCycleTracker(DutyCycleTracker dutyCycleTracker) Set the duty cycle tracker for the replayer.Get a newIdleStrategyfor idling the replayerAgent.replayerIdleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier) Provides anIdleStrategysupplier for idling the replayerAgent.Get the thread factory used for creating the replayer thread when running in DEDICATED threading mode.replayerThreadFactory(ThreadFactory threadFactory) Set the thread factory used for creating the replayer thread when running in DEDICATED threading mode.longThe timeout in nanoseconds for a replay publication to linger after draining.replayLingerTimeoutNs(long replayLingerTimeoutNs) The timeout in nanoseconds for or a replay publication to linger after draining.Get the counter used to track the count of concurrent replay sessions.replaySessionCounter(Counter counter) Set the counter used to track the count of concurrent replay sessions.Get the channel URI for replicating stream from another archive as replays.replicationChannel(String replicationChannel) The channel URI for replicating stream from another archive as replays.Get the configured instance of SecureRandom usingSecureRandom.getInstanceStrong()ifstrongis specified.Get the secure random algorithm should be used by various Aeron components.secureRandomAlgorithm(String algorithm) Define which secure random algorithm should be used by various Aeron components.intGet the file length used for recording data segment files.segmentFileLength(int segmentFileLength) Set the file length to be used for recording data segment files.longThe time internal in nanoseconds at which session liveness checks are performed.sessionLivenessCheckIntervalNs(long sessionLivenessCheckIntervalNs) The time internal in nanoseconds at which session liveness checks are performed.Get the thread factory used for creating threads inArchiveThreadingMode.SHAREDandArchiveThreadingMode.DEDICATEDthreading modes.threadFactory(ThreadFactory threadFactory) Set the thread factory used for creating threads inArchiveThreadingMode.SHAREDandArchiveThreadingMode.DEDICATEDthreading modes.Get the archive threading mode.threadingMode(ArchiveThreadingMode threadingMode) Set the archive threading mode.toString()Get the counter used to track the total number of bytes read by the replayer.totalReadBytesCounter(Counter counter) Set the counter used to track the total number of bytes read by the replayer.Get the counter used to track the total time used by the replayer to read data.totalReadTimeCounter(Counter counter) Set the counter used to track the total time used by the replayer to read data.Get the counter used to track the total number of bytes written by the recorder.totalWriteBytesCounter(Counter counter) Set the counter used to track the total number of bytes written by the recorder.Get the counter used to track the total time used by the recorder to write data.totalWriteTimeCounter(Counter counter) Set the counter used to track the total time used by the recorder to write data.
-
Constructor Details
-
Context
public Context()
-
-
Method Details
-
clone
Perform a shallow copy of the object. -
conclude
public void conclude()Conclude the configuration parameters by resolving dependencies and null values to use defaults. -
isConcluded
public boolean isConcluded()Has the context had theconclude()method called.- Returns:
- true of the
conclude()method has been called.
-
deleteArchiveOnStart
Should an existing archive be deleted on start. Useful only for testing.- Parameters:
deleteArchiveOnStart- true if an existing archive should be deleted on startup.- Returns:
- this for a fluent API.
-
deleteArchiveOnStart
public boolean deleteArchiveOnStart()Should an existing archive be deleted on start. Useful only for testing.- Returns:
trueif an existing archive should be deleted on start up.
-
archiveDirectoryName
Set the directory name to be used for the archive to store recordings and theCatalog. This name is used ifarchiveDir(File)is not set.- Parameters:
archiveDirectoryName- to store recordings and theCatalog.- Returns:
- this for a fluent API.
- See Also:
-
archiveDirectoryName
Get the directory name to be used to store recordings and theCatalog.- Returns:
- the directory name to be used for the archive to store recordings and the
Catalog.
-
archiveDir
Get the directory in which the Archive will store recordings and theCatalog.- Returns:
- the directory in which the Archive will store recordings and the
Catalog.
-
archiveDir
Set the directory in which the Archive will store recordings and theCatalog.- Parameters:
archiveDir- the directory in which the Archive will store recordings and theCatalog.- Returns:
- this for a fluent API.
-
markFileDir
Get the directory in which the Archive will store mark file (i.e.archive-mark.dat). It defaults toarchiveDir()if it is not set explicitly via theArchive.Configuration.MARK_FILE_DIR_PROP_NAME.- Returns:
- the directory in which the Archive will store mark file (i.e.
archive-mark.dat). - See Also:
-
markFileDir
Set the directory in which the Archive will store mark file (i.e.archive-mark.dat).- Parameters:
markFileDir- the directory in which the Archive will store mark file (i.e.archive-mark.dat).- Returns:
- this for a fluent API.
-
archiveFileStore
Get theFileStorewhere the archive will record streams.- Returns:
- the
FileStorewhere the archive will record streams.
-
archiveFileStore
Set theFileStorewhere the archive will record streams. This should only be used for testing.- Parameters:
fileStore- where the archive will record streams.- Returns:
- this for a fluent API.
-
archiveDirChannel
Get theFileChannelfor the directory in which the Archive will store recordings and theCatalog. This can be used for sync'ing the directory.- Returns:
- the directory in which the Archive will store recordings and the
Catalog.
-
archiveClientContext
Set theAeronArchive.Contextthat should be used for communicating with a remote archive for replication.- Parameters:
archiveContext- that should be used for communicating with a remote Archive.- Returns:
- this for a fluent API.
-
archiveClientContext
Get theAeronArchive.Contextthat should be used for communicating with a remote archive for replication.- Returns:
- the
AeronArchive.Contextthat should be used for communicating with a remote archive for replication.
-
controlChannelEnabled
public boolean controlChannelEnabled()Should the UDP control channel be enabled.- Returns:
trueif the UDP control channel should be enabled.- See Also:
-
controlChannelEnabled
Set if the UDP control channel should be enabled.- Parameters:
controlChannelEnabled- indication of if the network control channel should be enabled.- Returns:
- this for a fluent API.
- See Also:
-
controlChannel
Get the channel URI on which the control request subscription will listen.- Returns:
- the channel URI on which the control request subscription will listen.
- See Also:
-
controlChannel
Set the channel URI on which the control request subscription will listen.- Parameters:
controlChannel- channel URI on which the control request subscription will listen.- Returns:
- this for a fluent API.
- See Also:
-
controlStreamId
public int controlStreamId()Get the stream id on which the control request subscription will listen.- Returns:
- the stream id on which the control request subscription will listen.
- See Also:
-
controlStreamId
Set the stream id on which the control request subscription will listen.- Parameters:
controlStreamId- stream id on which the control request subscription will listen.- Returns:
- this for a fluent API.
- See Also:
-
localControlChannel
Get the driver local channel URI on which the control request subscription will listen.- Returns:
- the channel URI on which the control request subscription will listen.
- See Also:
-
localControlChannel
Set the driver local channel URI on which the control request subscription will listen.- Parameters:
controlChannel- channel URI on which the control request subscription will listen.- Returns:
- this for a fluent API.
- See Also:
-
localControlStreamId
public int localControlStreamId()Get the local stream id on which the control request subscription will listen.- Returns:
- the stream id on which the control request subscription will listen.
- See Also:
-
controlTermBufferSparse
Should the control streams use sparse file term buffers.- Parameters:
controlTermBufferSparse- for the control stream.- Returns:
- this for a fluent API.
- See Also:
-
controlTermBufferSparse
public boolean controlTermBufferSparse()Should the control streams use sparse file term buffers.- Returns:
trueif the control stream should use sparse file term buffers.- See Also:
-
controlTermBufferLength
Set the term buffer length for the control streams.- Parameters:
controlTermBufferLength- for the control streams.- Returns:
- this for a fluent API.
- See Also:
-
controlTermBufferLength
public int controlTermBufferLength()Get the term buffer length for the control streams.- Returns:
- the term buffer length for the control streams.
- See Also:
-
controlMtuLength
Set the MTU length for the control streams.- Parameters:
controlMtuLength- for the control streams.- Returns:
- this for a fluent API.
- See Also:
-
controlMtuLength
public int controlMtuLength()Get the MTU length for the control streams.- Returns:
- the MTU length for the control streams.
- See Also:
-
localControlStreamId
Set the local stream id on which the control request subscription will listen.- Parameters:
controlStreamId- stream id on which the control request subscription will listen.- Returns:
- this for a fluent API.
- See Also:
-
recordingEventsChannel
Get the channel URI on which the recording events publication will publish. Will be null if not configured.- Returns:
- the channel URI on which the recording events publication will publish.
- See Also:
-
recordingEventsChannel
Set the channel URI on which the recording events publication will publish.To support dynamic subscribers then this can be set to multicast or MDC (Multi-Destination-Cast) if multicast cannot be supported for on the available the network infrastructure.
- Parameters:
recordingEventsChannel- channel URI on which the recording events publication will publish.- Returns:
- this for a fluent API.
- See Also:
-
recordingEventsStreamId
public int recordingEventsStreamId()Get the stream id on which the recording events publication will publish.- Returns:
- the stream id on which the recording events publication will publish.
- See Also:
-
recordingEventsStreamId
Set the stream id on which the recording events publication will publish.- Parameters:
recordingEventsStreamId- stream id on which the recording events publication will publish.- Returns:
- this for a fluent API.
- See Also:
-
recordingEventsEnabled
public boolean recordingEventsEnabled()Should the recording events channel be enabled.- Returns:
trueif the recording events channel should be enabled.- See Also:
-
recordingEventsEnabled
Set if the recording events channel should be enabled.- Parameters:
recordingEventsEnabled- indication of if the recording events channel should be enabled.- Returns:
- this for a fluent API.
- See Also:
-
replicationChannel
Get the channel URI for replicating stream from another archive as replays.- Returns:
- the channel URI for replicating stream from another archive as replays.
- See Also:
-
replicationChannel
The channel URI for replicating stream from another archive as replays.- Parameters:
replicationChannel- channel URI for replicating stream from another archive as replays.- Returns:
- this for a fluent API.
- See Also:
-
connectTimeoutNs
The timeout in nanoseconds to wait for connection to be established.- Parameters:
connectTimeoutNs- to wait for a connection to be established.- Returns:
- this for a fluent API.
- See Also:
-
connectTimeoutNs
public long connectTimeoutNs()The timeout in nanoseconds to wait for connection to be established.- Returns:
- the message timeout in nanoseconds to wait for a connection to be established.
- See Also:
-
sessionLivenessCheckIntervalNs
The time internal in nanoseconds at which session liveness checks are performed.- Parameters:
sessionLivenessCheckIntervalNs- of a liveness check.- Returns:
- this for a fluent API.
- Since:
- 1.47.0
- See Also:
-
sessionLivenessCheckIntervalNs
public long sessionLivenessCheckIntervalNs()The time internal in nanoseconds at which session liveness checks are performed.- Returns:
- the time internal in nanoseconds at which session liveness checks are performed.
- Since:
- 1.47.0
- See Also:
-
replayLingerTimeoutNs
The timeout in nanoseconds for or a replay publication to linger after draining.- Parameters:
replayLingerTimeoutNs- in nanoseconds for a replay publication to linger after draining.- Returns:
- this for a fluent API.
- See Also:
-
replayLingerTimeoutNs
public long replayLingerTimeoutNs()The timeout in nanoseconds for a replay publication to linger after draining.- Returns:
- the timeout in nanoseconds for a replay publication to linger after draining.
- See Also:
-
conductorCycleThresholdNs
Set a threshold for the conductor work cycle time which when exceed it will increment the conductor cycle time exceeded count.- Parameters:
thresholdNs- value in nanoseconds- Returns:
- this for fluent API.
- See Also:
-
conductorCycleThresholdNs
public long conductorCycleThresholdNs()Threshold for the conductor work cycle time which when exceed it will increment the conductor cycle time exceeded count.- Returns:
- threshold to track for the conductor work cycle time.
-
recorderCycleThresholdNs
Set a threshold for the recorder work cycle time which when exceed it will increment the recorder cycle time exceeded count.- Parameters:
thresholdNs- value in nanoseconds- Returns:
- this for fluent API.
- See Also:
-
recorderCycleThresholdNs
public long recorderCycleThresholdNs()Threshold for the recorder work cycle time which when exceed it will increment the recorder cycle time exceeded count.- Returns:
- threshold to track for the recorder work cycle time.
-
replayerCycleThresholdNs
Set a threshold for the replayer work cycle time which when exceed it will increment the replayer cycle time exceeded count.- Parameters:
thresholdNs- value in nanoseconds- Returns:
- this for fluent API.
- See Also:
-
replayerCycleThresholdNs
public long replayerCycleThresholdNs()Threshold for the replayer work cycle time which when exceed it will increment the replayer cycle time exceeded count.- Returns:
- threshold to track for the replayer work cycle time.
-
conductorDutyCycleTracker
Set the duty cycle tracker for the conductor.- Parameters:
dutyCycleTracker- for the conductor.- Returns:
- this for a fluent API.
-
conductorDutyCycleTracker
The duty cycle tracker for the conductor.- Returns:
- duty cycle tracker for the conductor.
-
recorderDutyCycleTracker
Set the duty cycle tracker for the recorder. NOTE: Only used in DEDICATED threading mode.- Parameters:
dutyCycleTracker- for the recorder.- Returns:
- this for a fluent API.
-
recorderDutyCycleTracker
The duty cycle tracker for the recorder. NOTE: Only used in DEDICATED threading mode.- Returns:
- duty cycle tracker for the recorder.
-
replayerDutyCycleTracker
Set the duty cycle tracker for the replayer. NOTE: Only used in DEDICATED threading mode.- Parameters:
dutyCycleTracker- for the replayer.- Returns:
- this for a fluent API.
-
replayerDutyCycleTracker
The duty cycle tracker for the replayer. NOTE: Only used in DEDICATED threading mode.- Returns:
- duty cycle tracker for the replayer.
-
recordChecksum
Provides an explicitChecksumfor checksum computation during recording.- Parameters:
recordChecksum- to be used for recordings.- Returns:
- this for a fluent API.
- See Also:
-
recordChecksum
Get theChecksumfor checksum computation during recording. -
replayChecksum
TheChecksumfor checksum computation during replay.- Parameters:
replayChecksum- to be used for replays.- Returns:
- this for a fluent API.
- See Also:
-
replayChecksum
Get theChecksumfor checksum computation during replay. -
idleStrategySupplier
Provides anIdleStrategysupplier for idling the conductor or compositeAgent. Which is also the default for recorder and replayerAgents.- Parameters:
idleStrategySupplier- supplier for idling the conductor.- Returns:
- this for a fluent API.
-
idleStrategy
Get a newIdleStrategyfor idling the conductor or compositeAgent. Which is also the default for recorder and replayerAgents.- Returns:
- a new
IdleStrategyfor idling the conductor or compositeAgent.
-
recorderIdleStrategySupplier
Provides anIdleStrategysupplier for idling the recorderAgent.- Parameters:
idleStrategySupplier- supplier for idling the conductor.- Returns:
- this for a fluent API.
-
recorderIdleStrategy
Get a newIdleStrategyfor idling the recorderAgent.- Returns:
- a new
IdleStrategyfor idling the recorderAgent.
-
replayerIdleStrategySupplier
Provides anIdleStrategysupplier for idling the replayerAgent.- Parameters:
idleStrategySupplier- supplier for idling the replayer.- Returns:
- this for a fluent API.
-
replayerIdleStrategy
Get a newIdleStrategyfor idling the replayerAgent.- Returns:
- a new
IdleStrategyfor idling the replayerAgent.
-
epochClock
Set theEpochClockto be used for tracking wall clock time.- Parameters:
clock-EpochClockto be used for tracking wall clock time.- Returns:
- this for a fluent API.
-
epochClock
Get theEpochClockto used for tracking wall clock time.- Returns:
- the
EpochClockto used for tracking wall clock time.
-
nanoClock
Set theNanoClockto be used for tracking wall clock time.- Parameters:
clock-NanoClockto be used for tracking wall clock time.- Returns:
- this for a fluent API.
-
nanoClock
Get theNanoClockto used for tracking wall clock time.- Returns:
- the
NanoClockto used for tracking wall clock time.
-
segmentFileLength
public int segmentFileLength()Get the file length used for recording data segment files.- Returns:
- the file length used for recording data segment files
- See Also:
-
segmentFileLength
Set the file length to be used for recording data segment files. If theImage.termBufferLength()is larger than the segment file length then the term length will be used.- Parameters:
segmentFileLength- the file length to be used for recording data segment files.- Returns:
- this for a fluent API.
- See Also:
-
fileSyncLevel
public int fileSyncLevel()Get level at which files should be sync'ed to disk.- 0 - normal writes.
- 1 - sync file data.
- 2 - sync file data + metadata.
- Returns:
- the level to be applied for file write.
- See Also:
-
fileSyncLevel
Set level at which files should be sync'ed to disk.- 0 - normal writes.
- 1 - sync file data.
- 2 - sync file data + metadata.
- Parameters:
syncLevel- to be applied for file writes.- Returns:
- this for a fluent API.
- See Also:
-
catalogFileSyncLevel
public int catalogFileSyncLevel()Get level at which the catalog file should be sync'ed to disk.- 0 - normal writes.
- 1 - sync file data.
- 2 - sync file data + metadata.
- Returns:
- the level to be applied for file write.
- See Also:
-
catalogFileSyncLevel
Set level at which the catalog file should be sync'ed to disk.- 0 - normal writes.
- 1 - sync file data.
- 2 - sync file data + metadata.
- Parameters:
syncLevel- to be applied for file writes.- Returns:
- this for a fluent API.
- See Also:
-
mediaDriverAgentInvoker
Get theAgentInvokerthat should be used for the Media Driver if running in a lightweight mode.- Returns:
- the
AgentInvokerthat should be used for the Media Driver if running in a lightweight mode.
-
mediaDriverAgentInvoker
Set theAgentInvokerthat should be used for the Media Driver if running in a lightweight mode.- Parameters:
mediaDriverAgentInvoker- that should be used for the Media Driver if running in a lightweight mode.- Returns:
- this for a fluent API.
-
errorHandler
Get theErrorHandlerto be used by the Archive.- Returns:
- the
ErrorHandlerto be used by the Archive.
-
errorHandler
Set theErrorHandlerto be used by the Archive.- Parameters:
errorHandler- the error handler to be used by the Archive.- Returns:
- this for a fluent API
-
countedErrorHandler
Non-default for context.- Parameters:
countedErrorHandler- to override the default.- Returns:
- this for a fluent API.
-
countedErrorHandler
TheerrorHandler()that will incrementerrorCounter()by default.- Returns:
errorHandler()that will incrementerrorCounter()by default.
-
threadingMode
Get the archive threading mode.- Returns:
- the archive threading mode.
- See Also:
-
threadingMode
Set the archive threading mode.- Parameters:
threadingMode- archive threading mode.- Returns:
- this for a fluent API.
- See Also:
-
threadFactory
Get the thread factory used for creating threads inArchiveThreadingMode.SHAREDandArchiveThreadingMode.DEDICATEDthreading modes.- Returns:
- thread factory used for creating threads in SHARED and DEDICATED threading modes.
-
threadFactory
Set the thread factory used for creating threads inArchiveThreadingMode.SHAREDandArchiveThreadingMode.DEDICATEDthreading modes. The thread factories can be overridden for the recorder and replayer by usingrecorderThreadFactory(ThreadFactory)andreplayerThreadFactory(ThreadFactory)respectively.- Parameters:
threadFactory- used for creating threads in SHARED and DEDICATED threading modes.- Returns:
- this for a fluent API.
-
recorderThreadFactory
Get the thread factory used for creating the recorder thread when running in DEDICATED threading mode.- Returns:
- the thread factory used for creating the recorder thread when running in DEDICATED threading mode.
-
recorderThreadFactory
Set the thread factory used for creating the recorder thread when running in DEDICATED threading mode. This will be used to overridethreadFactory.- Parameters:
threadFactory- used for creating the recorder thread when running in DEDICATED threading mode.- Returns:
- this for a fluent API.
-
replayerThreadFactory
Get the thread factory used for creating the replayer thread when running in DEDICATED threading mode.- Returns:
- the thread factory used for creating the replayer thread when running in DEDICATED threading mode.
-
replayerThreadFactory
Set the thread factory used for creating the replayer thread when running in DEDICATED threading mode. This will be used to overridethreadFactory.- Parameters:
threadFactory- used for creating the replayer thread when running in DEDICATED threading mode.- Returns:
- this for a fluent API.
-
errorBufferLength
Set the error buffer length in bytes to use.- Parameters:
errorBufferLength- in bytes to use.- Returns:
- this for a fluent API.
- See Also:
-
errorBufferLength
public int errorBufferLength()The error buffer length in bytes.- Returns:
- error buffer length in bytes.
- See Also:
-
archiveId
Set the id for this Archive instance.- Parameters:
archiveId- for this Archive instance.- Returns:
- this for a fluent API
- See Also:
-
archiveId
public long archiveId()Get the id of this Archive instance.- Returns:
- the id of this Archive instance.
- See Also:
-
errorCounter
Get the error counter that will record the number of errors observed.- Returns:
- the error counter that will record the number of errors observed.
-
errorCounter
Set the error counter that will record the number of errors observed.- Parameters:
errorCounter- the error counter that will record the number of errors observed.- Returns:
- this for a fluent API.
-
controlSessionsCounter
Get the counter used to track the number of active control sessions.- Returns:
- the counter used to track the number of active control sessions.
-
controlSessionsCounter
Set the counter used to track the number of active control sessions.- Parameters:
controlSessionsCounter- the counter used to track the number of active control sessions.- Returns:
- this for a fluent API.
-
recordingSessionCounter
Get the counter used to track the count of concurrent recording sessions.- Returns:
- the counter used to track the count of concurrent recording sessions.
-
recordingSessionCounter
Set the counter used to track the count of concurrent recording sessions.- Parameters:
counter- used to track the count of concurrent recording sessions.- Returns:
- this for a fluent API.
-
replaySessionCounter
Get the counter used to track the count of concurrent replay sessions.- Returns:
- the counter used to track the count of concurrent replay sessions.
-
replaySessionCounter
Set the counter used to track the count of concurrent replay sessions.- Parameters:
counter- used to track the count of concurrent replay sessions.- Returns:
- this for a fluent API.
-
totalWriteBytesCounter
Get the counter used to track the total number of bytes written by the recorder.- Returns:
- the counter used to track the total number of bytes written by the recorder.
-
totalWriteBytesCounter
Set the counter used to track the total number of bytes written by the recorder.- Parameters:
counter- used to track the total number of bytes written by the recorder.- Returns:
- this for a fluent API.
-
totalWriteTimeCounter
Get the counter used to track the total time used by the recorder to write data.- Returns:
- the counter used to track the total time used by the recorder to write data.
-
totalWriteTimeCounter
Set the counter used to track the total time used by the recorder to write data.- Parameters:
counter- used to track the total time used by the recorder to write data.- Returns:
- this for a fluent API.
-
maxWriteTimeCounter
Get the counter used to track the max time used by the recorder to write a block of data.- Returns:
- the counter used to track the max time used by the recorder to write a block of data.
-
maxWriteTimeCounter
Set the counter used to track the max time used by the recorder to write a block of data.- Parameters:
counter- used to track the max time used by the recorder to write a block of data.- Returns:
- this for a fluent API.
-
totalReadBytesCounter
Get the counter used to track the total number of bytes read by the replayer.- Returns:
- the counter used to track the total number of bytes read by the replayer.
-
totalReadBytesCounter
Set the counter used to track the total number of bytes read by the replayer.- Parameters:
counter- used to track the total number of bytes read by the replayer.- Returns:
- this for a fluent API.
-
totalReadTimeCounter
Get the counter used to track the total time used by the replayer to read data.- Returns:
- the counter used to track the total time used by the replayer to read data.
-
totalReadTimeCounter
Set the counter used to track the total time used by the replayer to read data.- Parameters:
counter- used to track the total time used by the replayer to read data.- Returns:
- this for a fluent API.
-
maxReadTimeCounter
Get the counter used to track the max time used by the replayer to read a block of data.- Returns:
- the counter used to track the max time used by the replayer to read a block of data.
-
maxReadTimeCounter
Set the counter used to track the max time used by the replayer to read a block of data.- Parameters:
counter- used to track the max time used by the replayer to read a block of data.- Returns:
- this for a fluent API.
-
maxConcurrentRecordings
public int maxConcurrentRecordings()Get the max number of concurrent recordings.- Returns:
- the max number of concurrent recordings.
- See Also:
-
maxConcurrentRecordings
Set the max number of concurrent recordings.- Parameters:
maxConcurrentRecordings- the max number of concurrent recordings.- Returns:
- this for a fluent API.
- See Also:
-
maxConcurrentReplays
public int maxConcurrentReplays()Get the max number of concurrent replays.- Returns:
- the max number of concurrent replays.
- See Also:
-
maxConcurrentReplays
Set the max number of concurrent replays.- Parameters:
maxConcurrentReplays- the max number of concurrent replays.- Returns:
- this for a fluent API.
- See Also:
-
fileIoMaxLength
public int fileIoMaxLength()Get the max length of a file IO operation.- Returns:
- the max length of a file IO operation.
- See Also:
-
fileIoMaxLength
Set the max length of a file IO operation.- Parameters:
fileIoMaxLength- the max length of a file IO operation.- Returns:
- this for a fluent API.
- See Also:
-
lowStorageSpaceThreshold
Threshold below which the archive will reject new recording requests.- Parameters:
lowStorageSpaceThreshold- in bytes.- Returns:
- this for a fluent API.
- See Also:
-
lowStorageSpaceThreshold
public long lowStorageSpaceThreshold()Threshold below which the archive will reject new recording requests.- Returns:
- threshold below which the archive will reject new recording requests in bytes.
- See Also:
-
deleteArchiveDirectory
Deprecated.Delete the archive directory if thearchiveDir()value is not null.Use
deleteDirectory()instead. -
deleteDirectory
public void deleteDirectory()Delete the archive directory if thearchiveDir()value is not null. -
aeronDirectoryName
Set the top level Aeron directory used for communication between the Aeron client and Media Driver.- Parameters:
aeronDirectoryName- the top level Aeron directory.- Returns:
- this for a fluent API.
-
aeronDirectoryName
Get the top level Aeron directory used for communication between the Aeron client and Media Driver.- Returns:
- The top level Aeron directory.
-
aeron
Aeronclient for communicating with the local Media Driver.This client will be closed when the
Archive.close()orclose()methods are called ifownsAeronClient()is true.- Parameters:
aeron- client for communicating with the local Media Driver.- Returns:
- this for a fluent API.
- See Also:
-
aeron
Aeronclient for communicating with the local Media Driver.If not provided then a default will be established during
conclude()by callingAeron.connect().- Returns:
- client for communicating with the local Media Driver.
-
ownsAeronClient
Does this context own theaeron()client and this takes responsibility for closing it?- Parameters:
ownsAeronClient- does this context own theaeron()client.- Returns:
- this for a fluent API.
-
ownsAeronClient
public boolean ownsAeronClient()Does this context own theaeron()client and this takes responsibility for closing it?- Returns:
- does this context own the
aeron()client and this takes responsibility for closing it?
-
archiveMarkFile
TheArchiveMarkFilefor the Archive.- Parameters:
archiveMarkFile-ArchiveMarkFilefor the Archive.- Returns:
- this for a fluent API.
-
archiveMarkFile
TheArchiveMarkFilefor the Archive.- Returns:
ArchiveMarkFilefor the Archive.
-
maxCatalogEntries
Deprecated.This method was deprecated in favor ofcatalogCapacity(long)which works with bytes rather than number of entries.Maximum number of catalog entries for the Archive.Note: This method has no effect.
- Parameters:
maxCatalogEntries- for the archive.- Returns:
- this for a fluent API.
- See Also:
-
maxCatalogEntries
Deprecated.This method was deprecated in favor ofcatalogCapacity()which returns capacity of theCatalogin bytes rather than in number of entries.Maximum number of catalog entries for the Archive.Note: This method is not used.
- Returns:
- maximum number of catalog entries for the Archive.
- See Also:
-
catalogCapacity
Capacity in bytes of theCatalog.- Parameters:
catalogCapacity- in bytes.- Returns:
- this for a fluent API.
- See Also:
-
catalogCapacity
public long catalogCapacity()Capacity in bytes of theCatalog.- Returns:
- capacity in bytes of the
Catalog. - See Also:
-
authenticatorSupplier
Get theAuthenticatorSupplierthat should be used for the Archive.- Returns:
- the
AuthenticatorSupplierto be used for the Archive.
-
authenticatorSupplier
Set theAuthenticatorSupplierthat will be used for the Archive.- Parameters:
authenticatorSupplier-AuthenticatorSupplierto use for the Archive.- Returns:
- this for a fluent API.
-
authorisationServiceSupplier
Get theAuthorisationServiceSupplierthat should be used for the Archive.- Returns:
- the
AuthorisationServiceSupplierto be used for the Archive.
-
authorisationServiceSupplier
public Archive.Context authorisationServiceSupplier(AuthorisationServiceSupplier authorisationServiceSupplier) Set the
AuthorisationServiceSupplierthat will be used for the Archive.When using an authorisation service for the ConsensusModule, then the following values for protocolId, actionId, and type should be considered.
Parameters for authorisation service queries from the Archive Description protocolId actionId type(s) Start the recording of a stream MessageHeaderDecoder.SCHEMA_IDStartRecordingRequestDecoder.TEMPLATE_ID(null)Start the recording of a stream (version 2) StartRecordingRequest2Decoder.TEMPLATE_ID(null)Stop the recording of a stream StopRecordingRequestDecoder.TEMPLATE_ID(null)Replay a stream from the archive ReplayRequestDecoder.TEMPLATE_ID(null)Stop a replay from the archive StopReplayRequestDecoder.TEMPLATE_ID(null)List the recordings from the archive ListRecordingsRequestDecoder.TEMPLATE_ID(null)List the recordings from the archive for a specific URI ListRecordingsForUriRequestDecoder.TEMPLATE_ID(null)List a specific recording from the archive ListRecordingRequestDecoder.TEMPLATE_ID(null)Extend a recording ExtendRecordingRequestDecoder.TEMPLATE_ID(null)Extend a recording (version 2) ExtendRecordingRequest2Decoder.TEMPLATE_ID(null)Gets the position of a recording RecordingPositionRequestDecoder.TEMPLATE_ID(null)Truncate a recording TruncateRecordingRequestDecoder.TEMPLATE_ID(null)Stop a recording by subscription StopRecordingSubscriptionRequestDecoder.TEMPLATE_ID(null)Extend a recording ExtendRecordingRequestDecoder.TEMPLATE_ID(null)Get the stop position for a recording StopPositionRequestDecoder.TEMPLATE_ID(null)Find the last recording for a given stream, session and channel fragment FindLastMatchingRecordingRequestDecoder.TEMPLATE_ID(null)List subscriptions being used for recordings ListRecordingSubscriptionsRequestDecoder.TEMPLATE_ID(null)Stop all replays StopAllReplaysRequestDecoder.TEMPLATE_ID(null)Start replicating a recording ReplicateRequestDecoder.TEMPLATE_ID(null)Start replicating a recording (version 2) ReplicateRequest2Decoder.TEMPLATE_ID(null)Stop replication a recording StopReplicationRequestDecoder.TEMPLATE_ID(null)Get the start position of a recording StartRecordingRequestDecoder.TEMPLATE_ID(null)Detach segment files from a recording DetachSegmentsRequestDecoder.TEMPLATE_ID(null)Delete detached segments DeleteDetachedSegmentsRequestDecoder.TEMPLATE_ID(null)Attach new segments for a recording AttachSegmentsRequestDecoder.TEMPLATE_ID(null)Migrate segments from one recording to another MigrateSegmentsRequestDecoder.TEMPLATE_ID(null)Keep alive the archive connection KeepAliveRequestDecoder.TEMPLATE_ID(null)Replicate a recording with a tag TaggedReplicateRequestDecoder.TEMPLATE_ID(null)Stop recording by recording id StopRecordingByIdentityRequestDecoder.TEMPLATE_ID(null)Purge a recording by recording id PurgeRecordingRequestDecoder.TEMPLATE_ID(null)- Parameters:
authorisationServiceSupplier-AuthorisationServiceSupplierto use for the Archive.- Returns:
- this for a fluent API.
-
secureRandomAlgorithm
Get the secure random algorithm should be used by various Aeron components.- Returns:
- the secure random algorithm to be used.
- See Also:
-
secureRandomAlgorithm
Define which secure random algorithm should be used by various Aeron components. This string will be passed toSecureRandom.getInstance(String), with one exception. The special case ofstrong(case-insensitive) will useSecureRandom.getInstanceStrong()- Parameters:
algorithm- the algorithm to be used orstrong- Returns:
- this for the fluent API.
- See Also:
-
secureRandom
Get the configured instance of SecureRandom usingSecureRandom.getInstanceStrong()ifstrongis specified.- Returns:
- instance of SecureRandom
- Throws:
AeronException- if there is a problem resolving the algorithm
-
close
public void close()Close the context and free applicable resources.If
ownsAeronClient()is true then theaeron()client will be closed. -
toString
-
catalogCapacity()which returns capacity of theCatalogin bytes rather than in number of entries.