All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.clients.jedis.commands.ScriptingKeyCommands Maven / Gradle / Ivy

The newest version!
package redis.clients.jedis.commands;

import java.util.List;

public interface ScriptingKeyCommands {

  /**
   * Eval Command
   * Use to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.
   * @param script Lua 5.1 script. The script does not need to define a Lua function (and should not).
   *              It is just a Lua program that will run in the context of the Redis server.
   * @return The result of the evaluated script
   */
  Object eval(String script);

  /**
   * Eval Command
   * Use to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.
   * @param script Lua 5.1 script. The script does not need to define a Lua function (and should not).
   *              It is just a Lua program that will run in the context of the Redis server.
   * @param keyCount the count of the provided keys
   * @param params arguments that can be accessed from the script
   * @return The result of the evaluated script
   */
  Object eval(String script, int keyCount, String... params);

  /**
   * Eval Command
   * Use to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.
   * @param script Lua 5.1 script. The script does not need to define a Lua function (and should not).
   *              It is just a Lua program that will run in the context of the Redis server.
   * @param keys arguments that can be accessed by the script
   * @param args additional arguments should not represent key names and can be accessed by the script
   * @return The result of the evaluated script
   */
  Object eval(String script, List keys, List args);

  /**
   * Readonly version of {@link ScriptingKeyCommands#eval(String, List, List) EVAL}
   * @see ScriptingKeyCommands#eval(String, List, List)
   * @param script Lua 5.1 script. The script does not need to define a Lua function (and should not).
   *              It is just a Lua program that will run in the context of the Redis server.
   * @param keys arguments that can be accessed by the script
   * @param args additional arguments should not represent key names and can be accessed by the script
   * @return The result of the evaluated script
   */
  Object evalReadonly(String script, List keys, List args);

  /**
   * EvalSha Command
   * Similar to {@link ScriptingKeyCommands#eval(String) EVAL}, but the script cached on the server
   * side by its SHA1 digest. Scripts are cached on the server side using the SCRIPT LOAD command.
   * @see ScriptingKeyCommands#eval(String)
   * @param sha1 the script
   * @return The result of the evaluated script
   */
  Object evalsha(String sha1);

  /**
   * EvalSha Command
   * Similar to {@link ScriptingKeyCommands#eval(String, int, String...)}  EVAL}, but the script cached on the server
   * side by its SHA1 digest. Scripts are cached on the server side using the SCRIPT LOAD command.
   * @see ScriptingKeyCommands#eval(String, int, String...)
   * @param sha1 the script
   * @return The result of the evaluated script
   */
  Object evalsha(String sha1, int keyCount, String... params);

  /**
   * EvalSha Command
   * Similar to {@link ScriptingKeyCommands#eval(String, List, List)}  EVAL}, but the script cached on the server
   * side by its SHA1 digest. Scripts are cached on the server side using the SCRIPT LOAD command.
   * @see ScriptingKeyCommands#eval(String, List, List)
   * @param sha1 the script
   * @return The result of the evaluated script
   */
  Object evalsha(String sha1, List keys, List args);

  /**
   * Readonly version of {@link ScriptingKeyCommands#evalsha(String, List, List) EVAL}
   * @see ScriptingKeyCommands#evalsha(String, List, List)
   * @param sha1 the script
   * @return The result of the evaluated script
   */
  Object evalshaReadonly(String sha1, List keys, List args);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy