public interface BasicCommands
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
auth(java.lang.String password)
Request for authentication in a password-protected Redis server.
|
java.lang.String |
auth(java.lang.String user,
java.lang.String password)
Request for authentication with username and password, based on the ACL feature introduced in
Redis 6.0 see https://redis.io/topics/acl
|
java.lang.String |
bgrewriteaof()
Instruct Redis to start an Append Only File rewrite process.
|
java.lang.String |
bgsave()
Save the DB in background.
|
java.lang.String |
configResetStat() |
java.lang.String |
configRewrite() |
java.lang.Long |
dbSize()
Return the number of keys in the currently-selected database.
|
java.lang.String |
debug(DebugParams params) |
java.lang.String |
flushAll()
Delete all the keys of all the existing databases, not just the currently selected one.
|
java.lang.String |
flushAll(FlushMode flushMode)
Delete all the keys of all the existing databases, not just the currently selected one.
|
java.lang.String |
flushDB()
Delete all the keys of the currently selected DB.
|
java.lang.String |
flushDB(FlushMode flushMode)
Delete all the keys of the currently selected DB.
|
int |
getDB()
Return the index of the current database
|
java.lang.String |
info()
The INFO command returns information and statistics about the server in a format that is simple
to parse by computers and easy to read by humans.
|
java.lang.String |
info(java.lang.String section)
The INFO command returns information and statistics about the server in a format that is simple
to parse by computers and easy to read by humans.
|
java.lang.Long |
lastsave()
Return the UNIX TIME of the last DB save executed with success.
|
java.lang.String |
ping()
This command is often used to test if a connection is still alive, or to measure latency.
|
java.lang.String |
quit()
Ask the server to close the connection.
|
java.lang.String |
save()
The SAVE commands performs a synchronous save of the dataset producing a point in time snapshot
of all the data inside the Redis instance, in the form of an RDB file.
|
java.lang.String |
select(int index)
Select the DB with having the specified zero-based numeric index.
|
java.lang.String |
shutdown()
Stop all the client.
|
java.lang.String |
slaveof(java.lang.String host,
int port)
The SLAVEOF command can change the replication settings of a slave on the fly.
|
java.lang.String |
slaveofNoOne()
SLAVEOF NO ONE will stop replication, turning the server into a MASTER, but will not discard
the replication.
|
java.lang.String |
swapDB(int index1,
int index2)
This command swaps two Redis databases, so that immediately all the clients connected to a
given database will see the data of the other database, and the other way around.
|
java.lang.Long |
waitReplicas(int replicas,
long timeout)
Blocks until all the previous write commands are successfully transferred and acknowledged by
at least the specified number of replicas.
|
java.lang.String ping()
java.lang.String quit()
java.lang.String flushDB()
java.lang.String flushDB(FlushMode flushMode)
flushMode
- java.lang.Long dbSize()
java.lang.String select(int index)
index
- the indexjava.lang.String swapDB(int index1, int index2)
index1
- index2
- java.lang.String flushAll()
java.lang.String flushAll(FlushMode flushMode)
flushMode
- java.lang.String auth(java.lang.String password)
password
- java.lang.String auth(java.lang.String user, java.lang.String password)
user
- password
- java.lang.String save()
java.lang.String bgsave()
java.lang.String bgrewriteaof()
java.lang.Long lastsave()
java.lang.String shutdown()
java.lang.String info()
java.lang.String info(java.lang.String section)
section
- (all: Return all sections, default: Return only the default set of sections,
server: General information about the Redis server, clients: Client connections
section, memory: Memory consumption related information, persistence: RDB and AOF
related information, stats: General statistics, replication: Master/slave replication
information, cpu: CPU consumption statistics, commandstats: Redis command statistics,
cluster: Redis Cluster section, keyspace: Database related statistics)java.lang.String slaveof(java.lang.String host, int port)
host
- listening at the specified hostnameport
- server listening at the specified portjava.lang.String slaveofNoOne()
int getDB()
java.lang.String debug(DebugParams params)
java.lang.String configResetStat()
java.lang.String configRewrite()
java.lang.Long waitReplicas(int replicas, long timeout)
replicas
- successfully transferred and acknowledged by at least the specified number of
replicastimeout
- the time to block in milliseconds, a timeout of 0 means to block forever