Class ZADD
java.lang.Object
org.infinispan.server.resp.RespCommand
org.infinispan.server.resp.commands.sortedset.ZADD
- All Implemented Interfaces:
Resp3Command
Adds all the specified members with the specified scores to the sorted set stored at key.
It is possible to specify multiple score / member pairs.
If a specified member is already a member of the sorted set,
the score is updated and the element reinserted at the right position to ensure the correct ordering.
If key does not exist, a new sorted set with the specified members as sole members is created, like if the sorted set was empty. If the key exists but does not hold a sorted set, an error is returned.
Options:
- XX: Only update elements that already exist. Don't add new elements.
- NX: Only add new elements. Don't update already existing elements.
- LT: Only update existing elements if the new score is less than the current score. This flag doesn't prevent adding new elements.
- GT: Only update existing elements if the new score is greater than the current score. This flag doesn't prevent adding new elements.
- CH: Modify the return value from the number of new elements added, to the total number of elements changed. Changed elements are new elements added and elements already existing for which the score was updated. Normally the return value of ZADD only counts the number of new elements added.
- INCR: When this option is specified ZADD acts like
ZINCRBY. Only one score-element pair can be specified in this mode.
- Since:
- 15.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.infinispan.server.resp.RespCommand
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionperform(Resp3Handler handler, io.netty.channel.ChannelHandlerContext ctx, List<byte[]> arguments) Methods inherited from class org.infinispan.server.resp.RespCommand
extractKeys, fromByteBuf, getArity, getFirstKeyPos, getLastKeyPos, getName, getSteps, handleException, hasValidNumberOfArguments, match, size, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.infinispan.server.resp.commands.Resp3Command
handleException
-
Field Details
-
XX
- See Also:
-
NX
- See Also:
-
LT
- See Also:
-
GT
- See Also:
-
CH
- See Also:
-
INCR
- See Also:
-
ARGUMENTS
-
-
Constructor Details
-
ZADD
public ZADD()
-
-
Method Details
-
perform
public CompletionStage<RespRequestHandler> perform(Resp3Handler handler, io.netty.channel.ChannelHandlerContext ctx, List<byte[]> arguments) - Specified by:
performin interfaceResp3Command
-