Package org.redisson.api
Interface RScoredSortedSetAsync<V>
-
- Type Parameters:
V
- value
- All Superinterfaces:
RExpirableAsync
,RObjectAsync
,RSortableAsync<Set<V>>
- All Known Subinterfaces:
RGeo<V>
,RGeoAsync<V>
,RScoredSortedSet<V>
- All Known Implementing Classes:
RedissonGeo
,RedissonLexSortedSet
,RedissonScoredSortedSet
public interface RScoredSortedSetAsync<V> extends RExpirableAsync, RSortableAsync<Set<V>>
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RFuture<Long>
addAllAsync(Map<V,Double> objects)
RFuture<Integer>
addAndGetRankAsync(double score, V object)
Adds element to this set, overrides previous score if it has been already added.RFuture<Integer>
addAndGetRevRankAsync(double score, V object)
Adds element to this set, overrides previous score if it has been already added.RFuture<Boolean>
addAsync(double score, V object)
Adds element to this set, overrides previous score if it has been already added.RFuture<Integer>
addScoreAndGetRankAsync(V object, Number value)
Adds score to element and returns its rankRFuture<Integer>
addScoreAndGetRevRankAsync(V object, Number value)
Adds score to element and returns its reverse rankRFuture<Double>
addScoreAsync(V object, Number value)
RFuture<Boolean>
containsAllAsync(Collection<?> c)
RFuture<Boolean>
containsAsync(Object o)
RFuture<Long>
countAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns the number of elements with a score betweenstartScore
andendScore
.RFuture<Collection<ScoredEntry<V>>>
entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
RFuture<Collection<ScoredEntry<V>>>
entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
RFuture<Collection<ScoredEntry<V>>>
entryRangeAsync(int startIndex, int endIndex)
RFuture<Collection<ScoredEntry<V>>>
entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
RFuture<Collection<ScoredEntry<V>>>
entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
RFuture<Collection<ScoredEntry<V>>>
entryRangeReversedAsync(int startIndex, int endIndex)
RFuture<V>
firstAsync()
Returns the head element ornull
if this sorted set is empty.RFuture<Double>
firstScoreAsync()
Returns score of the head element or returnsnull
if this sorted set is empty.RFuture<Double>
getScoreAsync(V o)
Returns score of element ornull
if it doesn't exist.RFuture<Integer>
intersectionAsync(String... names)
Intersect provided ScoredSortedSets and store result to current ScoredSortedSetRFuture<Integer>
intersectionAsync(Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSetRFuture<Integer>
intersectionAsync(RScoredSortedSet.Aggregate aggregate, String... names)
Intersect provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSetRFuture<Integer>
intersectionAsync(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
Intersect provided ScoredSortedSets mapped to weight multiplier with defined aggregation method and store result to current ScoredSortedSetRFuture<V>
lastAsync()
Returns the tail element ornull
if this sorted set is empty.RFuture<Double>
lastScoreAsync()
Returns score of the tail element or returnsnull
if this sorted set is empty.RFuture<V>
pollFirstAsync()
Removes and returns the head element ornull
if this sorted set is empty.RFuture<Collection<V>>
pollFirstAsync(int count)
Removes and returns the head elements ornull
if this sorted set is empty.RFuture<V>
pollFirstAsync(long timeout, TimeUnit unit)
Removes and returns the head element ornull
if this sorted set is empty.RFuture<V>
pollFirstFromAnyAsync(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.RFuture<V>
pollLastAsync()
Removes and returns the tail element ornull
if this sorted set is empty.RFuture<Collection<V>>
pollLastAsync(int count)
Removes and returns the tail elements ornull
if this sorted set is empty.RFuture<V>
pollLastAsync(long timeout, TimeUnit unit)
Removes and returns the tail element ornull
if this sorted set is empty.RFuture<V>
pollLastFromAnyAsync(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.RFuture<Integer>
rankAsync(V o)
Returns rank of value, with the scores ordered from low to high.RFuture<Collection<V>>
readAllAsync()
Read all values at once.RFuture<Boolean>
removeAllAsync(Collection<?> c)
RFuture<Boolean>
removeAsync(V object)
RFuture<Integer>
removeRangeByRankAsync(int startIndex, int endIndex)
RFuture<Integer>
removeRangeByScoreAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
RFuture<Boolean>
retainAllAsync(Collection<?> c)
RFuture<Integer>
revRankAsync(V o)
Returns rank of value, with the scores ordered from high to low.RFuture<Integer>
sizeAsync()
RFuture<Boolean>
tryAddAsync(double score, V object)
Adds element to this set only if has not been added before.RFuture<Integer>
unionAsync(String... names)
Union provided ScoredSortedSets and store result to current ScoredSortedSetRFuture<Integer>
unionAsync(Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier and store result to current ScoredSortedSetRFuture<Integer>
unionAsync(RScoredSortedSet.Aggregate aggregate, String... names)
Union provided ScoredSortedSets with defined aggregation method and store result to current ScoredSortedSetRFuture<Integer>
unionAsync(RScoredSortedSet.Aggregate aggregate, Map<String,Double> nameWithWeight)
Union provided ScoredSortedSets mapped to weight multiplier with defined aggregation method and store result to current ScoredSortedSetRFuture<Collection<V>>
valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns all values betweenstartScore
andendScore
.RFuture<Collection<V>>
valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
RFuture<Collection<V>>
valueRangeAsync(int startIndex, int endIndex)
RFuture<Collection<V>>
valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns all values betweenstartScore
andendScore
in reversed order.RFuture<Collection<V>>
valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
RFuture<Collection<V>>
valueRangeReversedAsync(int startIndex, int endIndex)
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RSortableAsync
readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync
-
-
-
-
Method Detail
-
pollLastFromAnyAsync
RFuture<V> pollLastFromAnyAsync(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
-
pollFirstFromAnyAsync
RFuture<V> pollFirstFromAnyAsync(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
-
pollFirstAsync
RFuture<V> pollFirstAsync(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
-
pollLastAsync
RFuture<V> pollLastAsync(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
-
pollFirstAsync
RFuture<Collection<V>> pollFirstAsync(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
-
pollLastAsync
RFuture<Collection<V>> pollLastAsync(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
-
pollFirstAsync
RFuture<V> pollFirstAsync()
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
-
pollLastAsync
RFuture<V> pollLastAsync()
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
-
firstAsync
RFuture<V> firstAsync()
Returns the head element ornull
if this sorted set is empty.- Returns:
- the head element or
null
if this sorted set is empty
-
lastAsync
RFuture<V> lastAsync()
Returns the tail element ornull
if this sorted set is empty.- Returns:
- the tail element or
null
if this sorted set is empty
-
firstScoreAsync
RFuture<Double> firstScoreAsync()
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
-
lastScoreAsync
RFuture<Double> lastScoreAsync()
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
-
removeRangeByScoreAsync
RFuture<Integer> removeRangeByScoreAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
rankAsync
RFuture<Integer> rankAsync(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
-
revRankAsync
RFuture<Integer> revRankAsync(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
-
getScoreAsync
RFuture<Double> getScoreAsync(V o)
Returns score of element ornull
if it doesn't exist.- Parameters:
o
- - element- Returns:
- score
-
addAsync
RFuture<Boolean> addAsync(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.
-
addAndGetRankAsync
RFuture<Integer> addAndGetRankAsync(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
-
addAndGetRevRankAsync
RFuture<Integer> addAndGetRevRankAsync(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
-
tryAddAsync
RFuture<Boolean> tryAddAsync(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.
-
containsAllAsync
RFuture<Boolean> containsAllAsync(Collection<?> c)
-
removeAllAsync
RFuture<Boolean> removeAllAsync(Collection<?> c)
-
retainAllAsync
RFuture<Boolean> retainAllAsync(Collection<?> c)
-
addScoreAndGetRevRankAsync
RFuture<Integer> addScoreAndGetRevRankAsync(V object, Number value)
Adds score to element and returns its reverse rank- Parameters:
object
- - object itselfvalue
- - object score- Returns:
- reverse rank
-
addScoreAndGetRankAsync
RFuture<Integer> addScoreAndGetRankAsync(V object, Number value)
Adds score to element and returns its rank- Parameters:
object
- - object itselfvalue
- - object score- Returns:
- rank
-
valueRangeAsync
RFuture<Collection<V>> valueRangeAsync(int startIndex, int endIndex)
-
valueRangeReversedAsync
RFuture<Collection<V>> valueRangeReversedAsync(int startIndex, int endIndex)
-
entryRangeAsync
RFuture<Collection<ScoredEntry<V>>> entryRangeAsync(int startIndex, int endIndex)
-
entryRangeReversedAsync
RFuture<Collection<ScoredEntry<V>>> entryRangeReversedAsync(int startIndex, int endIndex)
-
valueRangeAsync
RFuture<Collection<V>> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
Returns all values betweenstartScore
andendScore
.- 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
-
valueRangeReversedAsync
RFuture<Collection<V>> valueRangeReversedAsync(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
-
entryRangeAsync
RFuture<Collection<ScoredEntry<V>>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
valueRangeAsync
RFuture<Collection<V>> valueRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
valueRangeReversedAsync
RFuture<Collection<V>> valueRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
entryRangeAsync
RFuture<Collection<ScoredEntry<V>>> entryRangeAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
entryRangeReversedAsync
RFuture<Collection<ScoredEntry<V>>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive)
-
entryRangeReversedAsync
RFuture<Collection<ScoredEntry<V>>> entryRangeReversedAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive, int offset, int count)
-
countAsync
RFuture<Long> countAsync(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
-
readAllAsync
RFuture<Collection<V>> readAllAsync()
Read all values at once.- Returns:
- values
-
intersectionAsync
RFuture<Integer> intersectionAsync(String... names)
Intersect provided ScoredSortedSets and store result to current ScoredSortedSet- Parameters:
names
- - names of ScoredSortedSet- Returns:
- length of intersection
-
intersectionAsync
RFuture<Integer> intersectionAsync(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
-
intersectionAsync
RFuture<Integer> intersectionAsync(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
-
intersectionAsync
RFuture<Integer> intersectionAsync(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
-
unionAsync
RFuture<Integer> unionAsync(String... names)
Union provided ScoredSortedSets and store result to current ScoredSortedSet- Parameters:
names
- - names of ScoredSortedSet- Returns:
- length of union
-
unionAsync
RFuture<Integer> unionAsync(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
-
unionAsync
RFuture<Integer> unionAsync(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
-
unionAsync
RFuture<Integer> unionAsync(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
-
-