Package org.redisson
Class RedissonBoundedBlockingQueue<V>
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonList<V>
-
- org.redisson.RedissonQueue<V>
-
- org.redisson.RedissonBoundedBlockingQueue<V>
-
- All Implemented Interfaces:
Iterable<V>,Collection<V>,BlockingQueue<V>,List<V>,Queue<V>,RandomAccess,RBlockingQueue<V>,RBlockingQueueAsync<V>,RBoundedBlockingQueue<V>,RBoundedBlockingQueueAsync<V>,RCollectionAsync<V>,RExpirable,RExpirableAsync,RList<V>,RListAsync<V>,RObject,RObjectAsync,RQueue<V>,RQueueAsync<V>,RSortable<List<V>>,RSortableAsync<List<V>>
public class RedissonBoundedBlockingQueue<V> extends RedissonQueue<V> implements RBoundedBlockingQueue<V>
Distributed and concurrent implementation of bounded
BlockingQueue.- Author:
- Nikita Koksharov
-
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec, name
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRedissonBoundedBlockingQueue(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)protectedRedissonBoundedBlockingQueue(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RFuture<Boolean>addAllAsync(Collection<? extends V> c)Adds all elements contained in the specified collectionRFuture<Boolean>addAsync(V e)Adds element into this collection.voidclear()booleanclearExpire()Clear an expire timeout or expire date for object.RFuture<Boolean>clearExpireAsync()Clear an expire timeout or expire date for object in async mode.protected RFuture<Boolean>clearExpireAsync(String... keys)RFuture<Boolean>deleteAsync()Delete object in async modeintdrainTo(Collection<? super V> c)intdrainTo(Collection<? super V> c, int maxElements)RFuture<Integer>drainToAsync(Collection<? super V> c)Removes all available elements from this queue and adds them to the given collection in async mode.RFuture<Integer>drainToAsync(Collection<? super V> c, int maxElements)Removes at most the given number of available elements from this queue and adds them to the given collection in async mode.booleanexpire(long timeToLive, TimeUnit timeUnit)Set a timeout for object.booleanexpire(Instant instant)Set an expire date for object.RFuture<Boolean>expireAsync(long timeToLive, TimeUnit timeUnit)Set a timeout for object in async mode.protected RFuture<Boolean>expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)RFuture<Boolean>expireAsync(Instant instant)Set an expire date for object.booleanexpireAt(long timestamp)UseRExpirable.expire(Instant)insteadbooleanexpireAt(Date timestamp)UseRExpirable.expire(Instant)insteadRFuture<Boolean>expireAtAsync(long timestamp)UseRExpirableAsync.expireAsync(Instant)insteadprotected RFuture<Boolean>expireAtAsync(long timestamp, String... keys)RFuture<Boolean>expireAtAsync(Date timestamp)UseRExpirableAsync.expireAsync(Instant)insteadbooleanoffer(V e, long timeout, TimeUnit unit)RFuture<Boolean>offerAsync(V e)Inserts the specified element into this queue.RFuture<Boolean>offerAsync(V e, long timeout, TimeUnit unit)Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.Vpoll(long timeout, TimeUnit unit)RFuture<V>pollAsync()Retrieves and removes the head of this queue in async mode.RFuture<V>pollAsync(long timeout, TimeUnit unit)Retrieves and removes the head of this queue in async mode, waiting up to the specified wait time if necessary for an element to become available.VpollFromAny(long timeout, TimeUnit unit, String... queueNames)Retrieves and removes first available head element of any queue, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.RFuture<V>pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)Retrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.VpollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit)Retrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.RFuture<V>pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit)Retrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.voidput(V e)RFuture<Void>putAsync(V e)Inserts the specified element into this queue in async mode, waiting if necessary for space to become available.intremainingCapacity()longremainTimeToLive()Remaining time to live of Redisson object that has a timeoutRFuture<Long>remainTimeToLiveAsync()Remaining time to live of Redisson object that has a timeoutRFuture<Boolean>removeAllAsync(Collection<?> c)Removes all of this collection's elements that are also contained in the specified collection.RFuture<Boolean>removeAsync(Object o)Removes a single instance of the specified element from this collection, if it is present.RFuture<Long>sizeInMemoryAsync()Returns bytes amount used by object in Redis memory.intsubscribeOnElements(Consumer<V> consumer)Subscribes on elements appeared in this queue.Vtake()RFuture<V>takeAsync()Retrieves and removes the head of this queue in async mode, waiting if necessary until an element becomes available.VtakeLastAndOfferFirstTo(String queueName)Retrieves and removes last available tail element of any queue and adds it at the head ofqueueName, waiting if necessary for an element to become available in any of defined queues including queue itself.RFuture<V>takeLastAndOfferFirstToAsync(String queueName)Retrieves and removes last available tail element of any queue and adds it at the head ofqueueName, waiting if necessary for an element to become available in any of defined queues including queue itself.booleantrySetCapacity(int capacity)Sets queue capacity only if it is not set before.RFuture<Boolean>trySetCapacityAsync(int capacity)Sets queue capacity only if it is not set before.voidunsubscribe(int listenerId)Un-subscribes defined listener.-
Methods inherited from class org.redisson.RedissonQueue
element, getFirst, offer, peek, peekAsync, poll, poll, pollAsync, pollLastAndOfferFirstTo, pollLastAndOfferFirstToAsync, remove, removeFirst
-
Methods inherited from class org.redisson.RedissonList
add, add, addAfter, addAfterAsync, addAll, addAll, addAllAsync, addAsync, addAsync, addBefore, addBeforeAsync, addListener, addListenerAsync, contains, containsAll, containsAllAsync, containsAsync, equals, fastRemove, fastRemoveAsync, fastSet, fastSetAsync, get, get, getAsync, getAsync, hashCode, indexOf, indexOfAsync, indexOfAsync, isEmpty, iterator, lastIndexOf, lastIndexOfAsync, lastIndexOfAsync, listIterator, listIterator, mapReduce, range, range, rangeAsync, rangeAsync, readAll, readAllAsync, readSort, readSort, readSort, readSort, readSort, readSort, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, remove, remove, remove, removeAll, removeAsync, removeAsync, removeIf, removeListener, removeListenerAsync, retainAll, retainAllAsync, set, setAsync, size, sizeAsync, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, subList, toArray, toArray, toString, trim, trimAsync
-
Methods inherited from class org.redisson.RedissonObject
addListener, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, offer, remove
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Methods inherited from interface org.redisson.api.RCollectionAsync
containsAllAsync, containsAsync, retainAllAsync, sizeAsync
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
expireAsync, expireAtAsync, expireAtAsync, 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, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RQueue
addListener, poll, pollLastAndOfferFirstTo, readAll
-
Methods inherited from interface org.redisson.api.RQueueAsync
addListenerAsync, peekAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsync
-
-
-
-
Constructor Detail
-
RedissonBoundedBlockingQueue
protected RedissonBoundedBlockingQueue(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
RedissonBoundedBlockingQueue
protected RedissonBoundedBlockingQueue(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
-
-
Method Detail
-
addAsync
public RFuture<Boolean> addAsync(V e)
Description copied from interface:RCollectionAsyncAdds element into this collection.- Specified by:
addAsyncin interfaceRCollectionAsync<V>- Overrides:
addAsyncin classRedissonList<V>- Parameters:
e- - element to add- Returns:
trueif an element was added andfalseif it is already present
-
putAsync
public RFuture<Void> putAsync(V e)
Description copied from interface:RBlockingQueueAsyncInserts the specified element into this queue in async mode, waiting if necessary for space to become available.- Specified by:
putAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
e- the element to add- Returns:
- void
-
put
public void put(V e) throws InterruptedException
- Specified by:
putin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
offerAsync
public RFuture<Boolean> offerAsync(V e)
Description copied from interface:RQueueAsyncInserts the specified element into this queue.- Specified by:
offerAsyncin interfaceRQueueAsync<V>- Overrides:
offerAsyncin classRedissonQueue<V>- Parameters:
e- the element to add- Returns:
trueif successful, orfalse
-
offer
public boolean offer(V e, long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
offerin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
offerAsync
public RFuture<Boolean> offerAsync(V e, long timeout, TimeUnit unit)
Description copied from interface:RBoundedBlockingQueueAsyncInserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.- Specified by:
offerAsyncin interfaceRBoundedBlockingQueueAsync<V>- Parameters:
e- the element to addtimeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
trueif successful, orfalseif the specified waiting time elapses before space is available
-
takeAsync
public RFuture<V> takeAsync()
Description copied from interface:RBlockingQueueAsyncRetrieves and removes the head of this queue in async mode, waiting if necessary until an element becomes available.- Specified by:
takeAsyncin interfaceRBlockingQueueAsync<V>- Returns:
- the head of this queue
-
removeAsync
public RFuture<Boolean> removeAsync(Object o)
Description copied from interface:RCollectionAsyncRemoves a single instance of the specified element from this collection, if it is present.- Specified by:
removeAsyncin interfaceRCollectionAsync<V>- Overrides:
removeAsyncin classRedissonList<V>- Parameters:
o- element to be removed from this collection, if present- Returns:
trueif an element was removed as a result of this call
-
removeAllAsync
public RFuture<Boolean> removeAllAsync(Collection<?> c)
Description copied from interface:RCollectionAsyncRemoves all of this collection's elements that are also contained in the specified collection.- Specified by:
removeAllAsyncin interfaceRCollectionAsync<V>- Overrides:
removeAllAsyncin classRedissonList<V>- Parameters:
c- collection containing elements to be removed from this collection- Returns:
trueif this collection changed as a result of the call
-
pollAsync
public RFuture<V> pollAsync()
Description copied from interface:RQueueAsyncRetrieves and removes the head of this queue in async mode.- Specified by:
pollAsyncin interfaceRQueueAsync<V>- Overrides:
pollAsyncin classRedissonQueue<V>- Returns:
- the head of this queue, or
null
-
take
public V take() throws InterruptedException
- Specified by:
takein interfaceBlockingQueue<V>- Throws:
InterruptedException
-
pollAsync
public RFuture<V> pollAsync(long timeout, TimeUnit unit)
Description copied from interface:RBlockingQueueAsyncRetrieves and removes the head of this queue in async mode, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available
-
poll
public V poll(long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
pollin interfaceBlockingQueue<V>- Throws:
InterruptedException
-
pollFromAny
public V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
Description copied from interface:RBlockingQueueRetrieves and removes first available head element of any queue, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
pollFromAnyin interfaceRBlockingQueue<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameterqueueNames- - queue names. Queue name itself is always included- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
pollFromAnyAsync
public RFuture<V> pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)
Description copied from interface:RBlockingQueueAsyncRetrieves and removes first available head element of any queue in async mode, waiting up to the specified wait time if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
pollFromAnyAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameterqueueNames- - queue names. Queue name itself is always included- Returns:
- Future object with the head of this queue, or
nullif the specified waiting time elapses before an element is available
-
takeLastAndOfferFirstTo
public V takeLastAndOfferFirstTo(String queueName) throws InterruptedException
Description copied from interface:RBlockingQueueRetrieves and removes last available tail element of any queue and adds it at the head ofqueueName, waiting if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
takeLastAndOfferFirstToin interfaceRBlockingQueue<V>- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
subscribeOnElements
public int subscribeOnElements(Consumer<V> consumer)
Description copied from interface:RBlockingQueueSubscribes on elements appeared in this queue. Continuously invokesRBlockingQueueAsync.takeAsync()method to get a new element.- Specified by:
subscribeOnElementsin interfaceRBlockingQueue<V>- Parameters:
consumer- - queue elements listener- Returns:
- listenerId - id of listener
-
unsubscribe
public void unsubscribe(int listenerId)
Description copied from interface:RBlockingQueueUn-subscribes defined listener.- Specified by:
unsubscribein interfaceRBlockingQueue<V>- Parameters:
listenerId- - id of listener
-
takeLastAndOfferFirstToAsync
public RFuture<V> takeLastAndOfferFirstToAsync(String queueName)
Description copied from interface:RBlockingQueueAsyncRetrieves and removes last available tail element of any queue and adds it at the head ofqueueName, waiting if necessary for an element to become available in any of defined queues including queue itself.- Specified by:
takeLastAndOfferFirstToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
queueName- - names of destination queue- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollLastAndOfferFirstToAsync
public RFuture<V> pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit)
Description copied from interface:RBlockingQueueAsyncRetrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollLastAndOfferFirstToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
queueName- - names of destination queuetimeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available
-
pollLastAndOfferFirstTo
public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException
Description copied from interface:RBlockingQueueRetrieves and removes last available tail element of this queue and adds it at the head ofqueueName, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollLastAndOfferFirstToin interfaceRBlockingQueue<V>- Parameters:
queueName- - names of destination queuetimeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the tail of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacityin interfaceBlockingQueue<V>
-
drainTo
public int drainTo(Collection<? super V> c)
- Specified by:
drainToin interfaceBlockingQueue<V>
-
drainToAsync
public RFuture<Integer> drainToAsync(Collection<? super V> c)
Description copied from interface:RBlockingQueueAsyncRemoves all available elements from this queue and adds them to the given collection in async mode. This operation may be more efficient than repeatedly polling this queue. A failure encountered while attempting to add elements to collectioncmay result in elements being in neither, either or both collections when the associated exception is thrown. Attempts to drain a queue to itself result inIllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress.- Specified by:
drainToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
c- the collection to transfer elements into- Returns:
- the number of elements transferred
-
drainTo
public int drainTo(Collection<? super V> c, int maxElements)
- Specified by:
drainToin interfaceBlockingQueue<V>
-
drainToAsync
public RFuture<Integer> drainToAsync(Collection<? super V> c, int maxElements)
Description copied from interface:RBlockingQueueAsyncRemoves at most the given number of available elements from this queue and adds them to the given collection in async mode. A failure encountered while attempting to add elements to collectioncmay result in elements being in neither, either or both collections when the associated exception is thrown. Attempts to drain a queue to itself result inIllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress.- Specified by:
drainToAsyncin interfaceRBlockingQueueAsync<V>- Parameters:
c- the collection to transfer elements intomaxElements- the maximum number of elements to transfer- Returns:
- the number of elements transferred
-
trySetCapacityAsync
public RFuture<Boolean> trySetCapacityAsync(int capacity)
Description copied from interface:RBoundedBlockingQueueAsyncSets queue capacity only if it is not set before.- Specified by:
trySetCapacityAsyncin interfaceRBoundedBlockingQueueAsync<V>- Parameters:
capacity- - queue capacity- Returns:
trueif capacity set successfullyfalseif capacity already set
-
trySetCapacity
public boolean trySetCapacity(int capacity)
Description copied from interface:RBoundedBlockingQueueSets queue capacity only if it is not set before.- Specified by:
trySetCapacityin interfaceRBoundedBlockingQueue<V>- Parameters:
capacity- - queue capacity- Returns:
trueif capacity set successfullyfalseif capacity already set
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<V>- Specified by:
clearin interfaceList<V>- Overrides:
clearin classRedissonList<V>
-
deleteAsync
public RFuture<Boolean> deleteAsync()
Description copied from interface:RObjectAsyncDelete object in async mode- Specified by:
deleteAsyncin interfaceRObjectAsync- Overrides:
deleteAsyncin classRedissonObject- Returns:
trueif object was deletedfalseif not
-
sizeInMemoryAsync
public RFuture<Long> sizeInMemoryAsync()
Description copied from interface:RObjectAsyncReturns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryAsyncin interfaceRObjectAsync- Overrides:
sizeInMemoryAsyncin classRedissonObject- Returns:
- size in bytes
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirableAsyncSet a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
clearExpireAsync
public RFuture<Boolean> clearExpireAsync()
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
addAllAsync
public RFuture<Boolean> addAllAsync(Collection<? extends V> c)
Description copied from interface:RCollectionAsyncAdds all elements contained in the specified collection- Specified by:
addAllAsyncin interfaceRCollectionAsync<V>- Overrides:
addAllAsyncin classRedissonList<V>- Parameters:
c- - collection of elements to add- Returns:
trueif at least one element was added andfalseif all elements are already present
-
expire
public boolean expire(long timeToLive, TimeUnit timeUnit)Description copied from interface:RExpirableSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
public boolean expire(Instant instant)
Description copied from interface:RExpirableSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
public RFuture<Boolean> expireAsync(Instant instant)
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(Date timestamp)
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(Date timestamp)
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirableRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLivein interfaceRExpirable- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
public RFuture<Long> remainTimeToLiveAsync()
Description copied from interface:RExpirableAsyncRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsyncin interfaceRExpirableAsync- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
expireAsync
protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
-
-