mapReduce();
+ /**
+ * 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.
+ *
+ * @param queueNames - names of queue
+ * @param timeout how long to wait before giving up, in units of
+ * {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @return the tail element, or {@code null} if all sorted sets are empty
+ */
+ V pollLastFromAny(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.
+ *
+ * @param queueNames - names of queue
+ * @param timeout how long to wait before giving up, in units of
+ * {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @return the head element, or {@code null} if all sorted sets are empty
+ */
+ V pollFirstFromAny(long timeout, TimeUnit unit, String ... queueNames);
+
+ /**
+ * Removes and returns the head element or {@code null} if this sorted set is empty.
+ *
+ * @param timeout how long to wait before giving up, in units of
+ * {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @return the head element,
+ * or {@code null} if this sorted set is empty
+ */
+ V pollFirst(long timeout, TimeUnit unit);
+
+ /**
+ * Removes and returns the tail element or {@code null} if this sorted set is empty.
+ *
+ * @param timeout how long to wait before giving up, in units of
+ * {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
+ V pollLast(long timeout, TimeUnit unit);
+
+ /**
+ * Removes and returns the head elements or {@code null} if this sorted set is empty.
+ *
+ * @param count - elements amount
+ * @return the head element,
+ * or {@code null} if this sorted set is empty
+ */
+ Collection pollFirst(int count);
+
+ /**
+ * Removes and returns the tail elements or {@code null} if this sorted set is empty.
+ *
+ * @param count - elements amount
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
+ Collection pollLast(int count);
+
+ /**
+ * Removes and returns the head element or {@code null} if this sorted set is empty.
+ *
+ * @return the head element,
+ * or {@code null} if this sorted set is empty
+ */
V pollFirst();
+ /**
+ * Removes and returns the tail element or {@code null} if this sorted set is empty.
+ *
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
V pollLast();
+ /**
+ * Returns the head element or {@code null} if this sorted set is empty.
+ *
+ * @return the head element or {@code null} if this sorted set is empty
+ */
V first();
+ /**
+ * Returns the tail element or {@code null} if this sorted set is empty.
+ *
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
V last();
-
+
+ /**
+ * Returns score of the tail element or returns {@code null} if this sorted set is empty.
+ *
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
Double firstScore();
-
+
+ /**
+ * Returns score of the head element or returns {@code null} if this sorted set is empty.
+ *
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
Double lastScore();
Long addAll(Map objects);
diff --git a/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java b/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java
index c2abadf63..7b6cead46 100644
--- a/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java
+++ b/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java
@@ -18,6 +18,7 @@ package org.redisson.api;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import org.redisson.api.RScoredSortedSet.Aggregate;
import org.redisson.client.protocol.ScoredEntry;
@@ -30,16 +31,124 @@ import org.redisson.client.protocol.ScoredEntry;
*/
public interface RScoredSortedSetAsync extends RExpirableAsync, RSortableAsync> {
- RFuture pollLastAsync();
+ /**
+ * 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.
+ *
+ * @param queueNames - names of queue
+ * @param timeout how long to wait before giving up, in units of
+ * {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @return the tail element, or {@code null} if all sorted sets are empty
+ */
+ RFuture pollLastFromAnyAsync(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.
+ *
+ * @param queueNames - names of queue
+ * @param timeout how long to wait before giving up, in units of
+ * {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @return the head element, or {@code null} if all sorted sets are empty
+ *
+ */
+ RFuture pollFirstFromAnyAsync(long timeout, TimeUnit unit, String ... queueNames);
+
+ /**
+ * Removes and returns the head element or {@code null} if this sorted set is empty.
+ *
+ * Requires Redis 5.0.0 and higher.
+ *
+ * @param timeout how long to wait before giving up, in units of
+ * {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @return the head element,
+ * or {@code null} if this sorted set is empty
+ */
+ RFuture pollFirstAsync(long timeout, TimeUnit unit);
+ /**
+ * Removes and returns the tail element or {@code null} if this sorted set is empty.
+ *
+ * Requires Redis 5.0.0 and higher.
+ *
+ * @param timeout how long to wait before giving up, in units of
+ * {@code unit}
+ * @param unit a {@code TimeUnit} determining how to interpret the
+ * {@code timeout} parameter
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
+ RFuture pollLastAsync(long timeout, TimeUnit unit);
+
+ /**
+ * Removes and returns the head elements or {@code null} if this sorted set is empty.
+ *
+ * @param count - elements amount
+ * @return the head element,
+ * or {@code null} if this sorted set is empty
+ */
+ RFuture> pollFirstAsync(int count);
+
+ /**
+ * Removes and returns the tail elements or {@code null} if this sorted set is empty.
+ *
+ * @param count - elements amount
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
+ RFuture> pollLastAsync(int count);
+
+ /**
+ * Removes and returns the head element or {@code null} if this sorted set is empty.
+ *
+ * @return the head element,
+ * or {@code null} if this sorted set is empty
+ */
RFuture pollFirstAsync();
+ /**
+ * Removes and returns the tail element or {@code null} if this sorted set is empty.
+ *
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
+ RFuture pollLastAsync();
+
+ /**
+ * Returns the head element or {@code null} if this sorted set is empty.
+ *
+ * @return the head element or {@code null} if this sorted set is empty
+ */
RFuture firstAsync();
+ /**
+ * Returns the tail element or {@code null} if this sorted set is empty.
+ *
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
RFuture lastAsync();
-
+
+ /**
+ * Returns score of the head element or returns {@code null} if this sorted set is empty.
+ *
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
RFuture firstScoreAsync();
-
+
+ /**
+ * Returns score of the tail element or returns {@code null} if this sorted set is empty.
+ *
+ * @return the tail element or {@code null} if this sorted set is empty
+ */
RFuture lastScoreAsync();
RFuture addAllAsync(Map objects);
@@ -48,8 +157,20 @@ public interface RScoredSortedSetAsync extends RExpirableAsync, RSortableAsyn
RFuture removeRangeByRankAsync(int startIndex, int endIndex);
+ /**
+ * Returns rank of value, with the scores ordered from low to high.
+ *
+ * @param o - object
+ * @return rank or null
if value does not exist
+ */
RFuture rankAsync(V o);
+ /**
+ * Returns rank of value, with the scores ordered from high to low.
+ *
+ * @param o - object
+ * @return rank or null
if value does not exist
+ */
RFuture revRankAsync(V o);
/**
@@ -90,7 +211,7 @@ public interface RScoredSortedSetAsync extends RExpirableAsync, RSortableAsyn
/**
* Adds element to this set only if has not been added before.
*
- * Works only with Redis 3.0.2 and higher.
+ * Requires Redis 3.0.2 and higher.
*
* @param score - object score
* @param object - object itself
diff --git a/redisson/src/main/java/org/redisson/client/protocol/RedisCommands.java b/redisson/src/main/java/org/redisson/client/protocol/RedisCommands.java
index 7b225ddaa..ec60ff7f2 100644
--- a/redisson/src/main/java/org/redisson/client/protocol/RedisCommands.java
+++ b/redisson/src/main/java/org/redisson/client/protocol/RedisCommands.java
@@ -24,7 +24,6 @@ import java.util.Set;
import org.redisson.api.RType;
import org.redisson.client.protocol.RedisCommand.ValueType;
-import org.redisson.client.protocol.convertor.BitSetReplayConvertor;
import org.redisson.client.protocol.convertor.BitsSizeReplayConvertor;
import org.redisson.client.protocol.convertor.BooleanAmountReplayConvertor;
import org.redisson.client.protocol.convertor.BooleanNotNullReplayConvertor;
@@ -36,13 +35,14 @@ import org.redisson.client.protocol.convertor.DoubleNullSafeReplayConvertor;
import org.redisson.client.protocol.convertor.DoubleReplayConvertor;
import org.redisson.client.protocol.convertor.IntegerReplayConvertor;
import org.redisson.client.protocol.convertor.KeyValueConvertor;
-import org.redisson.client.protocol.convertor.TimeObjectDecoder;
import org.redisson.client.protocol.convertor.LongReplayConvertor;
+import org.redisson.client.protocol.convertor.TimeObjectDecoder;
import org.redisson.client.protocol.convertor.TrueReplayConvertor;
import org.redisson.client.protocol.convertor.TypeConvertor;
import org.redisson.client.protocol.convertor.VoidReplayConvertor;
import org.redisson.client.protocol.decoder.ClusterNodesDecoder;
import org.redisson.client.protocol.decoder.KeyValueObjectDecoder;
+import org.redisson.client.protocol.decoder.ListFirstObjectDecoder;
import org.redisson.client.protocol.decoder.ListMultiDecoder;
import org.redisson.client.protocol.decoder.ListResultReplayDecoder;
import org.redisson.client.protocol.decoder.ListScanResult;
@@ -51,12 +51,12 @@ import org.redisson.client.protocol.decoder.Long2MultiDecoder;
import org.redisson.client.protocol.decoder.LongMultiDecoder;
import org.redisson.client.protocol.decoder.MapScanResult;
import org.redisson.client.protocol.decoder.MapScanResultReplayDecoder;
-import org.redisson.client.protocol.decoder.ObjectFirstResultReplayDecoder;
import org.redisson.client.protocol.decoder.ObjectFirstScoreReplayDecoder;
import org.redisson.client.protocol.decoder.ObjectListReplayDecoder;
import org.redisson.client.protocol.decoder.ObjectMapEntryReplayDecoder;
import org.redisson.client.protocol.decoder.ObjectMapReplayDecoder;
import org.redisson.client.protocol.decoder.ObjectSetReplayDecoder;
+import org.redisson.client.protocol.decoder.ScoredSortedSetPolledObjectDecoder;
import org.redisson.client.protocol.decoder.ScoredSortedSetReplayDecoder;
import org.redisson.client.protocol.decoder.ScoredSortedSetScanDecoder;
import org.redisson.client.protocol.decoder.ScoredSortedSetScanReplayDecoder;
@@ -93,8 +93,6 @@ public interface RedisCommands {
RedisStrictCommand BITPOS = new RedisStrictCommand("BITPOS", new IntegerReplayConvertor());
RedisStrictCommand SETBIT_VOID = new RedisStrictCommand("SETBIT", new VoidReplayConvertor());
RedisStrictCommand SETBIT = new RedisStrictCommand("SETBIT", new BooleanReplayConvertor());
- RedisStrictCommand SETBIT_TRUE = new RedisStrictCommand("SETBIT", new BitSetReplayConvertor(0));
- RedisStrictCommand SETBIT_FALSE = new RedisStrictCommand("SETBIT", new BitSetReplayConvertor(1));
RedisStrictCommand BITOP = new RedisStrictCommand("BITOP", new VoidReplayConvertor());
RedisStrictCommand WAIT = new RedisStrictCommand("WAIT", new IntegerReplayConvertor());
@@ -119,9 +117,11 @@ public interface RedisCommands {
RedisStrictCommand ZSCORE = new RedisStrictCommand("ZSCORE", new DoubleReplayConvertor());
RedisCommand ZRANK_INT = new RedisCommand("ZRANK", new IntegerReplayConvertor());
RedisCommand ZREVRANK_INT = new RedisCommand("ZREVRANK", new IntegerReplayConvertor());
- RedisCommand