Class RespCommand

java.lang.Object
org.infinispan.server.resp.RespCommand
Direct Known Subclasses:
AbstractBlockingPop, AGGCommand, APPEND, AUTH, BaseIterationCommand, CLIENT, COMMAND, CONFIG, DBSIZE, DECR, DECRBY, DEL, DIFF, DISCARD, ECHO, EXEC, EXISTS, EXPIRE, FamilyCommand, FLUSHDB, GET, GETDEL, GETEX, GETRANGE, HDEL, HELLO, HEXISTS, HGET, HGETALL, HINCRBY, HINCRBYFLOAT, HKEYS, HLEN, HMGET, HMSET, HRANDFIELD, HSETNX, HSTRLEN, HVALS, INCR, INCRBY, INCRBYFLOAT, INFO, KEYSLOT, LCS, LINDEX, LINSERT, LLEN, LMOVE, LMPOP, LPOS, LRANGE, LREM, LSET, LTRIM, MEMORY, MGET, MODULE, MSET, MSETNX, MULTI, NODES, PERSIST, PFADD, PING, POP, POP, PSUBSCRIBE, PUBLISH, PUNSUBSCRIBE, PUSH, QUIT, RANDOMKEY, READONLY, READWRITE, RENAME, RENAMENX, RESET, SADD, SCARD, SDIFF, SDIFFSTORE, SELECT, SET, SETNX, SETRANGE, SHARDS, SINTER, SINTERCARD, SINTERSTORE, SISMEMBER, SLOTS, SMEMBERS, SMISMEMBER, SMOVE, SORT, SORT_RO, SPOP, SRANDMEMBER, SREM, STRALGO, STRLEN, SUBSCRIBE, SUNION, SUNIONSTORE, TIME, TOUCH, TTL, TYPE, UNSUBSCRIBE, UNWATCH, WATCH, ZADD, ZCARD, ZCOUNT, ZINCRBY, ZINTERCARD, ZLEXCOUNT, ZMPOP, ZMSCORE, ZRANDMEMBER, ZRANGE, ZRANK, ZREM, ZREMRANGE, ZSCORE

public abstract class RespCommand extends Object
  • Field Details

    • log

      protected static final Log log
  • Constructor Details

    • RespCommand

      protected RespCommand(int arity, int firstKeyPos, int lastKeyPos, int steps)
      Parameters:
      arity - the number of arguments
      firstKeyPos - the position of the command's first key name argument. For most commands, the first key's position is 1. Position 0 is always the command name itself.
      lastKeyPos - the position of the command's last key name argument. Redis commands usually accept one, two or multiple number of keys. Commands that accept a single key have both first key and last key set to 1. Commands that accept two key name arguments, e.g. BRPOPLPUSH, SMOVE and RENAME, have this value set to the position of their second key. Multi-key commands that accept an arbitrary number of keys, such as MSET, use the value -1.
      steps - the step, or increment, between the first key and the position of the next key.
    • RespCommand

      protected RespCommand(String name, int arity, int firstKeyPos, int lastKeyPos, int steps)
      Parameters:
      name - the name of the command
      arity - the number of arguments
      firstKeyPos - the position of the command's first key name argument. For most commands, the first key's position is 1. Position 0 is always the command name itself.
      lastKeyPos - the position of the command's last key name argument. Redis commands usually accept one, two or multiple number of keys. Commands that accept a single key have both first key and last key set to 1. Commands that accept two key name arguments, e.g. BRPOPLPUSH, SMOVE and RENAME, have this value set to the position of their second key. Multi-key commands that accept an arbitrary number of keys, such as MSET, use the value -1.
      steps - the step, or increment, between the first key and the position of the next key.
  • Method Details

    • hasValidNumberOfArguments

      public boolean hasValidNumberOfArguments(List<byte[]> arguments)
    • handleException

      public CompletionStage<RespRequestHandler> handleException(RespRequestHandler handler, Throwable t)
    • getName

      public String getName()
    • fromByteBuf

      public static RespCommand fromByteBuf(io.netty.buffer.ByteBuf buf, int commandLength)
    • match

      public final boolean match(byte[] other)
    • size

      public int size(List<byte[]> arguments)
    • getArity

      public int getArity()
    • getFirstKeyPos

      public int getFirstKeyPos()
    • getLastKeyPos

      public int getLastKeyPos()
    • getSteps

      public int getSteps()
    • extractKeys

      public byte[][] extractKeys(List<byte[]> arguments)
    • aclMask

      public abstract long aclMask()
    • toString

      public String toString()
      Overrides:
      toString in class Object