public static interface ClientResources.Builder
ClientResources
.Modifier and Type | Method and Description |
---|---|
ClientResources.Builder |
addressResolverGroup(AddressResolverGroup<?> addressResolverGroup)
Sets the
AddressResolverGroup for DNS resolution. |
ClientResources |
build() |
default ClientResources.Builder |
commandLatencyCollector(CommandLatencyCollector commandLatencyCollector)
Deprecated.
since 6.0, use
commandLatencyRecorder(CommandLatencyRecorder) instead. |
ClientResources.Builder |
commandLatencyCollectorOptions(CommandLatencyCollectorOptions commandLatencyCollectorOptions)
Deprecated.
since 6.0. Configure
CommandLatencyRecorder directly using
CommandLatencyCollectorOptions . |
ClientResources.Builder |
commandLatencyPublisherOptions(EventPublisherOptions commandLatencyPublisherOptions)
Sets the
EventPublisherOptions to publish command latency metrics using the EventBus if the
CommandLatencyRecorder is an instance of CommandLatencyCollector that allows latency metric
retrieval. |
ClientResources.Builder |
commandLatencyRecorder(CommandLatencyRecorder latencyRecorder)
Sets the
CommandLatencyRecorder that can be used across different instances of the RedisClient. |
ClientResources.Builder |
computationThreadPoolSize(int computationThreadPoolSize)
Sets the thread pool size (number of threads to use) for computation operations (default value is the number of
CPUs).
|
ClientResources.Builder |
dnsResolver(DnsResolver dnsResolver)
Deprecated.
since 6.1. Configure
AddressResolverGroup instead. |
ClientResources.Builder |
eventBus(EventBus eventBus)
Sets the
EventBus that can be used across different instances of the RedisClient. |
ClientResources.Builder |
eventExecutorGroup(EventExecutorGroup eventExecutorGroup)
Sets a shared
event executor group that can be used across different instances of
RedisClient and RedisClusterClient . |
ClientResources.Builder |
eventLoopGroupProvider(EventLoopGroupProvider eventLoopGroupProvider)
Sets a shared
event executor provider that can be used across different instances of
RedisClient and RedisClusterClient . |
ClientResources.Builder |
ioThreadPoolSize(int ioThreadPoolSize)
Sets the thread pool size (number of threads to use) for I/O operations (default value is the number of CPUs).
|
ClientResources.Builder |
nettyCustomizer(NettyCustomizer nettyCustomizer)
Sets the
NettyCustomizer instance to customize netty components during connection. |
ClientResources.Builder |
reconnectDelay(Delay reconnectDelay)
Sets the stateless reconnect
Delay to delay reconnect attempts. |
ClientResources.Builder |
reconnectDelay(Supplier<Delay> reconnectDelay)
Sets the stateful reconnect
Supplier to delay reconnect attempts. |
ClientResources.Builder |
socketAddressResolver(SocketAddressResolver socketAddressResolver)
|
ClientResources.Builder |
threadFactoryProvider(ThreadFactoryProvider threadFactoryProvider)
|
ClientResources.Builder |
timer(Timer timer)
Sets a shared
Timer that can be used across different instances of RedisClient and
RedisClusterClient The provided Timer instance will not be shut down when
shutting down the client resources. |
ClientResources.Builder |
tracing(Tracing tracing)
Sets the
Tracing instance to trace Redis calls. |
ClientResources.Builder addressResolverGroup(AddressResolverGroup<?> addressResolverGroup)
AddressResolverGroup
for DNS resolution. This option is only effective if
DnsResolvers.UNRESOLVED
is used as DnsResolver
. Defaults to
DefaultAddressResolverGroup.INSTANCE
if netty-dns-resolver is not available,
otherwise defaults to DnsAddressResolverGroup
.addressResolverGroup
- the AddressResolverGroup
instance, must not be null
.this
ClientResources.Builder
@Deprecated default ClientResources.Builder commandLatencyCollector(CommandLatencyCollector commandLatencyCollector)
commandLatencyRecorder(CommandLatencyRecorder)
instead.CommandLatencyCollector
that can be used across different instances of the RedisClient.commandLatencyCollector
- the command latency collector, must not be null
.this
ClientResources.Builder
.ClientResources.Builder commandLatencyRecorder(CommandLatencyRecorder latencyRecorder)
CommandLatencyRecorder
that can be used across different instances of the RedisClient.latencyRecorder
- the command latency recorder, must not be null
.this
ClientResources.Builder
.@Deprecated ClientResources.Builder commandLatencyCollectorOptions(CommandLatencyCollectorOptions commandLatencyCollectorOptions)
CommandLatencyRecorder
directly using
CommandLatencyCollectorOptions
.CommandLatencyCollectorOptions
that can be used across different instances of the RedisClient. The
options are only effective if no commandLatencyCollector
is provided.commandLatencyCollectorOptions
- the command latency collector options, must not be null
.this
ClientResources.Builder
.ClientResources.Builder commandLatencyPublisherOptions(EventPublisherOptions commandLatencyPublisherOptions)
EventPublisherOptions
to publish command latency metrics using the EventBus
if the
CommandLatencyRecorder
is an instance of CommandLatencyCollector
that allows latency metric
retrieval.commandLatencyPublisherOptions
- the EventPublisherOptions
to publish command latency metrics using the
EventBus
, must not be null
.this
ClientResources.Builder
.ClientResources.Builder computationThreadPoolSize(int computationThreadPoolSize)
eventExecutorGroup
is provided.computationThreadPoolSize
- the thread pool size, must be greater 0
.this
ClientResources.Builder
.@Deprecated ClientResources.Builder dnsResolver(DnsResolver dnsResolver)
AddressResolverGroup
instead.DnsResolver
that is used to resolve hostnames to InetAddress
. Defaults to
DnsResolvers.UNRESOLVED
to use netty's AddressResolverGroup
.dnsResolver
- the DNS resolver, must not be null
.this
ClientResources.Builder
.ClientResources.Builder eventBus(EventBus eventBus)
EventBus
that can be used across different instances of the RedisClient.eventBus
- the event bus, must not be null
.this
ClientResources.Builder
.ClientResources.Builder eventExecutorGroup(EventExecutorGroup eventExecutorGroup)
event executor group
that can be used across different instances of
RedisClient
and RedisClusterClient
. The provided
EventExecutorGroup
instance will not be shut down when shutting down the client resources. You have to take
care of that. This is an advanced configuration that should only be used if you know what you are doing.eventExecutorGroup
- the shared eventExecutorGroup, must not be null
.this
ClientResources.Builder
.ClientResources.Builder eventLoopGroupProvider(EventLoopGroupProvider eventLoopGroupProvider)
event executor provider
that can be used across different instances of
RedisClient
and RedisClusterClient
. The provided
EventLoopGroupProvider
instance will not be shut down when shutting down the client resources. You have to
take care of that. This is an advanced configuration that should only be used if you know what you are doing.eventLoopGroupProvider
- the shared eventLoopGroupProvider, must not be null
.this
ClientResources.Builder
.ClientResources.Builder ioThreadPoolSize(int ioThreadPoolSize)
eventLoopGroupProvider
is provided.ioThreadPoolSize
- the thread pool size, must be greater 0
.this
ClientResources.Builder
.ClientResources.Builder nettyCustomizer(NettyCustomizer nettyCustomizer)
NettyCustomizer
instance to customize netty components during connection.nettyCustomizer
- the netty customizer instance, must not be null
.ClientResources.Builder reconnectDelay(Delay reconnectDelay)
Delay
to delay reconnect attempts. Defaults to binary exponential delay capped
at 30 SECONDS. reconnectDelay
must be a stateless Delay
.reconnectDelay
- the reconnect delay, must not be null
.ClientResources.Builder reconnectDelay(Supplier<Delay> reconnectDelay)
Supplier
to delay reconnect attempts. Defaults to binary exponential delay capped
at 30 SECONDS.reconnectDelay
- the reconnect delay, must not be null
.ClientResources.Builder socketAddressResolver(SocketAddressResolver socketAddressResolver)
SocketAddressResolver
that is used to resolve RedisURI
to
SocketAddress
. Defaults to SocketAddressResolver
using the configured DnsResolver
.socketAddressResolver
- the socket address resolver, must not be null
.this
ClientResources.Builder
.ClientResources.Builder threadFactoryProvider(ThreadFactoryProvider threadFactoryProvider)
ThreadFactoryProvider
to obtain ThreadFactory
for a
poolName
to create threads.
Applies only to threading resources created by ClientResources
when not configuring ClientResources.timer()
,
ClientResources.eventExecutorGroup()
, or ClientResources.eventLoopGroupProvider()
.
threadFactoryProvider
- a provider to obtain a ThreadFactory
for a
poolName
, must not be null
.this
ClientResources.Builder
.eventExecutorGroup(EventExecutorGroup)
,
eventLoopGroupProvider(EventLoopGroupProvider)
,
timer(Timer)
ClientResources.Builder timer(Timer timer)
Timer
that can be used across different instances of RedisClient
and
RedisClusterClient
The provided Timer
instance will not be shut down when
shutting down the client resources. You have to take care of that. This is an advanced configuration that should only
be used if you know what you are doing.timer
- the shared Timer
, must not be null
.this
ClientResources.Builder
.ClientResources.Builder tracing(Tracing tracing)
Tracing
instance to trace Redis calls.tracing
- the tracer infrastructure instance, must not be null
.ClientResources build()
DefaultClientResources
.Copyright © 2023 lettuce.io. All rights reserved.