Package org.redisson
Class RedissonFuction
java.lang.Object
org.redisson.RedissonFuction
- All Implemented Interfaces:
RFunction
,RFunctionAsync
- Author:
- Nikita Koksharov
-
Constructor Summary
ConstructorDescriptionRedissonFuction
(CommandAsyncExecutor commandExecutor) RedissonFuction
(CommandAsyncExecutor commandExecutor, Codec codec) -
Method Summary
Modifier and TypeMethodDescription<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 function<R> RFuture
<R> callAsync
(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values) Executes function<R> RFuture
<R> callAsync
(FunctionMode mode, String name, FunctionResult returnType) Executes function<R> RFuture
<R> callAsync
(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values) Executes functionvoid
Deletes library.deleteAsync
(String libraryName) Deletes library.byte[]
dump()
Returns serialized state of all libraries.RFuture
<byte[]> Returns serialized state of all libraries.void
flush()
Deletes all libraries.Deletes all libraries.void
kill()
Kills currently executed functions.Kills currently executed functions.list()
Returns information about libraries and functions per each.Returns information about libraries and functions per each by name pattern.Returns information about libraries and functions per each.Returns information about libraries and functions per each by name pattern.void
Loads a library.void
loadAndReplace
(String libraryName, String code) Loads a library and overwrites existing library.loadAndReplaceAsync
(String libraryName, String code) Loads a library and overwrites existing library.Loads a library.void
restore
(byte[] payload) Restores libraries using their state returned byRFunction.dump()
method.void
restoreAfterFlush
(byte[] payload) Restores libraries using their state returned byRFunction.dump()
method.restoreAfterFlushAsync
(byte[] payload) Restores libraries using their state returned byRFunctionAsync.dumpAsync()
method.void
restoreAndReplace
(byte[] payload) Restores libraries using their state returned byRFunction.dump()
method.restoreAndReplaceAsync
(byte[] payload) Restores libraries using their state returned byRFunctionAsync.dumpAsync()
method.restoreAsync
(byte[] payload) Restores libraries using their state returned byRFunctionAsync.dumpAsync()
method.stats()
Returns information about currently running Redis function and available execution engines.Returns information about currently running Redis function and available execution engines.
-
Constructor Details
-
RedissonFuction
-
RedissonFuction
-
-
Method Details
-
delete
Description copied from interface:RFunction
Deletes library. Error is thrown if library doesn't exist. -
deleteAsync
Description copied from interface:RFunctionAsync
Deletes library. Error is thrown if library doesn't exist.- Specified by:
deleteAsync
in interfaceRFunctionAsync
- Parameters:
libraryName
- library name
-
dump
public byte[] dump()Description copied from interface:RFunction
Returns serialized state of all libraries. -
dumpAsync
Description copied from interface:RFunctionAsync
Returns serialized state of all libraries.- Specified by:
dumpAsync
in interfaceRFunctionAsync
- Returns:
- serialized state
-
flush
public void flush()Description copied from interface:RFunction
Deletes all libraries. -
flushAsync
Description copied from interface:RFunctionAsync
Deletes all libraries.- Specified by:
flushAsync
in interfaceRFunctionAsync
-
kill
public void kill()Description copied from interface:RFunction
Kills currently executed functions. Applied only to functions which don't modify data. -
killAsync
Description copied from interface:RFunctionAsync
Kills currently executed functions. Applied only to functions which don't modify data.- Specified by:
killAsync
in interfaceRFunctionAsync
-
list
Description copied from interface:RFunction
Returns information about libraries and functions per each. -
listAsync
Description copied from interface:RFunctionAsync
Returns information about libraries and functions per each.- Specified by:
listAsync
in interfaceRFunctionAsync
- Returns:
- list of libraries
-
list
Description copied from interface:RFunction
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
-
listAsync
Description copied from interface:RFunctionAsync
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
- Specified by:
listAsync
in interfaceRFunctionAsync
- Parameters:
namePattern
- name pattern- Returns:
- list of libraries
-
load
Description copied from interface:RFunction
Loads a library. Error is thrown if library already exists. -
loadAsync
Description copied from interface:RFunctionAsync
Loads a library. Error is thrown if library already exists.- Specified by:
loadAsync
in interfaceRFunctionAsync
- Parameters:
libraryName
- library namecode
- function code
-
loadAndReplace
Description copied from interface:RFunction
Loads a library and overwrites existing library.- Specified by:
loadAndReplace
in interfaceRFunction
- Parameters:
libraryName
- library namecode
- function code
-
loadAndReplaceAsync
Description copied from interface:RFunctionAsync
Loads a library and overwrites existing library.- Specified by:
loadAndReplaceAsync
in interfaceRFunctionAsync
- Parameters:
libraryName
- library namecode
- function code
-
restore
public void restore(byte[] payload) Description copied from interface:RFunction
Restores libraries using their state returned byRFunction.dump()
method. Restored libraries are appended to the existing libraries and throws error in case of collision. -
restoreAsync
Description copied from interface:RFunctionAsync
Restores libraries using their state returned byRFunctionAsync.dumpAsync()
method. Restored libraries are appended to the existing libraries and throws error in case of collision.- Specified by:
restoreAsync
in interfaceRFunctionAsync
- Parameters:
payload
- serialized state
-
restoreAndReplace
public void restoreAndReplace(byte[] payload) Description copied from interface:RFunction
Restores libraries using their state returned byRFunction.dump()
method. Restored libraries are appended to the existing libraries.- Specified by:
restoreAndReplace
in interfaceRFunction
- Parameters:
payload
- serialized state
-
restoreAndReplaceAsync
Description copied from interface:RFunctionAsync
Restores libraries using their state returned byRFunctionAsync.dumpAsync()
method. Restored libraries are appended to the existing libraries.- Specified by:
restoreAndReplaceAsync
in interfaceRFunctionAsync
- Parameters:
payload
- serialized state
-
restoreAfterFlush
public void restoreAfterFlush(byte[] payload) Description copied from interface:RFunction
Restores libraries using their state returned byRFunction.dump()
method. Deletes all existing libraries before restoring.- Specified by:
restoreAfterFlush
in interfaceRFunction
- Parameters:
payload
- serialized state
-
restoreAfterFlushAsync
Description copied from interface:RFunctionAsync
Restores libraries using their state returned byRFunctionAsync.dumpAsync()
method. Deletes all existing libraries before restoring.- Specified by:
restoreAfterFlushAsync
in interfaceRFunctionAsync
- Parameters:
payload
- serialized state
-
call
public <R> R call(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values) Description copied from interface:RFunction
Executes function- Specified by:
call
in interfaceRFunction
- 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
public <R> R call(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values) Description copied from interface:RFunction
Executes function- Specified by:
call
in interfaceRFunction
- 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
Description copied from interface:RFunction
Executes function -
stats
Description copied from interface:RFunction
Returns information about currently running Redis function and available execution engines. -
statsAsync
Description copied from interface:RFunctionAsync
Returns information about currently running Redis function and available execution engines.- Specified by:
statsAsync
in interfaceRFunctionAsync
- Returns:
- function information
-
callAsync
public <R> RFuture<R> callAsync(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values) Description copied from interface:RFunctionAsync
Executes function- Specified by:
callAsync
in interfaceRFunctionAsync
- Type Parameters:
R
- - type of result- Parameters:
key
- - used to locate Redis node in Cluster which stores cached Lua scriptmode
- - execution modename
- - function namereturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
callAsync
public <R> RFuture<R> callAsync(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values) Description copied from interface:RFunctionAsync
Executes function- Specified by:
callAsync
in interfaceRFunctionAsync
- 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
-
callAsync
Description copied from interface:RFunctionAsync
Executes function- Specified by:
callAsync
in interfaceRFunctionAsync
- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modename
- - function namereturnType
- - return type- Returns:
- result object
-