public final class JedisServerOperations extends AbstractServerOperations<JedisStandaloneClient>
JedisRedisOperations.AbstractJedisCommand<CLIENT extends JedisRedisClient,CONN extends JedisRedisConnection,R>, JedisRedisOperations.JedisClusterCommand<R>, JedisRedisOperations.JedisCommand<R>, JedisRedisOperations.JedisSentinelCommand<R>
client
logger
构造器和说明 |
---|
JedisServerOperations(JedisStandaloneClient client) |
限定符和类型 | 方法和说明 |
---|---|
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(String path,
String... arguments)
Returns information about the modules loaded to the server
详情说明 https://redis.io/commands/module-load/
|
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
|
moduleLoad, moduleUnLoad
public JedisServerOperations(JedisStandaloneClient client)
public List<String> aclCat()
ServerCommands
public List<String> aclCat(String categoryName)
ServerCommands
categoryName
- Category Namepublic List<byte[]> aclCat(byte[] categoryName)
ServerCommands
categoryName
- Category Namepublic com.buession.lang.Status aclSetUser(String username, String... rules)
ServerCommands
username
- 用户名rules
- the specified rulespublic com.buession.lang.Status aclSetUser(byte[] username, byte[]... rules)
ServerCommands
username
- 用户名rules
- the specified rulespublic AclUser aclGetUser(String username)
ServerCommands
username
- 用户名public AclUser aclGetUser(byte[] username)
ServerCommands
username
- 用户名public List<String> aclUsers()
ServerCommands
public String aclWhoAmI()
ServerCommands
public Long aclDelUser(String... usernames)
ServerCommands
usernames
- 用户名public Long aclDelUser(byte[]... usernames)
ServerCommands
usernames
- 用户名public String aclGenPass()
ServerCommands
public List<String> aclList()
ServerCommands
public com.buession.lang.Status aclLoad()
ServerCommands
public List<AclLog> aclLog()
ServerCommands
public List<AclLog> aclLog(long count)
ServerCommands
count
- 返回数量public com.buession.lang.Status aclLogReset()
ServerCommands
public com.buession.lang.Status aclLogSave()
ServerCommands
public String bgRewriteAof()
ServerCommands
public String bgSave()
ServerCommands
public com.buession.lang.Status configSet(String parameter, String value)
ServerCommands
parameter
- 配置项value
- 配置值public com.buession.lang.Status configSet(byte[] parameter, byte[] value)
ServerCommands
parameter
- 配置项value
- 配置值public List<String> configGet(String parameter)
ServerCommands
parameter
- 配置项public List<byte[]> configGet(byte[] parameter)
ServerCommands
parameter
- 配置项public com.buession.lang.Status configResetStat()
ServerCommands
public com.buession.lang.Status configRewrite()
ServerCommands
public Long dbSize()
ServerCommands
public com.buession.lang.Status failover()
ServerCommands
public com.buession.lang.Status failover(String host, int port)
ServerCommands
host
- 主机地址port
- 端口public com.buession.lang.Status failover(String host, int port, int timeout)
ServerCommands
host
- 主机地址port
- 端口timeout
- 超时(单位:毫秒)public com.buession.lang.Status failover(String host, int port, boolean isForce, int timeout)
ServerCommands
host
- 主机地址port
- 端口isForce
- 是否强制timeout
- 超时(单位:毫秒)public com.buession.lang.Status failover(int timeout)
ServerCommands
timeout
- 超时(单位:毫秒)public com.buession.lang.Status flushAll()
ServerCommands
public com.buession.lang.Status flushAll(FlushMode mode)
ServerCommands
mode
- 刷新模式public com.buession.lang.Status flushDb()
ServerCommands
public com.buession.lang.Status flushDb(FlushMode mode)
ServerCommands
mode
- 刷新模式public Info info()
ServerCommands
public Info info(Info.Section section)
ServerCommands
section
- InfoSectionpublic Long lastSave()
ServerCommands
public String memoryDoctor()
ServerCommands
public com.buession.lang.Status memoryPurge()
ServerCommands
public MemoryStats memoryStats()
ServerCommands
public Long memoryUsage(String key)
ServerCommands
key
- Keypublic Long memoryUsage(byte[] key)
ServerCommands
key
- Keypublic Long memoryUsage(String key, int samples)
ServerCommands
key
- Keysamples
- Samples countpublic Long memoryUsage(byte[] key, int samples)
ServerCommands
key
- Keysamples
- Samples countpublic List<Module> moduleList()
ServerCommands
public com.buession.lang.Status moduleLoad(String path, String... arguments)
ServerCommands
path
- Module Patharguments
- Argumentspublic com.buession.lang.Status moduleUnLoad(String name)
ServerCommands
name
- Module Namepublic void monitor(RedisMonitor redisMonitor)
ServerCommands
redisMonitor
- Redis Monitorpublic Object pSync(String replicationId, long offset)
ServerCommands
replicationId
- Master Run Idoffset
- 偏移量public Object pSync(byte[] replicationId, long offset)
ServerCommands
replicationId
- Master Run Idoffset
- 偏移量public void sync()
ServerCommands
public com.buession.lang.Status replicaOf(String host, int port)
ServerCommands
host
- Redis 主机地址port
- Redis 端口public com.buession.lang.Status slaveOf(String host, int port)
ServerCommands
host
- Redis Slave Server 主机地址port
- Redis Slave Server 端口public List<Role> role()
ServerCommands
public com.buession.lang.Status save()
ServerCommands
public void shutdown()
ServerCommands
public void shutdown(boolean save)
ServerCommands
save
- 是否强制让数据库执行保存操作public List<SlowLog> slowLogGet()
ServerCommands
public List<SlowLog> slowLogGet(long count)
ServerCommands
count
- 返回条数public Long slowLogLen()
ServerCommands
public com.buession.lang.Status slowLogReset()
ServerCommands
public com.buession.lang.Status swapdb(int db1, int db2)
ServerCommands
db1
- 数据库 1 索引号db2
- 数据库 2 索引号public RedisServerTime time()
ServerCommands
Copyright © 2023 buession.com Inc.. All rights reserved.