Skip to content

Commit bf4b967

Browse files
committed
Fix formatting and imports
1 parent e7771d2 commit bf4b967

File tree

4 files changed

+46
-37
lines changed

4 files changed

+46
-37
lines changed

src/main/java/redis/clients/jedis/RedisClient.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public RedisClient() {
1717
}
1818

1919
/**
20-
* WARNING: This constructor only accepts a uri string as {@code url}. {@link JedisURIHelper#isValid(java.net.URI)}
21-
* can be used before this.
20+
* WARNING: This constructor only accepts a uri string as {@code url}.
21+
* {@link JedisURIHelper#isValid(java.net.URI)} can be used before this.
2222
* <p>
23-
* To use a host string, {@link #RedisClient(java.lang.String, int)} can be used with {@link Protocol#DEFAULT_PORT}.
24-
*
25-
* @param url
23+
* To use a host string, {@link #RedisClient(java.lang.String, int)} can be used with
24+
* {@link Protocol#DEFAULT_PORT}.
25+
* @param url redis url
2626
*/
2727
public RedisClient(final String url) {
2828
super(url);
@@ -37,14 +37,16 @@ public RedisClient(final HostAndPort hostAndPort) {
3737
}
3838

3939
public RedisClient(final String host, final int port, final String user, final String password) {
40-
super(new HostAndPort(host, port), DefaultJedisClientConfig.builder().user(user).password(password).build());
40+
super(new HostAndPort(host, port),
41+
DefaultJedisClientConfig.builder().user(user).password(password).build());
4142
}
4243

4344
public RedisClient(final URI uri) {
4445
super(uri);
4546
}
4647

47-
private RedisClient(CommandExecutor commandExecutor, ConnectionProvider connectionProvider, CommandObjects commandObjects, RedisProtocol redisProtocol, Cache cache) {
48+
private RedisClient(CommandExecutor commandExecutor, ConnectionProvider connectionProvider,
49+
CommandObjects commandObjects, RedisProtocol redisProtocol, Cache cache) {
4850
super(commandExecutor, connectionProvider, commandObjects, redisProtocol, cache);
4951
}
5052

@@ -58,8 +60,8 @@ static public class Builder extends StandaloneClientBuilder<RedisClient> {
5860

5961
@Override
6062
protected RedisClient createClient() {
61-
return new RedisClient(commandExecutor, connectionProvider, commandObjects, clientConfig.getRedisProtocol(),
62-
cache);
63+
return new RedisClient(commandExecutor, connectionProvider, commandObjects,
64+
clientConfig.getRedisProtocol(), cache);
6365
}
6466
}
6567

@@ -80,4 +82,3 @@ public Pipeline pipelined() {
8082
return (Pipeline) super.pipelined();
8183
}
8284
}
83-

src/main/java/redis/clients/jedis/RedisClusterClient.java

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,46 @@ public class RedisClusterClient extends UnifiedJedis {
2828
public static final int DEFAULT_MAX_ATTEMPTS = 5;
2929

3030
/**
31-
* Creates a RedisClusterClient instance. The provided node is used to make the first contact with the cluster.
31+
* Creates a RedisClusterClient instance. The provided node is used to make the first contact with
32+
* the cluster.
3233
* <p>
33-
* Here, the default timeout of {@value redis.clients.jedis.RedisClusterClient#DEFAULT_TIMEOUT} ms is being used with
34-
* {@value redis.clients.jedis.RedisClusterClient#DEFAULT_MAX_ATTEMPTS} maximum attempts.
34+
* Here, the default timeout of {@value redis.clients.jedis.RedisClusterClient#DEFAULT_TIMEOUT} ms
35+
* is being used with {@value redis.clients.jedis.RedisClusterClient#DEFAULT_MAX_ATTEMPTS} maximum
36+
* attempts.
3537
* @param node Node to first connect to.
3638
*/
3739
public RedisClusterClient(HostAndPort node) {
38-
super(new ClusterConnectionProvider(Collections.singleton(node), DefaultJedisClientConfig.builder().timeoutMillis(DEFAULT_TIMEOUT).build()),
40+
super(
41+
new ClusterConnectionProvider(Collections.singleton(node),
42+
DefaultJedisClientConfig.builder().timeoutMillis(DEFAULT_TIMEOUT).build()),
3943
DEFAULT_MAX_ATTEMPTS, Duration.ofMillis((long) DEFAULT_TIMEOUT * DEFAULT_MAX_ATTEMPTS));
4044
}
4145

4246
/**
4347
* Creates a RedisClusterClient with multiple entry points.
4448
* <p>
45-
* Here, the default timeout of {@value redis.clients.jedis.RedisClusterClient#DEFAULT_TIMEOUT} ms is being used with
46-
* {@value redis.clients.jedis.RedisClusterClient#DEFAULT_MAX_ATTEMPTS} maximum attempts.
49+
* Here, the default timeout of {@value redis.clients.jedis.RedisClusterClient#DEFAULT_TIMEOUT} ms
50+
* is being used with {@value redis.clients.jedis.RedisClusterClient#DEFAULT_MAX_ATTEMPTS} maximum
51+
* attempts.
4752
* @param nodes Nodes to connect to.
4853
*/
4954
public RedisClusterClient(Set<HostAndPort> nodes) {
50-
super(new ClusterConnectionProvider(nodes, DefaultJedisClientConfig.builder().timeoutMillis(DEFAULT_TIMEOUT).build()),
55+
super(
56+
new ClusterConnectionProvider(nodes,
57+
DefaultJedisClientConfig.builder().timeoutMillis(DEFAULT_TIMEOUT).build()),
5158
DEFAULT_MAX_ATTEMPTS, Duration.ofMillis((long) DEFAULT_TIMEOUT * DEFAULT_MAX_ATTEMPTS));
5259
}
5360

5461
public RedisClusterClient(Set<HostAndPort> nodes, String user, String password) {
55-
super(new ClusterConnectionProvider(nodes, DefaultJedisClientConfig.builder().user(user).password(password).build()),
56-
DEFAULT_MAX_ATTEMPTS, Duration.ofMillis((long) Protocol.DEFAULT_TIMEOUT * DEFAULT_MAX_ATTEMPTS));
62+
super(
63+
new ClusterConnectionProvider(nodes,
64+
DefaultJedisClientConfig.builder().user(user).password(password).build()),
65+
DEFAULT_MAX_ATTEMPTS,
66+
Duration.ofMillis((long) Protocol.DEFAULT_TIMEOUT * DEFAULT_MAX_ATTEMPTS));
5767
}
5868

59-
private RedisClusterClient(CommandExecutor commandExecutor, ConnectionProvider connectionProvider, CommandObjects commandObjects, RedisProtocol redisProtocol, Cache cache) {
69+
private RedisClusterClient(CommandExecutor commandExecutor, ConnectionProvider connectionProvider,
70+
CommandObjects commandObjects, RedisProtocol redisProtocol, Cache cache) {
6071
super(commandExecutor, connectionProvider, commandObjects, redisProtocol, cache);
6172
}
6273

@@ -70,8 +81,8 @@ static public class Builder extends ClusterClientBuilder<RedisClusterClient> {
7081

7182
@Override
7283
protected RedisClusterClient createClient() {
73-
return new RedisClusterClient(commandExecutor, connectionProvider, commandObjects, clientConfig.getRedisProtocol(),
74-
cache);
84+
return new RedisClusterClient(commandExecutor, connectionProvider, commandObjects,
85+
clientConfig.getRedisProtocol(), cache);
7586
}
7687
}
7788

@@ -95,7 +106,8 @@ public Map<String, ConnectionPool> getClusterNodes() {
95106
/**
96107
* Returns the connection for one of the 16,384 slots.
97108
* @param slot the slot to retrieve the connection for.
98-
* @return connection of the provided slot. {@code close()} of this connection must be called after use.
109+
* @return connection of the provided slot. {@code close()} of this connection must be called
110+
* after use.
99111
*/
100112
public Connection getConnectionFromSlot(int slot) {
101113
return ((ClusterConnectionProvider) provider).getConnectionFromSlot(slot);
@@ -125,7 +137,8 @@ public void ssubscribe(BinaryJedisShardedPubSub jedisPubSub, final byte[]... cha
125137

126138
@Override
127139
public ClusterPipeline pipelined() {
128-
return new ClusterPipeline((ClusterConnectionProvider) provider, (ClusterCommandObjects) commandObjects);
140+
return new ClusterPipeline((ClusterConnectionProvider) provider,
141+
(ClusterCommandObjects) commandObjects);
129142
}
130143

131144
/**
@@ -140,9 +153,9 @@ public AbstractTransaction transaction(boolean doMulti) {
140153

141154
public final <T> T executeCommandToReplica(CommandObject<T> commandObject) {
142155
if (!(executor instanceof ClusterCommandExecutor)) {
143-
throw new UnsupportedOperationException("Support only execute to replica in ClusterCommandExecutor");
156+
throw new UnsupportedOperationException(
157+
"Support only execute to replica in ClusterCommandExecutor");
144158
}
145159
return ((ClusterCommandExecutor) executor).executeCommandToReplica(commandObject);
146160
}
147161
}
148-

src/main/java/redis/clients/jedis/RedisSentinelClient.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
package redis.clients.jedis;
22

3-
import java.util.Set;
4-
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
5-
import redis.clients.jedis.annots.Experimental;
63
import redis.clients.jedis.builders.SentinelClientBuilder;
74
import redis.clients.jedis.csc.Cache;
8-
import redis.clients.jedis.csc.CacheConfig;
9-
import redis.clients.jedis.csc.CacheFactory;
5+
106
import redis.clients.jedis.executors.CommandExecutor;
117
import redis.clients.jedis.providers.ConnectionProvider;
128
import redis.clients.jedis.providers.SentineledConnectionProvider;
139

1410
public class RedisSentinelClient extends UnifiedJedis {
1511

16-
private RedisSentinelClient(CommandExecutor commandExecutor, ConnectionProvider connectionProvider, CommandObjects commandObjects, RedisProtocol redisProtocol, Cache cache) {
12+
private RedisSentinelClient(CommandExecutor commandExecutor,
13+
ConnectionProvider connectionProvider, CommandObjects commandObjects,
14+
RedisProtocol redisProtocol, Cache cache) {
1715
super(commandExecutor, connectionProvider, commandObjects, redisProtocol, cache);
1816
}
1917

@@ -27,14 +25,13 @@ static public class Builder extends SentinelClientBuilder<RedisSentinelClient> {
2725

2826
@Override
2927
protected RedisSentinelClient createClient() {
30-
return new RedisSentinelClient(commandExecutor, connectionProvider, commandObjects, clientConfig.getRedisProtocol(),
31-
cache);
28+
return new RedisSentinelClient(commandExecutor, connectionProvider, commandObjects,
29+
clientConfig.getRedisProtocol(), cache);
3230
}
3331
}
3432

3533
/**
3634
* Create a new builder for configuring RedisSentinelClient instances.
37-
*
3835
* @return a new {@link RedisSentinelClient.Builder} instance
3936
*/
4037
public static Builder builder() {
@@ -50,4 +47,3 @@ public Pipeline pipelined() {
5047
return (Pipeline) super.pipelined();
5148
}
5249
}
53-

src/main/java/redis/clients/jedis/UnifiedJedis.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import redis.clients.jedis.json.JsonSetParams;
2727
import redis.clients.jedis.json.Path;
2828
import redis.clients.jedis.json.Path2;
29-
import redis.clients.jedis.mcf.MultiDbCommandExecutor;
3029
import redis.clients.jedis.params.VAddParams;
3130
import redis.clients.jedis.params.VSimParams;
3231
import redis.clients.jedis.resps.RawVector;

0 commit comments

Comments
 (0)