5
5
import java .util .Map ;
6
6
import java .util .Set ;
7
7
import org .apache .commons .pool2 .impl .GenericObjectPoolConfig ;
8
- import redis .clients .jedis .executors .ClusterCommandExecutor ;
9
8
import redis .clients .jedis .providers .ClusterConnectionProvider ;
10
9
11
10
public class JedisCluster extends UnifiedJedis {
@@ -100,6 +99,12 @@ public JedisCluster(Set<HostAndPort> nodes, String user, String password) {
100
99
this (nodes , DefaultJedisClientConfig .builder ().user (user ).password (password ).build ());
101
100
}
102
101
102
+ public JedisCluster (Set <HostAndPort > nodes , String user , String password ,
103
+ HostAndPortMapper hostAndPortMap ) {
104
+ this (nodes , DefaultJedisClientConfig .builder ().user (user ).password (password )
105
+ .hostAndPortMapper (hostAndPortMap ).build ());
106
+ }
107
+
103
108
public JedisCluster (Set <HostAndPort > nodes , final GenericObjectPoolConfig <Connection > poolConfig ) {
104
109
this (nodes , DEFAULT_TIMEOUT , DEFAULT_MAX_ATTEMPTS , poolConfig );
105
110
}
@@ -124,8 +129,8 @@ public JedisCluster(Set<HostAndPort> clusterNodes, int connectionTimeout, int so
124
129
this (clusterNodes , connectionTimeout , soTimeout , maxAttempts , password , null , poolConfig );
125
130
}
126
131
127
- public JedisCluster (Set <HostAndPort > clusterNodes , int connectionTimeout ,
128
- int soTimeout , int maxAttempts , String password , String clientName ,
132
+ public JedisCluster (Set <HostAndPort > clusterNodes , int connectionTimeout , int soTimeout ,
133
+ int maxAttempts , String password , String clientName ,
129
134
GenericObjectPoolConfig <Connection > poolConfig ) {
130
135
this (clusterNodes , connectionTimeout , soTimeout , maxAttempts , null , password , clientName ,
131
136
poolConfig );
@@ -139,9 +144,9 @@ public JedisCluster(Set<HostAndPort> clusterNodes, int connectionTimeout, int so
139
144
maxAttempts , poolConfig );
140
145
}
141
146
142
- public JedisCluster (Set <HostAndPort > clusterNodes , int connectionTimeout ,
143
- int soTimeout , int infiniteSoTimeout , int maxAttempts , String user , String password ,
144
- String clientName , GenericObjectPoolConfig <Connection > poolConfig ) {
147
+ public JedisCluster (Set <HostAndPort > clusterNodes , int connectionTimeout , int soTimeout ,
148
+ int infiniteSoTimeout , int maxAttempts , String user , String password , String clientName ,
149
+ GenericObjectPoolConfig <Connection > poolConfig ) {
145
150
this (clusterNodes , DefaultJedisClientConfig .builder ().connectionTimeoutMillis (connectionTimeout )
146
151
.socketTimeoutMillis (soTimeout ).blockingSocketTimeoutMillis (infiniteSoTimeout )
147
152
.user (user ).password (password ).clientName (clientName ).build (), maxAttempts , poolConfig );
@@ -169,7 +174,8 @@ public JedisCluster(Set<HostAndPort> clusterNodes, JedisClientConfig clientConfi
169
174
}
170
175
171
176
public JedisCluster (Set <HostAndPort > clusterNodes , JedisClientConfig clientConfig ,
172
- int maxAttempts , Duration maxTotalRetriesDuration , GenericObjectPoolConfig <Connection > poolConfig ) {
177
+ int maxAttempts , Duration maxTotalRetriesDuration ,
178
+ GenericObjectPoolConfig <Connection > poolConfig ) {
173
179
super (clusterNodes , clientConfig , poolConfig , maxAttempts , maxTotalRetriesDuration );
174
180
}
175
181
@@ -181,7 +187,8 @@ public JedisCluster(Set<HostAndPort> clusterNodes, JedisClientConfig clientConfi
181
187
super (clusterNodes , clientConfig , maxAttempts );
182
188
}
183
189
184
- public JedisCluster (Set <HostAndPort > clusterNodes , JedisClientConfig clientConfig , int maxAttempts , Duration maxTotalRetriesDuration ) {
190
+ public JedisCluster (Set <HostAndPort > clusterNodes , JedisClientConfig clientConfig , int maxAttempts ,
191
+ Duration maxTotalRetriesDuration ) {
185
192
super (clusterNodes , clientConfig , maxAttempts , maxTotalRetriesDuration );
186
193
}
187
194
0 commit comments