Class RedisServerMethods


  • public class RedisServerMethods
    extends io.toro.martini.redis.RedisBaseMethods
    Methods for Server Control.
    • Constructor Detail

      • RedisServerMethods

        @Autowired
        RedisServerMethods​(io.toro.martini.database.DataSourceManager dataSourceManager)
    • Method Detail

      • clientGetname

        @GloopParameter(name="redisClientGetnameOutput")
        public static Object clientGetname​(@GloopParameter(allowNull=false)
                                           String connectionName,
                                           GloopExecutionContext context)
        Get the current connection name.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        K bulk-string-reply The connection name, or a null bulk reply if no name is set.
      • clientGetnameAsync

        @GloopParameter(name="redisFutureClientGetnameOutput")
        public static Future<Object> clientGetnameAsync​(@GloopParameter(allowNull=false)
                                                        String connectionName,
                                                        GloopExecutionContext context)
        Asynchronously get the current connection name.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        k bulk-string-reply the connection name, or a null bulk reply if no name is set.
      • clientKill

        @GloopParameter(name="redisClientKillOutput")
        public static Long clientKill​(@GloopParameter(allowNull=false)
                                      String connectionName,
                                      @GloopObjectParameter("killArgs{\n  skipme:boolean:By default this option is enabled, that is, the client calling the command will not get killed, however setting this option to false will have the effect of also killing the client calling the command\n addr::Kill the client at this address\n id:long:Kill the client with this client id\n type::This closes the connections of all the clients in the specified {@link Type class}. Note that clients blocked into the {@link Type MONITOR} command are considered to belong to the normal class:false::[\'NORMAL\',\'MASTER\',\'SLAVE\',\'PUBSUB\']\n}")
                                      GloopModel killArgs,
                                      GloopExecutionContext context)
        Kill connections of clients which are filtered by killArgs
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        killArgs - args for the kill operation
        Returns:
        Long integer-reply number of killed connections
      • clientKillAsync

        @GloopParameter(name="redisFutureClientKillOutput")
        public static Future<Long> clientKillAsync​(@GloopParameter(allowNull=false)
                                                   String connectionName,
                                                   @GloopObjectParameter("killArgs{\n  skipme:boolean:By default this option is enabled, that is, the client calling the command will not get killed, however setting this option to false will have the effect of also killing the client calling the command\n addr::Kill the client at this address\n id:long:Kill the client with this client id\n type::This closes the connections of all the clients in the specified {@link Type class}. Note that clients blocked into the {@link Type MONITOR} command are considered to belong to the normal class:false::[\'NORMAL\',\'MASTER\',\'SLAVE\',\'PUBSUB\']\n}")
                                                   GloopModel killArgs,
                                                   GloopExecutionContext context)
        Asynchronously kill connections of clients which are filtered by killArgs
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        killArgs - args for the kill operation
        Returns:
        long integer-reply number of killed connections
      • clientPause

        @GloopParameter(name="redisClientPauseOutput")
        public static String clientPause​(@GloopParameter(allowNull=false)
                                         String connectionName,
                                         @GloopParameter(allowNull=false)
                                         long timeout,
                                         GloopExecutionContext context)
        Stop processing commands from clients for some time.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        timeout - the timeout value in milliseconds
        Returns:
        String simple-string-reply The command returns OK or an error if the timeout is invalid.
      • clientPauseAsync

        @GloopParameter(name="redisFutureClientPauseOutput")
        public static Future<String> clientPauseAsync​(@GloopParameter(allowNull=false)
                                                      String connectionName,
                                                      @GloopParameter(allowNull=false)
                                                      long timeout,
                                                      GloopExecutionContext context)
        Asynchronously stop processing commands from clients for some time.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        timeout - the timeout value in milliseconds
        Returns:
        string simple-string-reply the command returns oK or an error if the timeout is invalid.
      • clientList

        @GloopParameter(name="redisClientListOutput")
        public static String clientList​(@GloopParameter(allowNull=false)
                                        String connectionName,
                                        GloopExecutionContext context)
        Get the list of client connections.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        String bulk-string-reply a unique string, formatted as follows: One client connection per line (separated by LF), each line is composed of a succession of property=value fields separated by a space character.
      • clientListAsync

        @GloopParameter(name="redisFutureClientListOutput")
        public static Future<String> clientListAsync​(@GloopParameter(allowNull=false)
                                                     String connectionName,
                                                     GloopExecutionContext context)
        Asynchronously get the list of client connections.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        string bulk-string-reply a unique string, formatted as follows: one client connection per line (separated by lF), each line is composed of a succession of property=value fields separated by a space character.
      • commandInfo

        @GloopParameter(name="redisCommandInfoOutput")
        public static List<Object> commandInfo​(@GloopParameter(allowNull=false)
                                               String connectionName,
                                               GloopExecutionContext context,
                                               @GloopObjectParameter("commandType[]:::false::[\'APPEND\',\'ASKING\',\'AUTH\',\'BGREWRITEAOF\',\'BGSAVE\',\'BITCOUNT\',\'BITFIELD\',\'BITOP\',\'BITPOS\',\'BLPOP\',\'BRPOP\',\'BRPOPLPUSH\',\'BZPOPMAX\',\'BZPOPMIN\',\'CLIENT\',\'CLUSTER\',\'COMMAND\',\'CONFIG\',\'DBSIZE\',\'DEBUG\',\'DECR\',\'DECRBY\',\'DEL\',\'DISCARD\',\'DUMP\',\'ECHO\',\'EVAL\',\'EVALSHA\',\'EXEC\',\'EXISTS\',\'EXPIRE\',\'EXPIREAT\',\'FLUSHALL\',\'FLUSHDB\',\'GEOADD\',\'GEODECODE\',\'GEODIST\',\'GEOENCODE\',\'GEOHASH\',\'GEOPOS\',\'GEORADIUS\',\'GEORADIUSBYMEMBER\',\'GEORADIUSBYMEMBER_RO\',\'GEORADIUS_RO\',\'GET\',\'GETBIT\',\'GETRANGE\',\'GETSET\',\'HDEL\',\'HEXISTS\',\'HGET\',\'HGETALL\',\'HINCRBY\',\'HINCRBYFLOAT\',\'HKEYS\',\'HLEN\',\'HMGET\',\'HMSET\',\'HSCAN\',\'HSET\',\'HSETNX\',\'HSTRLEN\',\'HVALS\',\'INCR\',\'INCRBY\',\'INCRBYFLOAT\',\'INFO\',\'KEYS\',\'LASTSAVE\',\'LINDEX\',\'LINSERT\',\'LLEN\',\'LPOP\',\'LPUSH\',\'LPUSHX\',\'LRANGE\',\'LREM\',\'LSET\',\'LTRIM\',\'MGET\',\'MIGRATE\',\'MONITOR\',\'MOVE\',\'MSET\',\'MSETNX\',\'MULTI\',\'MYID\',\'OBJECT\',\'PERSIST\',\'PEXPIRE\',\'PEXPIREAT\',\'PFADD\',\'PFCOUNT\',\'PFMERGE\',\'PING\',\'PSETEX\',\'PSUBSCRIBE\',\'PTTL\',\'PUBLISH\',\'PUBSUB\',\'PUNSUBSCRIBE\',\'QUIT\',\'RANDOMKEY\',\'READONLY\',\'READWRITE\',\'RENAME\',\'RENAMENX\',\'RESTORE\',\'ROLE\',\'RPOP\',\'RPOPLPUSH\',\'RPUSH\',\'RPUSHX\',\'SADD\',\'SAVE\',\'SCAN\',\'SCARD\',\'SCRIPT\',\'SDIFF\',\'SDIFFSTORE\',\'SELECT\',\'SENTINEL\',\'SET\',\'SETBIT\',\'SETEX\',\'SETNX\',\'SETRANGE\',\'SHUTDOWN\',\'SINTER\',\'SINTERSTORE\',\'SISMEMBER\',\'SLAVEOF\',\'SLOWLOG\',\'SMEMBERS\',\'SMOVE\',\'SORT\',\'SPOP\',\'SRANDMEMBER\',\'SREM\',\'SSCAN\',\'STRLEN\',\'SUBSCRIBE\',\'SUNION\',\'SUNIONSTORE\',\'SWAPDB\',\'SYNC\',\'TIME\',\'TOUCH\',\'TTL\',\'TYPE\',\'UNLINK\',\'UNSUBSCRIBE\',\'UNWATCH\',\'WAIT\',\'WATCH\',\'XACK\',\'XADD\',\'XCLAIM\',\'XDEL\',\'XGROUP\',\'XINFO\',\'XLEN\',\'XPENDING\',\'XRANGE\',\'XREAD\',\'XREADGROUP\',\'XREVRANGE\',\'XTRIM\',\'ZADD\',\'ZCARD\',\'ZCOUNT\',\'ZINCRBY\',\'ZINTERSTORE\',\'ZLEXCOUNT\',\'ZPOPMAX\',\'ZPOPMIN\',\'ZRANGE\',\'ZRANGEBYLEX\',\'ZRANGEBYSCORE\',\'ZRANK\',\'ZREM\',\'ZREMRANGEBYLEX\',\'ZREMRANGEBYRANK\',\'ZREMRANGEBYSCORE\',\'ZREVRANGE\',\'ZREVRANGEBYLEX\',\'ZREVRANGEBYSCORE\',\'ZREVRANK\',\'ZSCAN\',\'ZSCORE\',\'ZUNIONSTORE\']")
                                               String... commandType)
        Returns an array reply of details about the requested commands.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        commandType - the commands to query for
        Returns:
        List<Object> array-reply
      • commandInfoAsync

        @GloopParameter(name="redisFutureCommandInfoOutput")
        public static Future<List<Object>> commandInfoAsync​(@GloopParameter(allowNull=false)
                                                            String connectionName,
                                                            GloopExecutionContext context,
                                                            @GloopObjectParameter("commandType[]:::false::[\'APPEND\',\'ASKING\',\'AUTH\',\'BGREWRITEAOF\',\'BGSAVE\',\'BITCOUNT\',\'BITFIELD\',\'BITOP\',\'BITPOS\',\'BLPOP\',\'BRPOP\',\'BRPOPLPUSH\',\'BZPOPMAX\',\'BZPOPMIN\',\'CLIENT\',\'CLUSTER\',\'COMMAND\',\'CONFIG\',\'DBSIZE\',\'DEBUG\',\'DECR\',\'DECRBY\',\'DEL\',\'DISCARD\',\'DUMP\',\'ECHO\',\'EVAL\',\'EVALSHA\',\'EXEC\',\'EXISTS\',\'EXPIRE\',\'EXPIREAT\',\'FLUSHALL\',\'FLUSHDB\',\'GEOADD\',\'GEODECODE\',\'GEODIST\',\'GEOENCODE\',\'GEOHASH\',\'GEOPOS\',\'GEORADIUS\',\'GEORADIUSBYMEMBER\',\'GEORADIUSBYMEMBER_RO\',\'GEORADIUS_RO\',\'GET\',\'GETBIT\',\'GETRANGE\',\'GETSET\',\'HDEL\',\'HEXISTS\',\'HGET\',\'HGETALL\',\'HINCRBY\',\'HINCRBYFLOAT\',\'HKEYS\',\'HLEN\',\'HMGET\',\'HMSET\',\'HSCAN\',\'HSET\',\'HSETNX\',\'HSTRLEN\',\'HVALS\',\'INCR\',\'INCRBY\',\'INCRBYFLOAT\',\'INFO\',\'KEYS\',\'LASTSAVE\',\'LINDEX\',\'LINSERT\',\'LLEN\',\'LPOP\',\'LPUSH\',\'LPUSHX\',\'LRANGE\',\'LREM\',\'LSET\',\'LTRIM\',\'MGET\',\'MIGRATE\',\'MONITOR\',\'MOVE\',\'MSET\',\'MSETNX\',\'MULTI\',\'MYID\',\'OBJECT\',\'PERSIST\',\'PEXPIRE\',\'PEXPIREAT\',\'PFADD\',\'PFCOUNT\',\'PFMERGE\',\'PING\',\'PSETEX\',\'PSUBSCRIBE\',\'PTTL\',\'PUBLISH\',\'PUBSUB\',\'PUNSUBSCRIBE\',\'QUIT\',\'RANDOMKEY\',\'READONLY\',\'READWRITE\',\'RENAME\',\'RENAMENX\',\'RESTORE\',\'ROLE\',\'RPOP\',\'RPOPLPUSH\',\'RPUSH\',\'RPUSHX\',\'SADD\',\'SAVE\',\'SCAN\',\'SCARD\',\'SCRIPT\',\'SDIFF\',\'SDIFFSTORE\',\'SELECT\',\'SENTINEL\',\'SET\',\'SETBIT\',\'SETEX\',\'SETNX\',\'SETRANGE\',\'SHUTDOWN\',\'SINTER\',\'SINTERSTORE\',\'SISMEMBER\',\'SLAVEOF\',\'SLOWLOG\',\'SMEMBERS\',\'SMOVE\',\'SORT\',\'SPOP\',\'SRANDMEMBER\',\'SREM\',\'SSCAN\',\'STRLEN\',\'SUBSCRIBE\',\'SUNION\',\'SUNIONSTORE\',\'SWAPDB\',\'SYNC\',\'TIME\',\'TOUCH\',\'TTL\',\'TYPE\',\'UNLINK\',\'UNSUBSCRIBE\',\'UNWATCH\',\'WAIT\',\'WATCH\',\'XACK\',\'XADD\',\'XCLAIM\',\'XDEL\',\'XGROUP\',\'XINFO\',\'XLEN\',\'XPENDING\',\'XRANGE\',\'XREAD\',\'XREADGROUP\',\'XREVRANGE\',\'XTRIM\',\'ZADD\',\'ZCARD\',\'ZCOUNT\',\'ZINCRBY\',\'ZINTERSTORE\',\'ZLEXCOUNT\',\'ZPOPMAX\',\'ZPOPMIN\',\'ZRANGE\',\'ZRANGEBYLEX\',\'ZRANGEBYSCORE\',\'ZRANK\',\'ZREM\',\'ZREMRANGEBYLEX\',\'ZREMRANGEBYRANK\',\'ZREMRANGEBYSCORE\',\'ZREVRANGE\',\'ZREVRANGEBYLEX\',\'ZREVRANGEBYSCORE\',\'ZREVRANK\',\'ZSCAN\',\'ZSCORE\',\'ZUNIONSTORE\']")
                                                            String... commandType)
        Asynchronously returns an array reply of details about the requested commands.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        commandType - the commands to query for
        Returns:
        list<Object> array-reply
      • commandCount

        @GloopParameter(name="redisCommandCountOutput")
        public static Long commandCount​(@GloopParameter(allowNull=false)
                                        String connectionName,
                                        GloopExecutionContext context)
        Get total number of Redis commands.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        Long integer-reply of number of total commands in this Redis server.
      • commandCountAsync

        @GloopParameter(name="redisFutureCommandCountOutput")
        public static Future<Long> commandCountAsync​(@GloopParameter(allowNull=false)
                                                     String connectionName,
                                                     GloopExecutionContext context)
        Asynchronously get total number of redis commands.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        long integer-reply of number of total commands in this redis server.
      • configRewrite

        @GloopParameter(name="redisConfigRewriteOutput")
        public static String configRewrite​(@GloopParameter(allowNull=false)
                                           String connectionName,
                                           GloopExecutionContext context)
        Rewrite the configuration file with the in memory configuration.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        String simple-string-reply OK when the configuration was rewritten properly. Otherwise an error is returned.
      • configRewriteAsync

        @GloopParameter(name="redisFutureConfigRewriteOutput")
        public static Future<String> configRewriteAsync​(@GloopParameter(allowNull=false)
                                                        String connectionName,
                                                        GloopExecutionContext context)
        Asynchronously rewrite the configuration file with the in memory configuration.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        string simple-string-reply oK when the configuration was rewritten properly. otherwise an error is returned.
      • debugCrashAndRecoverAsync

        @GloopParameter(name="redisFutureDebugCrashAndRecoverOutput")
        public static Future<String> debugCrashAndRecoverAsync​(@GloopParameter(allowNull=false)
                                                               String connectionName,
                                                               Long delay,
                                                               GloopExecutionContext context)
        Asynchronously crash and recover
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        delay - optional delay in milliseconds
        Returns:
        string simple-string-reply
      • debugOomAsync

        public static void debugOomAsync​(@GloopParameter(allowNull=false)
                                         String connectionName,
                                         GloopExecutionContext context)
        Asynchronously make the server crash: out of memory.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
      • debugSegfault

        public static void debugSegfault​(@GloopParameter(allowNull=false)
                                         String connectionName,
                                         GloopExecutionContext context)
        Make the server crash: Invalid pointer access.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
      • debugSegfaultAsync

        public static void debugSegfaultAsync​(@GloopParameter(allowNull=false)
                                              String connectionName,
                                              GloopExecutionContext context)
        Asynchronously make the server crash: invalid pointer access.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
      • debugReload

        @GloopParameter(name="redisDebugReloadOutput")
        public static String debugReload​(@GloopParameter(allowNull=false)
                                         String connectionName,
                                         GloopExecutionContext context)
        Save RDB, clear the database and reload RDB.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        String simple-string-reply The commands returns OK on success.
      • debugReloadAsync

        @GloopParameter(name="redisFutureDebugReloadOutput")
        public static Future<String> debugReloadAsync​(@GloopParameter(allowNull=false)
                                                      String connectionName,
                                                      GloopExecutionContext context)
        Asynchronously save rDB, clear the database and reload rDB.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        string simple-string-reply the commands returns oK on success.
      • lastsaveAsync

        @GloopParameter(name="redisFutureLastsaveOutput")
        public static Future<Date> lastsaveAsync​(@GloopParameter(allowNull=false)
                                                 String connectionName,
                                                 GloopExecutionContext context)
        Asynchronously get the uNIX time stamp of the last successful save to disk.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        date integer-reply an uNIX time stamp.
      • time

        @GloopParameter(name="redisTimeOutput")
        public static List<Object> time​(@GloopParameter(allowNull=false)
                                        String connectionName,
                                        GloopExecutionContext context)
        Return the current server time.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        List<V> array-reply specifically: A multi bulk reply containing two elements: unix time in seconds. microseconds.
      • timeAsync

        @GloopParameter(name="redisFutureTimeOutput")
        public static Future<List<Object>> timeAsync​(@GloopParameter(allowNull=false)
                                                     String connectionName,
                                                     GloopExecutionContext context)
        Asynchronously return the current server time.
        Parameters:
        connectionName - The Martini Runtime Redis connection pool name
        Returns:
        list<V> array-reply specifically: a multi bulk reply containing two elements: unix time in seconds. microseconds.