public class GenericCacheSet<V extends java.io.Serializable> extends AbstractCacheSet<V>
cacheConfiguration, cacheSetDataLoader, logger, tenantId
statistics
isCacheDisabled
构造器和说明 |
---|
GenericCacheSet(java.lang.String group,
java.lang.String name,
CacheConfiguration config,
SetDataLoader dataLoader,
java.lang.Boolean isRestartReload) |
限定符和类型 | 方法和说明 |
---|---|
int |
add(V o)
Adds the specified element to this set if it is not already present
(optional operation).
|
int |
addAll(java.util.Collection<? extends V> c)
Adds all of the elements in the specified collection to this set if
they're not already present (optional operation).
|
boolean |
allowRedisFlush()
检查是否按需或者可以补偿回来
|
void |
clear()
清除所有缓存项。
|
int |
clearAndAddAll(java.util.Collection<? extends V> c)
清除缓存并将Map中的所有项目设置到缓存中。
|
boolean |
contains(V o)
Returns true if this set contains the specified element.
|
java.util.Iterator<V> |
iterator()
Returns an iterator over the elements in this set.
|
boolean |
needConsistent()
是否需要保持一级缓存一致性
|
V |
pop()
remove and return the random value in the Set.
|
int |
remove(V o)
Removes the specified element from this set if it is present (optional
operation).
|
int |
removeAll(java.util.Collection<? extends V> keys)
Removes from this set all of its elements that are contained in the
specified collection (optional operation).
|
int |
size()
该方法提供的为本地大小,不代表Redis缓存大小,谨慎使用
Returns the number of elements in this list.
|
java.util.Set<V> |
toSet()
将缓存转化为Set表示。
|
getCacheSetDataLoader, isEmpty
checkBatchCacheMiss, checkBatchInProtectCache, checkCacheMiss, checkInProtectCache, clearProtectCache, getCacheKey, getFullName, getGroup, getName, getStatistics, invalidateProtectCache, invalidateProtectCache, setBatchProtectCache, setProtectCache, setProtectDataExpire
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFullName, getGroup, getName, getStatistics
public GenericCacheSet(java.lang.String group, java.lang.String name, CacheConfiguration config, SetDataLoader dataLoader, java.lang.Boolean isRestartReload)
public boolean contains(V o)
CacheSet
e
such that (o==null ? e==null :
o.equals(e))
.o
- element whose presence in this set is to be tested.public java.util.Iterator<V> iterator()
CacheSet
public int add(V o)
CacheSet
o
, to this set if this set contains no element
e
such that (o==null ? e==null :
o.equals(e))
. If this set already contains the specified element,
the call leaves this set unchanged and returns false. In
combination with the restriction on constructors, this ensures that sets
never contain duplicate elements.
The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throwing an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain.
o
- element to be added to this set.public int remove(V o)
CacheSet
e
such that
(o==null ? e==null : o.equals(e))
, if the set contains such
an element. Returns true if the set contained the specified
element (or equivalently, if the set changed as a result of the call).
(The set will not contain the specified element once the call returns.)o
- object to be removed from this set, if present.public int addAll(java.util.Collection<? extends V> c)
CacheSet
c
- collection whose elements are to be added to this set.public int clearAndAddAll(java.util.Collection<? extends V> c)
CacheSet
c
- Java Setpublic int removeAll(java.util.Collection<? extends V> keys)
CacheSet
keys
- collection that defines which elements will be removed from
this set.public int size()
GroupCacheable
public void clear()
GroupCacheable
public boolean allowRedisFlush()
GroupCacheable
public boolean needConsistent()
GroupCacheable