Uploaded image for project: 'Spring Data Redis'
  1. Spring Data Redis
  2. DATAREDIS-1005

Add support for scripting commands with Jedis Cluster

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.1.9 (Lovelace SR9), 2.2 RC2 (Moore)
    • Fix Version/s: 2.2 RC2 (Moore)
    • Component/s: Jedis Driver
    • Labels:
      None

      Description

      Current implementation of JedisClusterConnection doesn't support Eval & EvalSha commands
      (see: https://redis.io/commands/eval, https://redis.io/commands/evalsha)

      The reason is class:
      org.springframework.data.redis.connection.jedis.JedisClusterScriptingCommands
      do not have implementations of required commands:

      @Override
      public <T> T eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs) {
         throw new InvalidDataAccessApiUsageException("Eval is not supported in cluster environment.");
      }
      
      @Override
      public <T> T evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs) {
         throw new InvalidDataAccessApiUsageException("EvalSha is not supported in cluster environment.");
      }

      Eval & EvalSha commands has to be implemented.

      For now we have an exception:

      org.springframework.dao.InvalidDataAccessApiUsageException: EvalSha is not supported in cluster environment.
      at org.springframework.data.redis.connection.jedis.JedisClusterScriptingCommands.evalSha(JedisClusterScriptingCommands.java:83)
      at org.springframework.data.redis.connection.DefaultedRedisConnection.evalSha(DefaultedRedisConnection.java:1440)
      at jdk.internal.reflect.GeneratedMethodAccessor611.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.springframework.data.redis.core.CloseSuppressingInvocationHandler.invoke(CloseSuppressingInvocationHandler.java:61)
      at com.sun.proxy.$Proxy179.evalSha(Unknown Source)
      at org.springframework.data.redis.core.script.DefaultScriptExecutor.eval(DefaultScriptExecutor.java:77)
      at org.springframework.data.redis.core.script.DefaultScriptExecutor.lambda$execute$0(DefaultScriptExecutor.java:68)
      at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:227)
      

        Attachments

          Activity

            People

            Assignee:
            mp911de Mark Paluch
            Reporter:
            pavel_hp Pavel Khokhlov
            Last updater:
            Mark Paluch
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: