KandraConfig

Configuration for the Kandra Ktor plugin.

install(Kandra) {
contactPoints = "localhost:9042"
keyspace = "coinx"
localDatacenter = "datacenter1"
autoCreateKeyspace = true
schemaMode = SchemaMode.AUTO_CREATE
register(User::class, Wallet::class)
pool { requestTimeoutMillis = 10_000 }
auth { provider = KandraAuth.fromEnv() }
retry { maxAttempts = 5 }
debug { logQueries = true; logSlowQueriesMs = 500 }
validate<User> { user ->
buildList { if (user.email.isBlank()) add(KandraValidationError("email", "cannot be blank")) }
}
}

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

When true, large batches are automatically split into chunks of batchMaxChunkSize.

Link copied to clipboard

Maximum statements per batch chunk when auto-chunking.

Link copied to clipboard

Batch warn threshold in KB — logs WARN when a batch exceeds this size estimate.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

When true, registers a /kandra/health route (and Ktor HealthCheck integration if available).

Link copied to clipboard

How long (in milliseconds) a /kandra/health result is cached before the next request triggers a fresh SELECT release_version FROM system.local against the cluster (GH-36). Without this, a probe storm (misconfigured monitoring, or deliberate abuse if the route is reachable beyond an orchestrator's internal network) translates 1:1 into real cluster queries. Set to 0 to disable caching and query on every request.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Log WARN when deleteBy/deleteAll would generate more than this many tombstones.

Link copied to clipboard

When true, validates keyspace permissions at startup (SELECT + MODIFY required).

Functions

Link copied to clipboard
fun auth(block: AuthConfig.() -> Unit)
Link copied to clipboard
Link copied to clipboard
fun debug(block: DebugConfig.() -> Unit)
Link copied to clipboard
fun failover(block: FailoverConfig.() -> Unit)
Link copied to clipboard
Link copied to clipboard
fun metrics(block: MetricsConfig.() -> Unit)
Link copied to clipboard
fun pool(block: PoolConfig.() -> Unit)
Link copied to clipboard
fun register(vararg classes: KClass<*>)
Link copied to clipboard
fun retry(block: RetryConfig.() -> Unit)
Link copied to clipboard
fun shutdown(block: ShutdownConfig.() -> Unit)
Link copied to clipboard
Link copied to clipboard
fun ssl(block: SslConfig.() -> Unit)
Link copied to clipboard
fun throttle(block: ThrottleConfig.() -> Unit)
Link copied to clipboard
inline fun <T : Any> validate(noinline validator: (T) -> List<KandraValidationError>)
fun <T : Any> validate(klass: KClass<T>, validator: KandraValidator<T>)