Skip to content

Commit

Permalink
tense
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Feb 21, 2024
1 parent 88649d9 commit 7d6c220
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 43 deletions.
10 changes: 5 additions & 5 deletions java/client/src/main/java/glide/api/RedisClusterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ public CompletableFuture<Long> clientId() {
return super.clientId();
}

@Override
public CompletableFuture<String> clientGetName() {
return super.clientGetName();
}

@Override
public CompletableFuture<ClusterValue<Long>> clientId(@NonNull Route route) {
return commandManager.submitNewCommand(
Expand All @@ -158,6 +153,11 @@ public CompletableFuture<ClusterValue<Long>> clientId(@NonNull Route route) {
: ClusterValue.of(handleMapResponse(response)));
}

@Override
public CompletableFuture<String> clientGetName() {
return super.clientGetName();
}

@Override
public CompletableFuture<ClusterValue<String>> clientGetName(@NonNull Route route) {
return commandManager.submitNewCommand(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface ConnectionManagementBaseCommands {
CompletableFuture<String> ping(String str);

/**
* Get the current connection id.
* Gets the current connection id.
*
* @see <a href="https://redis.io/commands/client-id/">redis.io</a> for details.
* @return The id of the client.
Expand All @@ -42,7 +42,7 @@ public interface ConnectionManagementBaseCommands {
CompletableFuture<Long> clientId();

/**
* Get the name of the current connection.
* Gets the name of the current connection.
*
* @see <a href="https://redis.io/commands/client-getname/">redis.io</a> for details.
* @return The name of the client connection as a string if a name is set, or <code>null</code> if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface ConnectionManagementClusterCommands {
CompletableFuture<String> ping(String str, Route route);

/**
* Get the current connection id.<br>
* Gets the current connection id.<br>
* The command will be routed a random node.
*
* @see <a href="https://redis.io/commands/client-id/">redis.io</a> for details.
Expand All @@ -49,22 +49,7 @@ public interface ConnectionManagementClusterCommands {
CompletableFuture<Long> clientId();

/**
* Get the name of the current connection.<br>
* The command will be routed a random node.
*
* @see <a href="https://redis.io/commands/client-getname/">redis.io</a> for details.
* @return The name of the client connection as a string if a name is set, or <code>null</code> if
* no name is assigned.
* @example
* <pre>
* String clientName = client.clientGetName().get();
* assert clientName != null
* </pre>
*/
CompletableFuture<String> clientGetName();

/**
* Get the current connection id.
* Gets the current connection id.
*
* @see <a href="https://redis.io/commands/client-id/">redis.io</a> for details.
* @param route Routing configuration for the command. Client will route the command to the nodes
Expand All @@ -87,7 +72,22 @@ public interface ConnectionManagementClusterCommands {
CompletableFuture<ClusterValue<Long>> clientId(Route route);

/**
* Get the name of the current connection.
* Gets the name of the current connection.<br>
* The command will be routed a random node.
*
* @see <a href="https://redis.io/commands/client-getname/">redis.io</a> for details.
* @return The name of the client connection as a string if a name is set, or <code>null</code> if
* no name is assigned.
* @example
* <pre>
* String clientName = client.clientGetName().get();
* assert clientName != null
* </pre>
*/
CompletableFuture<String> clientGetName();

/**
* Gets the name of the current connection.
*
* @see <a href="https://redis.io/commands/client-getname/">redis.io</a> for details.
* @param route Routing configuration for the command. Client will route the command to the nodes
Expand Down
20 changes: 2 additions & 18 deletions java/integTest/src/test/java/glide/cluster/CommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,24 +265,8 @@ public void info_with_multi_node_route_and_options() {
@Test
@SneakyThrows
public void clientId() {
var currentId = clusterClient.clientId().get();

try (var newClient =
RedisClusterClient.CreateClient(
RedisClusterClientConfiguration.builder()
.address(NodeAddress.builder().port(CLUSTER_PORTS[0]).build())
.requestTimeout(5000)
.build())
.get()) {

var newClientId = newClient.clientId().get();

assertTrue(
currentId < newClientId,
String.format(
"New client got ID smaller or equal that the old one. New ID : %d, old ID : %d",
newClientId, currentId));
}
var id = clusterClient.clientId().get();
assertTrue(id > 0);
}

@Test
Expand Down

0 comments on commit 7d6c220

Please sign in to comment.