Package io.aeron.archive
Class Archive.Configuration
java.lang.Object
io.aeron.archive.Archive.Configuration
- Enclosing class:
- Archive
Configuration for system properties and defaults.
Details for the individual parameters can be found in the Javadoc for the Archive.Context setters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe type id of theCounterused for keeping track of the count of concurrent control sessions.static final StringDefault directory for the archive files.static final StringShould the archive delete existing files on start.static final StringDirectory in which the archive stores it files such as the catalog and recordings.static final intThe type id of theCounterused for keeping track of the number of errors that have occurred.static final StringProperty name for the identity of the Archive instance.static final StringDefaultIdleStrategyto be used for the archiveAgents when not busy.static final StringTheIdleStrategyto be used for the archive recorderAgentwhen not busy.static final StringTheIdleStrategyto be used for the archive replayerAgentwhen not busy.static final StringName of the class to use as a supplier ofAuthenticatorfor the archive.static final StringName of the system property for specifying a supplier ofAuthenticatorfor the archive.static final StringName of the system property for specifying a supplier ofAuthorisationServicefor the archive.static final longDefault capacity in bytes for theCatalog.static final StringDefault capacity in bytes of the archiveCatalog.static final intDefault is to use normal file writes which may mean some data loss in the event of a power failure.static final StringThe level at which catalog updates and directory should be sync'ed to disk.static final longDefault threshold value for the conductor work cycle threshold to track for being exceeded.static final StringProperty name for threshold value for the conductor work cycle threshold to track for being exceeded.static final longDefault timeout for connecting back to a client for a control session or replay.static final StringTimeout for making a connection back to a client for a control session or replay.static final StringIs network (UDP) control channel enabled.static final AuthorisationServiceSupplierDefaultAuthorisationServiceSupplierthat returnsAuthorisationServicethat allows any command to be executed (i.e.static final StringDefaultIdleStrategyto be used for the archiveAgents when not busy.static final intSize in bytes of the error buffer for the archive when not eternally provided.static final StringSize in bytes of the error buffer for the archive when not externally provided.static final intDefault block length of data in a single IO operation during a recording or replay.static final StringMaximum length of a file IO operation for recording or replay.static final intDefault is to use normal file writes which may mean some data loss in the event of a power failure.static final StringThe level at which recording files should be sync'ed to disk.static final intDefault threshold below which the archive will reject new recording requests.static final StringThreshold below which the archive will reject new recording requests.static final StringAlternative directory to store mark file (i.e.static final longDeprecated.static final StringDeprecated.static final intDefault maximum number of concurrent recordings.static final StringMaximum number of concurrent recordings which can be active at a time.static final intDefault maximum number of concurrent replays.static final StringMaximum number of concurrent replays.static final StringProperty that specifies fully qualified class name of theChecksumto be used for checksum computation during recording.static final longDefault threshold value for the recorder work cycle threshold to track for being exceeded.static final StringProperty name for threshold value for the recorder work cycle threshold to track for being exceeded.static final StringProperty that specifies fully qualified class name of theChecksumto be used for checksum validation during replay.static final longDefault for long to linger a replay connection which defaults toConfiguration.publicationLingerTimeoutNs().static final StringHow long a replay publication should linger after all data is sent.static final longDefault threshold value for the replayer work cycle threshold to track for being exceeded.static final StringProperty name for threshold value for the replayer work cycle threshold to track for being exceeded.static final StringChannel for receiving replication streams replayed from another archive.static final intDefault segment file length which is multiple of terms.static final StringRecordings will be segmented on disk in files limited to the segment length which must be a multiple of the term length for each stream.static final longDefault time interval in nanoseconds for checking session liveness.static final StringTime interval in nanoseconds for checking session liveness checks.static final StringWhatArchiveThreadingModeshould be used. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringGet the directory name to be used for storing the archive.static longReturn configured id for the Archive.static AuthenticatorSupplierThe valueAUTHENTICATOR_SUPPLIER_DEFAULTor system propertyAUTHENTICATOR_SUPPLIER_PROP_NAMEif set.static AuthorisationServiceSupplierTheAuthorisationServiceSupplierspecified in theAUTHORISATION_SERVICE_SUPPLIER_PROP_NAMEsystem property or theDEFAULT_AUTHORISATION_SERVICE_SUPPLIER.static longDefault capacity (size) in bytes for the catalog file.static intThe level at which the catalog file and directory should be sync'ed to disk.static longGet threshold value for the conductor work cycle threshold to track for being exceeded.static longThe timeout in nanoseconds to wait for a connection.static booleanShould the network (UDP) control channel be enabled.static booleanWhether to delete directory on start or not.static intSize in bytes of the error buffer in the mark file.static intThe maximum length of a file IO operation.static intThe level at which files should be sync'ed to disk.static Supplier<IdleStrategy>idleStrategySupplier(StatusIndicator controllableStatus) Create a supplier ofIdleStrategys for theARCHIVE_IDLE_STRATEGY_PROP_NAMEsystem property.static longThe low storage space threshold beyond which the archive will reject new requests to record streams.static StringGet the alternative directory to be used for storing the archive mark file.static longDeprecated.UsecatalogCapacity()instead.static intThe maximum number of recordings that can operate concurrently after which new requests will be rejected.static intThe maximum number of replays that can operate concurrently after which new requests will be rejected.static StringFully qualified class name of theChecksumimplementation to use during recording to compute checksums.static longGet threshold value for the recorder work cycle threshold to track for being exceeded.static Supplier<IdleStrategy>recorderIdleStrategySupplier(StatusIndicator controllableStatus) Create a supplier ofIdleStrategys for theARCHIVE_RECORDER_IDLE_STRATEGY_PROP_NAMEsystem property.static StringFully qualified class name of theChecksumimplementation to use during replay for the checksum.static longGet threshold value for the replayer work cycle threshold to track for being exceeded.static Supplier<IdleStrategy>replayerIdleStrategySupplier(StatusIndicator controllableStatus) Create a supplier ofIdleStrategys for theARCHIVE_REPLAYER_IDLE_STRATEGY_PROP_NAMEsystem property.static longThe timeout in nanoseconds to for a replay network publication to linger after draining.static StringThe system propertyREPLICATION_CHANNEL_PROP_NAMEif set, null otherwise.static intThe length of file to be used for storing recording segments that must be a power of 2.static ArchiveThreadingModeThe threading mode to be employed by the archive.
-
Field Details
-
FILE_IO_MAX_LENGTH_DEFAULT
public static final int FILE_IO_MAX_LENGTH_DEFAULTDefault block length of data in a single IO operation during a recording or replay.- See Also:
-
FILE_IO_MAX_LENGTH_PROP_NAME
Maximum length of a file IO operation for recording or replay. Must be a power of 2.- See Also:
-
ARCHIVE_DIR_PROP_NAME
Directory in which the archive stores it files such as the catalog and recordings.- See Also:
-
ARCHIVE_DIR_DEFAULT
Default directory for the archive files.- See Also:
-
MARK_FILE_DIR_PROP_NAME
Alternative directory to store mark file (i.e.archive-mark.dat).- See Also:
-
SEGMENT_FILE_LENGTH_PROP_NAME
Recordings will be segmented on disk in files limited to the segment length which must be a multiple of the term length for each stream. For lots of small recording this value may be reduced.- See Also:
-
SEGMENT_FILE_LENGTH_DEFAULT
public static final int SEGMENT_FILE_LENGTH_DEFAULTDefault segment file length which is multiple of terms. -
LOW_STORAGE_SPACE_THRESHOLD_PROP_NAME
Threshold below which the archive will reject new recording requests.- See Also:
-
LOW_STORAGE_SPACE_THRESHOLD_DEFAULT
public static final int LOW_STORAGE_SPACE_THRESHOLD_DEFAULTDefault threshold below which the archive will reject new recording requests. -
FILE_SYNC_LEVEL_PROP_NAME
The level at which recording files should be sync'ed to disk.- 0 - normal writes.
- 1 - sync file data.
- 2 - sync file data + metadata.
- See Also:
-
FILE_SYNC_LEVEL_DEFAULT
public static final int FILE_SYNC_LEVEL_DEFAULTDefault is to use normal file writes which may mean some data loss in the event of a power failure. -
CATALOG_FILE_SYNC_LEVEL_PROP_NAME
The level at which catalog updates and directory should be sync'ed to disk.- 0 - normal writes.
- 1 - sync file data.
- 2 - sync file data + metadata.
- See Also:
-
CATALOG_FILE_SYNC_LEVEL_DEFAULT
public static final int CATALOG_FILE_SYNC_LEVEL_DEFAULTDefault is to use normal file writes which may mean some data loss in the event of a power failure. -
THREADING_MODE_PROP_NAME
WhatArchiveThreadingModeshould be used.- See Also:
-
ARCHIVE_IDLE_STRATEGY_PROP_NAME
DefaultIdleStrategyto be used for the archiveAgents when not busy.- See Also:
-
ARCHIVE_RECORDER_IDLE_STRATEGY_PROP_NAME
TheIdleStrategyto be used for the archive recorderAgentwhen not busy.- See Also:
-
ARCHIVE_REPLAYER_IDLE_STRATEGY_PROP_NAME
TheIdleStrategyto be used for the archive replayerAgentwhen not busy.- See Also:
-
DEFAULT_IDLE_STRATEGY
DefaultIdleStrategyto be used for the archiveAgents when not busy. -
MAX_CONCURRENT_RECORDINGS_PROP_NAME
Maximum number of concurrent recordings which can be active at a time. Going beyond this number will result in an exception and further recordings will be rejected. Since wildcard subscriptions can have multiple images, and thus multiple recordings, then the limit may come later. It is best to use session based subscriptions.- See Also:
-
MAX_CONCURRENT_RECORDINGS_DEFAULT
public static final int MAX_CONCURRENT_RECORDINGS_DEFAULTDefault maximum number of concurrent recordings. Unless on a very fast SSD and having sufficient memory for the page cache then this number should be kept low, especially when sync'ing writes. -
MAX_CONCURRENT_REPLAYS_PROP_NAME
Maximum number of concurrent replays. Beyond this maximum an exception will be raised and further replays will be rejected.- See Also:
-
MAX_CONCURRENT_REPLAYS_DEFAULT
public static final int MAX_CONCURRENT_REPLAYS_DEFAULTDefault maximum number of concurrent replays. Unless on a fast SSD and having sufficient memory for the page cache then this number should be kept low.- See Also:
-
MAX_CATALOG_ENTRIES_PROP_NAME
Deprecated.UseCATALOG_CAPACITY_PROP_NAMEinstead.Maximum number of entries for the archiveCatalog. Increasing this limit will require use of theCatalogTool. The number of entries can be reduced by extending existing recordings rather than creating new ones.- See Also:
-
MAX_CATALOG_ENTRIES_DEFAULT
Deprecated.Default limit for the entries in theCatalog. -
CATALOG_CAPACITY_PROP_NAME
Default capacity in bytes of the archiveCatalog.Catalogwill resize itself when this limit is reached.- See Also:
-
CATALOG_CAPACITY_DEFAULT
public static final long CATALOG_CAPACITY_DEFAULTDefault capacity in bytes for theCatalog. -
CONNECT_TIMEOUT_PROP_NAME
Timeout for making a connection back to a client for a control session or replay.- See Also:
-
CONNECT_TIMEOUT_DEFAULT_NS
public static final long CONNECT_TIMEOUT_DEFAULT_NSDefault timeout for connecting back to a client for a control session or replay. You may want to increase this on higher latency networks.- See Also:
-
SESSION_LIVENESS_CHECK_INTERVAL_PROP_NAME
Time interval in nanoseconds for checking session liveness checks.- Since:
- 1.47.0
- See Also:
-
SESSION_LIVENESS_CHECK_INTERVAL_DEFAULT_NS
public static final long SESSION_LIVENESS_CHECK_INTERVAL_DEFAULT_NSDefault time interval in nanoseconds for checking session liveness.- Since:
- 1.47.0
- See Also:
-
REPLAY_LINGER_TIMEOUT_PROP_NAME
How long a replay publication should linger after all data is sent. Longer linger can help avoid tail loss.- See Also:
-
REPLAY_LINGER_TIMEOUT_DEFAULT_NS
public static final long REPLAY_LINGER_TIMEOUT_DEFAULT_NSDefault for long to linger a replay connection which defaults toConfiguration.publicationLingerTimeoutNs().- See Also:
-
CONDUCTOR_CYCLE_THRESHOLD_PROP_NAME
Property name for threshold value for the conductor work cycle threshold to track for being exceeded.- See Also:
-
CONDUCTOR_CYCLE_THRESHOLD_DEFAULT_NS
public static final long CONDUCTOR_CYCLE_THRESHOLD_DEFAULT_NSDefault threshold value for the conductor work cycle threshold to track for being exceeded. -
RECORDER_CYCLE_THRESHOLD_PROP_NAME
Property name for threshold value for the recorder work cycle threshold to track for being exceeded.- See Also:
-
RECORDER_CYCLE_THRESHOLD_DEFAULT_NS
public static final long RECORDER_CYCLE_THRESHOLD_DEFAULT_NSDefault threshold value for the recorder work cycle threshold to track for being exceeded. -
REPLAYER_CYCLE_THRESHOLD_PROP_NAME
Property name for threshold value for the replayer work cycle threshold to track for being exceeded.- See Also:
-
REPLAYER_CYCLE_THRESHOLD_DEFAULT_NS
public static final long REPLAYER_CYCLE_THRESHOLD_DEFAULT_NSDefault threshold value for the replayer work cycle threshold to track for being exceeded. -
ARCHIVE_DIR_DELETE_ON_START_PROP_NAME
Should the archive delete existing files on start. Default is false and should only be true for testing.- See Also:
-
REPLICATION_CHANNEL_PROP_NAME
Channel for receiving replication streams replayed from another archive.- See Also:
-
AUTHENTICATOR_SUPPLIER_PROP_NAME
Name of the system property for specifying a supplier ofAuthenticatorfor the archive.- See Also:
-
AUTHENTICATOR_SUPPLIER_DEFAULT
Name of the class to use as a supplier ofAuthenticatorfor the archive. Default is a non-authenticating option.- See Also:
-
AUTHORISATION_SERVICE_SUPPLIER_PROP_NAME
Name of the system property for specifying a supplier ofAuthorisationServicefor the archive.- See Also:
-
DEFAULT_AUTHORISATION_SERVICE_SUPPLIER
DefaultAuthorisationServiceSupplierthat returnsAuthorisationServicethat allows any command to be executed (i.e.AuthorisationService.ALLOW_ALL). -
ARCHIVE_ERROR_COUNT_TYPE_ID
public static final int ARCHIVE_ERROR_COUNT_TYPE_IDThe type id of theCounterused for keeping track of the number of errors that have occurred.- See Also:
-
ARCHIVE_CONTROL_SESSIONS_TYPE_ID
public static final int ARCHIVE_CONTROL_SESSIONS_TYPE_IDThe type id of theCounterused for keeping track of the count of concurrent control sessions.- See Also:
-
ERROR_BUFFER_LENGTH_PROP_NAME
Size in bytes of the error buffer for the archive when not externally provided.- See Also:
-
ERROR_BUFFER_LENGTH_DEFAULT
public static final int ERROR_BUFFER_LENGTH_DEFAULTSize in bytes of the error buffer for the archive when not eternally provided.- See Also:
-
RECORD_CHECKSUM_PROP_NAME
Property that specifies fully qualified class name of theChecksumto be used for checksum computation during recording.- See Also:
-
REPLAY_CHECKSUM_PROP_NAME
Property that specifies fully qualified class name of theChecksumto be used for checksum validation during replay.- See Also:
-
ARCHIVE_ID_PROP_NAME
Property name for the identity of the Archive instance. If not specified defaults to theAeron.clientId()of the assignedAeroninstance.- See Also:
-
CONTROL_CHANNEL_ENABLED_PROP_NAME
Is network (UDP) control channel enabled. Defaults totrue.If set to anything other than
truethen control channel is disabled, i.e. the Archive will run in IPC-only mode.- See Also:
-
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
archiveDirName
Get the directory name to be used for storing the archive.- Returns:
- the directory name to be used for storing the archive.
-
markFileDir
Get the alternative directory to be used for storing the archive mark file.- Returns:
- the directory to be used for storing the archive mark file.
-
fileIoMaxLength
public static int fileIoMaxLength()The maximum length of a file IO operation.- Returns:
- the maximum length of a file IO operation.
-
segmentFileLength
public static int segmentFileLength()The length of file to be used for storing recording segments that must be a power of 2.If the
Image.termBufferLength()is greater than this will take priority.- Returns:
- length of file to be used for storing recording segments.
-
lowStorageSpaceThreshold
public static long lowStorageSpaceThreshold()The low storage space threshold beyond which the archive will reject new requests to record streams.- Returns:
- threshold beyond which the archive will reject new requests to record streams.
-
fileSyncLevel
public static int fileSyncLevel()The level at which files should be sync'ed to disk.- 0 - normal writes.
- 1 - sync file data.
- 2 - sync file data + metadata.
- Returns:
- level at which files should be sync'ed to disk.
- See Also:
-
catalogFileSyncLevel
public static int catalogFileSyncLevel()The level at which the catalog file and directory should be sync'ed to disk.- 0 - normal writes.
- 1 - sync file data.
- 2 - sync file data + metadata.
- Returns:
- level at which files should be sync'ed to disk.
- See Also:
-
threadingMode
The threading mode to be employed by the archive.- Returns:
- the threading mode to be employed by the archive.
-
idleStrategySupplier
Create a supplier ofIdleStrategys for theARCHIVE_IDLE_STRATEGY_PROP_NAMEsystem property.- Parameters:
controllableStatus- if aControllableIdleStrategyis required.- Returns:
- the new idle strategy
Supplier.
-
recorderIdleStrategySupplier
public static Supplier<IdleStrategy> recorderIdleStrategySupplier(StatusIndicator controllableStatus) Create a supplier ofIdleStrategys for theARCHIVE_RECORDER_IDLE_STRATEGY_PROP_NAMEsystem property.- Parameters:
controllableStatus- if aControllableIdleStrategyis required.- Returns:
- the new idle strategy
Supplier.
-
replayerIdleStrategySupplier
public static Supplier<IdleStrategy> replayerIdleStrategySupplier(StatusIndicator controllableStatus) Create a supplier ofIdleStrategys for theARCHIVE_REPLAYER_IDLE_STRATEGY_PROP_NAMEsystem property.- Parameters:
controllableStatus- if aControllableIdleStrategyis required.- Returns:
- the new idle strategy
Supplier.
-
maxConcurrentRecordings
public static int maxConcurrentRecordings()The maximum number of recordings that can operate concurrently after which new requests will be rejected.- Returns:
- the maximum number of recordings that can operate concurrently.
-
maxConcurrentReplays
public static int maxConcurrentReplays()The maximum number of replays that can operate concurrently after which new requests will be rejected.- Returns:
- the maximum number of replays that can operate concurrently.
-
maxCatalogEntries
Deprecated.UsecatalogCapacity()instead.Maximum number of catalog entries to allocate for the catalog file.- Returns:
- the maximum number of catalog entries to support for the catalog file.
- See Also:
-
catalogCapacity
public static long catalogCapacity()Default capacity (size) in bytes for the catalog file.- Returns:
- default size of the catalog file in bytes.
-
connectTimeoutNs
public static long connectTimeoutNs()The timeout in nanoseconds to wait for a connection.- Returns:
- timeout in nanoseconds to wait for a connection.
- See Also:
-
replayLingerTimeoutNs
public static long replayLingerTimeoutNs()The timeout in nanoseconds to for a replay network publication to linger after draining.- Returns:
- timeout in nanoseconds for a replay network publication to wait in linger.
- See Also:
-
conductorCycleThresholdNs
public static long conductorCycleThresholdNs()Get threshold value for the conductor work cycle threshold to track for being exceeded.- Returns:
- threshold value in nanoseconds.
-
recorderCycleThresholdNs
public static long recorderCycleThresholdNs()Get threshold value for the recorder work cycle threshold to track for being exceeded.- Returns:
- threshold value in nanoseconds.
-
replayerCycleThresholdNs
public static long replayerCycleThresholdNs()Get threshold value for the replayer work cycle threshold to track for being exceeded.- Returns:
- threshold value in nanoseconds.
-
deleteArchiveOnStart
public static boolean deleteArchiveOnStart()Whether to delete directory on start or not.- Returns:
- whether to delete directory on start or not.
- See Also:
-
replicationChannel
The system propertyREPLICATION_CHANNEL_PROP_NAMEif set, null otherwise.- Returns:
- system property
REPLICATION_CHANNEL_PROP_NAMEif set.
-
errorBufferLength
public static int errorBufferLength()Size in bytes of the error buffer in the mark file.- Returns:
- length of error buffer in bytes.
- See Also:
-
authenticatorSupplier
The valueAUTHENTICATOR_SUPPLIER_DEFAULTor system propertyAUTHENTICATOR_SUPPLIER_PROP_NAMEif set.- Returns:
AUTHENTICATOR_SUPPLIER_DEFAULTor system propertyAUTHENTICATOR_SUPPLIER_PROP_NAMEif set.
-
authorisationServiceSupplier
TheAuthorisationServiceSupplierspecified in theAUTHORISATION_SERVICE_SUPPLIER_PROP_NAMEsystem property or theDEFAULT_AUTHORISATION_SERVICE_SUPPLIER.- Returns:
- system property
AUTHORISATION_SERVICE_SUPPLIER_PROP_NAMEif set orDEFAULT_AUTHORISATION_SERVICE_SUPPLIERotherwise.
-
recordChecksum
Fully qualified class name of theChecksumimplementation to use during recording to compute checksums. Non-empty value means that checksum is enabled for recording.- Returns:
- class that implements
Checksuminterface - See Also:
-
replayChecksum
Fully qualified class name of theChecksumimplementation to use during replay for the checksum. Non-empty value means that checksum is enabled for replay.- Returns:
- class that implements
Checksuminterface - See Also:
-
controlChannelEnabled
public static boolean controlChannelEnabled()Should the network (UDP) control channel be enabled.- Returns:
trueif the network control channel to be enabled.- See Also:
-
archiveId
public static long archiveId()Return configured id for the Archive.- Returns:
- id for the Archive or
Aeron.NULL_VALUE. - See Also:
-
CATALOG_CAPACITY_PROP_NAMEinstead.