This is an automated email from the ASF dual-hosted git repository.

upthewaterspout pushed a commit to branch feature/redis-performance-testing
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 14e9c440255d50f9da516d3f4213931d7cc84c43
Author: Jens Deppe <[email protected]>
AuthorDate: Mon Mar 8 10:53:28 2021 -0800

    Avoid fn exe for strings
---
 .../executor/string/RedisStringCommandsFunctionInvoker.java      | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/string/RedisStringCommandsFunctionInvoker.java
 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/string/RedisStringCommandsFunctionInvoker.java
index e8a8cf0..c1f2879 100644
--- 
a/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/string/RedisStringCommandsFunctionInvoker.java
+++ 
b/geode-redis/src/main/java/org/apache/geode/redis/internal/executor/string/RedisStringCommandsFunctionInvoker.java
@@ -40,10 +40,12 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.Region;
+import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.logging.internal.log4j.api.LogService;
 import org.apache.geode.redis.internal.data.ByteArrayWrapper;
 import org.apache.geode.redis.internal.data.RedisData;
 import org.apache.geode.redis.internal.data.RedisKey;
+import org.apache.geode.redis.internal.executor.CommandFunction;
 import org.apache.geode.redis.internal.executor.RedisCommandsFunctionInvoker;
 
 /**
@@ -56,9 +58,12 @@ public class RedisStringCommandsFunctionInvoker extends 
RedisCommandsFunctionInv
 
   private static final Logger logger = LogService.getLogger();
   private static final AtomicInteger getInVmCount = new AtomicInteger(0);
+  private final CommandFunction function;
 
   public RedisStringCommandsFunctionInvoker(Region<RedisKey, RedisData> 
region) {
     super(region);
+
+    function = (CommandFunction) 
FunctionService.getFunction(CommandFunction.ID);
   }
 
   @Override
@@ -171,4 +176,8 @@ public class RedisStringCommandsFunctionInvoker extends 
RedisCommandsFunctionInv
   public ByteArrayWrapper mget(RedisKey key) {
     return invokeCommandFunction(key, MGET);
   }
+
+  protected <T> T invokeCommandFunction(RedisKey key, Object... arguments) {
+    return function.hackedExecute(key, arguments);
+  }
 }

Reply via email to