Package redis.clients.jedis.commands
Interface FunctionCommands
- All Known Subinterfaces:
JedisCommands
- All Known Implementing Classes:
Jedis,JedisCluster,JedisPooled,JedisSentineled,JedisSharding,UnifiedJedis
public interface FunctionCommands
-
Method Summary
Modifier and TypeMethodDescriptionInvoke a function.This is a read-only variant of theFCALLcommand that cannot execute commands that modify data.functionDelete(String libraryName) This command deletes the library called library-name and all functions in it.byte[]Return the serialized payload of loaded libraries.Deletes all the libraries, unless called with the optional mode argument, the 'lazyfree-lazy-user-flush' configuration directive sets the effective behavior.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.Kill a function that is currently executing.Return information about the functions and libraries.functionList(String libraryNamePattern) Return information about the functions and libraries.Similar toFUNCTION LISTbut include the libraries source implementation in the reply.functionListWithCode(String libraryNamePattern) Similar toFUNCTION LISTbut include the libraries source implementation in the reply.functionLoad(String functionCode) Load a library to Redis.functionLoadReplace(String functionCode) Load a library to Redis.functionRestore(byte[] serializedValue) Restore libraries from the serialized payload.functionRestore(byte[] serializedValue, FunctionRestorePolicy policy) Restore libraries from the serialized payload.Return information about the function that's currently running and information about the available execution engines.
-
Method Details
-
fcall
Invoke a function.- Parameters:
name-keys-args-
-
fcallReadonly
This is a read-only variant of theFCALLcommand that cannot execute commands that modify data. -
functionDelete
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 theFUNCTION RESTOREcommand.- 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
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
Return information about the functions and libraries.- Parameters:
libraryNamePattern- a pattern for matching library names- Returns:
LibraryInfo
-
functionListWithCode
List<LibraryInfo> functionListWithCode()Similar toFUNCTION LISTbut include the libraries source implementation in the reply.- Returns:
LibraryInfo- See Also:
-
functionListWithCode
Similar toFUNCTION LISTbut include the libraries source implementation in the reply.- Parameters:
libraryNamePattern- a pattern for matching library names- Returns:
LibraryInfo- See Also:
-
functionLoad
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
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
Restore libraries from the serialized payload. Default policy is APPEND.- Parameters:
serializedValue- the serialized payload- Returns:
- OK
-
functionRestore
Restore libraries from the serialized payload.- Parameters:
serializedValue- the serialized payloadpolicy- can beFLUSH, 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
-