V
- value typepublic class RedissonPriorityQueue<V> extends RedissonList<V> implements RPriorityQueue<V>
Modifier and Type | Class and Description |
---|---|
static class |
RedissonPriorityQueue.BinarySearchResult<V> |
codec, name
Constructor and Description |
---|
RedissonPriorityQueue(Codec codec,
CommandExecutor commandExecutor,
String name,
RedissonClient redisson) |
RedissonPriorityQueue(CommandExecutor commandExecutor,
String name,
RedissonClient redisson) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(V value) |
boolean |
addAll(Collection<? extends V> c) |
RedissonPriorityQueue.BinarySearchResult<V> |
binarySearch(V value,
Codec codec) |
void |
clear() |
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.
|
Comparator<? super V> |
comparator()
Returns comparator used by this queue
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
V |
element() |
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.
|
V |
getFirst() |
boolean |
offer(V e) |
V |
peek() |
RFuture<V> |
peekAsync() |
V |
poll() |
RFuture<V> |
pollAsync() |
protected <T> RFuture<V> |
pollAsync(RedisCommand<T> command,
Object... params) |
V |
pollLastAndOfferFirstTo(String queueName)
Retrieves and removes last available tail element of this queue queue and adds it at the head of
queueName . |
RFuture<V> |
pollLastAndOfferFirstToAsync(String queueName) |
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 |
remove() |
boolean |
remove(Object value) |
boolean |
removeAll(Collection<?> c) |
V |
removeFirst() |
boolean |
retainAll(Collection<?> c) |
String |
toString() |
boolean |
trySetComparator(Comparator<? super V> comparator)
Sets new comparator only if current set is empty
|
add, addAfter, addAfterAsync, addAll, addAllAsync, addAllAsync, addAsync, addAsync, addAsync, addBefore, addBeforeAsync, 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, removeAllAsync, removeAsync, removeAsync, removeAsync, retainAllAsync, set, setAsync, size, sizeAsync, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, subList, toArray, toArray, trim, trimAsync
addListener, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getLockByMapKey, getLockByValue, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
readAll
equals, hashCode, isEmpty, iterator, parallelStream, removeIf, size, spliterator, stream, toArray, toArray
addListener, copy, delete, dump, getCodec, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
addListenerAsync, copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
replaceAll, sort, spliterator
clearExpire, expire, expireAt, expireAt, remainTimeToLive
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
public RedissonPriorityQueue(CommandExecutor commandExecutor, String name, RedissonClient redisson)
public RedissonPriorityQueue(Codec codec, CommandExecutor commandExecutor, String name, RedissonClient redisson)
public boolean contains(Object o)
contains
in interface Collection<V>
contains
in interface List<V>
contains
in class RedissonList<V>
public boolean add(V value)
public boolean remove(Object value)
remove
in interface Collection<V>
remove
in interface List<V>
remove
in class RedissonList<V>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<V>
containsAll
in interface List<V>
containsAll
in class RedissonList<V>
public boolean addAll(Collection<? extends V> c)
addAll
in interface Collection<V>
addAll
in interface List<V>
addAll
in class RedissonList<V>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<V>
retainAll
in interface List<V>
retainAll
in class RedissonList<V>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<V>
removeAll
in interface List<V>
removeAll
in class RedissonList<V>
public void clear()
clear
in interface Collection<V>
clear
in interface List<V>
clear
in class RedissonList<V>
public Comparator<? super V> comparator()
RPriorityQueue
comparator
in interface RPriorityQueue<V>
protected <T> RFuture<V> pollAsync(RedisCommand<T> command, Object... params)
public V getFirst()
public boolean trySetComparator(Comparator<? super V> comparator)
RPriorityQueue
trySetComparator
in interface RPriorityQueue<V>
comparator
- for valuestrue
if new comparator setted
false
otherwisepublic V removeFirst()
public RedissonPriorityQueue.BinarySearchResult<V> binarySearch(V value, Codec codec)
public String toString()
toString
in class RedissonList<V>
public V pollLastAndOfferFirstTo(String queueName)
RPriorityQueue
queueName
.pollLastAndOfferFirstTo
in interface RPriorityQueue<V>
queueName
- - names of destination queuenull
if the
specified waiting time elapses before an element is availablepublic 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 RFuture<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 RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire date in milliseconds (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 RFuture<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 RFuture<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 RFuture<Long> remainTimeToLiveAsync()
RExpirableAsync
remainTimeToLiveAsync
in interface RExpirableAsync
Copyright © 2014–2020 Redisson. All rights reserved.