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.| 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. |
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 ClientResourcespublic Future<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit)
ClientResources.shutdown in interface ClientResourcesquietPeriod - 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 timeoutpublic EventLoopGroupProvider eventLoopGroupProvider()
ClientResourcesEventLoopGroupProvider 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 ClientResourcesEventLoopGroupProvider which provides access to the particular
event loop groupspublic EventExecutorGroup eventExecutorGroup()
ClientResourceseventExecutorGroup in interface ClientResourcespublic int ioThreadPoolSize()
ClientResourcesioThreadPoolSize in interface ClientResourcespublic int computationThreadPoolSize()
ClientResourcescomputationThreadPoolSize in interface ClientResourcespublic EventBus eventBus()
ClientResourceseventBus in interface ClientResourcespublic CommandLatencyCollector commandLatencyCollector()
ClientResourcesCommandLatencyCollector.commandLatencyCollector in interface ClientResourcespublic EventPublisherOptions commandLatencyPublisherOptions()
ClientResourcesEventPublisherOptions for latency event publishing.commandLatencyPublisherOptions in interface ClientResourcesEventPublisherOptions for latency event publishingpublic static DefaultClientResources create()
DefaultClientResources using default settings.Copyright © 2016. All rights reserved.