public interface ServerCommands
Modifier and Type | Method and Description |
---|---|
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 |
bgsaveSchedule() |
byte[] |
echo(byte[] arg) |
java.lang.String |
echo(java.lang.String string) |
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.
|
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.
|
long |
lastsave()
Return the UNIX TIME of the last DB save executed with success.
|
java.lang.String |
latencyDoctor()
The LATENCY DOCTOR command reports about different latency-related issues and advises about
possible remedies.
|
java.lang.String |
lolwut() |
java.lang.String |
lolwut(LolwutParams lolwutParams) |
java.lang.String |
ping()
This command is often used to test if a connection is still alive, or to measure latency.
|
java.lang.String |
ping(java.lang.String message) |
java.lang.String |
replicaof(java.lang.String host,
int port)
The REPLICAOF command can change the replication settings of a replica on the fly.
|
java.lang.String |
replicaofNoOne()
REPLICAOF NO ONE will stop replication, turning the server into a MASTER, but will not discard
the replication.
|
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.
|
void |
shutdown()
Stop all the client.
|
default void |
shutdown(SaveMode saveMode) |
void |
shutdown(ShutdownParams shutdownParams) |
java.lang.String |
shutdownAbort() |
java.lang.String |
slaveof(java.lang.String host,
int port)
Deprecated.
|
java.lang.String |
slaveofNoOne()
Deprecated.
Use
replicaofNoOne() . |
KeyValue<java.lang.Long,java.lang.Long> |
waitAOF(long numLocal,
long numReplicas,
long timeout)
Blocks the current client until all the previous write commands are acknowledged as having been
fsynced to the AOF of the local Redis and/or at least the specified number of replicas.
|
long |
waitReplicas(int replicas,
long timeout)
Synchronous replication of Redis as described here: http://antirez.com/news/66.
|
java.lang.String ping()
java.lang.String ping(java.lang.String message)
java.lang.String echo(java.lang.String string)
byte[] echo(byte[] arg)
java.lang.String flushDB()
java.lang.String flushDB(FlushMode flushMode)
flushMode
- can be SYNC or ASYNCjava.lang.String flushAll()
java.lang.String flushAll(FlushMode flushMode)
flushMode
- SYNC or ASYNCjava.lang.String auth(java.lang.String password)
java.lang.String auth(java.lang.String user, java.lang.String password)
java.lang.String save()
java.lang.String bgsave()
java.lang.String bgsaveSchedule()
java.lang.String bgrewriteaof()
long lastsave()
void shutdown() throws JedisException
JedisException
- only in case of error.default void shutdown(SaveMode saveMode) throws JedisException
JedisException
void shutdown(ShutdownParams shutdownParams) throws JedisException
shutdownParams
- set commands parametersJedisException
SaveMode
java.lang.String shutdownAbort()
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)@Deprecated java.lang.String slaveof(java.lang.String host, int port)
replicaof(java.lang.String, int)
.host
- listening at the specified hostnameport
- server listening at the specified port@Deprecated java.lang.String slaveofNoOne()
replicaofNoOne()
.java.lang.String replicaof(java.lang.String host, int port)
host
- listening at the specified hostnameport
- server listening at the specified portjava.lang.String replicaofNoOne()
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. If the timeout, specified in milliseconds, is reached, the command returns even if the specified number of replicas were not yet reached.
Since Java Object class has implemented wait
method, we cannot use it.
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 foreverKeyValue<java.lang.Long,java.lang.Long> waitAOF(long numLocal, long numReplicas, long timeout)
numLocal
- Number of local instances that are required to acknowledge the sync (0 or 1),
cannot be non-zero if the local Redis does not have AOF enablednumReplicas
- Number of replicas that are required to acknowledge the synctimeout
- Timeout in millis of the operation - if 0 timeout is unlimited. If the timeout is reached,
the command returns even if the specified number of acknowledgments has not been met.java.lang.String lolwut()
java.lang.String lolwut(LolwutParams lolwutParams)
java.lang.String latencyDoctor()
This command is the most powerful analysis tool in the latency monitoring framework, and is able to provide additional statistical data like the average period between latency spikes, the median deviation, and a human-readable analysis of the event. For certain events, like fork, additional information is provided, like the rate at which the system forks processes.
This is the output you should post in the Redis mailing list if you are looking for help about Latency related issues.
Copyright © 2023. All rights reserved.