Package org.redisson.api
Interface RFunction
-
- All Superinterfaces:
RFunctionAsync
- All Known Implementing Classes:
RedissonFuction
public interface RFunction extends RFunctionAsync
Interface for Redis Function feature- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <R> R
call(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
Executes function<R> R
call(FunctionMode mode, String name, FunctionResult returnType)
Executes function<R> R
call(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
Executes functionvoid
delete(String libraryName)
Deletes library.byte[]
dump()
Returns serialized state of all libraries.void
flush()
Deletes all libraries.void
kill()
Kills currently executed functions.List<FunctionLibrary>
list()
Returns information about libraries and functions per each.List<FunctionLibrary>
list(String namePattern)
Returns information about libraries and functions per each by name pattern.void
load(String libraryName, String code)
Loads a library.void
loadAndReplace(String libraryName, String code)
Loads a library and overwrites existing library.void
restore(byte[] payload)
Restores libraries using their state returned bydump()
method.void
restoreAfterFlush(byte[] payload)
Restores libraries using their state returned bydump()
method.void
restoreAndReplace(byte[] payload)
Restores libraries using their state returned bydump()
method.FunctionStats
stats()
Returns information about currently running Redis function and available execution engines.-
Methods inherited from interface org.redisson.api.RFunctionAsync
callAsync, callAsync, callAsync, deleteAsync, dumpAsync, flushAsync, killAsync, listAsync, listAsync, loadAndReplaceAsync, loadAsync, restoreAfterFlushAsync, restoreAndReplaceAsync, restoreAsync, statsAsync
-
-
-
-
Method Detail
-
delete
void delete(String libraryName)
Deletes library. Error is thrown if library doesn't exist.- Parameters:
libraryName
- library name
-
dump
byte[] dump()
Returns serialized state of all libraries.- Returns:
- serialized state
-
flush
void flush()
Deletes all libraries.
-
kill
void kill()
Kills currently executed functions. Applied only to functions which don't modify data.
-
list
List<FunctionLibrary> list()
Returns information about libraries and functions per each.- Returns:
- list of libraries
-
list
List<FunctionLibrary> list(String namePattern)
Returns information about libraries and functions per each by name pattern.Supported glob-style patterns: h?llo matches hello, hallo and hxllo h*llo matches hllo and heeeello h[ae]llo matches hello and hallo, but not hillo
- Parameters:
namePattern
- name pattern- Returns:
- list of libraries
-
load
void load(String libraryName, String code)
Loads a library. Error is thrown if library already exists.- Parameters:
libraryName
- library namecode
- function code
-
loadAndReplace
void loadAndReplace(String libraryName, String code)
Loads a library and overwrites existing library.- Parameters:
libraryName
- library namecode
- function code
-
restore
void restore(byte[] payload)
Restores libraries using their state returned bydump()
method. Restored libraries are appended to the existing libraries and throws error in case of collision.- Parameters:
payload
- serialized state
-
restoreAndReplace
void restoreAndReplace(byte[] payload)
Restores libraries using their state returned bydump()
method. Restored libraries are appended to the existing libraries.- Parameters:
payload
- serialized state
-
restoreAfterFlush
void restoreAfterFlush(byte[] payload)
Restores libraries using their state returned bydump()
method. Deletes all existing libraries before restoring.- Parameters:
payload
- serialized state
-
stats
FunctionStats stats()
Returns information about currently running Redis function and available execution engines.- Returns:
- function information
-
call
<R> R call(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
Executes function- Type Parameters:
R
- - type of result- Parameters:
key
- - used to locate Redis node in Clustermode
- - execution modename
- - function namereturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
call
<R> R call(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
Executes function- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modename
- - function namereturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
call
<R> R call(FunctionMode mode, String name, FunctionResult returnType)
Executes function- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modename
- - function namereturnType
- - return type- Returns:
- result object
-
-