Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add javadoc for ControlBinaryCommands #2835

Merged
merged 3 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,95 @@

import java.util.List;

/**
* The interface about Redis management command
*/
public interface ControlBinaryCommands extends AccessControlLogBinaryCommands, ClientBinaryCommands {

/**
* Provide information on the role of a Redis instance in the context of replication,
* by returning if the instance is currently a master, slave, or sentinel. The command
* also returns additional information about the state of the replication
* (if the role is master or slave) or the list of monitored master names (if the role is sentinel).
*
* @return The information on the role of a Redis instance
*/
List<Object> roleBinary();

/**
* Returns the reference count of the stored at {@code key}.
*
* @param key The key in Redis server
* @return The reference count of the stored at {@code key}
*/
Long objectRefcount(byte[] key);

/**
* Returns the internal encoding for the Redis object stored at {@code key}.
* <p>
* See for details: <a href="https://redis.io/commands/object-encoding">OBJECT ENCODING key</a>
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
*
* @param key The key in Redis server
* @return The number of references
*/
byte[] objectEncoding(byte[] key);

/**
* Returns the time in seconds since the last access to the value stored at {@code key}.
* The command is only available when the maxmemory-policy configuration directive
* is not set to one of the LFU policies.
*
* @param key The key in Redis server
* @return The idle time in seconds
*/
Long objectIdletime(byte[] key);

/**
* Returns the object subcommands and usages.
*
* @return object subcommands and usages
*/
List<byte[]> objectHelpBinary();

/**
* Returns the logarithmic access frequency counter of a Redis object stored at {@code key}.
* <p>
* The command is only available when the maxmemory-policy configuration directive is
* set to one of the LFU policies.
*
* @param key The key in Redis server
* @return The counter's value
*/
Long objectFreq(byte[] key);

/**
* Reports about different memory-related issues that the Redis server experiences,
* and advises about possible remedies.
*/
byte[] memoryDoctorBinary();

/**
* Reports the number of bytes that a key and its value require to be stored in RAM.
* The reported usage is the total of memory allocations for data and administrative
* overheads that a key its value require.
* <p>
* See for details: <a href="https://redis.io/commands/memory-usage">MEMORY USAGE key</a>
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
*
* @param key The key in Redis server
* @return The memory usage in bytes, or nil when the key does not exist
*/
Long memoryUsage(byte[] key);

/**
* Reports the number of bytes that a key and its value require to be stored in RAM.
* The reported usage is the total of memory allocations for data and administrative
* overheads that a key its value require.
* <p>
* See for details: <a href="https://redis.io/commands/memory-usage">MEMORY USAGE key SAMPLES count</a>
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
*
* @param key The key in Redis server
* @return The memory usage in bytes, or nil when the key does not exist
*/
Long memoryUsage(byte[] key, int samples);

}
71 changes: 71 additions & 0 deletions src/main/java/redis/clients/jedis/commands/ControlCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,95 @@

import java.util.List;

/**
* The interface about Redis management command
*/
public interface ControlCommands extends AccessControlLogCommands, ClientCommands {

/**
* Provide information on the role of a Redis instance in the context of replication,
* by returning if the instance is currently a master, slave, or sentinel. The command
* also returns additional information about the state of the replication
* (if the role is master or slave) or the list of monitored master names (if the role is sentinel).
*
* @return The information on the role of a Redis instance
*/
List<Object> role();

/**
* Returns the reference count of the stored at {@code key}.
*
* @param key The key in Redis server
* @return The reference count of the stored at {@code key}
*/
Long objectRefcount(String key);

/**
* Returns the internal encoding for the Redis object stored at {@code key}.
* <p>
* See for details: <a href="https://redis.io/commands/object-encoding">OBJECT ENCODING key</a>
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
*
* @param key The key in Redis server
* @return The number of references
*/
String objectEncoding(String key);

/**
* Returns the time in seconds since the last access to the value stored at {@code key}.
* The command is only available when the maxmemory-policy configuration directive
* is not set to one of the LFU policies.
*
* @param key The key in Redis server
* @return The idle time in seconds
*/
Long objectIdletime(String key);

/**
* Returns the object subcommands and usages.
*
* @return object subcommands and usages
*/
List<String> objectHelp();

/**
* Returns the logarithmic access frequency counter of a Redis object stored at {@code key}.
* <p>
* The command is only available when the maxmemory-policy configuration directive is
* set to one of the LFU policies.
*
* @param key The key in Redis server
* @return The counter's value
*/
Long objectFreq(String key);

/**
* Reports about different memory-related issues that the Redis server experiences,
* and advises about possible remedies.
*/
String memoryDoctor();

/**
* Reports the number of bytes that a key and its value require to be stored in RAM.
* The reported usage is the total of memory allocations for data and administrative
* overheads that a key its value require.
* <p>
* See for details: <a href="https://redis.io/commands/memory-usage">MEMORY USAGE key</a>
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
*
* @param key The key in Redis server
* @return The memory usage in bytes, or {@code nil} when the key does not exist
*/
Long memoryUsage(String key);

/**
* Reports the number of bytes that a key and its value require to be stored in RAM.
* The reported usage is the total of memory allocations for data and administrative
* overheads that a key its value require.
* <p>
* See for details: <a href="https://redis.io/commands/memory-usage">MEMORY USAGE key SAMPLES count</a>
sazzad16 marked this conversation as resolved.
Show resolved Hide resolved
*
* @param key The key in Redis server
* @return The memory usage in bytes, or {@code nil} when the key does not exist
*/
Long memoryUsage(String key, int samples);

}