public class RedisCacheMap<K,V> extends RedisMap<K,V> implements FineCacheMap<K,V>, RedisCacheObject
codec, DEFAULT_ENCODE_CHARSET, name, nameBytes, RET_FAIL, RET_FAIL_OBJ, RET_SUCCESS, RET_SUCCESS_OBJDEFAULT_CLEAN_EXPIRE_ITEM, DEFAULT_LATCH_EXPIRE_TIMEBOOLEAN_CONVERTOR, EVAL_HSCAN_CONVERTOR, INT_CONVERTOR, LONG_CONVERTOR, MORE_THAN_ZERO, RPUSH_BOOLEAN| 构造器和说明 |
|---|
RedisCacheMap(java.lang.String name,
RedisCollectionsClient collectionsClient,
RedisCollectionConfig config,
FineJedisPool pool) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
containsKeyOperation(java.lang.Object key)
----------------------------内部实现------------------------
|
protected boolean |
containsValueOperation(V value) |
void |
destroy()
销毁
因为有清过期key线程,所以需要支持
外层手动调用销毁方法
|
protected V |
getOperation(K key) |
protected com.fr.third.redis.clients.jedis.ScanResult<java.util.Map.Entry<byte[],byte[]>> |
getScanResult(long nextIterPos,
int count) |
V |
put(K key,
V value,
long ttl)
设置一个key-value 值,可以设置过期时间,单位毫秒
|
V |
put(K key,
V value,
long ttl,
long maxIdleTime)
设置key-value值单位为毫秒
|
V |
put(K key,
V value,
long ttl,
java.util.concurrent.TimeUnit unit)
设置一个key-value 值,可以设置过期时间
|
V |
put(K key,
V value,
long ttl,
java.util.concurrent.TimeUnit ttlUnit,
long maxIdleTime,
java.util.concurrent.TimeUnit maxIdleUnit)
设置一个key-value 值,可以设置过期时间,最大空闲时间
|
void |
putAll(java.util.Map<? extends K,? extends V> map,
long ttl) |
void |
putAll(java.util.Map<? extends K,? extends V> map,
long ttl,
java.util.concurrent.TimeUnit ttlUnit) |
protected void |
putAllOperation(java.util.Map<? extends K,? extends V> map) |
V |
putIfAbsent(K key,
V value,
long ttl)
当且仅当key不存在是进行保存,如果存在则返回原先的值
|
V |
putIfAbsent(K key,
V value,
long ttl,
long maxIdleTime)
缺失则设置key-value值单位为毫秒
|
V |
putIfAbsent(K key,
V value,
long ttl,
java.util.concurrent.TimeUnit ttlUnit)
当且仅当key不存在是进行保存,如果存在则返回原先的值
|
V |
putIfAbsent(K key,
V value,
long ttl,
java.util.concurrent.TimeUnit ttlUnit,
long maxIdleTime,
java.util.concurrent.TimeUnit maxIdleUnit)
缺失则设置一个key-value 值,可以设置过期时间,最大空闲时间
|
V |
putIfAbsentOperation(K key,
V value) |
V |
putIfAbsentOperation(K key,
V value,
long ttlTimeout,
long maxIdleTimeout,
long maxIdleDelta) |
protected V |
putOperation(K key,
V value)
------------------------------- 内部实现 ------------------------------
|
protected V |
putOperation(K key,
V value,
long ttlTimeout,
long maxIdleTimeout,
long maxIdleDelta) |
long |
remainTimeToLive(K key)
关联的key值还有多久才过期
|
long |
remainTimeToLiveOperation(K key) |
protected V |
removeOperation(K key) |
protected boolean |
removeOperation(java.lang.Object key,
java.lang.Object value) |
protected V |
replaceOperation(K key,
V value) |
int |
size()
注意这边返回的大小可能包括已经失效的key值
如果清理进程没有来的急清理过期的key
KeySet, Values,Entry 这些对象的迭代器的能保证获取出来的对象不是过期的
|
clear, containsKey, containsValue, decodeMapKey, decodeMapValue, encodeMapKey, encodeMapValue, entrySet, get, getScanResult, isEmpty, keySet, put, putAll, putIfAbsent, remove, remove, replace, replace, valuesappend, bitcount, bitcount, bitfield, checkKey, checkValue, decodeValue, decodeValue, decodeValues, decr, del, delete, echo, encodeIntParameter, encodeLongParameter, encodeParameters, encodeString, encodeValue, encodeValue, eval, eval, eval, eval, evalsha, evalsha, evalsha, execute, execute, exists, expire, expireAt, geoadd, geoadd, get, getCodec, getCollectionsClient, getEncodeName, getName, getNameBytes, getParamsWithBinary, getrange, getScriptById, getSet, hdel, hexists, hget, hgetAll, hincrBy, hincrByFloat, hkeys, hlen, hmget, hmset, hscan, hscan, hset, hset, hsetnx, hstrlen, hvals, incr, incrBy, incrByFloat, lindex, linsert, llen, lpop, lpush, lpushx, lrange, lrem, lset, ltrim, persist, pexpire, pexpireAt, pfadd, pfcount, prefixName, psetex, pttl, restore, rpop, rpush, rpushx, sadd, scard, set, set, setnx, setrange, sismember, smembers, sort, sort, spop, spop, srandmember, srandmember, srem, sscan, sscan, strlen, substr, suffixName, toNameBytesList, toNameBytesList, toNameBytesList, toNamesBytesList, ttl, type, unlink, zadd, zadd, zadd, zadd, zcard, zcount, zcount, zincrby, zincrby, zrange, zrangeByScore, zrangeByScore, zrangeByScore, zrangeByScore, zrangeByScoreWithScores, zrangeByScoreWithScores, zrangeByScoreWithScores, zrangeByScoreWithScores, zrangeWithScores, zrank, zrem, zremrangeByRank, zrevrange, zrevrangeByScore, zrevrangeByScore, zrevrangeByScore, zrevrangeByScore, zrevrangeByScoreWithScores, zrevrangeByScoreWithScores, zrevrangeByScoreWithScores, zrevrangeByScoreWithScores, zrevrangeWithScores, zrevrank, zscan, zscan, zscoreclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitkeySetpublic RedisCacheMap(java.lang.String name,
RedisCollectionsClient collectionsClient,
RedisCollectionConfig config,
FineJedisPool pool)
public V put(K key, V value, long ttl, java.util.concurrent.TimeUnit ttlUnit, long maxIdleTime, java.util.concurrent.TimeUnit maxIdleUnit)
FineCacheMapput 在接口中 FineCacheMap<K,V>ttl - 过期时间
为0时表示没有过期时间ttlUnit - 时间单位maxIdleTime - 最大过期时间应该大于最大空闲时间,最大空闲时间表示,如果有多长时间这个key值没有用
则失效
为0时表示没有最大空闲时间期限maxIdleUnit - 最大空闲时间时间单位public V put(K key, V value, long ttl, long maxIdleTime)
FineCacheMapput 在接口中 FineCacheMap<K,V>public V put(K key, V value, long ttl, java.util.concurrent.TimeUnit unit)
FineCacheMapput 在接口中 FineCacheMap<K,V>ttl - 过期时间
为0时表示没有过期时间unit - 时间单位public V put(K key, V value, long ttl)
FineCacheMapput 在接口中 FineCacheMap<K,V>ttl - 过期时间public V putIfAbsent(K key, V value, long ttl, java.util.concurrent.TimeUnit ttlUnit, long maxIdleTime, java.util.concurrent.TimeUnit maxIdleUnit)
FineCacheMapputIfAbsent 在接口中 FineCacheMap<K,V>ttl - 过期时间
为0时表示没有过期时间ttlUnit - 时间单位maxIdleTime - 最大过期时间应该大于最大空闲时间,最大空闲时间表示,如果有多长时间这个key值没有用
则失效
为0时表示没有最大空闲时间期限maxIdleUnit - 最大空闲时间时间单位public V putIfAbsent(K key, V value, long ttl, long maxIdleTime)
FineCacheMapputIfAbsent 在接口中 FineCacheMap<K,V>public V putIfAbsent(K key, V value, long ttl, java.util.concurrent.TimeUnit ttlUnit)
FineCacheMapputIfAbsent 在接口中 FineCacheMap<K,V>ttl - 过期时间
为0时表示没有过期时间ttlUnit - 时间单位public V putIfAbsent(K key, V value, long ttl)
FineCacheMapputIfAbsent 在接口中 FineCacheMap<K,V>ttl - 过期时间
为0时表示没有过期时间
时间毫秒public void putAll(java.util.Map<? extends K,? extends V> map, long ttl, java.util.concurrent.TimeUnit ttlUnit)
putAll 在接口中 FineCacheMap<K,V>ttl - 过期时间ttlUnit - - 时间单位public void putAll(java.util.Map<? extends K,? extends V> map, long ttl)
putAll 在接口中 FineCacheMap<K,V>ttl - 过期时间
单位毫秒public long remainTimeToLive(K key)
FineCacheMapremainTimeToLive 在接口中 FineCacheMap<K,V>key - - map keypublic void destroy()
FineCacheMapdestroy 在接口中 FineCacheMap<K,V>public int size()
FineCacheMapprotected V putOperation(K key, V value)
putOperation 在类中 RedisMap<K,V>protected V replaceOperation(K key, V value)
replaceOperation 在类中 RedisMap<K,V>protected V putOperation(K key, V value, long ttlTimeout, long maxIdleTimeout, long maxIdleDelta)
protected boolean removeOperation(java.lang.Object key,
java.lang.Object value)
removeOperation 在类中 RedisMap<K,V>public V putIfAbsentOperation(K key, V value)
putIfAbsentOperation 在类中 RedisMap<K,V>public V putIfAbsentOperation(K key, V value, long ttlTimeout, long maxIdleTimeout, long maxIdleDelta)
protected void putAllOperation(java.util.Map<? extends K,? extends V> map)
putAllOperation 在类中 RedisMap<K,V>public long remainTimeToLiveOperation(K key)
public boolean containsKeyOperation(java.lang.Object key)
RedisMapcontainsKeyOperation 在类中 RedisMap<K,V>protected boolean containsValueOperation(V value)
containsValueOperation 在类中 RedisMap<K,V>protected com.fr.third.redis.clients.jedis.ScanResult<java.util.Map.Entry<byte[],byte[]>> getScanResult(long nextIterPos,
int count)
getScanResult 在类中 RedisMap<K,V>