|
| void | set (String key, String value) |
| |
| String | get (String key) |
| |
| boolean | delete (String key) |
| |
| void | increment (String key, int incrementAmount) |
| |
| void | increment (String key) |
| |
| java.util.concurrent.CompletableFuture< String > | executeAsync (String command, String... args) |
| |
| String | execute (String command, String... args) |
| |
|
void | close () |
| |
|
|
| NettyKvClient (String host, int port, int timeoutMs) |
| |
◆ delete()
| boolean me.ccute.kvstore.sdk.client.NettyKvClient.delete |
( |
String | key | ) |
|
Deletes the given key and its associated value from the database.
- Parameters
-
| key | The unique identifier for the data. Cannot be null or empty. |
- Returns
- true if the key was deleted, false if it did not exist.
- Exceptions
-
| KvException | if a network or server error occurs. |
Implements me.ccute.kvstore.sdk.client.KvClient.
◆ execute()
| String me.ccute.kvstore.sdk.client.NettyKvClient.execute |
( |
String | command, |
|
|
String... | args ) |
Executes a raw command against the server. Useful for CLI tools or invoking custom server commands not yet typed in the SDK.
- Parameters
-
| command | The command to execute (e.g., "SET"). |
| args | The arguments for the command. |
- Returns
- The string response from the server.
- Exceptions
-
| KvException | if the command fails or times out. |
Implements me.ccute.kvstore.sdk.client.KvClient.
◆ executeAsync()
| java.util.concurrent.CompletableFuture< String > me.ccute.kvstore.sdk.client.NettyKvClient.executeAsync |
( |
String | command, |
|
|
String... | args ) |
◆ get()
| String me.ccute.kvstore.sdk.client.NettyKvClient.get |
( |
String | key | ) |
|
Retrieves the value associated with the given key.
- Parameters
-
| key | The unique identifier for the data. Cannot be null or empty. |
- Returns
- The value, or null if the key does not exist.
- Exceptions
-
| KvException | if a network or server error occurs. |
Implements me.ccute.kvstore.sdk.client.KvClient.
◆ increment() [1/2]
| void me.ccute.kvstore.sdk.client.NettyKvClient.increment |
( |
String | key | ) |
|
Increments the numeric value stored at the specified key by exactly 1.
This is a convenience method equivalent to calling increment(key, 1).
- Parameters
-
| key | The unique identifier for the data. Cannot be null or empty. |
- See also
- #increment(String, int)
Implements me.ccute.kvstore.sdk.client.KvClient.
◆ increment() [2/2]
| void me.ccute.kvstore.sdk.client.NettyKvClient.increment |
( |
String | key, |
|
|
int | increment ) |
Increments the numeric value stored at the specified key by the given amount.
If the key does not exist, it is initialized to 0 before performing the increment. If the stored value cannot be parsed as an integer, a KvException is thrown.
- Parameters
-
| key | The unique identifier for the data. Cannot be null or empty. |
| increment | The amount to add to the current value. Can be negative to decrement. |
- Exceptions
-
| IllegalArgumentException | if the key is invalid. |
| KvException | if a network error occurs or the existing value is not a number. |
Implements me.ccute.kvstore.sdk.client.KvClient.
◆ set()
| void me.ccute.kvstore.sdk.client.NettyKvClient.set |
( |
String | key, |
|
|
String | value ) |
Stores a value in the database associated with the given key.
- Parameters
-
| key | The unique identifier for the data. Cannot be null or empty. |
| value | The string value to store. Cannot be null. |
- Exceptions
-
| IllegalArgumentException | if the key or value is invalid. |
| KvException | if a network or server error occurs. |
Implements me.ccute.kvstore.sdk.client.KvClient.
The documentation for this class was generated from the following file:
- sdk/java/src/main/java/me/ccute/kvstore/sdk/client/NettyKvClient.java