BaseStorageTable

abstract class BaseStorageTable(val spec: StorageTableSpec) : StorageTable

Inheritors

Constructors

Link copied to clipboard
constructor(spec: StorageTableSpec)

Properties

Link copied to clipboard
Link copied to clipboard
abstract val storage: Storage

The Storage the table belongs to.

Functions

Link copied to clipboard
abstract suspend fun delete(key: String, partitionId: String? = null): Boolean

Deletes data.

Link copied to clipboard
abstract suspend fun deleteAll()

Deletes all data previously stored in this table.

Link copied to clipboard
abstract suspend fun deletePartition(partitionId: String)

Deletes all data previously stored in this the given partition.

Link copied to clipboard
abstract suspend fun enumerate(partitionId: String? = null, afterKey: String? = null, limit: Int = Int.MAX_VALUE): List<String>

Enumerate keys of the records with given table and partitionId in key lexicographic order.

Link copied to clipboard
abstract suspend fun enumerateWithData(partitionId: String? = null, afterKey: String? = null, limit: Int = Int.MAX_VALUE): List<Pair<String, ByteString>>

Enumerate the records with given table and partitionId in key lexicographic order.

Link copied to clipboard
abstract suspend fun get(key: String, partitionId: String? = null): ByteString?

Gets data.

Link copied to clipboard
abstract suspend fun insert(key: String?, data: ByteString, partitionId: String? = null, expiration: Instant = Instant.DISTANT_FUTURE): String

Stores new data.

Link copied to clipboard
abstract suspend fun purgeExpired()

Reclaim storage that is taken up by the expired entries.

Link copied to clipboard
abstract suspend fun update(key: String, data: ByteString, partitionId: String? = null, expiration: Instant? = null)

Updates data that is already stored in the engine.