public class RedissonBlockingDeque<V> extends RedissonDeque<V> implements RBlockingDeque<V>
Distributed and concurrent implementation of BlockingDeque.
Queue size limited by Redis server memory amount. This is why remainingCapacity() always
returns Integer.MAX_VALUE
codec, commandExecutor| Modifier | Constructor and Description |
|---|---|
protected |
RedissonBlockingDeque(Codec codec,
CommandAsyncExecutor commandExecutor,
String name,
RedissonClient redisson) |
protected |
RedissonBlockingDeque(CommandAsyncExecutor commandExecutor,
String name,
RedissonClient redisson) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
clearExpire()
Clear an expire timeout or expire date for object.
|
RFuture<Boolean> |
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.
|
int |
drainTo(Collection<? super V> c) |
int |
drainTo(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.
|
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object in async mode.
|
boolean |
expireAt(Date timestamp)
Set an expire date for object.
|
boolean |
expireAt(long timestamp)
Set an expire date for object.
|
RFuture<Boolean> |
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.
|
RFuture<Boolean> |
expireAtAsync(long timestamp)
Set an expire date for object in async mode.
|
boolean |
offer(V e,
long timeout,
TimeUnit unit) |
boolean |
offerFirst(V e,
long timeout,
TimeUnit unit) |
boolean |
offerLast(V e,
long timeout,
TimeUnit unit) |
V |
poll(long timeout,
TimeUnit unit) |
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.
|
V |
pollFirst(long timeout,
TimeUnit unit) |
RFuture<V> |
pollFirstAsync(long timeout,
TimeUnit unit) |
V |
pollFirstFromAny(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 own.
|
RFuture<V> |
pollFirstFromAnyAsync(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 own.
|
V |
pollFromAny(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 own.
|
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 own.
|
V |
pollLast(long timeout,
TimeUnit unit) |
V |
pollLastAndOfferFirstTo(String queueName,
long timeout,
TimeUnit unit) |
RFuture<V> |
pollLastAndOfferFirstToAsync(String queueName,
long timeout,
TimeUnit unit) |
RFuture<V> |
pollLastAsync(long timeout,
TimeUnit unit) |
V |
pollLastFromAny(long timeout,
TimeUnit unit,
String... queueNames)
Retrieves and removes first available tail 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 own.
|
RFuture<V> |
pollLastFromAnyAsync(long timeout,
TimeUnit unit,
String... queueNames)
Retrieves and removes first available tail 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 own.
|
void |
put(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.
|
void |
putFirst(V e) |
RFuture<Void> |
putFirstAsync(V e) |
void |
putLast(V e) |
RFuture<Void> |
putLastAsync(V e) |
int |
remainingCapacity() |
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout
|
V |
take() |
RFuture<V> |
takeAsync()
Retrieves and removes the head of this queue in async mode, waiting if necessary
until an element becomes available.
|
V |
takeFirst() |
RFuture<V> |
takeFirstAsync() |
V |
takeLast() |
V |
takeLastAndOfferFirstTo(String queueName) |
RFuture<V> |
takeLastAndOfferFirstToAsync(String queueName) |
RFuture<V> |
takeLastAsync() |
addFirst, addFirstAsync, addLast, addLastAsync, descendingIterator, getLast, getLastAsync, offerFirst, offerFirstAsync, offerLast, offerLastAsync, peekFirst, peekFirstAsync, peekLast, peekLastAsync, pollFirst, pollFirstAsync, pollLast, pollLastAsync, pop, popAsync, push, pushAsync, removeFirstAsync, removeFirstOccurrence, removeFirstOccurrenceAsync, removeLast, removeLastAsync, removeLastOccurrence, removeLastOccurrenceAsyncelement, getFirst, offer, offerAsync, peek, peekAsync, poll, pollAsync, pollLastAndOfferFirstTo, pollLastAndOfferFirstToAsync, remove, removeFirstadd, add, addAfter, addAfterAsync, addAll, addAll, addAllAsync, addAllAsync, addAsync, addAsync, addBefore, addBeforeAsync, clear, 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, readAll, readAllAsync, readSort, readSort, readSort, readSort, readSort, readSort, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, remove, remove, remove, remove, removeAll, removeAllAsync, removeAsync, removeAsync, removeAsync, retainAll, retainAllAsync, set, setAsync, size, sizeAsync, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, subList, toArray, toArray, toString, trim, trimAsyncawait, copy, copyAsync, delete, deleteAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, rename, renameAsync, renamenx, renamenxAsync, suffixName, toSeconds, touch, touchAsync, unlink, unlinkAsyncclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addFirst, addLast, contains, element, iterator, offer, offerFirst, offerLast, peek, poll, push, remove, remove, removeFirstOccurrence, removeLastOccurrence, sizedescendingIterator, getFirst, getLast, peekFirst, peekLast, pollFirst, pollLast, pop, removeFirst, removeLastpollLastAndOfferFirstTo, readAlladdAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArrayclearExpire, expire, expireAt, expireAt, remainTimeToLivecopy, delete, getCodec, getName, isExists, migrate, move, rename, renamenx, touch, unlinkaddFirstAsync, addLastAsync, getLastAsync, offerFirstAsync, offerLastAsync, peekFirstAsync, peekLastAsync, pollFirstAsync, pollLastAsync, popAsync, pushAsync, removeFirstAsync, removeFirstOccurrenceAsync, removeLastAsync, removeLastOccurrenceAsyncofferAsync, peekAsync, pollAsync, pollLastAndOfferFirstToAsync, readAllAsyncaddAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsyncclearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsynccopyAsync, deleteAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, touchAsync, unlinkAsyncreplaceAll, sort, spliteratorprotected RedissonBlockingDeque(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
protected RedissonBlockingDeque(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson)
public RFuture<Void> putAsync(V e)
RBlockingQueueAsyncputAsync in interface RBlockingQueueAsync<V>e - the element to addpublic void put(V e) throws InterruptedException
put in interface BlockingDeque<V>put in interface BlockingQueue<V>InterruptedExceptionpublic boolean offer(V e, long timeout, TimeUnit unit) throws InterruptedException
offer in interface BlockingDeque<V>offer in interface BlockingQueue<V>InterruptedExceptionpublic RFuture<V> takeAsync()
RBlockingQueueAsynctakeAsync in interface RBlockingQueueAsync<V>public V take() throws InterruptedException
take in interface BlockingDeque<V>take in interface BlockingQueue<V>InterruptedExceptionpublic RFuture<V> pollAsync(long timeout, TimeUnit unit)
RBlockingQueueAsyncpollAsync in interface RBlockingQueueAsync<V>timeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameternull if the
specified waiting time elapses before an element is availablepublic V poll(long timeout, TimeUnit unit) throws InterruptedException
poll in interface BlockingDeque<V>poll in interface BlockingQueue<V>InterruptedExceptionpublic V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
RBlockingQueuepollFromAny in interface RBlockingQueue<V>timeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterqueueNames - - names of queuenull if the
specified waiting time elapses before an element is availableInterruptedException - if interrupted while waitingpublic RFuture<V> pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)
RBlockingQueueAsyncpollFromAnyAsync in interface RBlockingQueueAsync<V>timeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterqueueNames - - names of queuenull if the
specified waiting time elapses before an element is availablepublic RFuture<V> pollLastAndOfferFirstToAsync(String queueName, long timeout, TimeUnit unit)
pollLastAndOfferFirstToAsync in interface RBlockingQueueAsync<V>public V pollLastAndOfferFirstTo(String queueName, long timeout, TimeUnit unit) throws InterruptedException
pollLastAndOfferFirstTo in interface RBlockingQueue<V>InterruptedExceptionpublic V takeLastAndOfferFirstTo(String queueName) throws InterruptedException
takeLastAndOfferFirstTo in interface RBlockingQueue<V>InterruptedExceptionpublic RFuture<V> takeLastAndOfferFirstToAsync(String queueName)
takeLastAndOfferFirstToAsync in interface RBlockingQueueAsync<V>public int remainingCapacity()
remainingCapacity in interface BlockingQueue<V>public int drainTo(Collection<? super V> c)
drainTo in interface BlockingQueue<V>public RFuture<Integer> drainToAsync(Collection<? super V> c)
RBlockingQueueAsyncc may result in elements being in neither,
either or both collections when the associated exception is
thrown. Attempts to drain a queue to itself result in
IllegalArgumentException. Further, the behavior of
this operation is undefined if the specified collection is
modified while the operation is in progress.drainToAsync in interface RBlockingQueueAsync<V>c - the collection to transfer elements intopublic int drainTo(Collection<? super V> c, int maxElements)
drainTo in interface BlockingQueue<V>public RFuture<Integer> drainToAsync(Collection<? super V> c, int maxElements)
RBlockingQueueAsyncc may result in elements being in neither,
either or both collections when the associated exception is
thrown. Attempts to drain a queue to itself result in
IllegalArgumentException. Further, the behavior of
this operation is undefined if the specified collection is
modified while the operation is in progress.drainToAsync in interface RBlockingQueueAsync<V>c - the collection to transfer elements intomaxElements - the maximum number of elements to transferpublic RFuture<Void> putFirstAsync(V e)
putFirstAsync in interface RBlockingDequeAsync<V>public RFuture<Void> putLastAsync(V e)
putLastAsync in interface RBlockingDequeAsync<V>public void putFirst(V e) throws InterruptedException
putFirst in interface BlockingDeque<V>InterruptedExceptionpublic void putLast(V e) throws InterruptedException
putLast in interface BlockingDeque<V>InterruptedExceptionpublic boolean offerFirst(V e, long timeout, TimeUnit unit) throws InterruptedException
offerFirst in interface BlockingDeque<V>InterruptedExceptionpublic boolean offerLast(V e, long timeout, TimeUnit unit) throws InterruptedException
offerLast in interface BlockingDeque<V>InterruptedExceptionpublic V takeFirst() throws InterruptedException
takeFirst in interface BlockingDeque<V>InterruptedExceptionpublic RFuture<V> takeFirstAsync()
takeFirstAsync in interface RBlockingDequeAsync<V>public RFuture<V> takeLastAsync()
takeLastAsync in interface RBlockingDequeAsync<V>public V takeLast() throws InterruptedException
takeLast in interface BlockingDeque<V>InterruptedExceptionpublic RFuture<V> pollFirstAsync(long timeout, TimeUnit unit)
pollFirstAsync in interface RBlockingDequeAsync<V>public V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
RBlockingDequepollFirstFromAny in interface RBlockingDeque<V>timeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterqueueNames - - names of queuenull if the
specified waiting time elapses before an element is availableInterruptedException - if interrupted while waitingpublic RFuture<V> pollFirstFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)
RBlockingDequeAsyncpollFirstFromAnyAsync in interface RBlockingDequeAsync<V>timeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterqueueNames - - names of queuenull if the
specified waiting time elapses before an element is availablepublic V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
RBlockingDequepollLastFromAny in interface RBlockingDeque<V>timeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterqueueNames - - names of queuenull if the
specified waiting time elapses before an element is availableInterruptedException - if interrupted while waitingpublic RFuture<V> pollLastFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)
RBlockingDequeAsyncpollLastFromAnyAsync in interface RBlockingDequeAsync<V>timeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterqueueNames - - names of queuenull if the
specified waiting time elapses before an element is availablepublic V pollFirst(long timeout, TimeUnit unit) throws InterruptedException
pollFirst in interface BlockingDeque<V>InterruptedExceptionpublic RFuture<V> pollLastAsync(long timeout, TimeUnit unit)
pollLastAsync in interface RBlockingDequeAsync<V>public V pollLast(long timeout, TimeUnit unit) throws InterruptedException
pollLast in interface BlockingDeque<V>InterruptedExceptionpublic boolean expire(long timeToLive,
TimeUnit timeUnit)
RExpirableexpire in interface RExpirabletimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsyncexpireAsync in interface RExpirableAsynctimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic boolean expireAt(long timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire date in seconds (Unix timestamp)true if the timeout was set and false if notpublic boolean expireAt(Date timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire datetrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire datetrue if the timeout was set and false if notpublic boolean clearExpire()
RExpirableclearExpire in interface RExpirabletrue if timeout was removed
false if object does not exist or does not have an associated timeoutpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsyncclearExpireAsync in interface RExpirableAsynctrue if the timeout was cleared and false if notpublic long remainTimeToLive()
RExpirableremainTimeToLive in interface RExpirablepublic RFuture<Long> remainTimeToLiveAsync()
RExpirableAsyncremainTimeToLiveAsync in interface RExpirableAsyncCopyright © 2014–2018 The Redisson Project. All rights reserved.