public interface ServerCommands extends RedisCommands
限定符和类型 | 方法和说明 |
---|---|
List<String> |
aclCat()
The command shows the available ACL categories
详情说明 https://redis.io/commands/acl-cat/
|
List<byte[]> |
aclCat(byte[] categoryName)
The command shows all the Redis commands in the specified category
详情说明 https://redis.io/commands/acl-cat/
|
List<String> |
aclCat(String categoryName)
The command shows all the Redis commands in the specified category
详情说明 https://redis.io/commands/acl-cat/
|
Long |
aclDelUser(byte[]... usernames)
Delete all the specified ACL users and terminate all the connections that are authenticated with such users
详情说明 https://redis.io/commands/acl-deluser/
|
Long |
aclDelUser(String... usernames)
Delete all the specified ACL users and terminate all the connections that are authenticated with such users
详情说明 https://redis.io/commands/acl-deluser/
|
String |
aclGenPass()
ACL users need a solid password in order to authenticate to the server without security risks
详情说明 https://redis.io/commands/acl-genpass/
|
AclUser |
aclGetUser(byte[] username)
The command returns all the rules defined for an existing ACL user
详情说明 https://redis.io/commands/acl-getuser/
|
AclUser |
aclGetUser(String username)
The command returns all the rules defined for an existing ACL user
详情说明 https://redis.io/commands/acl-getuser/
|
List<String> |
aclList()
The command shows the currently active ACL rules in the Redis server
详情说明 https://redis.io/commands/acl-list/
|
com.buession.lang.Status |
aclLoad()
When Redis is configured to use an ACL file (with the aclfile configuration option),
this command will reload the ACLs from the file, replacing all the current ACL rules with the ones defined in the file
详情说明 https://redis.io/commands/acl-load/
|
List<AclLog> |
aclLog()
The optional argument specifies how many entries to show.
|
List<AclLog> |
aclLog(long count)
The optional argument specifies how many entries to show.
|
com.buession.lang.Status |
aclLogReset()
The optional argument specifies how many entries to show.
|
com.buession.lang.Status |
aclLogSave()
When Redis is configured to use an ACL file (with the aclfile configuration option),
this command will save the currently defined ACLs from the server memory to the ACL file
详情说明 https://redis.io/commands/acl-save/
|
com.buession.lang.Status |
aclSetUser(byte[] username,
byte[]... rules)
Create an ACL user with the specified rules or modify the rules of an existing user
详情说明 https://redis.io/commands/acl-setuser/
|
com.buession.lang.Status |
aclSetUser(String username,
String... rules)
Create an ACL user with the specified rules or modify the rules of an existing user
详情说明 https://redis.io/commands/acl-setuser/
|
List<String> |
aclUsers()
The command shows a list of all the usernames of the currently configured users in the Redis ACL system
详情说明 https://redis.io/commands/acl-users/
|
String |
aclWhoAmI()
Return the username the current connection is authenticated with
详情说明 https://redis.io/commands/acl-whoami/
|
String |
bgRewriteAof()
执行一个 AOF文件 重写操作;重写会创建一个当前 AOF 文件的体积优化版本
详情说明 http://redisdoc.com/persistence/bgrewriteaof.html
|
String |
bgSave()
在后台异步保存当前数据库的数据到磁盘
详情说明 http://redisdoc.com/persistence/bgsave.html
|
List<byte[]> |
configGet(byte[] parameter)
获取 Redis 服务器的配置参数
详情说明 http://redisdoc.com/configure/config_get.html
|
List<String> |
configGet(String parameter)
获取 Redis 服务器的配置参数
详情说明 http://redisdoc.com/configure/config_get.html
|
com.buession.lang.Status |
configResetStat()
重置 INFO 命令中的某些统计数据,包括:
1)Keyspace hits (键空间命中次数)
2)Keyspace misses (键空间不命中次数)
3)Number of commands processed (执行命令的次数)
4)Number of connections received (连接服务器的次数)
5)Number of expired keys (过期key的数量)
6)Number of rejected connections (被拒绝的连接数量)
7)Latest fork(2) time(最后执行 fork(2) 的时间)
8)The aof_delayed_fsync counter(aof_delayed_fsync 计数器的值)
详情说明 http://redisdoc.com/configure/config_resetstat.html
|
com.buession.lang.Status |
configRewrite()
对启动 Redis 服务器时所指定的 redis.conf 文件进行改写
详情说明 http://redisdoc.com/configure/config_rewrite.html
|
com.buession.lang.Status |
configSet(byte[] parameter,
byte[] value)
动态地调整 Redis 服务器的配置
详情说明 http://redisdoc.com/configure/config_set.html
|
com.buession.lang.Status |
configSet(String parameter,
String value)
动态地调整 Redis 服务器的配置
详情说明 http://redisdoc.com/configure/config_set.html
|
Long |
dbSize()
获取数据库的 key 的数量
详情说明 http://redisdoc.com/database/dbsize.html
|
com.buession.lang.Status |
failover()
This command will start a coordinated failover between the currently-connected-to master and one of its replicas
详情说明 https://redis.io/commands/failover/
|
com.buession.lang.Status |
failover(int timeout)
This command will start a coordinated failover between the currently-connected-to master and one of its replicas
详情说明 https://redis.io/commands/failover/
|
com.buession.lang.Status |
failover(String host,
int port)
This command will start a coordinated failover between the currently-connected-to master and one of its replicas
详情说明 https://redis.io/commands/failover/
|
com.buession.lang.Status |
failover(String host,
int port,
boolean isForce,
int timeout)
This command will start a coordinated failover between the currently-connected-to master and one of its replicas
详情说明 https://redis.io/commands/failover/
|
com.buession.lang.Status |
failover(String host,
int port,
int timeout)
This command will start a coordinated failover between the currently-connected-to master and one of its replicas
详情说明 https://redis.io/commands/failover/
|
com.buession.lang.Status |
flushAll()
清空整个 Redis 服务器的数据(删除所有数据库的所有 key )
详情说明 http://redisdoc.com/database/flushallhtml
|
com.buession.lang.Status |
flushAll(FlushMode mode)
清空整个 Redis 服务器的数据(删除所有数据库的所有 key )
详情说明 http://redisdoc.com/database/flushallhtml
|
com.buession.lang.Status |
flushDb()
清空当前数据库中的所有 key
详情说明 http://redisdoc.com/database/flushdb.html
|
com.buession.lang.Status |
flushDb(FlushMode mode)
清空当前数据库中的所有 key
详情说明 http://redisdoc.com/database/flushdb.html
|
Info |
info()
获取关于 Redis 服务器的各种信息和统计数值
详情说明 http://redisdoc.com/client_and_server/info.html
|
Info |
info(Info.Section section)
获取关于 Redis 服务器通过 section 指定的部分信息
详情说明 http://redisdoc.com/client_and_server/info.html
|
Long |
lastSave()
获取最近一次 Redis 成功将数据保存到磁盘上的时间,以 UNIX 时间戳格式表示
详情说明 http://redisdoc.com/persistence/lastsave.html
|
String |
memoryDoctor()
列出 Redis 服务器遇到的不同类型的内存相关问题,并提供相应的解决建议
详情说明 https://redis.io/commands/memory-doctor/
|
com.buession.lang.Status |
memoryPurge()
The MEMORY PURGE command attempts to purge dirty pages so these can be reclaimed by the allocator
详情说明 https://redis.io/commands/memory-purge/
|
MemoryStats |
memoryStats()
The MEMORY STATS command returns an Array reply about the memory usage of the server
详情说明 https://redis.io/commands/memory-stats/
|
Long |
memoryUsage(byte[] key)
The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in RAM
详情说明 https://redis.io/commands/memory-usage/
|
Long |
memoryUsage(byte[] key,
int samples)
The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in RAM
详情说明 https://redis.io/commands/memory-usage/
|
Long |
memoryUsage(String key)
The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in RAM
详情说明 https://redis.io/commands/memory-usage/
|
Long |
memoryUsage(String key,
int samples)
The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in RAM
详情说明 https://redis.io/commands/memory-usage/
|
List<Module> |
moduleList()
Returns information about the modules loaded to the server
详情说明 https://redis.io/commands/module-list/
|
com.buession.lang.Status |
moduleLoad(byte[] path,
byte[]... arguments)
Returns information about the modules loaded to the server
详情说明 https://redis.io/commands/module-load/
|
com.buession.lang.Status |
moduleLoad(String path,
String... arguments)
Returns information about the modules loaded to the server
详情说明 https://redis.io/commands/module-load/
|
com.buession.lang.Status |
moduleUnLoad(byte[] name)
This command unloads the module specified by name
详情说明 https://redis.io/commands/module-unload/
|
com.buession.lang.Status |
moduleUnLoad(String name)
This command unloads the module specified by name
详情说明 https://redis.io/commands/module-unload/
|
void |
monitor(RedisMonitor redisMonitor)
实时打印出 Redis 服务器接收到的命令
详情说明 http://redisdoc.com/debug/monitor.html
|
Object |
pSync(byte[] replicationId,
long offset)
用于复制功能(replication)的内部命令
详情说明 http://redisdoc.com/internal/psync.html
|
Object |
pSync(String replicationId,
long offset)
用于复制功能(replication)的内部命令
详情说明 http://redisdoc.com/internal/psync.html
|
com.buession.lang.Status |
replicaOf(String host,
int port)
可以在线修改当前服务器的复制设置
如果当前服务器已经是副本服务器,会将当前服务器转变为某一服务器的副本服务器;
如果当前服务器已经是某个主服务器的副本服务器,那么将使当前服务器停止对原主服务器的同步,丢弃旧数据集,转而开始对新主服务器进行同步
详情说明 https://redis.io/commands/replicaof/
|
List<Role> |
role()
获取实例在复制中担任的角色信息
详情说明 http://redisdoc.com/replication/role.html
|
com.buession.lang.Status |
save()
执行一个同步保存操作,将当前 Redis 实例的所有数据快照(snapshot)以 RDB 文件的形式保存到硬盘;
该操作,因为它会阻塞所有客户端
详情说明 http://redisdoc.com/persistence/save.html
|
void |
shutdown()
SHUTDOWN 命令执行以下操作:
1)停止所有客户端
2)如果有至少一个保存点在等待,执行 SAVE 命令
3)如果 AOF 选项被打开,更新 AOF 文件
4)关闭 redis 服务器
详情说明 http://redisdoc.com/client_and_server/shutdown.html
|
void |
shutdown(boolean save)
SHUTDOWN 命令执行以下操作:
1)停止所有客户端
2)如果有至少一个保存点在等待,执行 SAVE 命令
3)如果 AOF 选项被打开,更新 AOF 文件
4)关闭 redis 服务器(server)
详情说明 http://redisdoc.com/client_and_server/shutdown.html
|
com.buession.lang.Status |
slaveOf(String host,
int port)
用于在 Redis 运行时动态地修改复制(replication)功能的行为;
可以将当前服务器转变为指定服务器的从属服务器(slave server)
详情说明 http://redisdoc.com/replication/slaveof.html
|
List<SlowLog> |
slowLogGet()
The SLOWLOG GET command returns entries from the slow log in chronological order
详情说明 https://redis.io/commands/slowlog-get/
|
List<SlowLog> |
slowLogGet(long count)
The SLOWLOG GET command returns entries from the slow log in chronological order
详情说明 https://redis.io/commands/slowlog-get/
|
Long |
slowLogLen()
This command returns the current number of entries in the slow log
详情说明 https://redis.io/commands/slowlog-len/
|
com.buession.lang.Status |
slowLogReset()
This command resets the slow log, clearing all entries in it
详情说明 https://redis.io/commands/slowlog-reset/
|
com.buession.lang.Status |
swapdb(int db1,
int db2)
对换指定的两个数据库,使得两个数据库的数据立即互换
详情说明 http://redisdoc.com/database/swapdb.html
|
void |
sync()
用于复制功能(replication)的内部命令
详情说明 http://redisdoc.com/internal/sync.html
|
RedisServerTime |
time()
获取当前服务器时间
详情说明 http://redisdoc.com/client_and_server/time.html
|
List<String> aclCat()
List<String> aclCat(String categoryName)
categoryName
- Category NameList<byte[]> aclCat(byte[] categoryName)
categoryName
- Category Namecom.buession.lang.Status aclSetUser(String username, String... rules)
username
- 用户名rules
- the specified rulescom.buession.lang.Status aclSetUser(byte[] username, byte[]... rules)
username
- 用户名rules
- the specified rulesAclUser aclGetUser(String username)
username
- 用户名AclUser aclGetUser(byte[] username)
username
- 用户名List<String> aclUsers()
String aclWhoAmI()
Long aclDelUser(String... usernames)
usernames
- 用户名Long aclDelUser(byte[]... usernames)
usernames
- 用户名String aclGenPass()
List<String> aclList()
com.buession.lang.Status aclLoad()
List<AclLog> aclLog()
List<AclLog> aclLog(long count)
count
- 返回数量com.buession.lang.Status aclLogReset()
com.buession.lang.Status aclLogSave()
String bgRewriteAof()
String bgSave()
com.buession.lang.Status configSet(String parameter, String value)
parameter
- 配置项value
- 配置值com.buession.lang.Status configSet(byte[] parameter, byte[] value)
parameter
- 配置项value
- 配置值List<String> configGet(String parameter)
parameter
- 配置项List<byte[]> configGet(byte[] parameter)
parameter
- 配置项com.buession.lang.Status configResetStat()
com.buession.lang.Status configRewrite()
Long dbSize()
com.buession.lang.Status failover()
com.buession.lang.Status failover(String host, int port)
host
- 主机地址port
- 端口com.buession.lang.Status failover(String host, int port, int timeout)
host
- 主机地址port
- 端口timeout
- 超时(单位:毫秒)com.buession.lang.Status failover(String host, int port, boolean isForce, int timeout)
host
- 主机地址port
- 端口isForce
- 是否强制timeout
- 超时(单位:毫秒)com.buession.lang.Status failover(int timeout)
timeout
- 超时(单位:毫秒)com.buession.lang.Status flushAll()
com.buession.lang.Status flushAll(FlushMode mode)
mode
- 刷新模式com.buession.lang.Status flushDb()
com.buession.lang.Status flushDb(FlushMode mode)
mode
- 刷新模式Info info()
Info info(Info.Section section)
section
- InfoSectionLong lastSave()
String memoryDoctor()
com.buession.lang.Status memoryPurge()
MemoryStats memoryStats()
Long memoryUsage(String key)
key
- KeyLong memoryUsage(byte[] key)
key
- KeyLong memoryUsage(String key, int samples)
key
- Keysamples
- Samples countLong memoryUsage(byte[] key, int samples)
key
- Keysamples
- Samples countList<Module> moduleList()
com.buession.lang.Status moduleLoad(String path, String... arguments)
path
- Module Patharguments
- Argumentscom.buession.lang.Status moduleLoad(byte[] path, byte[]... arguments)
path
- Module Patharguments
- Argumentscom.buession.lang.Status moduleUnLoad(String name)
name
- Module Namecom.buession.lang.Status moduleUnLoad(byte[] name)
name
- Module Namevoid monitor(RedisMonitor redisMonitor)
redisMonitor
- Redis MonitorObject pSync(String replicationId, long offset)
replicationId
- Master Run Idoffset
- 偏移量Object pSync(byte[] replicationId, long offset)
replicationId
- Master Run Idoffset
- 偏移量void sync()
com.buession.lang.Status replicaOf(String host, int port)
host
- Redis 主机地址port
- Redis 端口com.buession.lang.Status slaveOf(String host, int port)
host
- Redis Slave Server 主机地址port
- Redis Slave Server 端口com.buession.lang.Status save()
void shutdown()
void shutdown(boolean save)
save
- 是否强制让数据库执行保存操作List<SlowLog> slowLogGet()
List<SlowLog> slowLogGet(long count)
count
- 返回条数Long slowLogLen()
com.buession.lang.Status slowLogReset()
com.buession.lang.Status swapdb(int db1, int db2)
db1
- 数据库 1 索引号db2
- 数据库 2 索引号RedisServerTime time()
Copyright © 2022 buession.com Inc.. All rights reserved.