public class RediSearchClient
extends io.lettuce.core.RedisClient
RediSearchClient can be used with:
RediSearchClient is an expensive resource. It holds a set of netty's
EventLoopGroup's that use multiple threads. Reuse
this instance as much as possible or share a ClientResources instance
amongst multiple client instances.
RedisURI,
StatefulRediSearchConnection,
RedisFuture,
Mono,
Flux,
RedisCodec,
ClientOptions,
ClientResources,
MasterReplica| Modifier | Constructor and Description |
|---|---|
protected |
RediSearchClient()
Creates a uri-less RediSearchClient.
|
protected |
RediSearchClient(io.lettuce.core.resource.ClientResources clientResources,
io.lettuce.core.RedisURI redisURI) |
| Modifier and Type | Method and Description |
|---|---|
StatefulRediSearchConnection<java.lang.String,java.lang.String> |
connect()
Open a new connection to a RediSearch server that treats keys and values as
UTF-8 strings.
|
<K,V> StatefulRediSearchConnection<K,V> |
connect(io.lettuce.core.codec.RedisCodec<K,V> codec)
Open a new connection to a RediSearch server.
|
<K,V> StatefulRediSearchConnection<K,V> |
connect(io.lettuce.core.codec.RedisCodec<K,V> codec,
io.lettuce.core.RedisURI redisURI)
Open a new connection to a RediSearch server using the supplied
RedisURI and the supplied codec to encode/decode
keys. |
StatefulRediSearchConnection<java.lang.String,java.lang.String> |
connect(io.lettuce.core.RedisURI redisURI)
Open a new connection to a RediSearch server using the supplied
RedisURI that treats keys and values as UTF-8 strings. |
static RediSearchClient |
create()
Creates a uri-less RediSearchClient with default
ClientResources. |
static RediSearchClient |
create(io.lettuce.core.resource.ClientResources clientResources)
Creates a uri-less RediSearchClient with shared
ClientResources. |
static RediSearchClient |
create(io.lettuce.core.resource.ClientResources clientResources,
io.lettuce.core.RedisURI redisURI)
Create a new client that connects to the supplied
uri with
shared ClientResources. |
static RediSearchClient |
create(io.lettuce.core.resource.ClientResources clientResources,
java.lang.String uri)
Create a new client that connects to the supplied uri with shared
ClientResources.You need to shut down the ClientResources
upon shutting down your application. |
static RediSearchClient |
create(io.lettuce.core.RedisURI redisURI)
Create a new client that connects to the supplied
uri with
default ClientResources. |
static RediSearchClient |
create(java.lang.String uri)
Create a new client that connects to the supplied uri with default
ClientResources. |
protected <K,V> StatefulRediSearchConnectionImpl<K,V> |
newStatefulRedisConnection(io.lettuce.core.RedisChannelWriter channelWriter,
io.lettuce.core.protocol.PushHandler pushHandler,
io.lettuce.core.codec.RedisCodec<K,V> codec,
java.time.Duration timeout)
Create a new instance of
StatefulRediSearchConnectionImpl or a
subclass. |
connectAsync, connectPubSub, connectPubSub, connectPubSub, connectPubSub, connectPubSubAsync, connectSentinel, connectSentinel, connectSentinel, connectSentinel, connectSentinelAsync, getSocketAddress, newStatefulRedisPubSubConnection, newStatefulRedisSentinelConnection, newStringStringCodec, setOptionsaddListener, channelType, connectionBuilder, createHandshake, getChannelCount, getConnection, getConnection, getDefaultTimeout, getOptions, getResourceCount, getResources, initializeChannelAsync, removeListener, setDefaultTimeout, setDefaultTimeout, shutdown, shutdown, shutdown, shutdownAsync, shutdownAsyncprotected RediSearchClient(io.lettuce.core.resource.ClientResources clientResources,
io.lettuce.core.RedisURI redisURI)
protected RediSearchClient()
RedisURI on connecting. Methods without
having a RedisURI will fail with a
IllegalStateException. Non-private constructor to make
RediSearchClient proxyable.public static RediSearchClient create()
ClientResources. You
can connect to different Redis servers but you must supply a RedisURI
on connecting. Methods without having a RedisURI will fail with a
IllegalStateException.RediSearchClientpublic static RediSearchClient create(io.lettuce.core.RedisURI redisURI)
uri with
default ClientResources. You can connect to different Redis servers
but you must supply a RedisURI on connecting.redisURI - the Redis URI, must not be nullRediSearchClientpublic static RediSearchClient create(java.lang.String uri)
ClientResources. You can connect to different Redis servers but you
must supply a RedisURI on connecting.uri - the Redis URI, must not be nullRediSearchClientpublic static RediSearchClient create(io.lettuce.core.resource.ClientResources clientResources)
ClientResources. You
need to shut down the ClientResources upon shutting down your
application. You can connect to different Redis servers but you must supply a
RedisURI on connecting. Methods without having a RedisURI
will fail with a IllegalStateException.clientResources - the client resources, must not be nullRediSearchClientpublic static RediSearchClient create(io.lettuce.core.resource.ClientResources clientResources, java.lang.String uri)
ClientResources.You need to shut down the ClientResources
upon shutting down your application. You can connect to different Redis
servers but you must supply a RedisURI on connecting.clientResources - the client resources, must not be nulluri - the Redis URI, must not be nullRediSearchClientpublic static RediSearchClient create(io.lettuce.core.resource.ClientResources clientResources, io.lettuce.core.RedisURI redisURI)
uri with
shared ClientResources. You need to shut down the
ClientResources upon shutting down your application.You can connect
to different Redis servers but you must supply a RedisURI on
connecting.clientResources - the client resources, must not be nullredisURI - the Redis URI, must not be nullRediSearchClientpublic StatefulRediSearchConnection<java.lang.String,java.lang.String> connect()
connect in class io.lettuce.core.RedisClientpublic <K,V> StatefulRediSearchConnection<K,V> connect(io.lettuce.core.codec.RedisCodec<K,V> codec)
codec to encode/decode keys and values.connect in class io.lettuce.core.RedisClientK - Key typeV - Value typecodec - Use this codec to encode/decode keys and values, must not be
nullpublic StatefulRediSearchConnection<java.lang.String,java.lang.String> connect(io.lettuce.core.RedisURI redisURI)
RedisURI that treats keys and values as UTF-8 strings.connect in class io.lettuce.core.RedisClientredisURI - the Redis server to connect to, must not be nullpublic <K,V> StatefulRediSearchConnection<K,V> connect(io.lettuce.core.codec.RedisCodec<K,V> codec, io.lettuce.core.RedisURI redisURI)
RedisURI and the supplied codec to encode/decode
keys.connect in class io.lettuce.core.RedisClientK - Key typeV - Value typecodec - Use this codec to encode/decode keys and values, must not be
nullredisURI - the Redis server to connect to, must not be nullprotected <K,V> StatefulRediSearchConnectionImpl<K,V> newStatefulRedisConnection(io.lettuce.core.RedisChannelWriter channelWriter, io.lettuce.core.protocol.PushHandler pushHandler, io.lettuce.core.codec.RedisCodec<K,V> codec, java.time.Duration timeout)
StatefulRediSearchConnectionImpl or a
subclass.
Subclasses of RediSearchClient may override that method.
newStatefulRedisConnection in class io.lettuce.core.RedisClientK - Key-TypeV - Value TypechannelWriter - the channel writercodec - codectimeout - default timeout