Class KeyValueConfig

  • All Implemented Interfaces:

    
    public final class KeyValueConfig
    
                        

    DSL builder for Key-Value store configuration

    Provides a Kotlin-friendly way to configure Key-Value buckets with sensible defaults and compile-time validation.

    Example:

    val kvStore = js.keyValue("my-bucket") {
        description = "User preferences storage"
        maxHistoryPerKey = 10
        ttl = 7.days
        storageType = StorageType.MEMORY
        replicas = 3
    }
    • Constructor Detail

    • Method Detail

      • getMaxHistoryPerKey

         final Long getMaxHistoryPerKey()

        Maximum number of history entries per key (includes current value) Default: 1 (only keep current value) Set to higher value to track history of changes

      • getMaxValueSize

         final Integer getMaxValueSize()

        Maximum size in bytes for a single value Default: -1 (server default, typically 1MB)

      • getMaxBucketSize

         final Long getMaxBucketSize()

        Maximum number of bytes for the entire bucket Default: -1 (unlimited)

      • getTtl

         final Duration getTtl()

        Time-to-live for entries in the bucket Default: Duration.ZERO (no expiration)

        Example: ttl = 24.hours

      • getReplicas

         final Integer getReplicas()

        Number of replicas for the bucket (cluster mode) Default: 1 (single replica)

        For high availability, set to 3 or more (odd numbers recommended)

      • getPlacement

         final Placement getPlacement()

        Placement constraints for the bucket Only relevant in cluster mode

      • getCompression

         final Boolean getCompression()

        Whether the bucket's messages are stored S2-compressed Default: false (no compression)