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
EVAL_BOOLEAN_ARGS2
Modifier | Constructor and Description |
---|---|
protected |
RedissonBlockingDeque(Codec codec,
CommandAsyncExecutor commandExecutor,
String name) |
protected |
RedissonBlockingDeque(CommandAsyncExecutor commandExecutor,
String name) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
await(io.netty.util.concurrent.Future<?> future,
long timeout,
TimeUnit timeoutUnit) |
boolean |
clearExpire()
Clear an expire timeout or expire date for object.
|
io.netty.util.concurrent.Future<Boolean> |
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.
|
boolean |
delete()
Deletes the object
|
io.netty.util.concurrent.Future<Boolean> |
deleteAsync()
Delete object in async mode
|
int |
drainTo(Collection<? super V> c) |
int |
drainTo(Collection<? super V> c,
int maxElements) |
io.netty.util.concurrent.Future<Integer> |
drainToAsync(Collection<? super V> c) |
io.netty.util.concurrent.Future<Integer> |
drainToAsync(Collection<? super V> c,
int maxElements) |
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
io.netty.util.concurrent.Future<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.
|
io.netty.util.concurrent.Future<Boolean> |
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.
|
io.netty.util.concurrent.Future<Boolean> |
expireAtAsync(long timestamp)
Set an expire date for object in async mode.
|
protected <V> V |
get(io.netty.util.concurrent.Future<V> future) |
String |
getName()
Returns name of object
|
boolean |
isExists()
Check object existence
|
io.netty.util.concurrent.Future<Boolean> |
isExistsAsync()
Check object existence in async mode.
|
void |
migrate(String host,
int port,
int database)
Transfer an object from source Redis instance to destination Redis instance
|
io.netty.util.concurrent.Future<Void> |
migrateAsync(String host,
int port,
int database)
Transfer an object from source Redis instance to destination Redis instance
in async mode
|
boolean |
move(int database)
Move object to another database
|
io.netty.util.concurrent.Future<Boolean> |
moveAsync(int database)
Move object to another database in async mode
|
protected <V> io.netty.util.concurrent.Promise<V> |
newPromise() |
protected <V> io.netty.util.concurrent.Future<V> |
newSucceededFuture(V result) |
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) |
io.netty.util.concurrent.Future<V> |
pollAsync(long timeout,
TimeUnit unit) |
V |
pollFirst(long timeout,
TimeUnit unit) |
io.netty.util.concurrent.Future<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.
|
io.netty.util.concurrent.Future<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.
|
io.netty.util.concurrent.Future<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) |
io.netty.util.concurrent.Future<V> |
pollLastAndOfferFirstToAsync(String queueName,
long timeout,
TimeUnit unit) |
io.netty.util.concurrent.Future<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.
|
io.netty.util.concurrent.Future<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) |
io.netty.util.concurrent.Future<Boolean> |
putAsync(V e) |
void |
putFirst(V e) |
io.netty.util.concurrent.Future<Void> |
putFirstAsync(V e) |
void |
putLast(V e) |
io.netty.util.concurrent.Future<Void> |
putLastAsync(V e) |
int |
remainingCapacity() |
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
io.netty.util.concurrent.Future<Long> |
remainTimeToLiveAsync()
Get remaining time to live of object in seconds.
|
void |
rename(String newName)
Rename current object key to
newName |
io.netty.util.concurrent.Future<Void> |
renameAsync(String newName)
Rename current object key to
newName
in async mode |
boolean |
renamenx(String newName)
Rename current object key to
newName
only if new key is not exists |
io.netty.util.concurrent.Future<Boolean> |
renamenxAsync(String newName)
Rename current object key to
newName
in async mode only if new key is not exists |
V |
take() |
io.netty.util.concurrent.Future<V> |
takeAsync() |
V |
takeFirst() |
io.netty.util.concurrent.Future<V> |
takeFirstAsync() |
V |
takeLast() |
io.netty.util.concurrent.Future<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, removeLastOccurrenceAsync
element, getFirst, offer, offerAsync, peek, peekAsync, poll, pollAsync, pollLastAndOfferFirstTo, pollLastAndOfferFirstTo, pollLastAndOfferFirstToAsync, pollLastAndOfferFirstToAsync, remove, removeFirst
add, add, addAfter, addAfterAsync, addAll, addAll, addAllAsync, addAllAsync, addAsync, addBefore, addBeforeAsync, clear, contains, containsAll, containsAllAsync, containsAsync, equals, fastRemove, fastRemoveAsync, fastSet, fastSetAsync, get, getAsync, hashCode, indexOf, indexOfAsync, isEmpty, iterator, lastIndexOf, lastIndexOfAsync, listIterator, listIterator, readAll, readAllAsync, remove, remove, remove, removeAll, removeAllAsync, removeAsync, removeAsync, retainAll, retainAllAsync, set, setAsync, size, sizeAsync, subList, toArray, toArray, toString, trim, trimAsync
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addFirst, addLast, contains, element, iterator, offer, offerFirst, offerLast, peek, poll, push, remove, remove, removeFirstOccurrence, removeLastOccurrence, size
descendingIterator, getFirst, getLast, peekFirst, peekLast, pollFirst, pollLast, pop, removeFirst, removeLast
pollLastAndOfferFirstTo, pollLastAndOfferFirstTo
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
clearExpire, expire, expireAt, expireAt, remainTimeToLive
delete, getName, isExists, migrate, move, rename, renamenx
addFirstAsync, addLastAsync, getLastAsync, offerFirstAsync, offerLastAsync, peekFirstAsync, peekLastAsync, pollFirstAsync, pollLastAsync, popAsync, pushAsync, removeFirstAsync, removeFirstOccurrenceAsync, removeLastAsync, removeLastOccurrenceAsync
offerAsync, peekAsync, pollAsync, pollLastAndOfferFirstToAsync, pollLastAndOfferFirstToAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
deleteAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync
protected RedissonBlockingDeque(CommandAsyncExecutor commandExecutor, String name)
protected RedissonBlockingDeque(Codec codec, CommandAsyncExecutor commandExecutor, String name)
public io.netty.util.concurrent.Future<Boolean> putAsync(V e)
putAsync
in interface RBlockingQueueAsync<V>
public void put(V e) throws InterruptedException
put
in interface BlockingDeque<V>
put
in interface BlockingQueue<V>
InterruptedException
public boolean offer(V e, long timeout, TimeUnit unit) throws InterruptedException
offer
in interface BlockingDeque<V>
offer
in interface BlockingQueue<V>
InterruptedException
public io.netty.util.concurrent.Future<V> takeAsync()
takeAsync
in interface RBlockingQueueAsync<V>
public V take() throws InterruptedException
take
in interface BlockingDeque<V>
take
in interface BlockingQueue<V>
InterruptedException
public io.netty.util.concurrent.Future<V> pollAsync(long timeout, TimeUnit unit)
pollAsync
in interface RBlockingQueueAsync<V>
public V poll(long timeout, TimeUnit unit) throws InterruptedException
poll
in interface BlockingDeque<V>
poll
in interface BlockingQueue<V>
InterruptedException
public V pollFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
RBlockingQueue
pollFromAny
in interface RBlockingQueue<V>
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableInterruptedException
- if interrupted while waitingpublic io.netty.util.concurrent.Future<V> pollFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)
RBlockingQueueAsync
pollFromAnyAsync
in interface RBlockingQueueAsync<V>
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availablepublic io.netty.util.concurrent.Future<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>
InterruptedException
public int remainingCapacity()
remainingCapacity
in interface BlockingQueue<V>
public int drainTo(Collection<? super V> c)
drainTo
in interface BlockingQueue<V>
public io.netty.util.concurrent.Future<Integer> drainToAsync(Collection<? super V> c)
drainToAsync
in interface RBlockingQueueAsync<V>
public int drainTo(Collection<? super V> c, int maxElements)
drainTo
in interface BlockingQueue<V>
public io.netty.util.concurrent.Future<Integer> drainToAsync(Collection<? super V> c, int maxElements)
drainToAsync
in interface RBlockingQueueAsync<V>
public io.netty.util.concurrent.Future<Void> putFirstAsync(V e)
putFirstAsync
in interface RBlockingDequeAsync<V>
public io.netty.util.concurrent.Future<Void> putLastAsync(V e)
putLastAsync
in interface RBlockingDequeAsync<V>
public void putFirst(V e) throws InterruptedException
putFirst
in interface BlockingDeque<V>
InterruptedException
public void putLast(V e) throws InterruptedException
putLast
in interface BlockingDeque<V>
InterruptedException
public boolean offerFirst(V e, long timeout, TimeUnit unit) throws InterruptedException
offerFirst
in interface BlockingDeque<V>
InterruptedException
public boolean offerLast(V e, long timeout, TimeUnit unit) throws InterruptedException
offerLast
in interface BlockingDeque<V>
InterruptedException
public V takeFirst() throws InterruptedException
takeFirst
in interface BlockingDeque<V>
InterruptedException
public io.netty.util.concurrent.Future<V> takeFirstAsync()
takeFirstAsync
in interface RBlockingDequeAsync<V>
public io.netty.util.concurrent.Future<V> takeLastAsync()
takeLastAsync
in interface RBlockingDequeAsync<V>
public V takeLast() throws InterruptedException
takeLast
in interface BlockingDeque<V>
InterruptedException
public io.netty.util.concurrent.Future<V> pollFirstAsync(long timeout, TimeUnit unit)
pollFirstAsync
in interface RBlockingDequeAsync<V>
public V pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
RBlockingDeque
pollFirstFromAny
in interface RBlockingDeque<V>
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableInterruptedException
- if interrupted while waitingpublic io.netty.util.concurrent.Future<V> pollFirstFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)
RBlockingDequeAsync
pollFirstFromAnyAsync
in interface RBlockingDequeAsync<V>
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availablepublic V pollLastFromAny(long timeout, TimeUnit unit, String... queueNames) throws InterruptedException
RBlockingDeque
pollLastFromAny
in interface RBlockingDeque<V>
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableInterruptedException
- if interrupted while waitingpublic io.netty.util.concurrent.Future<V> pollLastFromAnyAsync(long timeout, TimeUnit unit, String... queueNames)
RBlockingDequeAsync
pollLastFromAnyAsync
in interface RBlockingDequeAsync<V>
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availablepublic V pollFirst(long timeout, TimeUnit unit) throws InterruptedException
pollFirst
in interface BlockingDeque<V>
InterruptedException
public io.netty.util.concurrent.Future<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>
InterruptedException
public boolean expire(long timeToLive, TimeUnit timeUnit)
RExpirable
expire
in interface RExpirable
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic io.netty.util.concurrent.Future<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsync
expireAsync
in interface RExpirableAsync
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic boolean expireAt(long timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic io.netty.util.concurrent.Future<Boolean> expireAtAsync(long timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire date in seconds (Unix timestamp)true
if the timeout was set and false
if notpublic boolean expireAt(Date timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic io.netty.util.concurrent.Future<Boolean> expireAtAsync(Date timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic boolean clearExpire()
RExpirable
clearExpire
in interface RExpirable
true
if timeout was removed
false
if object does not exist or does not have an associated timeoutpublic io.netty.util.concurrent.Future<Boolean> clearExpireAsync()
RExpirableAsync
clearExpireAsync
in interface RExpirableAsync
true
if the timeout was cleared and false
if notpublic long remainTimeToLive()
RExpirable
remainTimeToLive
in interface RExpirable
public io.netty.util.concurrent.Future<Long> remainTimeToLiveAsync()
RExpirableAsync
remainTimeToLiveAsync
in interface RExpirableAsync
-1
if object does not exist or time in secondsprotected boolean await(io.netty.util.concurrent.Future<?> future, long timeout, TimeUnit timeoutUnit) throws InterruptedException
InterruptedException
protected <V> V get(io.netty.util.concurrent.Future<V> future)
protected <V> io.netty.util.concurrent.Promise<V> newPromise()
protected <V> io.netty.util.concurrent.Future<V> newSucceededFuture(V result)
public void rename(String newName)
RObject
newName
public io.netty.util.concurrent.Future<Void> renameAsync(String newName)
RObjectAsync
newName
in async moderenameAsync
in interface RObjectAsync
public void migrate(String host, int port, int database)
RObject
public io.netty.util.concurrent.Future<Void> migrateAsync(String host, int port, int database)
RObjectAsync
migrateAsync
in interface RObjectAsync
host
- - destination hostport
- - destination portdatabase
- - destination databasepublic boolean move(int database)
RObject
public io.netty.util.concurrent.Future<Boolean> moveAsync(int database)
RObjectAsync
moveAsync
in interface RObjectAsync
true
if key was moved false
if notpublic boolean renamenx(String newName)
RObject
newName
only if new key is not existspublic io.netty.util.concurrent.Future<Boolean> renamenxAsync(String newName)
RObjectAsync
newName
in async mode only if new key is not existsrenamenxAsync
in interface RObjectAsync
public boolean delete()
RObject
public io.netty.util.concurrent.Future<Boolean> deleteAsync()
RObjectAsync
deleteAsync
in interface RObjectAsync
true
if object was deleted false
if notpublic boolean isExists()
RObject
public io.netty.util.concurrent.Future<Boolean> isExistsAsync()
RObjectAsync
isExistsAsync
in interface RObjectAsync
true
if object exists and false
otherwiseCopyright © 2014–2016. All rights reserved.