Package org.redisson.api
Interface RSortedSet<V>
- Type Parameters:
V- value type
- All Superinterfaces:
Collection<V>,Iterable<V>,RExpirable,RExpirableAsync,RObject,RObjectAsync,Set<V>,SortedSet<V>
- All Known Subinterfaces:
RLexSortedSet
- All Known Implementing Classes:
RedissonLexSortedSet,RedissonSortedSet
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptiondistributedIterator(int count) Returns element iterator that can be shared across multiple applications.distributedIterator(String iteratorName, int count) Returns iterator over elements that match specified pattern.<KOut,VOut>
RCollectionMapReduce<V, KOut, VOut> ReturnsRMapReduceobject associated with this objectRemoves and returns the head element ornullif this sorted set is empty.pollFirst(int count) Removes and returns the head elements of this sorted set.Removes and returns the head element ornullif this sorted set is empty.Removes and returns the head elements.Removes and returns the head element ornullif this sorted set is empty.pollFirstAsync(int count) Removes and returns the head elements of this sorted set.pollFirstAsync(Duration duration) Removes and returns the head element ornullif this sorted set is empty.pollFirstAsync(Duration duration, int count) Removes and returns the head elements.pollLast()Removes and returns the tail element ornullif this sorted set is empty.pollLast(int count) Removes and returns the tail elements of this sorted set.Removes and returns the tail element ornullif this sorted set is empty.Removes and returns the tail elements.Removes and returns the tail element ornullif this sorted set is empty.pollLastAsync(int count) Removes and returns the tail elements of this sorted set.pollLastAsync(Duration duration) Removes and returns the tail element ornullif this sorted set is empty.pollLastAsync(Duration duration, int count) Removes and returns the tail elements.readAll()removeAsync(Object value) booleantrySetComparator(Comparator<? super V> comparator) Sets new comparator only if current set is emptyMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RObject
addListener, copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getAccessFrequency, getCodec, getIdleTime, getInternalEncoding, getName, getReferenceCount, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getAccessFrequencyAsync, getIdleTimeAsync, getInternalEncodingAsync, getReferenceCountAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncMethods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArrayMethods inherited from interface java.util.SortedSet
comparator, first, headSet, last, spliterator, subSet, tailSet
-
Method Details
-
mapReduce
ReturnsRMapReduceobject associated with this object- Type Parameters:
KOut- output keyVOut- output value- Returns:
- MapReduce instance
-
readAll
Collection<V> readAll() -
readAllAsync
RFuture<Collection<V>> readAllAsync() -
pollFirst
V pollFirst()Removes and returns the head element ornullif this sorted set is empty.- Returns:
- the head element,
or
nullif this sorted set is empty
-
pollFirst
Removes and returns the head elements of this sorted set.Requires Redis 6.2.0 and higher.
- Parameters:
count- - elements amount- Returns:
- the head elements of this sorted set
-
pollFirst
Removes and returns the head element ornullif this sorted set is empty.- Parameters:
duration- how long to wait before giving up- Returns:
- the head element,
or
nullif this sorted set is empty
-
pollFirst
Removes and returns the head elements.Requires Redis 7.0.0 and higher.
- Parameters:
duration- how long to wait before giving upcount- elements amount- Returns:
- the head elements
-
pollFirstAsync
Removes and returns the head element ornullif this sorted set is empty.- Returns:
- the head element,
or
nullif this sorted set is empty
-
pollFirstAsync
Removes and returns the head elements of this sorted set.Requires Redis 6.2.0 and higher.
- Parameters:
count- - elements amount- Returns:
- the head elements of this sorted set
-
pollFirstAsync
Removes and returns the head element ornullif this sorted set is empty.- Parameters:
duration- how long to wait before giving up- Returns:
- the head element,
or
nullif this sorted set is empty
-
pollFirstAsync
Removes and returns the head elements.Requires Redis 7.0.0 and higher.
- Parameters:
duration- how long to wait before giving upcount- elements amount- Returns:
- the head elements
-
pollLast
V pollLast()Removes and returns the tail element ornullif this sorted set is empty.- Returns:
- the tail element or
nullif this sorted set is empty
-
pollLast
Removes and returns the tail elements of this sorted set.Requires Redis 6.2.0 and higher.
- Parameters:
count- - elements amount- Returns:
- the tail elements of this sorted set
-
pollLast
Removes and returns the tail element ornullif this sorted set is empty.- Parameters:
duration- how long to wait before giving up- Returns:
- the tail element,
or
nullif this sorted set is empty
-
pollLast
Removes and returns the tail elements.Requires Redis 7.0.0 and higher.
- Parameters:
duration- how long to wait before giving upcount- elements amount- Returns:
- the tail elements
-
pollLastAsync
Removes and returns the tail element ornullif this sorted set is empty.- Returns:
- the tail element or
nullif this sorted set is empty
-
pollLastAsync
Removes and returns the tail elements of this sorted set.Requires Redis 6.2.0 and higher.
- Parameters:
count- - elements amount- Returns:
- the tail elements of this sorted set
-
pollLastAsync
Removes and returns the tail element ornullif this sorted set is empty.- Parameters:
duration- how long to wait before giving up- Returns:
- the tail element,
or
nullif this sorted set is empty
-
pollLastAsync
Removes and returns the tail elements.Requires Redis 7.0.0 and higher.
- Parameters:
duration- how long to wait before giving upcount- elements amount- Returns:
- the tail elements
-
addAsync
-
removeAsync
-
trySetComparator
Sets new comparator only if current set is empty- Parameters:
comparator- for values- Returns:
trueif new comparator settedfalseotherwise
-
distributedIterator
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 RList.distributedIterator(String, int) for creating different iterators.- Parameters:
count- batch size- Returns:
- shared elements iterator
-
distributedIterator
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 list name.- Parameters:
iteratorName- redis object name to which cursor will be savedcount- batch size- Returns:
- shared elements iterator
-