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 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 TypeMethodDescriptionint
addListener
(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 cachevoid
Clears local cache across all instancesClears local cache across all instancesReturns state of local cachevoid
Pre-warm the cached entries.void
preloadCache
(int count) Pre-warm the cached entries.Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
Methods inherited from interface org.redisson.api.RDestroyable
destroy
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods 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, valueSize
Methods 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, valueSizeAsync
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
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 bycount
param.- 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:
addListener
in interfaceRMap<K,
V> - Specified by:
addListener
in interfaceRObject
- Parameters:
listener
- - local cache event listener- Returns:
- listener id
- See Also:
-