ReadOnlyNormalizedCache

Functions

Link copied to clipboard
open suspend fun close()
Link copied to clipboard
abstract suspend fun dump(): Map<@JvmSuppressWildcards KClass<*>, Map<CacheKey, Record>>
Link copied to clipboard
abstract suspend fun loadRecord(key: CacheKey, cacheHeaders: CacheHeaders): Record?
Link copied to clipboard
abstract suspend fun loadRecords(keys: Collection<CacheKey>, cacheHeaders: CacheHeaders): Collection<Record>

Calls through to NormalizedCache.loadRecord. Implementations should override this method if the underlying storage technology can offer an optimized manner to read multiple records. There is no guarantee on the order of returned Record

Link copied to clipboard
open fun sizeOfRecord(record: Record): Int

Returns the size in bytes of a Record. This is an optional operation that can be implemented by the caches for debug purposes, otherwise it defaults to -1, meaning unknown size.