Package org.redisson
Class RedissonScript
- java.lang.Object
-
- org.redisson.RedissonScript
-
- All Implemented Interfaces:
RScript
,RScriptAsync
public class RedissonScript extends Object implements RScript
- Author:
- Nikita Koksharov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.redisson.api.RScript
RScript.Mode, RScript.ReturnType
-
-
Constructor Summary
Constructors Constructor Description RedissonScript(CommandAsyncExecutor commandExecutor)
RedissonScript(CommandAsyncExecutor commandExecutor, Codec codec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
eval(String key, RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Executes Lua script<R> R
eval(RScript.Mode mode, String luaScript, RScript.ReturnType returnType)
Executes Lua script<R> R
eval(RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Executes Lua script<R> RFuture<R>
evalAsync(String key, RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Executes Lua script<R> RFuture<R>
evalAsync(RScript.Mode mode, String luaScript, RScript.ReturnType returnType)
Executes Lua script<R> RFuture<R>
evalAsync(RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Executes Lua script<R> R
evalSha(String key, RScript.Mode mode, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
Executes Lua script stored in Redis scripts cache by SHA-1 digest<R> R
evalSha(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType)
Executes Lua script stored in Redis scripts cache by SHA-1 digest<R> R
evalSha(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
Executes Lua script stored in Redis scripts cache by SHA-1 digest<R> RFuture<R>
evalShaAsync(String key, RScript.Mode mode, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
Executes Lua script stored in Redis scripts cache by SHA-1 digest<R> RFuture<R>
evalShaAsync(String key, RScript.Mode mode, Codec codec, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
<R> RFuture<R>
evalShaAsync(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType)
Executes Lua script stored in Redis scripts cache by SHA-1 digest<R> RFuture<R>
evalShaAsync(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
Executes Lua script stored in Redis scripts cache by SHA-1 digestList<Boolean>
scriptExists(String... shaDigests)
Checks for presence Lua scripts in Redis script cache by SHA-1 digest.List<Boolean>
scriptExists(String key, String... shaDigests)
RFuture<List<Boolean>>
scriptExistsAsync(String... shaDigests)
Checks for presence Lua scripts in Redis script cache by SHA-1 digest.RFuture<List<Boolean>>
scriptExistsAsync(String key, String... shaDigests)
Checks for presence Lua scripts in Redis script cache by SHA-1 digest.void
scriptFlush()
Flushes Lua script cache.void
scriptFlush(String key)
RFuture<Void>
scriptFlushAsync()
Flushes Lua script cache.RFuture<Void>
scriptFlushAsync(String key)
void
scriptKill()
Kills currently executed Lua scriptvoid
scriptKill(String key)
RFuture<Void>
scriptKillAsync()
Kills currently executed Lua scriptRFuture<Void>
scriptKillAsync(String key)
String
scriptLoad(String luaScript)
Loads Lua script into Redis scripts cache and returns its SHA-1 digestString
scriptLoad(String key, String luaScript)
RFuture<String>
scriptLoadAsync(String luaScript)
Loads Lua script into Redis scripts cache and returns its SHA-1 digestRFuture<String>
scriptLoadAsync(String key, String luaScript)
Loads Lua script into Redis scripts cache and returns its SHA-1 digest
-
-
-
Constructor Detail
-
RedissonScript
public RedissonScript(CommandAsyncExecutor commandExecutor)
-
RedissonScript
public RedissonScript(CommandAsyncExecutor commandExecutor, Codec codec)
-
-
Method Detail
-
scriptLoad
public String scriptLoad(String luaScript)
Description copied from interface:RScript
Loads Lua script into Redis scripts cache and returns its SHA-1 digest- Specified by:
scriptLoad
in interfaceRScript
- Parameters:
luaScript
- - lua script- Returns:
- SHA-1 digest
-
scriptLoadAsync
public RFuture<String> scriptLoadAsync(String luaScript)
Description copied from interface:RScriptAsync
Loads Lua script into Redis scripts cache and returns its SHA-1 digest- Specified by:
scriptLoadAsync
in interfaceRScriptAsync
- Parameters:
luaScript
- - lua script- Returns:
- SHA-1 digest
-
scriptLoadAsync
public RFuture<String> scriptLoadAsync(String key, String luaScript)
Description copied from interface:RScriptAsync
Loads Lua script into Redis scripts cache and returns its SHA-1 digest- Specified by:
scriptLoadAsync
in interfaceRScriptAsync
- Parameters:
key
- - used to locate Redis node in Cluster which stores cached Lua scriptluaScript
- - lua script- Returns:
- SHA-1 digest
-
eval
public <R> R eval(RScript.Mode mode, String luaScript, RScript.ReturnType returnType)
Description copied from interface:RScript
Executes Lua script
-
eval
public <R> R eval(RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScript
Executes Lua script- Specified by:
eval
in interfaceRScript
- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modeluaScript
- - lua scriptreturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
evalAsync
public <R> RFuture<R> evalAsync(RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScriptAsync
Executes Lua script- Specified by:
evalAsync
in interfaceRScriptAsync
- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modeluaScript
- - lua scriptreturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
evalSha
public <R> R evalSha(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType)
Description copied from interface:RScript
Executes Lua script stored in Redis scripts cache by SHA-1 digest
-
evalSha
public <R> R evalSha(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScript
Executes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalSha
in interfaceRScript
- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modeshaDigest
- - SHA-1 digestreturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
evalShaAsync
public <R> RFuture<R> evalShaAsync(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScriptAsync
Executes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalShaAsync
in interfaceRScriptAsync
- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modeshaDigest
- - SHA-1 digestreturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
evalShaAsync
public <R> RFuture<R> evalShaAsync(String key, RScript.Mode mode, Codec codec, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
-
scriptKill
public void scriptKill()
Description copied from interface:RScript
Kills currently executed Lua script- Specified by:
scriptKill
in interfaceRScript
-
scriptKill
public void scriptKill(String key)
-
scriptKillAsync
public RFuture<Void> scriptKillAsync()
Description copied from interface:RScriptAsync
Kills currently executed Lua script- Specified by:
scriptKillAsync
in interfaceRScriptAsync
- Returns:
- void
-
scriptExists
public List<Boolean> scriptExists(String... shaDigests)
Description copied from interface:RScript
Checks for presence Lua scripts in Redis script cache by SHA-1 digest.- Specified by:
scriptExists
in interfaceRScript
- Parameters:
shaDigests
- - collection of SHA-1 digests- Returns:
- list of booleans corresponding to collection SHA-1 digests
-
scriptExistsAsync
public RFuture<List<Boolean>> scriptExistsAsync(String... shaDigests)
Description copied from interface:RScriptAsync
Checks for presence Lua scripts in Redis script cache by SHA-1 digest.- Specified by:
scriptExistsAsync
in interfaceRScriptAsync
- Parameters:
shaDigests
- - collection of SHA-1 digests- Returns:
- list of booleans corresponding to collection SHA-1 digests
-
scriptExistsAsync
public RFuture<List<Boolean>> scriptExistsAsync(String key, String... shaDigests)
Description copied from interface:RScriptAsync
Checks for presence Lua scripts in Redis script cache by SHA-1 digest.- Specified by:
scriptExistsAsync
in interfaceRScriptAsync
- Parameters:
key
- - used to locate Redis node in Cluster which stores cached Lua scriptshaDigests
- - collection of SHA-1 digests- Returns:
- list of booleans corresponding to collection SHA-1 digests
-
scriptFlush
public void scriptFlush()
Description copied from interface:RScript
Flushes Lua script cache.- Specified by:
scriptFlush
in interfaceRScript
-
scriptFlush
public void scriptFlush(String key)
-
scriptFlushAsync
public RFuture<Void> scriptFlushAsync()
Description copied from interface:RScriptAsync
Flushes Lua script cache.- Specified by:
scriptFlushAsync
in interfaceRScriptAsync
- Returns:
- void
-
evalShaAsync
public <R> RFuture<R> evalShaAsync(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType)
Description copied from interface:RScriptAsync
Executes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalShaAsync
in interfaceRScriptAsync
- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modeshaDigest
- - SHA-1 digestreturnType
- - return type- Returns:
- result object
-
evalAsync
public <R> RFuture<R> evalAsync(RScript.Mode mode, String luaScript, RScript.ReturnType returnType)
Description copied from interface:RScriptAsync
Executes Lua script- Specified by:
evalAsync
in interfaceRScriptAsync
- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modeluaScript
- - lua scriptreturnType
- - return type- Returns:
- result object
-
evalShaAsync
public <R> RFuture<R> evalShaAsync(String key, RScript.Mode mode, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScriptAsync
Executes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalShaAsync
in interfaceRScriptAsync
- Type Parameters:
R
- - type of result- Parameters:
key
- - used to locate Redis node in Cluster which stores cached Lua scriptmode
- - execution modeshaDigest
- - SHA-1 digestreturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
evalAsync
public <R> RFuture<R> evalAsync(String key, RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScriptAsync
Executes Lua script- Specified by:
evalAsync
in interfaceRScriptAsync
- Type Parameters:
R
- - type of result- Parameters:
key
- - used to locate Redis node in Cluster which stores cached Lua scriptmode
- - execution modeluaScript
- - lua scriptreturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
evalSha
public <R> R evalSha(String key, RScript.Mode mode, String shaDigest, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScript
Executes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalSha
in interfaceRScript
- Type Parameters:
R
- - type of result- Parameters:
key
- - used to locate Redis node in Cluster which stores cached Lua scriptmode
- - execution modeshaDigest
- - SHA-1 digestreturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
eval
public <R> R eval(String key, RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScript
Executes Lua script- Specified by:
eval
in interfaceRScript
- Type Parameters:
R
- - type of result- Parameters:
key
- - used to locate Redis node in Cluster which stores cached Lua scriptmode
- - execution modeluaScript
- - lua scriptreturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
-