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
public interface RLocalCachedMap<K,V> extends RMap<K,V>, RDestroyable
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<Map.Entry<K,V>>
cachedEntrySet()
Returns all map entries stored in local cacheSet<K>
cachedKeySet()
Returns all keys stored in local cacheCollection<V>
cachedValues()
Returns all values stored in local cachevoid
clearLocalCache()
Clears local cache across all instancesRFuture<Void>
clearLocalCacheAsync()
Clears local cache across all instancesMap<K,V>
getCachedMap()
Returns state of local cachevoid
preloadCache()
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, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, 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, 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
addListener, 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
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Method Detail
-
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
RFuture<Void> clearLocalCacheAsync()
Clears local cache across all instances- Returns:
- void
-
clearLocalCache
void clearLocalCache()
Clears local cache across all instances
-
cachedValues
Collection<V> cachedValues()
Returns all values stored in local cache- Returns:
- values
-
cachedEntrySet
Set<Map.Entry<K,V>> cachedEntrySet()
Returns all map entries stored in local cache- Returns:
- entries
-
-