From 97669f3883978562e922401e4dc10bd92aac4e6b Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Sat, 2 Jul 2016 18:41:29 +0200 Subject: [PATCH] Polishing Improve Javadoc of ClientResources and EventLoopGroupProvider. --- .../redis/resource/ClientResources.java | 13 +++++++----- .../resource/EventLoopGroupProvider.java | 21 +++++++++++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/lambdaworks/redis/resource/ClientResources.java b/src/main/java/com/lambdaworks/redis/resource/ClientResources.java index 54457423bc..c4ec6035f9 100644 --- a/src/main/java/com/lambdaworks/redis/resource/ClientResources.java +++ b/src/main/java/com/lambdaworks/redis/resource/ClientResources.java @@ -51,10 +51,12 @@ public interface ClientResources { Future shutdown(long quietPeriod, long timeout, TimeUnit timeUnit); /** - * Return s the {@link EventLoopGroupProvider} which provides access to the particular - * {@link io.netty.channel.EventLoopGroup event loop groups}. lettuce needs at least two implementations: - * {@link io.netty.channel.nio.NioEventLoopGroup} for TCP/IP connections and - * {@link io.netty.channel.epoll.EpollEventLoopGroup} for unix domain socket connections (epoll). + * Returns the {@link EventLoopGroupProvider} that provides access to the particular {@link io.netty.channel.EventLoopGroup + * event loop groups}. lettuce requires at least two implementations: {@link io.netty.channel.nio.NioEventLoopGroup} for + * TCP/IP connections and {@link io.netty.channel.epoll.EpollEventLoopGroup} for unix domain socket connections (epoll). + * + * You can use {@link DefaultEventLoopGroupProvider} as default implementation or implement an own + * {@link EventLoopGroupProvider} to share existing {@link io.netty.channel.EventLoopGroup EventLoopGroup's} with lettuce. * * @return the {@link EventLoopGroupProvider} which provides access to the particular * {@link io.netty.channel.EventLoopGroup event loop groups} @@ -62,7 +64,8 @@ public interface ClientResources { EventLoopGroupProvider eventLoopGroupProvider(); /** - * Returns the computation pool used for internal operations. + * Returns the computation pool used for internal operations. Such tasks are periodic Redis Cluster and Redis Sentinel + * topology updates and scheduling of connection reconnection by {@link com.lambdaworks.redis.protocol.ConnectionWatchdog}. * * @return the computation pool used for internal operations */ diff --git a/src/main/java/com/lambdaworks/redis/resource/EventLoopGroupProvider.java b/src/main/java/com/lambdaworks/redis/resource/EventLoopGroupProvider.java index 799237b80c..f9368462e1 100644 --- a/src/main/java/com/lambdaworks/redis/resource/EventLoopGroupProvider.java +++ b/src/main/java/com/lambdaworks/redis/resource/EventLoopGroupProvider.java @@ -7,18 +7,21 @@ import io.netty.util.concurrent.Future; /** - * Provider for {@link EventExecutorGroup EventLoopGroups and EventExecutorGroups}. A event loop group is a heavy-weight - * instance holding and providing {@link Thread} instances. Multiple instances can be created but are expensive. Keeping too - * many instances open can exhaust the number of open files. + * Provider for {@link EventLoopGroup EventLoopGroups and EventExecutorGroups}. A event loop group is a heavy-weight instance + * holding and providing {@link Thread} instances. Multiple instances can be created but are expensive. Keeping too many + * instances open can exhaust the number of open files. *

* Usually, the default settings are sufficient. However, customizing might be useful for some special cases where multiple - * RedisClient or RedisClusterClient instances are needed that share one or more event loop groups. + * {@link com.lambdaworks.redis.RedisClient} or {@link com.lambdaworks.redis.cluster.RedisClusterClient} instances are needed + * that share one or more event loop groups. *

*

* The {@link EventLoopGroupProvider} allows to allocate and release instances implementing {@link EventExecutorGroup}. The * {@link EventExecutorGroup} instances must not be terminated or shutdown by the user. Resources are managed by the particular * {@link EventLoopGroupProvider}. *

+ * You can implement your own {@link EventLoopGroupProvider} to share existing {@link EventLoopGroup EventLoopGroup's} with + * lettuce. * * @author Mark Paluch * @since 3.4 @@ -26,12 +29,12 @@ public interface EventLoopGroupProvider { /** - * Retrieve a {@link EventLoopGroup} for the type {@code type}. Do not terminate or shutdown the instance. Call the - * {@link #release(EventExecutorGroup, long, long, TimeUnit)} to release an individual instance or + * Retrieve a {@link EventLoopGroup} for the {@link EventLoopGroup channel} {@code type}. Do not terminate or shutdown the + * instance. Call the {@link #release(EventExecutorGroup, long, long, TimeUnit)} to release an individual instance or * {@link #shutdown(long, long, TimeUnit)} method to free the all resources. * - * @param type type of the event loop group, must not be {@literal null} - * @param type parameter + * @param type class of the {@link EventLoopGroup}, must not be {@literal null} + * @param type of the {@link EventLoopGroup} * @return the {@link EventLoopGroup}. */ T allocate(Class type); @@ -45,7 +48,7 @@ public interface EventLoopGroupProvider { int threadPoolSize(); /** - * Release a {@code eventLoopGroup} instance. The method will shutdown/terminate the event loop group if it is no longer + * Release a {@code eventLoopGroup} instance. The method will shutdown/terminate the {@link EventExecutorGroup} if it is no longer * needed. * * @param eventLoopGroup the eventLoopGroup instance, must not be {@literal null}