Interface DatabaseAdapterConfig

  • All Known Subinterfaces:
    AdjustableDatabaseAdapterConfig

    public interface DatabaseAdapterConfig
    Base database-adapter configuration type.

    DatabaseAdapter implementations that need more configuration options must extend this interface, have the Value.Immutable annotation and declare the with... methods implemented by "immutables".

    • Field Detail

      • DEFAULT_REPOSITORY_ID

        static final java.lang.String DEFAULT_REPOSITORY_ID
        See Also:
        Constant Field Values
      • DEFAULT_PARENTS_PER_COMMIT

        static final int DEFAULT_PARENTS_PER_COMMIT
        See Also:
        Constant Field Values
      • DEFAULT_MAX_KEY_LIST_ENTITY_SIZE

        static final int DEFAULT_MAX_KEY_LIST_ENTITY_SIZE
        See Also:
        Constant Field Values
      • DEFAULT_KEY_LIST_HASH_LOAD_FACTOR

        static final float DEFAULT_KEY_LIST_HASH_LOAD_FACTOR
        See Also:
        Constant Field Values
      • DEFAULT_KEY_LIST_ENTITY_PREFETCH

        static final int DEFAULT_KEY_LIST_ENTITY_PREFETCH
        See Also:
        Constant Field Values
      • DEFAULT_PARENTS_PER_REFLOG_ENTRY

        static final int DEFAULT_PARENTS_PER_REFLOG_ENTRY
        See Also:
        Constant Field Values
      • DEFAULT_RETRY_INITIAL_SLEEP_MILLIS_LOWER

        static final int DEFAULT_RETRY_INITIAL_SLEEP_MILLIS_LOWER
        See Also:
        Constant Field Values
      • DEFAULT_RETRY_INITIAL_SLEEP_MILLIS_UPPER

        static final int DEFAULT_RETRY_INITIAL_SLEEP_MILLIS_UPPER
        See Also:
        Constant Field Values
      • DEFAULT_RETRY_MAX_SLEEP_MILLIS

        static final int DEFAULT_RETRY_MAX_SLEEP_MILLIS
        See Also:
        Constant Field Values
      • DEFAULT_ASSUMED_WALL_CLOCK_DRIFT_MICROS

        static final long DEFAULT_ASSUMED_WALL_CLOCK_DRIFT_MICROS
        See Also:
        Constant Field Values
      • DEFAULT_ATTACHMENT_KEYS_BATCH_SIZE

        static final int DEFAULT_ATTACHMENT_KEYS_BATCH_SIZE
        See Also:
        Constant Field Values
    • Method Detail

      • getRepositoryId

        @Default
        default java.lang.String getRepositoryId()
        A free-form string that identifies a particular Nessie storage repository.

        When remote (shared) storage is used, multiple Nessie repositories may co-exist in the same database (and in the same schema). In that case this configuration parameter can be used to distinguish those repositories.

        All DatabaseAdapter implementations must respect this parameter.

      • getParentsPerCommit

        @Default
        default int getParentsPerCommit()
        The number of parent-commit-hashes stored in CommitLogEntry.getParents(). Defaults to 20.
      • getKeyListDistance

        @Default
        default int getKeyListDistance()
        Each n-th CommitLogEntry, where n == value of this parameter, will contain a "full" KeyList. Defaults to 20.
      • getMaxKeyListSize

        @Default
        default int getMaxKeyListSize()
        Maximum size of a database object/row.

        This parameter is respected for KeyList in a CommitLogEntry.

        Not all kinds of databases have hard limits on the maximum size of a database object/row.

        This value must not be "on the edge" - means: it must leave enough room for a somewhat large-ish list via CommitLogEntry.getKeyListsIds(), database-serialization overhead and similar.

        Values <=0 are illegal, defaults to 250000.

      • getMaxKeyListEntitySize

        @Default
        default int getMaxKeyListEntitySize()
        Maximum size of a database object/row.

        This parameter is respected for KeyListEntity.

        Not all kinds of databases have hard limits on the maximum size of a database object/row.

        This value must not be "on the edge" - means: it must leave enough room for database-serialization overhead and similar.

        Values <=0 are illegal, defaults to 1000000.

      • getKeyListHashLoadFactor

        @Default
        default float getKeyListHashLoadFactor()
        Configures key-list hash-table load-factor for the open-addressing hash map used for key-lists.

        Small segments and load factors above 0.65 are bad, as those would lead to many database fetches. Good configurations, that usually lead to only one additional key-list segment fetch are these:

        • segment size of 128kB or more with a load factor of 0.65
        • segment sizes of 64kB or more with a load factor of 0.45
      • getKeyListEntityPrefetch

        @Default
        default int getKeyListEntityPrefetch()
        The number of adjacent key-list-entities to fetch, defaults to 0.

        Applied to key-lists written by Nessie since 0.31.0 using the CommitLogEntry.KeyListVariant.OPEN_ADDRESSING format.

      • getClock

        @Default
        default java.time.Clock getClock()
        The Clock to use.
      • currentTimeInMicros

        @Redacted
        @Auxiliary
        @NonAttribute
        default long currentTimeInMicros()
        Returns the current time in microseconds since epoch.
      • getParentsPerRefLogEntry

        @Default
        default int getParentsPerRefLogEntry()
        The number of Ancestor (reflogId, commitHash) stored in RefLog.getParents(). Defaults to 20.
      • getAssumedWallClockDriftMicros

        @Default
        default long getAssumedWallClockDriftMicros()
        The assumed wall-clock drift between multiple Nessie instances in microseconds.
      • getAttachmentKeysBatchSize

        @Default
        default int getAttachmentKeysBatchSize()
        The maximum chunk size passed down to the actual database when fetching or putting content attachments.

        Concrete database adapter implementation may silently change this limit.