You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/01/03 21:19:26 UTC

[GitHub] [geode] dschneider-pivotal commented on a change in pull request #7227: feature/GEODE-9832: SMOVE Command Support

dschneider-pivotal commented on a change in pull request #7227:
URL: https://github.com/apache/geode/pull/7227#discussion_r777708262



##########
File path: geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSet.java
##########
@@ -69,6 +69,30 @@ public RedisSet(int expectedSize) {
    */
   public RedisSet() {}
 
+  public static int smove(RegionProvider regionProvider, List<RedisKey> keys, byte[] member) {
+    Region<RedisKey, RedisData> region = regionProvider.getDataRegion();
+    RedisKey sourceKey = keys.get(0);
+    RedisKey destKey = keys.get(1);
+
+    RedisSet source = regionProvider.getTypedRedisData(REDIS_SET, sourceKey, false);
+    if (source.scard() == 0 || !source.members.contains(member)) {
+      return 0;
+    }
+
+    RedisSet destination = regionProvider.getTypedRedisData(REDIS_SET, keys.get(1), false);

Review comment:
       should this use "destKey" instead of "keys.get(1)"?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org