Package org.redisson.api
Interface RLocalCachedMap<K,V>
- Type Parameters:
K- map keyV- map value
- All Superinterfaces:
ConcurrentMap<K,,V> Map<K,,V> RDestroyable,RExpirable,RExpirableAsync,RMap<K,,V> RMapAsync<K,,V> RObject,RObjectAsync
- All Known Subinterfaces:
RLocalCachedMapCache<K,V>
- All Known Implementing Classes:
RedissonLocalCachedMap,RedissonTransactionalLocalCachedMap
Map object with local entry cache support.
Each instance maintains local cache to achieve fast read operations. Suitable for maps which used mostly for read operations and network roundtrip delays are undesirable.
- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionintaddListener(ObjectListener listener) Adds local cache event listenerReturns all map entries stored in local cacheReturns all keys stored in local cacheReturns all values stored in local cachevoidClears local cache across all instancesClears local cache across all instancesReturns state of local cachevoidPre-warm the cached entries.voidpreloadCache(int count) Pre-warm the cached entries.Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllMethods inherited from interface org.redisson.api.RDestroyable
destroyMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RMap
addAndGet, containsKey, containsValue, entrySet, entrySet, entrySet, entrySet, fastPut, fastPutIfAbsent, fastPutIfExists, fastRemove, fastReplace, get, getAll, getCountDownLatch, getFairLock, getLock, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, keySet, keySet, keySet, keySet, loadAll, loadAll, mapReduce, put, putAll, putAll, putIfAbsent, putIfExists, randomEntries, randomKeys, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, replace, replace, values, values, values, values, valueSizeMethods inherited from interface org.redisson.api.RMapAsync
addAndGetAsync, addListenerAsync, clearAsync, computeAsync, computeIfAbsentAsync, computeIfPresentAsync, containsKeyAsync, containsValueAsync, fastPutAsync, fastPutIfAbsentAsync, fastPutIfExistsAsync, fastRemoveAsync, fastReplaceAsync, getAllAsync, getAsync, loadAllAsync, loadAllAsync, mergeAsync, putAllAsync, putAllAsync, putAsync, putIfAbsentAsync, putIfExistsAsync, randomEntriesAsync, randomKeysAsync, readAllEntrySetAsync, readAllKeySetAsync, readAllMapAsync, readAllValuesAsync, removeAsync, removeAsync, replaceAsync, replaceAsync, sizeAsync, valueSizeAsyncMethods inherited from interface org.redisson.api.RObject
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
preloadCache
void preloadCache()Pre-warm the cached entries. Not guaranteed to load ALL values, but statistically will preload approximately all (all if no concurrent mutating activity). Entries are loaded in a batch with size of 10 elements. -
preloadCache
void preloadCache(int count) Pre-warm the cached entries. Not guaranteed to load ALL values, but statistically will preload approximately all (all if no concurrent mutating activity) Entries are loaded in a batch. Batch size is defined bycountparam.- Parameters:
count- - size of batch
-
clearLocalCacheAsync
Clears local cache across all instances- Returns:
- void
-
clearLocalCache
void clearLocalCache()Clears local cache across all instances -
cachedKeySet
Returns all keys stored in local cache- Returns:
- keys
-
cachedValues
Collection<V> cachedValues()Returns all values stored in local cache- Returns:
- values
-
cachedEntrySet
Returns all map entries stored in local cache- Returns:
- entries
-
getCachedMap
Returns state of local cache- Returns:
- map
-
addListener
Adds local cache event listener- Specified by:
addListenerin interfaceRMap<K,V> - Specified by:
addListenerin interfaceRObject- Parameters:
listener- - local cache event listener- Returns:
- listener id
- See Also:
-