Class RedissonSetCache<V>
- Type Parameters:
V
- value
- All Implemented Interfaces:
Iterable<V>
,Collection<V>
,Set<V>
,RCollectionAsync<V>
,RDestroyable
,RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RSet<V>
,RSetAsync<V>
,RSetCache<V>
,RSetCacheAsync<V>
,RSortable<Set<V>>
,RSortableAsync<Set<V>>
,ScanIterator
- Direct Known Subclasses:
RedissonTransactionalSetCache
Set-based cache with ability to set TTL for each entry via
RSetCache.add(Object, long, TimeUnit)
method.
Current Redis implementation doesn't have set entry eviction functionality.
Thus values are checked for TTL expiration during any value read operation.
If entry expired then it doesn't returns and clean task runs asynchronous.
Clean task deletes removes 100 expired entries at once.
In addition there is EvictionScheduler
. This scheduler
deletes expired entries in time interval between 5 seconds to 2 hours.
If eviction is not required then it's better to use RSet
.
- Author:
- Nikita Koksharov
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
Constructor Summary
ConstructorDescriptionRedissonSetCache
(Codec codec, EvictionScheduler evictionScheduler, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson) RedissonSetCache
(EvictionScheduler evictionScheduler, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Stores value with specified time to live.boolean
addAll
(Collection<? extends V> c) int
Adds all elements contained in the specified map to this sorted set.addAllAsync
(Collection<? extends V> c) Adds all elements contained in the specified collectionaddAllAsync
(Map<V, Duration> objects) Adds all elements contained in the specified map to this sorted set.int
addAllCounted
(Collection<? extends V> c) Adds all elements contained in the specified collection.addAllCountedAsync
(Collection<? extends V> c) Adds all elements contained in the specified collection.int
addAllIfAbsent
(Map<V, Duration> objects) Adds elements to this set only if they haven't been added before.addAllIfAbsentAsync
(Map<V, Duration> objects) Adds elements to this set only if they haven't been added before.int
addAllIfExist
(Map<V, Duration> objects) Adds elements to this set only if they already exist.addAllIfExistAsync
(Map<V, Duration> objects) Adds elements to this set only if they already exist.int
addAllIfGreater
(Map<V, Duration> objects) Adds elements to this set only if new ttl greater than current ttl of existed elements.addAllIfGreaterAsync
(Map<V, Duration> objects) Adds elements to this set only if new ttl greater than current ttl of existed elements.int
addAllIfLess
(Map<V, Duration> objects) Adds elements to this set only if new ttl less than current ttl of existed elements.addAllIfLessAsync
(Map<V, Duration> objects) Adds elements to this set only if new ttl less than current ttl of existed elements.Adds element into this collection.Stores value with specified time to live.boolean
addIfAbsent
(Duration ttl, V object) Adds element to this set only if has not been added before.addIfAbsentAsync
(Duration ttl, V object) Adds element to this set only if has not been added before.boolean
addIfExists
(Duration ttl, V object) Adds element to this set only if it's already exists.addIfExistsAsync
(Duration ttl, V object) Adds element to this set only if it's already exists.boolean
addIfGreater
(Duration ttl, V object) Adds element to this set only if new ttl greater than current ttl of existed element.addIfGreaterAsync
(Duration ttl, V object) Adds element to this set only if new ttl greater than current ttl of existed element.boolean
Adds element to this set only if new ttl less than current ttl of existed element.addIfLessAsync
(Duration ttl, V object) Adds element to this set only if new ttl less than current ttl of existed element.void
clear()
boolean
Clear an expire timeout or expire date for object.Clear an expire timeout or expire date for object in async mode.clearExpireAsync
(String... keys) boolean
boolean
containsAll
(Collection<?> c) containsAllAsync
(Collection<?> c) Returnstrue
if this collection contains all of the elements in the specified collection.Returnstrue
if this collection contains encoded state of the specified element.containsEach
(Collection<V> c) Check if each element is contained in the specified collection.Check if each element is contained in the specified collection.countIntersection
(int limit, String... names) Counts elements of set as a result of sets intersection with current set.countIntersection
(String... names) Counts elements of set as a result of sets intersection with current set.countIntersectionAsync
(int limit, String... names) Counts elements of set as a result of sets intersection with current set.countIntersectionAsync
(String... names) Counts elements of set as a result of sets intersection with current set.void
destroy()
Destroys object when it's not necessary anymore.int
Diff sets specified by name and write to current set.Diff sets specified by name and write to current set.distributedIterator
(int count) Returns element iterator that can be shared across multiple applications.distributedIterator
(String pattern) Returns iterator over elements that match specified pattern.distributedIterator
(String iteratorName, String pattern, int count) Returns iterator over elements that match specified pattern.boolean
UseRExpirable.expire(Duration)
insteadboolean
Sets a timeout for this object.boolean
Sets an expiration date for this object.expireAsync
(long timeToLive, TimeUnit timeUnit) UseRExpirableAsync.expireAsync(Duration)
insteadexpireAsync
(long timeToLive, TimeUnit timeUnit, String param, String... keys) expireAsync
(Duration duration) Set a timeout for object.expireAsync
(Instant instant) Set an expire date for object.boolean
expireAt
(long timestamp) UseRExpirable.expire(Instant)
insteadboolean
UseRExpirable.expire(Instant)
insteadexpireAtAsync
(long timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadexpireAtAsync
(long timestamp, String param, String... keys) expireAtAsync
(Date timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadboolean
expireIfGreater
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.boolean
expireIfGreater
(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.expireIfGreaterAsync
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.expireIfGreaterAsync
(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.boolean
expireIfLess
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.boolean
expireIfLess
(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.expireIfLessAsync
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.expireIfLessAsync
(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.boolean
expireIfNotSet
(Duration duration) Sets a timeout for this object only if it hasn't been set before.boolean
expireIfNotSet
(Instant time) Sets an expiration date for this object only if it hasn't been set before.expireIfNotSetAsync
(Duration duration) Sets a timeout for this object only if it hasn't been set before.expireIfNotSetAsync
(Instant time) Sets an expiration date for this object only if it hasn't been set before.boolean
expireIfSet
(Duration duration) Sets a timeout for this object only if it has been already set.boolean
expireIfSet
(Instant time) Sets an expiration date for this object only if it has been already set.expireIfSetAsync
(Duration duration) Sets a timeout for this object only if it has been already set.expireIfSetAsync
(Instant time) Sets an expiration date for this object only if it has been already set.getCountDownLatch
(V value) ReturnsRCountDownLatch
instance associated withvalue
long
Expiration time of Redisson object that has a timeoutExpiration time of Redisson object that has a timeoutgetFairLock
(V value) ReturnsRLock
instance associated withvalue
Returns lock instance associated withvalue
getPermitExpirableSemaphore
(V value) ReturnsRPermitExpirableSemaphore
instance associated withvalue
getReadWriteLock
(V value) ReturnsRReadWriteLock
instance associated withvalue
getSemaphore
(V value) ReturnsRSemaphore
instance associated withvalue
int
intersection
(String... names) Intersection sets specified by name and write to current set.intersectionAsync
(String... names) Intersection sets specified by name and write to current set.boolean
isEmpty()
iterator()
iterator
(int count) Returns elements iterator fetches elements in a batch.Returns elements iterator.Returns elements iterator fetches elements in a batch.<KOut,
VOut>
RCollectionMapReduce<V, KOut, VOut> ReturnsRMapReduce
object associated with this objectboolean
Move a member from this set to the given destination set in.Move a member from this set to the given destination set in async mode.random()
Returns random elementrandom
(int count) Returns random elements from set limited bycount
Returns random element from set in async moderandomAsync
(int count) Returns random elements from set limited bycount
readAll()
Read all elements at onceRead all elements at onceDiff sets specified by name with current set.readDiffAsync
(String... names) Diff sets specified by name with current set.readIntersection
(String... names) Intersection sets specified by name with current set without current set state change.readIntersectionAsync
(String... names) Intersection sets specified by name with current set.<T> Collection
<T> Read data in sorted view<T> Collection
<T> Read data in sorted viewRead data in sorted viewRead data in sorted viewRead data in sorted viewRead data in sorted view<T> Collection
<T> readSortAlpha
(String byPattern, List<String> getPatterns, SortOrder order) Read data in sorted view lexicographically<T> Collection
<T> readSortAlpha
(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Read data in sorted view lexicographicallyreadSortAlpha
(String byPattern, SortOrder order) Read data in sorted view lexicographicallyreadSortAlpha
(String byPattern, SortOrder order, int offset, int count) Read data in sorted view lexicographicallyreadSortAlpha
(SortOrder order) Read data in sorted view lexicographicallyreadSortAlpha
(SortOrder order, int offset, int count) Read data in sorted view lexicographically<T> RFuture
<Collection<T>> readSortAlphaAsync
(String byPattern, List<String> getPatterns, SortOrder order) Read data in sorted view lexicographically<T> RFuture
<Collection<T>> readSortAlphaAsync
(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Read data in sorted view lexicographicallyreadSortAlphaAsync
(String byPattern, SortOrder order) Read data in sorted view lexicographicallyreadSortAlphaAsync
(String byPattern, SortOrder order, int offset, int count) Read data in sorted view lexicographicallyreadSortAlphaAsync
(SortOrder order) Read data in sorted view lexicographicallyreadSortAlphaAsync
(SortOrder order, int offset, int count) Read data in sorted view lexicographically<T> RFuture
<Collection<T>> readSortAsync
(String byPattern, List<String> getPatterns, SortOrder order) Read data in sorted view<T> RFuture
<Collection<T>> readSortAsync
(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Read data in sorted viewreadSortAsync
(String byPattern, SortOrder order) Read data in sorted viewreadSortAsync
(String byPattern, SortOrder order, int offset, int count) Read data in sorted viewreadSortAsync
(SortOrder order) Read data in sorted viewreadSortAsync
(SortOrder order, int offset, int count) Read data in sorted viewUnion sets specified by name with current set without current set state change.readUnionAsync
(String... names) Union sets specified by name with current set.long
Remaining time to live of Redisson object that has a timeoutRemaining time to live of Redisson object that has a timeoutboolean
boolean
removeAll
(Collection<?> c) removeAllAsync
(Collection<?> c) Removes all of this collection's elements that are also contained in the specified collection.int
removeAllCounted
(Collection<? extends V> c) Removes all elements contained in the specified collection.removeAllCountedAsync
(Collection<? extends V> c) Removes all elements contained in the specified collection.Removes a single instance of the specified element from this collection, if it is present.Removes and returns random elementremoveRandom
(int amount) Removes and returns random elements limited byamount
Removes and returns random element from set in async moderemoveRandomAsync
(int amount) Removes and returns random elements from set in async modeboolean
retainAll
(Collection<?> c) retainAllAsync
(Collection<?> c) Retains only the elements in this collection that are contained in the specified collection.scanIterator
(String name, RedisClient client, long startPos, String pattern, int count) scanIteratorAsync
(String name, RedisClient client, long startPos, String pattern, int count) int
size()
Returns the number of elements in cache.Returns number of elements in this collection.int
Sort data and store todestName
listint
sortTo
(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Sort data and store todestName
listint
Sort data and store todestName
listint
Sort data and store todestName
listint
Sort data and store todestName
listint
Sort data and store todestName
listSort data and store todestName
listsortToAsync
(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Sort data and store todestName
listsortToAsync
(String destName, String byPattern, SortOrder order) Sort data and store todestName
listsortToAsync
(String destName, String byPattern, SortOrder order, int offset, int count) Sort data and store todestName
listsortToAsync
(String destName, SortOrder order) Sort data and store todestName
listsortToAsync
(String destName, SortOrder order, int offset, int count) Sort data and store todestName
liststream
(int count) Returns stream of elements fetches elements in a batch.Returns stream of elements.Returns stream of elements fetches elements in a batch.Object[]
toArray()
<T> T[]
toArray
(T[] a) boolean
UseRSetCache.addIfAbsent(Duration, Object)
insteadboolean
Tries to add elements only if none of them in set.tryAddAsync
(long ttl, TimeUnit unit, V... values) tryAddAsync
(V... values) Tries to add elements only if none of them in set.int
Union sets specified by name and write to current set.unionAsync
(String... names) Union sets specified by name and write to current set.Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, getServiceManager, getSubscribeService, isExists, isExistsAsync, map, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
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.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
Methods inherited from interface org.redisson.api.RSet
addListener
Methods inherited from interface org.redisson.api.RSetAsync
addListenerAsync
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
RedissonSetCache
public RedissonSetCache(EvictionScheduler evictionScheduler, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson) -
RedissonSetCache
public RedissonSetCache(Codec codec, EvictionScheduler evictionScheduler, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
-
Method Details
-
mapReduce
Description copied from interface:RSet
ReturnsRMapReduce
object associated with this object -
size
public int size()Description copied from interface:RSetCache
Returns the number of elements in cache. This number can reflects expired elements too due to non realtime cleanup process. -
sizeAsync
Description copied from interface:RCollectionAsync
Returns number of elements in this collection.- Specified by:
sizeAsync
in interfaceRCollectionAsync<V>
- Specified by:
sizeAsync
in interfaceRSetCacheAsync<V>
- Returns:
- size of collection
-
isEmpty
public boolean isEmpty() -
contains
-
containsAsync
Description copied from interface:RCollectionAsync
Returnstrue
if this collection contains encoded state of the specified element.- Specified by:
containsAsync
in interfaceRCollectionAsync<V>
- Parameters:
o
- element whose presence in this collection is to be tested- Returns:
true
if this collection contains the specified element andfalse
otherwise
-
scanIterator
public ScanResult<Object> scanIterator(String name, RedisClient client, long startPos, String pattern, int count) - Specified by:
scanIterator
in interfaceScanIterator
-
scanIteratorAsync
public RFuture<ScanResult<Object>> scanIteratorAsync(String name, RedisClient client, long startPos, String pattern, int count) - Specified by:
scanIteratorAsync
in interfaceScanIterator
-
iterator
Description copied from interface:RSet
Returns elements iterator fetches elements in a batch. Batch size is defined bycount
param. -
iterator
Description copied from interface:RSet
Returns elements iterator. Ifpattern
is not null then only elements match this pattern are loaded. -
iterator
Description copied from interface:RSet
Returns elements iterator fetches elements in a batch. Batch size is defined bycount
param. If pattern is not null then only elements match this pattern are loaded. -
iterator
-
readAll
Description copied from interface:RSet
Read all elements at once -
readAllAsync
Description copied from interface:RSetAsync
Read all elements at once- Specified by:
readAllAsync
in interfaceRSetAsync<V>
- Returns:
- values
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
-
add
Description copied from interface:RSetCache
Stores value with specified time to live. Value expires after specified time to live. -
addAsync
Description copied from interface:RSetCacheAsync
Stores value with specified time to live. Value expires after specified time to live.- Specified by:
addAsync
in interfaceRSetCacheAsync<V>
- Parameters:
value
- to addttl
- - time to live for key\value entry. If0
then stores infinitely.unit
- - time unit- Returns:
true
if value has been added.false
if value already been in collection.
-
tryAdd
Description copied from interface:RSet
Tries to add elements only if none of them in set. -
tryAddAsync
Description copied from interface:RSetAsync
Tries to add elements only if none of them in set.- Specified by:
tryAddAsync
in interfaceRSetAsync<V>
- Parameters:
values
- - values to add- Returns:
true
if elements successfully added, otherwisefalse
.
-
tryAdd
Description copied from interface:RSetCache
UseRSetCache.addIfAbsent(Duration, Object)
instead -
tryAddAsync
Description copied from interface:RSetCacheAsync
- Specified by:
tryAddAsync
in interfaceRSetCacheAsync<V>
- Parameters:
ttl
- - time to live for value. If0
then stores infinitely.unit
- - time unitvalues
- - values to add- Returns:
true
if elements successfully added, otherwisefalse
.
-
addAsync
Description copied from interface:RCollectionAsync
Adds element into this collection.- Specified by:
addAsync
in interfaceRCollectionAsync<V>
- Parameters:
value
- - element to add- Returns:
true
if an element was added andfalse
if it is already present
-
removeAsync
Description copied from interface:RCollectionAsync
Removes a single instance of the specified element from this collection, if it is present.- Specified by:
removeAsync
in interfaceRCollectionAsync<V>
- Parameters:
o
- element to be removed from this collection, if present- Returns:
true
if an element was removed as a result of this call
-
remove
- Specified by:
remove
in interfaceCollection<V>
- Specified by:
remove
in interfaceScanIterator
- Specified by:
remove
in interfaceSet<V>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<V>
- Specified by:
containsAll
in interfaceSet<V>
-
containsAllAsync
Description copied from interface:RCollectionAsync
Returnstrue
if this collection contains all of the elements in the specified collection.- Specified by:
containsAllAsync
in interfaceRCollectionAsync<V>
- Parameters:
c
- collection to be checked for containment in this collection- Returns:
true
if this collection contains all of the elements in the specified collection
-
addAll
-
addAllAsync
Description copied from interface:RCollectionAsync
Adds all elements contained in the specified collection- Specified by:
addAllAsync
in interfaceRCollectionAsync<V>
- Parameters:
c
- - collection of elements to add- Returns:
true
if at least one element was added andfalse
if all elements are already present
-
retainAll
-
retainAllAsync
Description copied from interface:RCollectionAsync
Retains only the elements in this collection that are contained in the specified collection.- Specified by:
retainAllAsync
in interfaceRCollectionAsync<V>
- Parameters:
c
- collection containing elements to be retained in this collection- Returns:
true
if this collection changed as a result of the call
-
removeAllAsync
Description copied from interface:RCollectionAsync
Removes all of this collection's elements that are also contained in the specified collection.- Specified by:
removeAllAsync
in interfaceRCollectionAsync<V>
- Parameters:
c
- collection containing elements to be removed from this collection- Returns:
true
if this collection changed as a result of the call
-
removeAll
-
clear
public void clear() -
getPermitExpirableSemaphore
Description copied from interface:RSet
ReturnsRPermitExpirableSemaphore
instance associated withvalue
- Specified by:
getPermitExpirableSemaphore
in interfaceRSet<V>
- Parameters:
value
- - set value- Returns:
- RPermitExpirableSemaphore object
-
getSemaphore
Description copied from interface:RSet
ReturnsRSemaphore
instance associated withvalue
- Specified by:
getSemaphore
in interfaceRSet<V>
- Parameters:
value
- - set value- Returns:
- RSemaphore object
-
getCountDownLatch
Description copied from interface:RSet
ReturnsRCountDownLatch
instance associated withvalue
- Specified by:
getCountDownLatch
in interfaceRSet<V>
- Parameters:
value
- - set value- Returns:
- RCountDownLatch object
-
getFairLock
Description copied from interface:RSet
ReturnsRLock
instance associated withvalue
- Specified by:
getFairLock
in interfaceRSet<V>
- Parameters:
value
- - set value- Returns:
- RLock object
-
getLock
Description copied from interface:RSet
Returns lock instance associated withvalue
-
getReadWriteLock
Description copied from interface:RSet
ReturnsRReadWriteLock
instance associated withvalue
- Specified by:
getReadWriteLock
in interfaceRSet<V>
- Parameters:
value
- - set value- Returns:
- RReadWriteLock object
-
destroy
public void destroy()Description copied from interface:RDestroyable
Destroys object when it's not necessary anymore.- Specified by:
destroy
in interfaceRDestroyable
-
stream
Description copied from interface:RSet
Returns stream of elements fetches elements in a batch. Batch size is defined bycount
param. -
stream
Description copied from interface:RSet
Returns stream of elements fetches elements in a batch. Batch size is defined bycount
param. If pattern is not null then only elements match this pattern are loaded. -
stream
Description copied from interface:RSet
Returns stream of elements. If pattern is not null then only elements match this pattern are loaded. -
addAllCounted
Description copied from interface:RSet
Adds all elements contained in the specified collection. Returns number of added elements.- Specified by:
addAllCounted
in interfaceRSet<V>
- Parameters:
c
- - collection of elements to add- Returns:
- number of added elements
-
removeAllCounted
Description copied from interface:RSet
Removes all elements contained in the specified collection. Returns number of removed elements.- Specified by:
removeAllCounted
in interfaceRSet<V>
- Parameters:
c
- - collection of elements to add- Returns:
- number of removed elements
-
distributedIterator
Description copied from interface:RSet
Returns iterator over elements that match specified pattern. Iterator can be shared across multiple applications. Creating multiple iterators on the same object with this method will result in a single shared iterator. See RSet.distributedIterator(String, String, int) for creating different iterators.- Specified by:
distributedIterator
in interfaceRSet<V>
- Parameters:
pattern
- element pattern- Returns:
- shared elements iterator
-
distributedIterator
Description copied from interface:RSet
Returns element iterator that can be shared across multiple applications. Creating multiple iterators on the same object with this method will result in a single shared iterator. See RSet.distributedIterator(String, String, int) for creating different iterators.- Specified by:
distributedIterator
in interfaceRSet<V>
- Parameters:
count
- batch size- Returns:
- shared elements iterator
-
distributedIterator
Description copied from interface:RSet
Returns iterator over elements that match specified pattern. Iterator can be shared across multiple applications. Creating multiple iterators on the same object with this method will result in a single shared iterator. Iterator name must be resolved to the same hash slot as set name.- Specified by:
distributedIterator
in interfaceRSet<V>
- Parameters:
iteratorName
- redis object name to which cursor will be savedpattern
- element patterncount
- batch size- Returns:
- shared elements iterator
-
removeRandom
Description copied from interface:RSet
Removes and returns random elements limited byamount
- Specified by:
removeRandom
in interfaceRSet<V>
- Parameters:
amount
- of random elements- Returns:
- random elements
-
removeRandom
Description copied from interface:RSet
Removes and returns random element- Specified by:
removeRandom
in interfaceRSet<V>
- Returns:
- random element
-
random
Description copied from interface:RSet
Returns random element -
random
Description copied from interface:RSet
Returns random elements from set limited bycount
-
move
Description copied from interface:RSet
Move a member from this set to the given destination set in. -
union
Description copied from interface:RSet
Union sets specified by name and write to current set. If current set already exists, it is overwritten. -
readUnion
Description copied from interface:RSet
Union sets specified by name with current set without current set state change. -
diff
Description copied from interface:RSet
Diff sets specified by name and write to current set. If current set already exists, it is overwritten. -
readDiff
Description copied from interface:RSet
Diff sets specified by name with current set. Without current set state change. -
intersection
Description copied from interface:RSet
Intersection sets specified by name and write to current set. If current set already exists, it is overwritten.- Specified by:
intersection
in interfaceRSet<V>
- Parameters:
names
- - name of sets- Returns:
- size of intersection
-
readIntersection
Description copied from interface:RSet
Intersection sets specified by name with current set without current set state change.- Specified by:
readIntersection
in interfaceRSet<V>
- Parameters:
names
- - name of sets- Returns:
- values
-
countIntersection
Description copied from interface:RSet
Counts elements of set as a result of sets intersection with current set.Requires Redis 7.0.0 and higher.
- Specified by:
countIntersection
in interfaceRSet<V>
- Parameters:
names
- - name of sets- Returns:
- amount of elements
-
countIntersection
Description copied from interface:RSet
Counts elements of set as a result of sets intersection with current set.Requires Redis 7.0.0 and higher.
- Specified by:
countIntersection
in interfaceRSet<V>
- Parameters:
limit
- - sets intersection limitnames
- - name of sets- Returns:
- amount of elements
-
containsEach
Description copied from interface:RSet
Check if each element is contained in the specified collection. Returns contained elements.Requires Redis 6.2.0 and higher.
- Specified by:
containsEach
in interfaceRSet<V>
- Parameters:
c
- - collection to check- Returns:
- contained elements
-
removeRandomAsync
Description copied from interface:RSetAsync
Removes and returns random elements from set in async mode- Specified by:
removeRandomAsync
in interfaceRSetAsync<V>
- Parameters:
amount
- of random values- Returns:
- random values
-
removeRandomAsync
Description copied from interface:RSetAsync
Removes and returns random element from set in async mode- Specified by:
removeRandomAsync
in interfaceRSetAsync<V>
- Returns:
- value
-
randomAsync
Description copied from interface:RSetAsync
Returns random element from set in async mode- Specified by:
randomAsync
in interfaceRSetAsync<V>
- Returns:
- value
-
randomAsync
Description copied from interface:RSetAsync
Returns random elements from set limited bycount
- Specified by:
randomAsync
in interfaceRSetAsync<V>
- Parameters:
count
- - values amount to return- Returns:
- value
-
moveAsync
Description copied from interface:RSetAsync
Move a member from this set to the given destination set in async mode. -
unionAsync
Description copied from interface:RSetAsync
Union sets specified by name and write to current set. If current set already exists, it is overwritten.- Specified by:
unionAsync
in interfaceRSetAsync<V>
- Parameters:
names
- - name of sets- Returns:
- size of union
-
readUnionAsync
Description copied from interface:RSetAsync
Union sets specified by name with current set. Without current set state change.- Specified by:
readUnionAsync
in interfaceRSetAsync<V>
- Parameters:
names
- - name of sets- Returns:
- values
-
diffAsync
Description copied from interface:RSetAsync
Diff sets specified by name and write to current set. If current set already exists, it is overwritten. -
readDiffAsync
Description copied from interface:RSetAsync
Diff sets specified by name with current set. Without current set state change.- Specified by:
readDiffAsync
in interfaceRSetAsync<V>
- Parameters:
names
- - name of sets- Returns:
- values
-
intersectionAsync
Description copied from interface:RSetAsync
Intersection sets specified by name and write to current set. If current set already exists, it is overwritten.- Specified by:
intersectionAsync
in interfaceRSetAsync<V>
- Parameters:
names
- - name of sets- Returns:
- size of intersection
-
readIntersectionAsync
Description copied from interface:RSetAsync
Intersection sets specified by name with current set. Without current set state change.- Specified by:
readIntersectionAsync
in interfaceRSetAsync<V>
- Parameters:
names
- - name of sets- Returns:
- values
-
countIntersectionAsync
Description copied from interface:RSetAsync
Counts elements of set as a result of sets intersection with current set.Requires Redis 7.0.0 and higher.
- Specified by:
countIntersectionAsync
in interfaceRSetAsync<V>
- Parameters:
names
- - name of sets- Returns:
- amount of elements
-
countIntersectionAsync
Description copied from interface:RSetAsync
Counts elements of set as a result of sets intersection with current set.Requires Redis 7.0.0 and higher.
- Specified by:
countIntersectionAsync
in interfaceRSetAsync<V>
- Parameters:
limit
- - sets intersection limitnames
- - name of sets- Returns:
- amount of elements
-
addAllCountedAsync
Description copied from interface:RSetAsync
Adds all elements contained in the specified collection. Returns number of added elements.- Specified by:
addAllCountedAsync
in interfaceRSetAsync<V>
- Parameters:
c
- - collection of elements to add- Returns:
- number of added elements
-
removeAllCountedAsync
Description copied from interface:RSetAsync
Removes all elements contained in the specified collection. Returns number of removed elements.- Specified by:
removeAllCountedAsync
in interfaceRSetAsync<V>
- Parameters:
c
- - collection of elements to add- Returns:
- number of removed elements
-
containsEachAsync
Description copied from interface:RSetAsync
Check if each element is contained in the specified collection. Returns contained elements.Requires Redis 6.2.0 and higher.
- Specified by:
containsEachAsync
in interfaceRSetAsync<V>
- Parameters:
c
- - collection to check- Returns:
- contained elements
-
readSort
Description copied from interface:RSortable
Read data in sorted view -
readSort
Description copied from interface:RSortable
Read data in sorted view -
readSort
Description copied from interface:RSortable
Read data in sorted view -
readSort
Description copied from interface:RSortable
Read data in sorted view -
readSort
Description copied from interface:RSortable
Read data in sorted view -
readSort
public <T> Collection<T> readSort(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Description copied from interface:RSortable
Read data in sorted view- Specified by:
readSort
in interfaceRSortable<V>
- Type Parameters:
T
- object type- Parameters:
byPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection
-
readSortAlpha
Description copied from interface:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in interfaceRSortable<V>
- Parameters:
order
- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
Description copied from interface:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in interfaceRSortable<V>
- Parameters:
order
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
Description copied from interface:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in interfaceRSortable<V>
- Parameters:
byPattern
- that is used to generate the keys that are used for sortingorder
- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
Description copied from interface:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in interfaceRSortable<V>
- Parameters:
byPattern
- that is used to generate the keys that are used for sortingorder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
Description copied from interface:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in interfaceRSortable<V>
- Type Parameters:
T
- object type- Parameters:
byPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlpha
public <T> Collection<T> readSortAlpha(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Description copied from interface:RSortable
Read data in sorted view lexicographically- Specified by:
readSortAlpha
in interfaceRSortable<V>
- Type Parameters:
T
- object type- Parameters:
byPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection lexicographically
-
sortTo
Description copied from interface:RSortable
Sort data and store todestName
list -
sortTo
Description copied from interface:RSortable
Sort data and store todestName
list -
sortTo
Description copied from interface:RSortable
Sort data and store todestName
list -
sortTo
Description copied from interface:RSortable
Sort data and store todestName
list -
sortTo
Description copied from interface:RSortable
Sort data and store todestName
list -
sortTo
public int sortTo(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Description copied from interface:RSortable
Sort data and store todestName
list- Specified by:
sortTo
in interfaceRSortable<V>
- Parameters:
destName
- list object destinationbyPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- length of sorted data
-
readSortAsync
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in interfaceRSortableAsync<V>
- Parameters:
order
- for sorted data- Returns:
- sorted collection
-
readSortAsync
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in interfaceRSortableAsync<V>
- Parameters:
order
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection
-
readSortAsync
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in interfaceRSortableAsync<V>
- Parameters:
byPattern
- that is used to generate the keys that are used for sortingorder
- for sorted data- Returns:
- sorted collection
-
readSortAsync
Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in interfaceRSortableAsync<V>
- Parameters:
byPattern
- that is used to generate the keys that are used for sortingorder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection
-
readSortAsync
public <T> RFuture<Collection<T>> readSortAsync(String byPattern, List<String> getPatterns, SortOrder order) Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in interfaceRSortableAsync<V>
- Type Parameters:
T
- object type- Parameters:
byPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted data- Returns:
- sorted collection
-
readSortAsync
public <T> RFuture<Collection<T>> readSortAsync(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Description copied from interface:RSortableAsync
Read data in sorted view- Specified by:
readSortAsync
in interfaceRSortableAsync<V>
- Type Parameters:
T
- object type- Parameters:
byPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection
-
readSortAlphaAsync
Description copied from interface:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in interfaceRSortableAsync<V>
- Parameters:
order
- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
Description copied from interface:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in interfaceRSortableAsync<V>
- Parameters:
order
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
Description copied from interface:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in interfaceRSortableAsync<V>
- Parameters:
byPattern
- that is used to generate the keys that are used for sortingorder
- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
Description copied from interface:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in interfaceRSortableAsync<V>
- Parameters:
byPattern
- that is used to generate the keys that are used for sortingorder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public <T> RFuture<Collection<T>> readSortAlphaAsync(String byPattern, List<String> getPatterns, SortOrder order) Description copied from interface:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in interfaceRSortableAsync<V>
- Type Parameters:
T
- object type- Parameters:
byPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted data- Returns:
- sorted collection lexicographically
-
readSortAlphaAsync
public <T> RFuture<Collection<T>> readSortAlphaAsync(String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Description copied from interface:RSortableAsync
Read data in sorted view lexicographically- Specified by:
readSortAlphaAsync
in interfaceRSortableAsync<V>
- Type Parameters:
T
- object type- Parameters:
byPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- sorted collection lexicographically
-
sortToAsync
Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in interfaceRSortableAsync<V>
- Parameters:
destName
- list object destinationorder
- for sorted data- Returns:
- length of sorted data
-
sortToAsync
Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in interfaceRSortableAsync<V>
- Parameters:
destName
- list object destinationorder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- length of sorted data
-
sortToAsync
Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in interfaceRSortableAsync<V>
- Parameters:
destName
- list object destinationbyPattern
- that is used to generate the keys that are used for sortingorder
- for sorted data- Returns:
- length of sorted data
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, SortOrder order, int offset, int count) Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in interfaceRSortableAsync<V>
- Parameters:
destName
- list object destinationbyPattern
- that is used to generate the keys that are used for sortingorder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- length of sorted data
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order) Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in interfaceRSortableAsync<V>
- Parameters:
destName
- list object destinationbyPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted data- Returns:
- length of sorted data
-
sortToAsync
public RFuture<Integer> sortToAsync(String destName, String byPattern, List<String> getPatterns, SortOrder order, int offset, int count) Description copied from interface:RSortableAsync
Sort data and store todestName
list- Specified by:
sortToAsync
in interfaceRSortableAsync<V>
- Parameters:
destName
- list object destinationbyPattern
- that is used to generate the keys that are used for sortinggetPatterns
- that is used to load values by keys in sorted vieworder
- for sorted dataoffset
- of sorted datacount
- of sorted data- Returns:
- length of sorted data
-
addIfAbsent
Description copied from interface:RSetCache
Adds element to this set only if has not been added before.Requires Redis 3.0.2 and higher.
- Specified by:
addIfAbsent
in interfaceRSetCache<V>
- Parameters:
ttl
- - object ttlobject
- - object itself- Returns:
true
if element added andfalse
if not.
-
addIfExists
Description copied from interface:RSetCache
Adds element to this set only if it's already exists.Requires Redis 3.0.2 and higher.
- Specified by:
addIfExists
in interfaceRSetCache<V>
- Parameters:
ttl
- - object ttlobject
- - object itself- Returns:
true
if element added andfalse
if not.
-
addIfLess
Description copied from interface:RSetCache
Adds element to this set only if new ttl less than current ttl of existed element.Requires Redis 6.2.0 and higher.
-
addIfGreater
Description copied from interface:RSetCache
Adds element to this set only if new ttl greater than current ttl of existed element.Requires Redis 6.2.0 and higher.
- Specified by:
addIfGreater
in interfaceRSetCache<V>
- Parameters:
ttl
- - object ttlobject
- - object itself- Returns:
true
if element added andfalse
if not.
-
addIfAbsentAsync
Description copied from interface:RSetCacheAsync
Adds element to this set only if has not been added before.Requires Redis 3.0.2 and higher.
- Specified by:
addIfAbsentAsync
in interfaceRSetCacheAsync<V>
- Parameters:
ttl
- - object ttlobject
- - object itself- Returns:
true
if element added andfalse
if not.
-
addIfExistsAsync
Description copied from interface:RSetCacheAsync
Adds element to this set only if it's already exists.Requires Redis 3.0.2 and higher.
- Specified by:
addIfExistsAsync
in interfaceRSetCacheAsync<V>
- Parameters:
ttl
- - object ttlobject
- - object itself- Returns:
true
if element added andfalse
if not.
-
addIfLessAsync
Description copied from interface:RSetCacheAsync
Adds element to this set only if new ttl less than current ttl of existed element.Requires Redis 6.2.0 and higher.
- Specified by:
addIfLessAsync
in interfaceRSetCacheAsync<V>
- Parameters:
ttl
- - object ttlobject
- - object itself- Returns:
true
if element added andfalse
if not.
-
addIfGreaterAsync
Description copied from interface:RSetCacheAsync
Adds element to this set only if new ttl greater than current ttl of existed element.Requires Redis 6.2.0 and higher.
- Specified by:
addIfGreaterAsync
in interfaceRSetCacheAsync<V>
- Parameters:
ttl
- - object ttlobject
- - object itself- Returns:
true
if element added andfalse
if not.
-
addAllIfAbsent
Description copied from interface:RSetCache
Adds elements to this set only if they haven't been added before.Requires Redis 3.0.2 and higher.
- Specified by:
addAllIfAbsent
in interfaceRSetCache<V>
- Parameters:
objects
- map of elements to add- Returns:
- amount of added elements
-
addAllIfExist
Description copied from interface:RSetCache
Adds elements to this set only if they already exist.Requires Redis 3.0.2 and higher.
- Specified by:
addAllIfExist
in interfaceRSetCache<V>
- Parameters:
objects
- map of elements to add- Returns:
- amount of added elements
-
addAllIfGreater
Description copied from interface:RSetCache
Adds elements to this set only if new ttl greater than current ttl of existed elements.Requires Redis 6.2.0 and higher.
- Specified by:
addAllIfGreater
in interfaceRSetCache<V>
- Parameters:
objects
- map of elements to add- Returns:
- amount of added elements
-
addAllIfLess
Description copied from interface:RSetCache
Adds elements to this set only if new ttl less than current ttl of existed elements.Requires Redis 6.2.0 and higher.
- Specified by:
addAllIfLess
in interfaceRSetCache<V>
- Parameters:
objects
- map of elements to add- Returns:
- amount of added elements
-
addAllIfAbsentAsync
Description copied from interface:RSetCacheAsync
Adds elements to this set only if they haven't been added before.Requires Redis 3.0.2 and higher.
- Specified by:
addAllIfAbsentAsync
in interfaceRSetCacheAsync<V>
- Parameters:
objects
- map of elements to add- Returns:
- amount of added elements
-
addAllIfExistAsync
Description copied from interface:RSetCacheAsync
Adds elements to this set only if they already exist.Requires Redis 3.0.2 and higher.
- Specified by:
addAllIfExistAsync
in interfaceRSetCacheAsync<V>
- Parameters:
objects
- map of elements to add- Returns:
- amount of added elements
-
addAllIfGreaterAsync
Description copied from interface:RSetCacheAsync
Adds elements to this set only if new ttl greater than current ttl of existed elements.Requires Redis 6.2.0 and higher.
- Specified by:
addAllIfGreaterAsync
in interfaceRSetCacheAsync<V>
- Parameters:
objects
- map of elements to add- Returns:
- amount of added elements
-
addAllIfLessAsync
Description copied from interface:RSetCacheAsync
Adds elements to this set only if new ttl less than current ttl of existed elements.Requires Redis 6.2.0 and higher.
- Specified by:
addAllIfLessAsync
in interfaceRSetCacheAsync<V>
- Parameters:
objects
- map of elements to add- Returns:
- amount of added elements
-
addAll
Description copied from interface:RSetCache
Adds all elements contained in the specified map to this sorted set. Map contains of ttl mapped by object. -
addAllAsync
Description copied from interface:RSetCacheAsync
Adds all elements contained in the specified map to this sorted set. Map contains of ttl mapped by object.- Specified by:
addAllAsync
in interfaceRSetCacheAsync<V>
- Parameters:
objects
- - map of elements to add- Returns:
- amount of added elements, not including already existing in this sorted set
-
expire
Description copied from interface:RExpirable
UseRExpirable.expire(Duration)
instead- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Duration)
instead- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
instant
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreater
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLess
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreater
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLess
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
clearExpireAsync
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
Description copied from interface:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
public long getExpireTime()Description copied from interface:RExpirable
Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTime
in interfaceRExpirable
- Returns:
- expiration time
-
getExpireTimeAsync
Description copied from interface:RExpirableAsync
Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsync
in interfaceRExpirableAsync
- Returns:
- expiration time
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
-