Interface FunctionCommands

All Known Subinterfaces:
JedisCommands
All Known Implementing Classes:
Jedis, JedisCluster, JedisPooled, JedisSentineled, JedisSharding, UnifiedJedis

public interface FunctionCommands
  • Method Details

    • fcall

      Object fcall(String name, List<String> keys, List<String> args)
      Invoke a function.
      Parameters:
      name -
      keys -
      args -
    • fcallReadonly

      Object fcallReadonly(String name, List<String> keys, List<String> args)
      This is a read-only variant of the FCALL command that cannot execute commands that modify data.
    • functionDelete

      String functionDelete(String libraryName)
      This command deletes the library called library-name and all functions in it. If the library doesn't exist, the server returns an error.
      Parameters:
      libraryName -
      Returns:
      OK
    • functionDump

      byte[] functionDump()
      Return the serialized payload of loaded libraries. You can restore the serialized payload later with the FUNCTION RESTORE command.
      Returns:
      the serialized payload
    • functionFlush

      String functionFlush()
      Deletes all the libraries, unless called with the optional mode argument, the 'lazyfree-lazy-user-flush' configuration directive sets the effective behavior.
      Returns:
      OK
    • functionFlush

      String functionFlush(FlushMode mode)
      Deletes all the libraries, unless called with the optional mode argument, the 'lazyfree-lazy-user-flush' configuration directive sets the effective behavior.
      Parameters:
      mode - ASYNC: Asynchronously flush the libraries, SYNC: Synchronously flush the libraries.
      Returns:
      OK
    • functionKill

      String functionKill()
      Kill a function that is currently executing. The command can be used only on functions that did not modify the dataset during their execution.
      Returns:
      OK
    • functionList

      List<LibraryInfo> functionList()
      Return information about the functions and libraries.
      Returns:
      LibraryInfo
    • functionList

      List<LibraryInfo> functionList(String libraryNamePattern)
      Return information about the functions and libraries.
      Parameters:
      libraryNamePattern - a pattern for matching library names
      Returns:
      LibraryInfo
    • functionListWithCode

      List<LibraryInfo> functionListWithCode()
      Similar to FUNCTION LIST but include the libraries source implementation in the reply.
      Returns:
      LibraryInfo
      See Also:
    • functionListWithCode

      List<LibraryInfo> functionListWithCode(String libraryNamePattern)
      Similar to FUNCTION LIST but include the libraries source implementation in the reply.
      Parameters:
      libraryNamePattern - a pattern for matching library names
      Returns:
      LibraryInfo
      See Also:
    • functionLoad

      String functionLoad(String functionCode)
      Load a library to Redis.

      The library payload must start with Shebang statement that provides a metadata about the library (like the engine to use and the library name). Shebang format: #!<engine name> name=<library name>. Currently engine name must be lua.

      Parameters:
      functionCode - the source code.
      Returns:
      The library name that was loaded
    • functionLoadReplace

      String functionLoadReplace(String functionCode)
      Load a library to Redis. Will replace the current library if it already exists.
      Parameters:
      functionCode - the source code
      Returns:
      The library name that was loaded
    • functionRestore

      String functionRestore(byte[] serializedValue)
      Restore libraries from the serialized payload. Default policy is APPEND.
      Parameters:
      serializedValue - the serialized payload
      Returns:
      OK
    • functionRestore

      String functionRestore(byte[] serializedValue, FunctionRestorePolicy policy)
      Restore libraries from the serialized payload.
      Parameters:
      serializedValue - the serialized payload
      policy - can be FLUSH, APPEND or REPLACE
      Returns:
      OK
    • functionStats

      FunctionStats functionStats()
      Return information about the function that's currently running and information about the available execution engines.
      Returns:
      FunctionStats