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



##########
File path: 
geode-redis/src/main/java/org/apache/geode/redis/internal/executor/RenameExecutor.java
##########
@@ -64,6 +69,24 @@ public void executeCommand(Command command, 
ExecutionHandlerContext context) {
             region.put(newKey, value);
             removeEntry(key, redisDataType, context);
             break;
+          case REDIS_HASH:
+            // TODO this all needs to be done atomically. Add RENAME support 
to RedisHashCommands
+            RedisHashCommands redisHashCommands =
+                new 
RedisHashCommandsFunctionExecutor(context.getRegionProvider().getDataRegion());
+            Collection<ByteArrayWrapper> fieldsAndValues = 
redisHashCommands.hgetall(key);
+            redisHashCommands.del(key);
+            redisHashCommands.del(newKey);
+            redisHashCommands.hset(newKey, new ArrayList<>(fieldsAndValues), 
false);
+            break;
+          case REDIS_SET:
+            // TODO this all needs to be done atomically. Add RENAME support 
to RedisSetCommands

Review comment:
       I added one




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to