Github user galen-pivotal commented on a diff in the pull request:

    https://github.com/apache/geode/pull/404#discussion_r104041093
  
    --- Diff: 
geode-core/src/main/java/org/apache/geode/redis/internal/executor/hash/HDelExecutor.java
 ---
    @@ -40,25 +38,25 @@ public void executeCommand(Command command, 
ExecutionHandlerContext context) {
         int numDeleted = 0;
     
         ByteArrayWrapper key = command.getKey();
    +    Map<ByteArrayWrapper, ByteArrayWrapper> map = getMap(context, key);
     
    -    checkDataType(key, RedisDataType.REDIS_HASH, context);
    -    Region<ByteArrayWrapper, ByteArrayWrapper> keyRegion = 
getRegion(context, key);
    -
    -    if (keyRegion == null) {
    +    if (map == null || map.isEmpty()) {
           
command.setResponse(Coder.getIntegerResponse(context.getByteBufAllocator(), 
numDeleted));
           return;
         }
     
    -
         for (int i = START_FIELDS_INDEX; i < commandElems.size(); i++) {
           ByteArrayWrapper field = new ByteArrayWrapper(commandElems.get(i));
    -      Object oldValue = keyRegion.remove(field);
    +      Object oldValue = map.remove(field);
           if (oldValue != null)
             numDeleted++;
         }
    -    if (keyRegion.isEmpty()) {
    -      context.getRegionProvider().removeKey(key, RedisDataType.REDIS_HASH);
    -    }
    +    // save map
    +    saveMap(map, context, key);
    +
    +    // if (map.isEmpty()) {
    --- End diff --
    
    Would prefer to remove code rather than comment it out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to