Skip to content

Commit

Permalink
Polishing #2023
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Feb 28, 2022
1 parent 6245e26 commit 1cae15f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/lettuce/core/TimeoutOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.lettuce.core.protocol.RedisCommand;

/**
* Options for command timeouts. This options configure how and whether commands time out once they were dispatched. Command
* Options for command timeouts. These options configure how and whether commands time out once they were dispatched. Command
* timeout begins:
* <ul>
* <li>When the command is sent successfully to the transport</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ public interface RedisServerCommands<K, V> {
* @return String simple-string-reply.
* @deprecated since 6.1.7, use {@link #replicaof(String, int)} instead.
*/
@Deprecated
String slaveof(String host, int port);

/**
Expand All @@ -400,6 +401,7 @@ public interface RedisServerCommands<K, V> {
* @return String simple-string-reply.
* @deprecated since 6.1.7, use {@link #replicaofNoOne()} instead.
*/
@Deprecated
String slaveofNoOne();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;

Expand Down Expand Up @@ -64,10 +63,13 @@
class TopologyRefreshIntegrationTests extends TestSupport {

private static final String host = TestSettings.hostAddr();

private final RedisClient client;

private RedisClusterClient clusterClient;

private RedisCommands<String, String> redis1;

private RedisCommands<String, String> redis2;

@Inject
Expand All @@ -77,8 +79,8 @@ class TopologyRefreshIntegrationTests extends TestSupport {

@BeforeEach
void openConnection() {
clusterClient = RedisClusterClient.create(client.getResources(), RedisURI.Builder
.redis(host, ClusterTestSettings.port1).build());
clusterClient = RedisClusterClient.create(client.getResources(),
RedisURI.Builder.redis(host, ClusterTestSettings.port1).build());
redis1 = client.connect(RedisURI.Builder.redis(ClusterTestSettings.host, ClusterTestSettings.port1).build()).sync();
redis2 = client.connect(RedisURI.Builder.redis(ClusterTestSettings.host, ClusterTestSettings.port2).build()).sync();
}
Expand Down Expand Up @@ -272,11 +274,10 @@ void adaptiveTriggerOnMoveRedirection() {
assertThat(clusterClient.getPartitions().getPartitionByNodeId(node1.getNodeId()).getSlots()).hasSize(0);
assertThat(clusterClient.getPartitions().getPartitionByNodeId(node2.getNodeId()).getSlots()).hasSize(16384);

Future<String> b = connection.reactive().set("b", value).toFuture();// slot 3300
connection.reactive().set("b", value).toFuture();// slot 3300

Wait.untilEquals(12000, () -> clusterClient.getPartitions().getPartitionByNodeId(node1.getNodeId()).getSlots().size())
.waitOrTimeout();
System.out.println(b);

assertThat(clusterClient.getPartitions().getPartitionByNodeId(node1.getNodeId()).getSlots()).hasSize(12000);
assertThat(clusterClient.getPartitions().getPartitionByNodeId(node2.getNodeId()).getSlots()).hasSize(4384);
Expand Down Expand Up @@ -308,4 +309,5 @@ private void runReconnectTest(
}
clusterConnection.getStatefulConnection().close();
}

}

0 comments on commit 1cae15f

Please sign in to comment.