Skip to content

Commit

Permalink
Restore public contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
tishun committed Dec 30, 2024
1 parent 03b9967 commit 309af6d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>6.5.0.BUILD-SNAPSHOT</version>
<version>6.5.2.BUILD-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lettuce</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public AbstractRedisAsyncCommands(StatefulConnection<K, V> connection, RedisCode
this.commandBuilder = new RedisCommandBuilder<>(codec);
this.jsonCommandBuilder = new RedisJsonCommandBuilder<>(codec, parser);
}

/**
* Initialize a new instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public RedisAdvancedClusterAsyncCommandsImpl(StatefulRedisClusterConnection<K, V
this.codec = codec;
}


@Override
public RedisFuture<String> clientSetname(K name) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public RedisAdvancedClusterReactiveCommandsImpl(StatefulRedisClusterConnectionIm
* {@link #RedisAdvancedClusterReactiveCommandsImpl(StatefulRedisClusterConnection, RedisCodec, Mono)}.
*/
@Deprecated
public RedisAdvancedClusterReactiveCommandsImpl(StatefulRedisClusterConnectionImpl<K, V> connection, RedisCodec<K, V> codec) {
public RedisAdvancedClusterReactiveCommandsImpl(StatefulRedisClusterConnectionImpl<K, V> connection,
RedisCodec<K, V> codec) {
super(connection, codec);
this.codec = codec;
}
Expand Down
36 changes: 36 additions & 0 deletions src/main/java/io/lettuce/core/cluster/RedisClusterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,24 @@ protected <K, V> StatefulRedisConnectionImpl<K, V> newStatefulRedisConnection(Re
return new StatefulRedisConnectionImpl<>(channelWriter, pushHandler, codec, timeout, parser);
}

/**
* Create a new instance of {@link StatefulRedisConnectionImpl} or a subclass.
* <p>
* Subclasses of {@link RedisClusterClient} may override that method.
*
* @param channelWriter the channel writer
* @param pushHandler the handler for push notifications
* @param codec codec
* @param timeout default timeout
* @param <K> Key-Type
* @param <V> Value Type
* @return new instance of StatefulRedisConnectionImpl
*/
protected <K, V> StatefulRedisConnectionImpl<K, V> newStatefulRedisConnection(RedisChannelWriter channelWriter,
PushHandler pushHandler, RedisCodec<K, V> codec, Duration timeout) {
return new StatefulRedisConnectionImpl<>(channelWriter, pushHandler, codec, timeout);
}

/**
* Create a pub/sub connection to a redis socket address.
*
Expand Down Expand Up @@ -712,6 +730,24 @@ protected <V, K> StatefulRedisClusterConnectionImpl<K, V> newStatefulRedisCluste
return new StatefulRedisClusterConnectionImpl(channelWriter, pushHandler, codec, timeout, parser);
}

/**
* Create a new instance of {@link StatefulRedisClusterConnectionImpl} or a subclass.
* <p>
* Subclasses of {@link RedisClusterClient} may override that method.
*
* @param channelWriter the channel writer
* @param pushHandler the handler for push notifications
* @param codec codec
* @param timeout default timeout
* @param <K> Key-Type
* @param <V> Value Type
* @return new instance of StatefulRedisClusterConnectionImpl
*/
protected <V, K> StatefulRedisClusterConnectionImpl<K, V> newStatefulRedisClusterConnection(
RedisChannelWriter channelWriter, ClusterPushHandler pushHandler, RedisCodec<K, V> codec, Duration timeout) {
return new StatefulRedisClusterConnectionImpl(channelWriter, pushHandler, codec, timeout);
}

private <T, K, V> Mono<T> connect(Mono<SocketAddress> socketAddressSupplier, DefaultEndpoint endpoint,
StatefulRedisClusterConnectionImpl<K, V> connection, Supplier<CommandHandler> commandHandlerSupplier) {

Expand Down

0 comments on commit 309af6d

Please sign in to comment.