diff --git a/src/main/java/io/lettuce/core/AbstractRedisClient.java b/src/main/java/io/lettuce/core/AbstractRedisClient.java index 30c03de05c..96dc306aa0 100644 --- a/src/main/java/io/lettuce/core/AbstractRedisClient.java +++ b/src/main/java/io/lettuce/core/AbstractRedisClient.java @@ -125,7 +125,7 @@ public void setDefaultTimeout(Duration timeout) { * * @param timeout Default connection timeout. * @param unit Unit of time for the timeout. - * @deprecated since 5.0, use {@link #setDefaultTimeout(long, TimeUnit)}. + * @deprecated since 5.0, use {@link #setDefaultTimeout(Duration)}. */ @Deprecated public void setDefaultTimeout(long timeout, TimeUnit unit) { diff --git a/src/main/java/io/lettuce/core/FutureSyncInvocationHandler.java b/src/main/java/io/lettuce/core/FutureSyncInvocationHandler.java index a9abf8a7bf..fc659ae353 100644 --- a/src/main/java/io/lettuce/core/FutureSyncInvocationHandler.java +++ b/src/main/java/io/lettuce/core/FutureSyncInvocationHandler.java @@ -36,7 +36,7 @@ class FutureSyncInvocationHandler extends AbstractInvocationHandler { private final Object asyncApi; private final MethodTranslator translator; - public FutureSyncInvocationHandler(StatefulConnection connection, Object asyncApi, Class[] interfaces) { + FutureSyncInvocationHandler(StatefulConnection connection, Object asyncApi, Class[] interfaces) { this.connection = connection; this.asyncApi = asyncApi; this.translator = MethodTranslator.of(asyncApi.getClass(), interfaces); diff --git a/src/main/java/io/lettuce/core/RedisException.java b/src/main/java/io/lettuce/core/RedisException.java index a85dca86d1..4890b079be 100644 --- a/src/main/java/io/lettuce/core/RedisException.java +++ b/src/main/java/io/lettuce/core/RedisException.java @@ -26,7 +26,7 @@ public class RedisException extends RuntimeException { /** * Create a {@code RedisException} with the specified detail message. - * + * * @param msg the detail message. */ public RedisException(String msg) { @@ -35,18 +35,17 @@ public RedisException(String msg) { /** * Create a {@code RedisException} with the specified detail message and nested exception. - * + * * @param msg the detail message. * @param cause the nested exception. */ - public RedisException(String msg, Throwable e) { - super(msg, e); + public RedisException(String msg, Throwable cause) { + super(msg, cause); } /** * Create a {@code RedisException} with the specified nested exception. - * - * @param msg the detail message. + * * @param cause the nested exception. */ public RedisException(Throwable cause) { diff --git a/src/main/java/io/lettuce/core/cluster/ClusterNodeEndpoint.java b/src/main/java/io/lettuce/core/cluster/ClusterNodeEndpoint.java index e6bd38eedf..551de33695 100644 --- a/src/main/java/io/lettuce/core/cluster/ClusterNodeEndpoint.java +++ b/src/main/java/io/lettuce/core/cluster/ClusterNodeEndpoint.java @@ -42,8 +42,8 @@ class ClusterNodeEndpoint extends DefaultEndpoint { /** * Initialize a new instance that handles commands from the supplied queue. * - * @param clientOptions client options for this connection - * @param clientResources client resources for this connection + * @param clientOptions client options for this connection. + * @param clientResources client resources for this connection. * @param clusterChannelWriter top-most channel writer. */ public ClusterNodeEndpoint(ClientOptions clientOptions, ClientResources clientResources, diff --git a/src/main/java/io/lettuce/core/masterslave/MasterSlave.java b/src/main/java/io/lettuce/core/masterslave/MasterSlave.java index 4595699bc1..c579c6bdba 100644 --- a/src/main/java/io/lettuce/core/masterslave/MasterSlave.java +++ b/src/main/java/io/lettuce/core/masterslave/MasterSlave.java @@ -165,6 +165,8 @@ private static StatefulRedisMasterSlaveConnection connectSentinel(R StatefulRedisMasterSlaveConnectionImpl connection = new StatefulRedisMasterSlaveConnectionImpl<>(channelWriter, codec, redisURI.getTimeout()); + connection.setOptions(redisClient.getOptions()); + Runnable runnable = () -> { try { @@ -224,6 +226,8 @@ private static StatefulRedisMasterSlaveConnection connectMasterSlav StatefulRedisMasterSlaveConnectionImpl connection = new StatefulRedisMasterSlaveConnectionImpl<>( channelWriter, codec, redisURI.getTimeout()); + connection.setOptions(redisClient.getOptions()); + return connection; } catch (RuntimeException e) { @@ -260,6 +264,8 @@ private static StatefulRedisMasterSlaveConnection connectStaticMast StatefulRedisMasterSlaveConnectionImpl connection = new StatefulRedisMasterSlaveConnectionImpl<>( channelWriter, codec, seedNode.getTimeout()); + connection.setOptions(redisClient.getOptions()); + return connection; } catch (RuntimeException e) { diff --git a/src/main/java/io/lettuce/core/protocol/CompleteableCommand.java b/src/main/java/io/lettuce/core/protocol/CompleteableCommand.java index bbef912cc2..0da1d46666 100644 --- a/src/main/java/io/lettuce/core/protocol/CompleteableCommand.java +++ b/src/main/java/io/lettuce/core/protocol/CompleteableCommand.java @@ -18,10 +18,20 @@ import java.util.function.Consumer; /** + * Extension to commands that provide registration of command completion callbacks. Completion callbacks allow execution of + * tasks after successive, failed or any completion outcome. A callback must be non-blocking. Callback registration gives no + * guarantee over callback ordering. + * * @author Mark Paluch */ public interface CompleteableCommand { + /** + * Register a command callback for command completion that notifies the callback with the command result or the failure + * resulting from command completion. + * + * @param action must not be {@literal null}. + */ void onComplete(Consumer action); }