DonalEvans commented on a change in pull request #6595:
URL: https://github.com/apache/geode/pull/6595#discussion_r650079969



##########
File path: 
geode-apis-compatible-with-redis/src/distributedTest/java/org/apache/geode/redis/internal/data/DeltaDUnitTest.java
##########
@@ -45,31 +49,24 @@
   @ClassRule

Review comment:
       While this class is being cleaned up, the `@SuppressWarnings` a few 
lines above here is unnecessary and can be removed.

##########
File path: 
geode-apis-compatible-with-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/MovedDUnitTest.java
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+
+package org.apache.geode.redis.internal.executor;
+
+import static 
org.apache.geode.test.dunit.rules.RedisClusterStartupRule.BIND_ADDRESS;
+import static 
org.apache.geode.test.dunit.rules.RedisClusterStartupRule.REDIS_CLIENT_TIMEOUT;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import io.lettuce.core.cluster.ClusterClientOptions;
+import io.lettuce.core.cluster.ClusterTopologyRefreshOptions;
+import io.lettuce.core.cluster.RedisClusterClient;
+import io.lettuce.core.cluster.api.sync.RedisAdvancedClusterCommands;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.exceptions.JedisMovedDataException;
+
+import org.apache.geode.cache.control.RebalanceFactory;
+import org.apache.geode.cache.control.ResourceManager;
+import org.apache.geode.redis.internal.cluster.RedisMemberInfo;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.dunit.rules.RedisClusterStartupRule;
+
+public class MovedDUnitTest {
+
+  @ClassRule
+  public static RedisClusterStartupRule clusterStartUp = new 
RedisClusterStartupRule();
+
+  private static Jedis jedis1;
+  private static Jedis jedis2;
+  private static RedisAdvancedClusterCommands<String, String> lettuce;
+  private static MemberVM locator;
+  private static int redisServerPort1;
+  private static final int ENTRIES = 200;
+
+  @BeforeClass
+  public static void classSetup() {
+    locator = clusterStartUp.startLocatorVM(0);
+    clusterStartUp.startRedisVM(1, locator.getPort());
+    clusterStartUp.startRedisVM(2, locator.getPort());
+
+    redisServerPort1 = clusterStartUp.getRedisPort(1);
+    int redisServerPort2 = clusterStartUp.getRedisPort(2);
+
+    jedis1 = new Jedis(BIND_ADDRESS, redisServerPort1, REDIS_CLIENT_TIMEOUT);
+    jedis2 = new Jedis(BIND_ADDRESS, redisServerPort2, REDIS_CLIENT_TIMEOUT);
+
+    RedisClusterClient clusterClient =
+        RedisClusterClient.create("redis://localhost:" + redisServerPort1);
+
+    ClusterTopologyRefreshOptions refreshOptions =
+        ClusterTopologyRefreshOptions.builder()
+            .enableAllAdaptiveRefreshTriggers()
+            .build();
+
+    clusterClient.setOptions(ClusterClientOptions.builder()
+        .topologyRefreshOptions(refreshOptions)
+        .autoReconnect(true)
+        .validateClusterNodeMembership(false)
+        .build());
+
+    lettuce = clusterClient.connect().sync();
+  }
+
+  @Before

Review comment:
       Does this test need an `@After` or `@AfterClass` method? Most other 
Redis DUnit tests seem to have one to clean up the clients started in the test.

##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java
##########
@@ -266,7 +267,7 @@ public static ByteBuf getCustomErrorResponse(ByteBuf 
buffer, String error) {
   public static ByteBuf getWrongTypeResponse(ByteBuf buffer, String error) {

Review comment:
       Can this method be changed to also call `getErrorResponse0()` like the 
other error response types?

##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/cluster/RedisMemberInfo.java
##########
@@ -26,7 +27,7 @@
 import org.apache.geode.internal.serialization.KnownVersion;
 import org.apache.geode.internal.serialization.SerializationContext;
 
-public class RedisMemberInfo implements DataSerializableFixedID {
+public class RedisMemberInfo implements DataSerializableFixedID, Serializable {

Review comment:
       What's the reason for this change? Also, this class should define a 
serialVersionUID if it's implementing Serializable.

##########
File path: 
geode-apis-compatible-with-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/hash/HScanDunitTest.java
##########
@@ -62,8 +57,7 @@
   public ExecutorServiceRule executor = new ExecutorServiceRule();
 
   private static RedisAdvancedClusterCommands<String, String> commands;
-  private RedisClusterClient redisClient;
-  private StatefulRedisClusterConnection<String, String> connection;
+  private static StatefulRedisClusterConnection<String, String> connection;

Review comment:
       This field is never used and can be removed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to