Package org.nuxeo.ecm.core.redis
Class RedisAbstractExecutor
- java.lang.Object
-
- org.nuxeo.ecm.core.redis.RedisAbstractExecutor
-
- All Implemented Interfaces:
RedisExecutor
- Direct Known Subclasses:
RedisFailoverExecutor
,RedisPoolExecutor
public abstract class RedisAbstractExecutor extends Object implements RedisExecutor
Abstract implementation of aRedisExecutor
.This base implementation collects the loaded scripts to be able to re-load them if the server has been restarted and has lost them.
- Since:
- 8.10
-
-
Constructor Summary
Constructors Constructor Description RedisAbstractExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
evalsha(byte[] sha1, List<byte[]> keys, List<byte[]> args)
Evaluates the script of the given SHA1 with the given keys and arguments.Object
evalsha(String sha1, List<String> keys, List<String> args)
Evaluates the script of the given SHA1 with the given keys and arguments.String
scriptLoad(String script)
Loads the script into Redis.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.redis.RedisExecutor
execute, getPool, psubscribe, startMonitor, stopMonitor, subscribe
-
-
-
-
Method Detail
-
scriptLoad
public String scriptLoad(String script) throws redis.clients.jedis.exceptions.JedisException
Description copied from interface:RedisExecutor
Loads the script into Redis.- Specified by:
scriptLoad
in interfaceRedisExecutor
- Returns:
- the script SHA1
- Throws:
redis.clients.jedis.exceptions.JedisException
-
evalsha
public Object evalsha(String sha1, List<String> keys, List<String> args) throws redis.clients.jedis.exceptions.JedisException
Description copied from interface:RedisExecutor
Evaluates the script of the given SHA1 with the given keys and arguments.Can reload the script if the Redis instance restarted and the script isn't available anymore.
- Specified by:
evalsha
in interfaceRedisExecutor
- Parameters:
sha1
- the script SHA1keys
- the keysargs
- the arguments- Returns:
- the SHA1
- Throws:
redis.clients.jedis.exceptions.JedisException
-
evalsha
public Object evalsha(byte[] sha1, List<byte[]> keys, List<byte[]> args) throws redis.clients.jedis.exceptions.JedisException
Description copied from interface:RedisExecutor
Evaluates the script of the given SHA1 with the given keys and arguments.Can reload the script if the Redis instance restarted and the script isn't available anymore.
- Specified by:
evalsha
in interfaceRedisExecutor
- Parameters:
sha1
- the script SHA1keys
- the keysargs
- the arguments- Returns:
- the SHA1
- Throws:
redis.clients.jedis.exceptions.JedisException
-
-