Package org.redisson.api
Interface RScoredSortedSetReactive<V>
-
- Type Parameters:
V
- value type
- All Superinterfaces:
RExpirableReactive
,RObjectReactive
,RSortableReactive<Set<V>>
- All Known Subinterfaces:
RGeoReactive<V>
,RLexSortedSetReactive
public interface RScoredSortedSetReactive<V> extends RExpirableReactive, RSortableReactive<Set<V>>
Reactive interface for SortedSet object- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.reactivestreams.Publisher<Boolean>
add(double score, V object)
Adds element to this set, overrides previous score if it has been already added.org.reactivestreams.Publisher<Long>
addAll(Map<V,Double> objects)
org.reactivestreams.Publisher<Integer>
addAndGetRank(double score, V object)
Adds element to this set, overrides previous score if it has been already added.org.reactivestreams.Publisher<Integer>
addAndGetRevRank(double score, V object)
Adds element to this set, overrides previous score if it has been already added.org.reactivestreams.Publisher<Double>
addScore(V object, Number value)
org.reactivestreams.Publisher<Integer>
addScoreAndGetRank(V object, Number value)
Adds score to element and returns its rankorg.reactivestreams.Publisher<Integer>
addScoreAndGetRevRank(V object, Number value)
Adds score to element and returns its reverse rankorg.reactivestreams.Publisher<Boolean>
contains(V o)
org.reactivestreams.Publisher<Boolean>
containsAll(Collection<?> c)
org.reactivestreams.Publisher<Long>
count(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns the number of elements with a score betweenstartScore
andendScore
.org.reactivestreams.Publisher<Collection<ScoredEntry<V>>>
entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>>
entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>>
entryRange(int startIndex, int endIndex)
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>>
entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>>
entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>>
entryRangeReversed(int startIndex, int endIndex)
org.reactivestreams.Publisher<V>
first()
Returns the head element ornull
if this sorted set is empty.org.reactivestreams.Publisher<Double>
firstScore()
Returns score of the head element or returnsnull
if this sorted set is empty.org.reactivestreams.Publisher<Double>
getScore(V o)
org.reactivestreams.Publisher<Integer>
intersection(String... names)
Intersect provided ScoredSortedSets and store result to current ScoredSortedSetorg.reactivestreams.Publisher<Integer>
intersection(Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSetorg.reactivestreams.Publisher<Integer>
intersection(RScoredSortedSet.Aggregate aggregate, String... names)
Intersect provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSetorg.reactivestreams.Publisher<Integer>
intersection(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier with defined aggregation method and store result to current ScoredSortedSetorg.reactivestreams.Publisher<V>
iterator()
org.reactivestreams.Publisher<V>
iterator(int count)
Returns an iterator over elements in this set.org.reactivestreams.Publisher<V>
iterator(String pattern)
Returns an iterator over elements in this set.org.reactivestreams.Publisher<V>
iterator(String pattern, int count)
Returns an iterator over elements in this set.org.reactivestreams.Publisher<V>
last()
Returns the tail element ornull
if this sorted set is empty.org.reactivestreams.Publisher<Double>
lastScore()
Returns score of the tail element or returnsnull
if this sorted set is empty.org.reactivestreams.Publisher<V>
pollFirst()
Removes and returns the head element ornull
if this sorted set is empty.org.reactivestreams.Publisher<Collection<V>>
pollFirst(int count)
Removes and returns the head elements ornull
if this sorted set is empty.org.reactivestreams.Publisher<V>
pollFirst(long timeout, TimeUnit unit)
Removes and returns the head element ornull
if this sorted set is empty.org.reactivestreams.Publisher<V>
pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames)
Removes and returns first available head element of any sorted set, waiting up to the specified wait time if necessary for an element to become available in any of defined sorted sets including this one.org.reactivestreams.Publisher<V>
pollLast()
Removes and returns the tail element ornull
if this sorted set is empty.org.reactivestreams.Publisher<Collection<V>>
pollLast(int count)
Removes and returns the tail elements ornull
if this sorted set is empty.org.reactivestreams.Publisher<V>
pollLast(long timeout, TimeUnit unit)
Removes and returns the tail element ornull
if this sorted set is empty.org.reactivestreams.Publisher<V>
pollLastFromAny(long timeout, TimeUnit unit, String... queueNames)
Removes and returns first available tail element of any sorted set, waiting up to the specified wait time if necessary for an element to become available in any of defined sorted sets including this one.org.reactivestreams.Publisher<Integer>
rank(V o)
Returns rank of value, with the scores ordered from low to high.org.reactivestreams.Publisher<Collection<V>>
readAll()
Read all values at once.org.reactivestreams.Publisher<Boolean>
remove(V object)
org.reactivestreams.Publisher<Boolean>
removeAll(Collection<?> c)
org.reactivestreams.Publisher<Integer>
removeRangeByRank(int startIndex, int endIndex)
org.reactivestreams.Publisher<Integer>
removeRangeByScore(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
org.reactivestreams.Publisher<Boolean>
retainAll(Collection<?> c)
org.reactivestreams.Publisher<Integer>
revRank(V o)
Returns rank of value, with the scores ordered from high to low.org.reactivestreams.Publisher<Integer>
size()
org.reactivestreams.Publisher<V>
takeFirst()
Removes and returns the head element waiting if necessary for an element to become available.org.reactivestreams.Publisher<V>
takeLast()
Removes and returns the tail element waiting if necessary for an element to become available.org.reactivestreams.Publisher<Boolean>
tryAdd(double score, V object)
Adds element to this set only if has not been added before.org.reactivestreams.Publisher<Integer>
union(String... names)
Union provided ScoredSortedSets and store result to current ScoredSortedSetorg.reactivestreams.Publisher<Integer>
union(Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSetorg.reactivestreams.Publisher<Integer>
union(RScoredSortedSet.Aggregate aggregate, String... names)
Union provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSetorg.reactivestreams.Publisher<Integer>
union(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier with defined aggregation method and store result to current ScoredSortedSetorg.reactivestreams.Publisher<Collection<V>>
valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
org.reactivestreams.Publisher<Collection<V>>
valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
org.reactivestreams.Publisher<Collection<V>>
valueRange(int startIndex, int endIndex)
org.reactivestreams.Publisher<Collection<V>>
valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns all values betweenstartScore
andendScore
in reversed order.org.reactivestreams.Publisher<Collection<V>>
valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
org.reactivestreams.Publisher<Collection<V>>
valueRangeReversed(int startIndex, int endIndex)
-
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectReactive
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, touch, unlink
-
Methods inherited from interface org.redisson.api.RSortableReactive
readSorted, readSorted, readSorted, readSorted, readSorted, readSorted, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo
-
-
-
-
Method Detail
-
pollLastFromAny
org.reactivestreams.Publisher<V> pollLastFromAny(long timeout, TimeUnit unit, String... queueNames)
Removes and returns first available tail element of any sorted set, waiting up to the specified wait time if necessary for an element to become available in any of defined sorted sets including this one.Requires Redis 5.0.0 and higher.
- Parameters:
queueNames
- - names of queuetimeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the tail element, or
null
if all sorted sets are empty
-
pollFirstFromAny
org.reactivestreams.Publisher<V> pollFirstFromAny(long timeout, TimeUnit unit, String... queueNames)
Removes and returns first available head element of any sorted set, waiting up to the specified wait time if necessary for an element to become available in any of defined sorted sets including this one.Requires Redis 5.0.0 and higher.
- Parameters:
queueNames
- - names of queuetimeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the head element, or
null
if all sorted sets are empty
-
pollFirst
org.reactivestreams.Publisher<V> pollFirst(long timeout, TimeUnit unit)
Removes and returns the head element ornull
if this sorted set is empty.Requires Redis 5.0.0 and higher.
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the head element,
or
null
if this sorted set is empty
-
pollLast
org.reactivestreams.Publisher<V> pollLast(long timeout, TimeUnit unit)
Removes and returns the tail element ornull
if this sorted set is empty.Requires Redis 5.0.0 and higher.
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the tail element or
null
if this sorted set is empty
-
pollFirst
org.reactivestreams.Publisher<Collection<V>> pollFirst(int count)
Removes and returns the head elements ornull
if this sorted set is empty.- Parameters:
count
- - elements amount- Returns:
- the head element,
or
null
if this sorted set is empty
-
pollLast
org.reactivestreams.Publisher<Collection<V>> pollLast(int count)
Removes and returns the tail elements ornull
if this sorted set is empty.- Parameters:
count
- - elements amount- Returns:
- the tail element or
null
if this sorted set is empty
-
pollFirst
org.reactivestreams.Publisher<V> pollFirst()
Removes and returns the head element ornull
if this sorted set is empty.- Returns:
- the head element,
or
null
if this sorted set is empty
-
pollLast
org.reactivestreams.Publisher<V> pollLast()
Removes and returns the tail element ornull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
first
org.reactivestreams.Publisher<V> first()
Returns the head element ornull
if this sorted set is empty.- Returns:
- the head element or
null
if this sorted set is empty
-
last
org.reactivestreams.Publisher<V> last()
Returns the tail element ornull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
firstScore
org.reactivestreams.Publisher<Double> firstScore()
Returns score of the head element or returnsnull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
lastScore
org.reactivestreams.Publisher<Double> lastScore()
Returns score of the tail element or returnsnull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
iterator
org.reactivestreams.Publisher<V> iterator(String pattern)
Returns an iterator over elements in this set. Ifpattern
is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search pattern- Returns:
- iterator
-
iterator
org.reactivestreams.Publisher<V> iterator(int count)
Returns an iterator over elements in this set. Elements are loaded in batch. Batch size is defined bycount
param.- Parameters:
count
- - size of elements batch- Returns:
- iterator
-
iterator
org.reactivestreams.Publisher<V> iterator(String pattern, int count)
Returns an iterator over elements in this set. Elements are loaded in batch. Batch size is defined bycount
param. If pattern is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search patterncount
- - size of elements batch- Returns:
- iterator
-
iterator
org.reactivestreams.Publisher<V> iterator()
-
removeRangeByScore
org.reactivestreams.Publisher<Integer> removeRangeByScore(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
removeRangeByRank
org.reactivestreams.Publisher<Integer> removeRangeByRank(int startIndex, int endIndex)
-
rank
org.reactivestreams.Publisher<Integer> rank(V o)
Returns rank of value, with the scores ordered from low to high.- Parameters:
o
- - object- Returns:
- rank or
null
if value does not exist
-
revRank
org.reactivestreams.Publisher<Integer> revRank(V o)
Returns rank of value, with the scores ordered from high to low.- Parameters:
o
- - object- Returns:
- rank or
null
if value does not exist
-
add
org.reactivestreams.Publisher<Boolean> add(double score, V object)
Adds element to this set, overrides previous score if it has been already added.- Parameters:
score
- - object scoreobject
- - object itself- Returns:
true
if element has added andfalse
if not.
-
addAndGetRank
org.reactivestreams.Publisher<Integer> addAndGetRank(double score, V object)
Adds element to this set, overrides previous score if it has been already added. Finally return the rank of the item- Parameters:
score
- - object scoreobject
- - object itself- Returns:
- rank
-
addAndGetRevRank
org.reactivestreams.Publisher<Integer> addAndGetRevRank(double score, V object)
Adds element to this set, overrides previous score if it has been already added. Finally return the reverse rank of the item- Parameters:
score
- - object scoreobject
- - object itself- Returns:
- reverse rank
-
tryAdd
org.reactivestreams.Publisher<Boolean> tryAdd(double score, V object)
Adds element to this set only if has not been added before.Requires Redis 3.0.2 and higher.
- Parameters:
score
- - object scoreobject
- - object itself- Returns:
true
if element has added andfalse
if not.
-
size
org.reactivestreams.Publisher<Integer> size()
-
containsAll
org.reactivestreams.Publisher<Boolean> containsAll(Collection<?> c)
-
removeAll
org.reactivestreams.Publisher<Boolean> removeAll(Collection<?> c)
-
retainAll
org.reactivestreams.Publisher<Boolean> retainAll(Collection<?> c)
-
addScoreAndGetRevRank
org.reactivestreams.Publisher<Integer> addScoreAndGetRevRank(V object, Number value)
Adds score to element and returns its reverse rank- Parameters:
object
- - object itselfvalue
- - object score- Returns:
- reverse rank
-
addScoreAndGetRank
org.reactivestreams.Publisher<Integer> addScoreAndGetRank(V object, Number value)
Adds score to element and returns its rank- Parameters:
object
- - object itselfvalue
- - object score- Returns:
- rank
-
valueRange
org.reactivestreams.Publisher<Collection<V>> valueRange(int startIndex, int endIndex)
-
entryRange
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>> entryRange(int startIndex, int endIndex)
-
valueRange
org.reactivestreams.Publisher<Collection<V>> valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
entryRange
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>> entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
valueRange
org.reactivestreams.Publisher<Collection<V>> valueRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
entryRange
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>> entryRange(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
valueRangeReversed
org.reactivestreams.Publisher<Collection<V>> valueRangeReversed(int startIndex, int endIndex)
-
valueRangeReversed
org.reactivestreams.Publisher<Collection<V>> valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns all values betweenstartScore
andendScore
in reversed order.- Parameters:
startScore
- - start score. UseDouble.POSITIVE_INFINITY
orDouble.NEGATIVE_INFINITY
to define infinity numbersstartScoreInclusive
- - start score inclusiveendScore
- - end score UseDouble.POSITIVE_INFINITY
orDouble.NEGATIVE_INFINITY
to define infinity numbersendScoreInclusive
- - end score inclusive- Returns:
- values
-
valueRangeReversed
org.reactivestreams.Publisher<Collection<V>> valueRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
entryRangeReversed
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>> entryRangeReversed(int startIndex, int endIndex)
-
entryRangeReversed
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>> entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
entryRangeReversed
org.reactivestreams.Publisher<Collection<ScoredEntry<V>>> entryRangeReversed(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
count
org.reactivestreams.Publisher<Long> count(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns the number of elements with a score betweenstartScore
andendScore
.- Parameters:
startScore
- - start scorestartScoreInclusive
- - start score inclusiveendScore
- - end scoreendScoreInclusive
- - end score inclusive- Returns:
- count
-
readAll
org.reactivestreams.Publisher<Collection<V>> readAll()
Read all values at once.- Returns:
- values
-
intersection
org.reactivestreams.Publisher<Integer> intersection(String... names)
Intersect provided ScoredSortedSets and store result to current ScoredSortedSet- Parameters:
names
- - names of ScoredSortedSet- Returns:
- length of intersection
-
intersection
org.reactivestreams.Publisher<Integer> intersection(RScoredSortedSet.Aggregate aggregate, String... names)
Intersect provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSet- Parameters:
aggregate
- - score aggregation modenames
- - names of ScoredSortedSet- Returns:
- length of intersection
-
intersection
org.reactivestreams.Publisher<Integer> intersection(Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSet- Parameters:
nameWithWeight
- - name of ScoredSortedSet mapped to weight multiplier- Returns:
- length of intersection
-
intersection
org.reactivestreams.Publisher<Integer> intersection(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier with defined aggregation method and store result to current ScoredSortedSet- Parameters:
aggregate
- - score aggregation modenameWithWeight
- - name of ScoredSortedSet mapped to weight multiplier- Returns:
- length of intersection
-
union
org.reactivestreams.Publisher<Integer> union(String... names)
Union provided ScoredSortedSets and store result to current ScoredSortedSet- Parameters:
names
- - names of ScoredSortedSet- Returns:
- length of union
-
union
org.reactivestreams.Publisher<Integer> union(RScoredSortedSet.Aggregate aggregate, String... names)
Union provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSet- Parameters:
aggregate
- - score aggregation modenames
- - names of ScoredSortedSet- Returns:
- length of union
-
union
org.reactivestreams.Publisher<Integer> union(Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSet- Parameters:
nameWithWeight
- - name of ScoredSortedSet mapped to weight multiplier- Returns:
- length of union
-
union
org.reactivestreams.Publisher<Integer> union(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier with defined aggregation method and store result to current ScoredSortedSet- Parameters:
aggregate
- - score aggregation modenameWithWeight
- - name of ScoredSortedSet mapped to weight multiplier- Returns:
- length of union
-
takeFirst
org.reactivestreams.Publisher<V> takeFirst()
Removes and returns the head element waiting if necessary for an element to become available.- Returns:
- the head element
-
takeLast
org.reactivestreams.Publisher<V> takeLast()
Removes and returns the tail element waiting if necessary for an element to become available.- Returns:
- the tail element
-
-