Interface RedisScriptingCommands

All Known Subinterfaces:
DefaultedRedisClusterConnection, DefaultedRedisConnection, RedisClusterConnection, RedisCommands, RedisConnection, RedisConnectionUtils.RedisConnectionProxy, StringRedisConnection
All Known Implementing Classes:
AbstractRedisConnection, DefaultStringRedisConnection, JedisClusterConnection, JedisConnection, LettuceClusterConnection, LettuceConnection

public interface RedisScriptingCommands
Scripting commands.
Author:
Costin Leau, Christoph Strobl, David Liu, Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
    Evaluate given script.
    <T> T
    evalSha(byte[] scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
    Evaluate given scriptSha.
    <T> T
    evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
    Evaluate given scriptSha.
    scriptExists(String... scriptShas)
    Check if given scriptShas exist in script cache.
    void
    Flush lua script cache.
    void
    Kill current lua script execution.
    scriptLoad(byte[] script)
    Load lua script into scripts cache, without executing it.
    Execute the script by calling evalSha(byte[], ReturnType, int, byte[]...).
  • Method Details

    • scriptFlush

      void scriptFlush()
      Flush lua script cache.
      See Also:
    • scriptKill

      void scriptKill()
      Kill current lua script execution.
      See Also:
    • scriptLoad

      @Nullable String scriptLoad(byte[] script)
      Load lua script into scripts cache, without executing it.
      Execute the script by calling evalSha(byte[], ReturnType, int, byte[]...).
      Parameters:
      script - must not be null.
      Returns:
      null when used in pipeline / transaction.
      See Also:
    • scriptExists

      @Nullable List<Boolean> scriptExists(String... scriptShas)
      Check if given scriptShas exist in script cache.
      Parameters:
      scriptShas -
      Returns:
      one entry per given scriptSha in returned List or null when used in pipeline / transaction.
      See Also:
    • eval

      @Nullable <T> T eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
      Evaluate given script.
      Parameters:
      script - must not be null.
      returnType - must not be null.
      numKeys -
      keysAndArgs - must not be null.
      Returns:
      script result. null when used in pipeline / transaction.
      See Also:
    • evalSha

      @Nullable <T> T evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
      Evaluate given scriptSha.
      Parameters:
      scriptSha - must not be null.
      returnType - must not be null.
      numKeys -
      keysAndArgs - must not be null.
      Returns:
      script result. null when used in pipeline / transaction.
      See Also:
    • evalSha

      @Nullable <T> T evalSha(byte[] scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
      Evaluate given scriptSha.
      Parameters:
      scriptSha - must not be null.
      returnType - must not be null.
      numKeys -
      keysAndArgs - must not be null.
      Returns:
      script result. null when used in pipeline / transaction.
      Since:
      1.5
      See Also: