BatchEngine
class BatchEngine(session: CqlSession, statementBuilder: StatementBuilder, scope: CoroutineScope, eventListener: KandraEventListener? = null, retryConfig: RetryConfig = RetryConfig(), debugConfig: DebugConfig = DebugConfig(), codec: KandraCodec = KandraCodec.default)
Executes save, update, delete, and saveAll operations using LOGGED batch statements.
BATCH-consistency lookups are included in the atomic batch. EVENTUAL-consistency lookups fire asynchronously via scope after the batch commits; failures are forwarded to eventListener (if set) then logged.
Transient failures listed in retryConfig.retryOn are retried with linear backoff. When isShuttingDown is set, all new queries are rejected with KandraQueryException.
Constructors
Link copied to clipboard
constructor(session: CqlSession, statementBuilder: StatementBuilder, scope: CoroutineScope, eventListener: KandraEventListener? = null, retryConfig: RetryConfig = RetryConfig(), debugConfig: DebugConfig = DebugConfig(), codec: KandraCodec = KandraCodec.default)
Properties
Functions
Link copied to clipboard
fun configureBatchLimits(warnThresholdKb: Int, maxChunkSize: Int, autoChunk: Boolean, tombstoneWarnThreshold: Int = 1000)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun save(schema: TableSchema, entity: Any, ttlSeconds: Int? = null, timestampMicros: Long? = null, consistency: KandraConsistency? = null)
Link copied to clipboard
suspend fun saveAllSuspend(schema: TableSchema, entities: List<Any>, ttlSeconds: Int? = null, useBatch: Boolean = true)
Link copied to clipboard
fun saveIfNotExists(schema: TableSchema, entity: Any, serialConsistency: KandraConsistency = KandraConsistency.LOCAL_SERIAL): Boolean
Link copied to clipboard
suspend fun saveIfNotExistsSuspend(schema: TableSchema, entity: Any, serialConsistency: KandraConsistency = KandraConsistency.LOCAL_SERIAL): Boolean
Link copied to clipboard
suspend fun saveSuspend(schema: TableSchema, entity: Any, ttlSeconds: Int? = null, timestampMicros: Long? = null, consistency: KandraConsistency? = null)
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