public interface BasicCommands
Modifier and Type | Method and Description |
---|---|
String |
auth(String password)
Request for authentication in a password-protected Redis server.
|
String |
bgrewriteaof()
Instruct Redis to start an Append Only File rewrite process.
|
String |
bgsave()
Save the DB in background.
|
String |
configResetStat() |
String |
configRewrite() |
Long |
dbSize()
Return the number of keys in the currently-selected database.
|
String |
debug(DebugParams params) |
String |
flushAll()
Delete all the keys of all the existing databases, not just the currently selected one.
|
String |
flushDB()
Delete all the keys of the currently selected DB.
|
int |
getDB()
Return the index of the current database
|
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.
|
String |
info(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.
|
Long |
lastsave()
Return the UNIX TIME of the last DB save executed with success.
|
String |
ping()
This command is often used to test if a connection is still alive, or to measure latency.
|
String |
quit()
Ask the server to close the connection.
|
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.
|
String |
select(int index)
Select the DB with having the specified zero-based numeric index.
|
String |
shutdown()
Stop all the client.
|
String |
slaveof(String host,
int port)
The SLAVEOF command can change the replication settings of a slave on the fly.
|
String |
slaveofNoOne()
SLAVEOF NO ONE will stop replication, turning the server into a MASTER, but will not discard the replication.
|
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.
|
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.
|
String ping()
String quit()
String flushDB()
Long dbSize()
String select(int index)
index
- the indexString swapDB(int index1, int index2)
index1
- index2
- String flushAll()
String auth(String password)
password
- String save()
String bgsave()
String bgrewriteaof()
Long lastsave()
String shutdown()
String info()
String info(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)String slaveof(String host, int port)
host,
- listening at the specified hostnameport,
- server listening at the specified portString slaveofNoOne()
int getDB()
String debug(DebugParams params)
String configResetStat()
String configRewrite()
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 foreverCopyright © 2018. All rights reserved.