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> Reval(String key, RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)Executes Lua script<R> Reval(RScript.Mode mode, String luaScript, RScript.ReturnType returnType)Executes Lua script<R> Reval(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> RevalSha(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> RevalSha(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType)Executes Lua script stored in Redis scripts cache by SHA-1 digest<R> RevalSha(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.voidscriptFlush()Flushes Lua script cache.voidscriptFlush(String key)RFuture<Void>scriptFlushAsync()Flushes Lua script cache.RFuture<Void>scriptFlushAsync(String key)voidscriptKill()Kills currently executed Lua scriptvoidscriptKill(String key)RFuture<Void>scriptKillAsync()Kills currently executed Lua scriptRFuture<Void>scriptKillAsync(String key)StringscriptLoad(String luaScript)Loads Lua script into Redis scripts cache and returns its SHA-1 digestStringscriptLoad(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:RScriptLoads Lua script into Redis scripts cache and returns its SHA-1 digest- Specified by:
scriptLoadin interfaceRScript- Parameters:
luaScript- - lua script- Returns:
- SHA-1 digest
-
scriptLoadAsync
public RFuture<String> scriptLoadAsync(String luaScript)
Description copied from interface:RScriptAsyncLoads Lua script into Redis scripts cache and returns its SHA-1 digest- Specified by:
scriptLoadAsyncin interfaceRScriptAsync- Parameters:
luaScript- - lua script- Returns:
- SHA-1 digest
-
scriptLoadAsync
public RFuture<String> scriptLoadAsync(String key, String luaScript)
Description copied from interface:RScriptAsyncLoads Lua script into Redis scripts cache and returns its SHA-1 digest- Specified by:
scriptLoadAsyncin 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:RScriptExecutes Lua script
-
eval
public <R> R eval(RScript.Mode mode, String luaScript, RScript.ReturnType returnType, List<Object> keys, Object... values)
Description copied from interface:RScriptExecutes Lua script- Specified by:
evalin 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:RScriptAsyncExecutes Lua script- Specified by:
evalAsyncin 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:RScriptExecutes 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:RScriptExecutes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalShain 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:RScriptAsyncExecutes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalShaAsyncin 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:RScriptKills currently executed Lua script- Specified by:
scriptKillin interfaceRScript
-
scriptKill
public void scriptKill(String key)
-
scriptKillAsync
public RFuture<Void> scriptKillAsync()
Description copied from interface:RScriptAsyncKills currently executed Lua script- Specified by:
scriptKillAsyncin interfaceRScriptAsync- Returns:
- void
-
scriptExists
public List<Boolean> scriptExists(String... shaDigests)
Description copied from interface:RScriptChecks for presence Lua scripts in Redis script cache by SHA-1 digest.- Specified by:
scriptExistsin 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:RScriptAsyncChecks for presence Lua scripts in Redis script cache by SHA-1 digest.- Specified by:
scriptExistsAsyncin 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:RScriptAsyncChecks for presence Lua scripts in Redis script cache by SHA-1 digest.- Specified by:
scriptExistsAsyncin 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:RScriptFlushes Lua script cache.- Specified by:
scriptFlushin interfaceRScript
-
scriptFlush
public void scriptFlush(String key)
-
scriptFlushAsync
public RFuture<Void> scriptFlushAsync()
Description copied from interface:RScriptAsyncFlushes Lua script cache.- Specified by:
scriptFlushAsyncin interfaceRScriptAsync- Returns:
- void
-
evalShaAsync
public <R> RFuture<R> evalShaAsync(RScript.Mode mode, String shaDigest, RScript.ReturnType returnType)
Description copied from interface:RScriptAsyncExecutes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalShaAsyncin 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:RScriptAsyncExecutes Lua script- Specified by:
evalAsyncin 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:RScriptAsyncExecutes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalShaAsyncin 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:RScriptAsyncExecutes Lua script- Specified by:
evalAsyncin 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:RScriptExecutes Lua script stored in Redis scripts cache by SHA-1 digest- Specified by:
evalShain 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:RScriptExecutes Lua script- Specified by:
evalin 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
-
-