public static class DefaultClientResources.Builder extends Object implements ClientResources.Builder
DefaultClientResources.| Modifier and Type | Method and Description |
|---|---|
DefaultClientResources |
build() |
DefaultClientResources.Builder |
commandLatencyCollector(CommandLatencyCollector commandLatencyCollector)
Sets the
CommandLatencyCollector that can that can be used across different instances of the RedisClient. |
DefaultClientResources.Builder |
commandLatencyCollectorOptions(CommandLatencyCollectorOptions commandLatencyCollectorOptions)
Sets the
CommandLatencyCollectorOptions that can that can be used across different instances of the
RedisClient. |
DefaultClientResources.Builder |
commandLatencyPublisherOptions(EventPublisherOptions commandLatencyPublisherOptions)
Sets the
EventPublisherOptions to publish command latency metrics using the EventBus. |
DefaultClientResources.Builder |
computationThreadPoolSize(int computationThreadPoolSize)
Sets the thread pool size (number of threads to use) for computation operations (default value is the number of
CPUs).
|
DefaultClientResources.Builder |
dnsResolver(DnsResolver dnsResolver)
Sets the
DnsResolver that is used to resolve hostnames to InetAddress. |
DefaultClientResources.Builder |
eventBus(EventBus eventBus)
Sets the
EventBus that can that can be used across different instances of the RedisClient. |
DefaultClientResources.Builder |
eventExecutorGroup(EventExecutorGroup eventExecutorGroup)
Sets a shared
event executor group that can be used across different instances of
RedisClient and RedisClusterClient. |
DefaultClientResources.Builder |
eventLoopGroupProvider(EventLoopGroupProvider eventLoopGroupProvider)
Sets a shared
event executor provider that can be used across different instances of
RedisClient and RedisClusterClient. |
DefaultClientResources.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).
|
DefaultClientResources.Builder |
nettyCustomizer(NettyCustomizer nettyCustomizer)
Sets the
NettyCustomizer instance to customize netty components during connection. |
DefaultClientResources.Builder |
reconnectDelay(Delay reconnectDelay)
Sets the stateless reconnect
Delay to delay reconnect attempts. |
DefaultClientResources.Builder |
reconnectDelay(Supplier<Delay> reconnectDelay)
Sets the stateful reconnect
Supplier to delay reconnect attempts. |
ClientResources.Builder |
socketAddressResolver(SocketAddressResolver socketAddressResolver)
|
DefaultClientResources.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. |
DefaultClientResources.Builder |
tracing(Tracing tracing)
Sets the
Tracing instance to trace Redis calls. |
public DefaultClientResources.Builder ioThreadPoolSize(int ioThreadPoolSize)
eventLoopGroupProvider is provided.ioThreadPoolSize in interface ClientResources.BuilderioThreadPoolSize - the thread pool size, must be greater 0.this DefaultClientResources.Builder.public DefaultClientResources.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 in interface ClientResources.BuildereventLoopGroupProvider - the shared eventLoopGroupProvider, must not be null.this DefaultClientResources.Builder.public DefaultClientResources.Builder computationThreadPoolSize(int computationThreadPoolSize)
eventExecutorGroup is provided.computationThreadPoolSize in interface ClientResources.BuildercomputationThreadPoolSize - the thread pool size, must be greater 0.this DefaultClientResources.Builder.public DefaultClientResources.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 in interface ClientResources.BuildereventExecutorGroup - the shared eventExecutorGroup, must not be null.this DefaultClientResources.Builder.public DefaultClientResources.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 in interface ClientResources.Buildertimer - the shared Timer, must not be null.this DefaultClientResources.Builder.public DefaultClientResources.Builder eventBus(EventBus eventBus)
EventBus that can that can be used across different instances of the RedisClient.eventBus in interface ClientResources.BuildereventBus - the event bus, must not be null.this DefaultClientResources.Builder.public DefaultClientResources.Builder commandLatencyPublisherOptions(EventPublisherOptions commandLatencyPublisherOptions)
EventPublisherOptions to publish command latency metrics using the EventBus.commandLatencyPublisherOptions in interface ClientResources.BuildercommandLatencyPublisherOptions - the EventPublisherOptions to publish command latency metrics using the
EventBus, must not be null.this DefaultClientResources.Builder.public DefaultClientResources.Builder commandLatencyCollectorOptions(CommandLatencyCollectorOptions commandLatencyCollectorOptions)
CommandLatencyCollectorOptions that can that can be used across different instances of the
RedisClient. The options are only effective if no commandLatencyCollector is provided.commandLatencyCollectorOptions in interface ClientResources.BuildercommandLatencyCollectorOptions - the command latency collector options, must not be null.this DefaultClientResources.Builder.public DefaultClientResources.Builder commandLatencyCollector(CommandLatencyCollector commandLatencyCollector)
CommandLatencyCollector that can that can be used across different instances of the RedisClient.commandLatencyCollector in interface ClientResources.BuildercommandLatencyCollector - the command latency collector, must not be null.this DefaultClientResources.Builder.public ClientResources.Builder socketAddressResolver(SocketAddressResolver socketAddressResolver)
SocketAddressResolver that is used to resolve RedisURI to
SocketAddress. Defaults to SocketAddressResolver using the configured DnsResolver.socketAddressResolver in interface ClientResources.BuildersocketAddressResolver - the socket address resolver, must not be null.this ClientResources.Builder.public DefaultClientResources.Builder dnsResolver(DnsResolver dnsResolver)
DnsResolver that is used to resolve hostnames to InetAddress. Defaults to
DnsResolvers.JVM_DEFAULTdnsResolver in interface ClientResources.BuilderdnsResolver - the DNS resolver, must not be null.this DefaultClientResources.Builder.public DefaultClientResources.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 in interface ClientResources.BuilderreconnectDelay - the reconnect delay, must not be null.public DefaultClientResources.Builder reconnectDelay(Supplier<Delay> reconnectDelay)
Supplier to delay reconnect attempts. Defaults to binary exponential delay capped
at 30 SECONDS.reconnectDelay in interface ClientResources.BuilderreconnectDelay - the reconnect delay, must not be null.public DefaultClientResources.Builder nettyCustomizer(NettyCustomizer nettyCustomizer)
NettyCustomizer instance to customize netty components during connection.nettyCustomizer in interface ClientResources.BuildernettyCustomizer - the netty customizer instance, must not be null.public DefaultClientResources.Builder tracing(Tracing tracing)
Tracing instance to trace Redis calls.tracing in interface ClientResources.Buildertracing - the tracer infrastructure instance, must not be null.public DefaultClientResources build()
build in interface ClientResources.BuilderDefaultClientResources.Copyright © 2019 lettuce.io. All rights reserved.