public class DefaultClientResources extends Object implements ClientResources
The DefaultClientResources
instance is stateful, you have to shutdown the instance if you're no longer using it.
DefaultClientResources
allow to configure:
ioThreadPoolSize
, alternativelyeventLoopGroupProvider
which is a provided instance of EventLoopGroupProvider
. Higher precedence than
ioThreadPoolSize
.eventExecutorGroup
which is a provided instance of EventExecutorGroup
. Higher precedence than
computationThreadPoolSize
.eventBus
which is a provided instance of EventBus
.commandLatencyCollector
which is a provided instance of
CommandLatencyCollector
.dnsResolver
which is a provided instance of
DnsResolver
.Modifier and Type | Class and Description |
---|---|
static class |
DefaultClientResources.Builder
Builder for
DefaultClientResources . |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_COMPUTATION_THREADS |
static int |
DEFAULT_IO_THREADS |
protected static io.netty.util.internal.logging.InternalLogger |
logger |
static int |
MIN_COMPUTATION_THREADS |
static int |
MIN_IO_THREADS |
Modifier | Constructor and Description |
---|---|
protected |
DefaultClientResources(DefaultClientResources.Builder builder) |
Modifier and Type | Method and Description |
---|---|
CommandLatencyCollector |
commandLatencyCollector()
Returns the
CommandLatencyCollector . |
EventPublisherOptions |
commandLatencyPublisherOptions()
Returns the
EventPublisherOptions for latency event publishing. |
int |
computationThreadPoolSize()
Returns the pool size (number of threads) for all computation tasks.
|
static DefaultClientResources |
create()
Create a new
DefaultClientResources using default settings. |
DnsResolver |
dnsResolver()
Returns the
DnsResolver . |
EventBus |
eventBus()
Returns the event bus used to publish events.
|
EventExecutorGroup |
eventExecutorGroup()
Returns the computation pool used for internal operations.
|
EventLoopGroupProvider |
eventLoopGroupProvider()
Return s the
EventLoopGroupProvider which provides access to the particular
event loop groups . lettuce needs at least two implementations:
NioEventLoopGroup for TCP/IP connections and
EpollEventLoopGroup for unix domain socket connections (epoll). |
protected void |
finalize() |
int |
ioThreadPoolSize()
Returns the pool size (number of threads) for IO threads.
|
Future<Boolean> |
shutdown()
Shutdown the
ClientResources . |
Future<Boolean> |
shutdown(long quietPeriod,
long timeout,
TimeUnit timeUnit)
Shutdown the
ClientResources . |
protected static final io.netty.util.internal.logging.InternalLogger logger
public static final int MIN_IO_THREADS
public static final int MIN_COMPUTATION_THREADS
public static final int DEFAULT_IO_THREADS
public static final int DEFAULT_COMPUTATION_THREADS
protected DefaultClientResources(DefaultClientResources.Builder builder)
protected void finalize() throws Throwable
public Future<Boolean> shutdown()
ClientResources
.shutdown
in interface ClientResources
public Future<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit)
ClientResources
.shutdown
in interface ClientResources
quietPeriod
- the quiet period as described in the documentationtimeout
- the maximum amount of time to wait until the executor is shutdown regardless if a task was submitted
during the quiet periodtimeUnit
- the unit of quietPeriod
and timeout
public EventLoopGroupProvider eventLoopGroupProvider()
ClientResources
EventLoopGroupProvider
which provides access to the particular
event loop groups
. lettuce needs at least two implementations:
NioEventLoopGroup
for TCP/IP connections and
EpollEventLoopGroup
for unix domain socket connections (epoll).eventLoopGroupProvider
in interface ClientResources
EventLoopGroupProvider
which provides access to the particular
event loop groups
public EventExecutorGroup eventExecutorGroup()
ClientResources
eventExecutorGroup
in interface ClientResources
public int ioThreadPoolSize()
ClientResources
ioThreadPoolSize
in interface ClientResources
public int computationThreadPoolSize()
ClientResources
computationThreadPoolSize
in interface ClientResources
public EventBus eventBus()
ClientResources
eventBus
in interface ClientResources
public CommandLatencyCollector commandLatencyCollector()
ClientResources
CommandLatencyCollector
.commandLatencyCollector
in interface ClientResources
public EventPublisherOptions commandLatencyPublisherOptions()
ClientResources
EventPublisherOptions
for latency event publishing.commandLatencyPublisherOptions
in interface ClientResources
EventPublisherOptions
for latency event publishingpublic DnsResolver dnsResolver()
ClientResources
DnsResolver
.dnsResolver
in interface ClientResources
public static DefaultClientResources create()
DefaultClientResources
using default settings.Copyright © 2016. All rights reserved.