K - The type of keys that may be passed during script executionpublic class DefaultReactiveScriptExecutor<K> extends Object implements ReactiveScriptExecutor<K>
ReactiveScriptExecutor. Optimizes performance by attempting to execute script first
using EVALSHA, then falling back to EVAL if Redis has not yet cached the script.| Constructor and Description |
|---|
DefaultReactiveScriptExecutor(ReactiveRedisConnectionFactory connectionFactory,
RedisSerializationContext<K,?> serializationContext)
Creates a new
DefaultReactiveScriptExecutor given ReactiveRedisConnectionFactory and
RedisSerializationContext. |
| Modifier and Type | Method and Description |
|---|---|
protected <T> reactor.core.publisher.Flux<T> |
deserializeResult(RedisElementReader<T> reader,
reactor.core.publisher.Flux<T> result) |
protected <T> reactor.core.publisher.Flux<T> |
eval(ReactiveRedisConnection connection,
RedisScript<T> script,
ReturnType returnType,
int numKeys,
ByteBuffer[] keysAndArgs,
RedisElementReader<T> resultReader) |
<T> reactor.core.publisher.Flux<T> |
execute(RedisScript<T> script,
List<K> keys,
List<?> args)
Executes the given
RedisScript |
<T> reactor.core.publisher.Flux<T> |
execute(RedisScript<T> script,
List<K> keys,
List<?> args,
RedisElementWriter<?> argsWriter,
RedisElementReader<T> resultReader)
Executes the given
RedisScript, using the provided RedisSerializers to serialize the script
arguments and result. |
ReactiveRedisConnectionFactory |
getConnectionFactory() |
protected ByteBuffer[] |
keysAndArgs(RedisElementWriter argsWriter,
List<K> keys,
List<?> args) |
protected RedisSerializationContext.SerializationPair<K> |
keySerializer() |
protected ByteBuffer |
scriptBytes(RedisScript<?> script) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecute, executepublic DefaultReactiveScriptExecutor(ReactiveRedisConnectionFactory connectionFactory, RedisSerializationContext<K,?> serializationContext)
DefaultReactiveScriptExecutor given ReactiveRedisConnectionFactory and
RedisSerializationContext.connectionFactory - must not be null.serializationContext - must not be null.public <T> reactor.core.publisher.Flux<T> execute(RedisScript<T> script, List<K> keys, List<?> args)
ReactiveScriptExecutorRedisScriptexecute in interface ReactiveScriptExecutor<K>script - The script to execute. Must not be null.keys - Any keys that need to be passed to the script. Must not be null.args - Any args that need to be passed to the script. Can be empty.Flux.empty() if RedisScript.getResultType() is
null, likely indicating a throw-away status reply (i.e. "OK")public <T> reactor.core.publisher.Flux<T> execute(RedisScript<T> script, List<K> keys, List<?> args, RedisElementWriter<?> argsWriter, RedisElementReader<T> resultReader)
ReactiveScriptExecutorRedisScript, using the provided RedisSerializers to serialize the script
arguments and result.execute in interface ReactiveScriptExecutor<K>script - The script to execute. must not be null.keys - Any keys that need to be passed to the scriptargs - Any args that need to be passed to the scriptargsWriter - The RedisElementWriter to use for serializing args. Must not be null.resultReader - The RedisElementReader to use for serializing the script return value. Must not be
null.Flux.empty() if RedisScript.getResultType() is
null, likely indicating a throw-away status reply (i.e. "OK")protected <T> reactor.core.publisher.Flux<T> eval(ReactiveRedisConnection connection, RedisScript<T> script, ReturnType returnType, int numKeys, ByteBuffer[] keysAndArgs, RedisElementReader<T> resultReader)
protected ByteBuffer[] keysAndArgs(RedisElementWriter argsWriter, List<K> keys, List<?> args)
protected ByteBuffer scriptBytes(RedisScript<?> script)
script - protected <T> reactor.core.publisher.Flux<T> deserializeResult(RedisElementReader<T> reader, reactor.core.publisher.Flux<T> result)
protected RedisSerializationContext.SerializationPair<K> keySerializer()
public ReactiveRedisConnectionFactory getConnectionFactory()
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.