Package io.lettuce.core.api.sync
Interface RedisScriptingCommands<K,V>
-
- Type Parameters:
K
- Key type.V
- Value type.
- All Known Subinterfaces:
RedisAdvancedClusterCommands<K,V>
,RedisClusterCommands<K,V>
,RedisClusterPubSubCommands<K,V>
,RedisCommands<K,V>
,RedisPubSubCommands<K,V>
public interface RedisScriptingCommands<K,V>
Synchronous executed commands for Scripting.Lua scripts
are encoded by using the configuredcharset
.- Since:
- 4.0
- Author:
- Mark Paluch
- Generated class:
- by io.lettuce.apigenerator.CreateSyncApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
digest(byte[] script)
Create a SHA1 digest from a Lua script.String
digest(String script)
Create a SHA1 digest from a Lua script.<T> T
eval(byte[] script, ScriptOutputType type, K... keys)
Execute a Lua script server side.<T> T
eval(byte[] script, ScriptOutputType type, K[] keys, V... values)
Execute a Lua script server side.<T> T
eval(String script, ScriptOutputType type, K... keys)
Execute a Lua script server side.<T> T
eval(String script, ScriptOutputType type, K[] keys, V... values)
Execute a Lua script server side.<T> T
evalReadOnly(byte[] script, ScriptOutputType type, K[] keys, V... values)
This is a read-only variant of the EVAL command that cannot execute commands that modify data.<T> T
evalsha(String digest, ScriptOutputType type, K... keys)
Evaluates a script cached on the server side by its SHA1 digest.<T> T
evalsha(String digest, ScriptOutputType type, K[] keys, V... values)
Execute a Lua script server side.<T> T
evalshaReadOnly(String digest, ScriptOutputType type, K[] keys, V... values)
This is a read-only variant of the EVALSHA command that cannot execute commands that modify data.List<Boolean>
scriptExists(String... digests)
Check existence of scripts in the script cache.String
scriptFlush()
Remove all the scripts from the script cache.String
scriptFlush(FlushMode flushMode)
Remove all the scripts from the script cache using the specifiedFlushMode
.String
scriptKill()
Kill the script currently in execution.String
scriptLoad(byte[] script)
Load the specified Lua script into the script cache.String
scriptLoad(String script)
Load the specified Lua script into the script cache.
-
-
-
Method Detail
-
eval
<T> T eval(String script, ScriptOutputType type, K... keys)
Execute a Lua script server side.- Type Parameters:
T
- expected return type.- Parameters:
script
- Lua 5.1 script.type
- output type.keys
- key names.- Returns:
- script result.
-
eval
<T> T eval(byte[] script, ScriptOutputType type, K... keys)
Execute a Lua script server side.- Type Parameters:
T
- expected return type.- Parameters:
script
- Lua 5.1 script.type
- output type.keys
- key names.- Returns:
- script result.
- Since:
- 6.0
-
eval
<T> T eval(String script, ScriptOutputType type, K[] keys, V... values)
Execute a Lua script server side.- Type Parameters:
T
- expected return type.- Parameters:
script
- Lua 5.1 script.type
- output type.keys
- the keys.values
- the values.- Returns:
- script result.
-
eval
<T> T eval(byte[] script, ScriptOutputType type, K[] keys, V... values)
Execute a Lua script server side.- Type Parameters:
T
- expected return type.- Parameters:
script
- Lua 5.1 script.type
- output type.keys
- the keys.values
- the values.- Returns:
- script result.
- Since:
- 6.0
-
evalReadOnly
<T> T evalReadOnly(byte[] script, ScriptOutputType type, K[] keys, V... values)
This is a read-only variant of the EVAL command that cannot execute commands that modify data.- Type Parameters:
T
- expected return type.- Parameters:
script
- Lua 5.1 script.type
- output type.keys
- the keys.values
- the values.- Returns:
- script result.
- Since:
- 6.2
-
evalsha
<T> T evalsha(String digest, ScriptOutputType type, K... keys)
Evaluates a script cached on the server side by its SHA1 digest.- Type Parameters:
T
- expected return type.- Parameters:
digest
- SHA1 of the script.type
- output type.keys
- the keys.- Returns:
- script result.
-
evalsha
<T> T evalsha(String digest, ScriptOutputType type, K[] keys, V... values)
Execute a Lua script server side.- Type Parameters:
T
- expected return type.- Parameters:
digest
- SHA1 of the script.type
- output type.keys
- the keys.values
- the values.- Returns:
- script result.
-
evalshaReadOnly
<T> T evalshaReadOnly(String digest, ScriptOutputType type, K[] keys, V... values)
This is a read-only variant of the EVALSHA command that cannot execute commands that modify data.- Type Parameters:
T
- expected return type.- Parameters:
digest
- SHA1 of the script.type
- output type.keys
- the keys.values
- the values.- Returns:
- script result.
- Since:
- 6.2
-
scriptExists
List<Boolean> scriptExists(String... digests)
Check existence of scripts in the script cache.- Parameters:
digests
- script digests.- Returns:
- List<Boolean> array-reply The command returns an array of integers that correspond to the specified SHA1 digest arguments. For every corresponding SHA1 digest of a script that actually exists in the script cache, an 1 is returned, otherwise 0 is returned.
-
scriptFlush
String scriptFlush()
Remove all the scripts from the script cache.- Returns:
- String simple-string-reply.
-
scriptFlush
String scriptFlush(FlushMode flushMode)
Remove all the scripts from the script cache using the specifiedFlushMode
.- Parameters:
flushMode
- the flush mode (sync/async).- Returns:
- String simple-string-reply.
- Since:
- 6.1
-
scriptKill
String scriptKill()
Kill the script currently in execution.- Returns:
- String simple-string-reply.
-
scriptLoad
String scriptLoad(String script)
Load the specified Lua script into the script cache.- Parameters:
script
- script content.- Returns:
- String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
- Since:
- 6.0
-
scriptLoad
String scriptLoad(byte[] script)
Load the specified Lua script into the script cache.- Parameters:
script
- script content.- Returns:
- String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
- Since:
- 6.0
-
digest
String digest(String script)
Create a SHA1 digest from a Lua script.- Parameters:
script
- script content.- Returns:
- the SHA1 value.
- Since:
- 6.0
-
digest
String digest(byte[] script)
Create a SHA1 digest from a Lua script.- Parameters:
script
- script content.- Returns:
- the SHA1 value.
- Since:
- 6.0
-
-