Class Archive.Configuration

java.lang.Object
io.aeron.archive.Archive.Configuration
Enclosing class:
Archive

public static final class Archive.Configuration extends Object
Configuration for system properties and defaults.

Details for the individual parameters can be found in the Javadoc for the Archive.Context setters.

  • Field Details

    • FILE_IO_MAX_LENGTH_DEFAULT

      public static final int FILE_IO_MAX_LENGTH_DEFAULT
      Default block length of data in a single IO operation during a recording or replay.
      See Also:
    • FILE_IO_MAX_LENGTH_PROP_NAME

      public static final String 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

      public static final String ARCHIVE_DIR_PROP_NAME
      Directory in which the archive stores it files such as the catalog and recordings.
      See Also:
    • ARCHIVE_DIR_DEFAULT

      public static final String ARCHIVE_DIR_DEFAULT
      Default directory for the archive files.
      See Also:
    • MARK_FILE_DIR_PROP_NAME

      public static final String MARK_FILE_DIR_PROP_NAME
      Alternative directory to store mark file (i.e. archive-mark.dat).
      See Also:
    • SEGMENT_FILE_LENGTH_PROP_NAME

      public static final String 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_DEFAULT
      Default segment file length which is multiple of terms.
      See Also:
    • LOW_STORAGE_SPACE_THRESHOLD_PROP_NAME

      public static final String 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_DEFAULT
      Default threshold below which the archive will reject new recording requests.
      See Also:
    • FILE_SYNC_LEVEL_PROP_NAME

      public static final String 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_DEFAULT
      Default is to use normal file writes which may mean some data loss in the event of a power failure.
      See Also:
    • CATALOG_FILE_SYNC_LEVEL_PROP_NAME

      public static final String 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_DEFAULT
      Default is to use normal file writes which may mean some data loss in the event of a power failure.
      See Also:
    • THREADING_MODE_PROP_NAME

      public static final String THREADING_MODE_PROP_NAME
      What ArchiveThreadingMode should be used.
      See Also:
    • ARCHIVE_IDLE_STRATEGY_PROP_NAME

      public static final String ARCHIVE_IDLE_STRATEGY_PROP_NAME
      Default IdleStrategy to be used for the archive Agents when not busy.
      See Also:
    • ARCHIVE_RECORDER_IDLE_STRATEGY_PROP_NAME

      public static final String ARCHIVE_RECORDER_IDLE_STRATEGY_PROP_NAME
      The IdleStrategy to be used for the archive recorder Agent when not busy.
      See Also:
    • ARCHIVE_REPLAYER_IDLE_STRATEGY_PROP_NAME

      public static final String ARCHIVE_REPLAYER_IDLE_STRATEGY_PROP_NAME
      The IdleStrategy to be used for the archive replayer Agent when not busy.
      See Also:
    • DEFAULT_IDLE_STRATEGY

      public static final String DEFAULT_IDLE_STRATEGY
      Default IdleStrategy to be used for the archive Agents when not busy.
      See Also:
    • MAX_CONCURRENT_RECORDINGS_PROP_NAME

      public static final String 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_DEFAULT
      Default 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.
      See Also:
    • MAX_CONCURRENT_REPLAYS_PROP_NAME

      public static final String 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_DEFAULT
      Default 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 public static final String MAX_CATALOG_ENTRIES_PROP_NAME
      Deprecated.
      Maximum number of entries for the archive Catalog. Increasing this limit will require use of the CatalogTool. The number of entries can be reduced by extending existing recordings rather than creating new ones.
      See Also:
    • MAX_CATALOG_ENTRIES_DEFAULT

      @Deprecated public static final long MAX_CATALOG_ENTRIES_DEFAULT
      Deprecated.
      Default limit for the entries in the Catalog.
      See Also:
    • CATALOG_CAPACITY_PROP_NAME

      public static final String CATALOG_CAPACITY_PROP_NAME
      Default capacity in bytes of the archive Catalog. Catalog will resize itself when this limit is reached.
      See Also:
    • CATALOG_CAPACITY_DEFAULT

      public static final long CATALOG_CAPACITY_DEFAULT
      Default capacity in bytes for the Catalog.
      See Also:
    • CONNECT_TIMEOUT_PROP_NAME

      public static final String 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_NS
      Default 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

      public static final String 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_NS
      Default time interval in nanoseconds for checking session liveness.
      Since:
      1.47.0
      See Also:
    • REPLAY_LINGER_TIMEOUT_PROP_NAME

      public static final String 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_NS
      Default for long to linger a replay connection which defaults to Configuration.publicationLingerTimeoutNs().
      See Also:
    • CONDUCTOR_CYCLE_THRESHOLD_PROP_NAME

      public static final String 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_NS
      Default threshold value for the conductor work cycle threshold to track for being exceeded.
    • RECORDER_CYCLE_THRESHOLD_PROP_NAME

      public static final String 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_NS
      Default threshold value for the recorder work cycle threshold to track for being exceeded.
    • REPLAYER_CYCLE_THRESHOLD_PROP_NAME

      public static final String 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_NS
      Default threshold value for the replayer work cycle threshold to track for being exceeded.
    • ARCHIVE_DIR_DELETE_ON_START_PROP_NAME

      public static final String 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

      public static final String REPLICATION_CHANNEL_PROP_NAME
      Channel for receiving replication streams replayed from another archive.
      See Also:
    • AUTHENTICATOR_SUPPLIER_PROP_NAME

      public static final String AUTHENTICATOR_SUPPLIER_PROP_NAME
      Name of the system property for specifying a supplier of Authenticator for the archive.
      See Also:
    • AUTHENTICATOR_SUPPLIER_DEFAULT

      public static final String AUTHENTICATOR_SUPPLIER_DEFAULT
      Name of the class to use as a supplier of Authenticator for the archive. Default is a non-authenticating option.
      See Also:
    • AUTHORISATION_SERVICE_SUPPLIER_PROP_NAME

      public static final String AUTHORISATION_SERVICE_SUPPLIER_PROP_NAME
      Name of the system property for specifying a supplier of AuthorisationService for the archive.
      See Also:
    • DEFAULT_AUTHORISATION_SERVICE_SUPPLIER

      public static final AuthorisationServiceSupplier DEFAULT_AUTHORISATION_SERVICE_SUPPLIER
      Default AuthorisationServiceSupplier that returns AuthorisationService that allows any command to be executed (i.e. AuthorisationService.ALLOW_ALL).
    • ARCHIVE_ERROR_COUNT_TYPE_ID

      public static final int ARCHIVE_ERROR_COUNT_TYPE_ID
      The type id of the Counter used 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_ID
      The type id of the Counter used for keeping track of the count of concurrent control sessions.
      See Also:
    • ERROR_BUFFER_LENGTH_PROP_NAME

      public static final String 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_DEFAULT
      Size in bytes of the error buffer for the archive when not eternally provided.
      See Also:
    • RECORD_CHECKSUM_PROP_NAME

      public static final String RECORD_CHECKSUM_PROP_NAME
      Property that specifies fully qualified class name of the Checksum to be used for checksum computation during recording.
      See Also:
    • REPLAY_CHECKSUM_PROP_NAME

      public static final String REPLAY_CHECKSUM_PROP_NAME
      Property that specifies fully qualified class name of the Checksum to be used for checksum validation during replay.
      See Also:
    • ARCHIVE_ID_PROP_NAME

      public static final String ARCHIVE_ID_PROP_NAME
      Property name for the identity of the Archive instance. If not specified defaults to the Aeron.clientId() of the assigned Aeron instance.
      See Also:
    • CONTROL_CHANNEL_ENABLED_PROP_NAME

      public static final String CONTROL_CHANNEL_ENABLED_PROP_NAME
      Is network (UDP) control channel enabled. Defaults to true.

      If set to anything other than true then control channel is disabled, i.e. the Archive will run in IPC-only mode.

      See Also:
  • Constructor Details

    • Configuration

      public Configuration()
  • Method Details

    • archiveDirName

      public static String archiveDirName()
      Get the directory name to be used for storing the archive.
      Returns:
      the directory name to be used for storing the archive.
    • markFileDir

      public static String 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

      public static ArchiveThreadingMode threadingMode()
      The threading mode to be employed by the archive.
      Returns:
      the threading mode to be employed by the archive.
    • idleStrategySupplier

      public static Supplier<IdleStrategy> idleStrategySupplier(StatusIndicator controllableStatus)
      Create a supplier of IdleStrategys for the ARCHIVE_IDLE_STRATEGY_PROP_NAME system property.
      Parameters:
      controllableStatus - if a ControllableIdleStrategy is required.
      Returns:
      the new idle strategy Supplier.
    • recorderIdleStrategySupplier

      public static Supplier<IdleStrategy> recorderIdleStrategySupplier(StatusIndicator controllableStatus)
      Create a supplier of IdleStrategys for the ARCHIVE_RECORDER_IDLE_STRATEGY_PROP_NAME system property.
      Parameters:
      controllableStatus - if a ControllableIdleStrategy is required.
      Returns:
      the new idle strategy Supplier.
    • replayerIdleStrategySupplier

      public static Supplier<IdleStrategy> replayerIdleStrategySupplier(StatusIndicator controllableStatus)
      Create a supplier of IdleStrategys for the ARCHIVE_REPLAYER_IDLE_STRATEGY_PROP_NAME system property.
      Parameters:
      controllableStatus - if a ControllableIdleStrategy is 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 public static long maxCatalogEntries()
      Deprecated.
      Use catalogCapacity() 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

      public static String replicationChannel()
      The system property REPLICATION_CHANNEL_PROP_NAME if set, null otherwise.
      Returns:
      system property REPLICATION_CHANNEL_PROP_NAME if 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

      public static AuthenticatorSupplier authenticatorSupplier()
      Returns:
      AUTHENTICATOR_SUPPLIER_DEFAULT or system property AUTHENTICATOR_SUPPLIER_PROP_NAME if set.
    • authorisationServiceSupplier

      public static AuthorisationServiceSupplier authorisationServiceSupplier()
      Returns:
      system property AUTHORISATION_SERVICE_SUPPLIER_PROP_NAME if set or DEFAULT_AUTHORISATION_SERVICE_SUPPLIER otherwise.
    • recordChecksum

      public static String recordChecksum()
      Fully qualified class name of the Checksum implementation to use during recording to compute checksums. Non-empty value means that checksum is enabled for recording.
      Returns:
      class that implements Checksum interface
      See Also:
    • replayChecksum

      public static String replayChecksum()
      Fully qualified class name of the Checksum implementation to use during replay for the checksum. Non-empty value means that checksum is enabled for replay.
      Returns:
      class that implements Checksum interface
      See Also:
    • controlChannelEnabled

      public static boolean controlChannelEnabled()
      Should the network (UDP) control channel be enabled.
      Returns:
      true if 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: