@@ -34,6 +34,11 @@ public JedisClusterConnectionHandler(Set<HostAndPort> nodes, final GenericObject
3434 this (nodes , poolConfig , connectionTimeout , soTimeout , infiniteSoTimeout , user , password , clientName , false , null , null , null , null );
3535 }
3636
37+ public JedisClusterConnectionHandler (Set <HostAndPort > nodes , final GenericObjectPoolConfig poolConfig ,
38+ final JedisSocketConfig socketConfig , String user , String password , String clientName ) {
39+ this (nodes , poolConfig , socketConfig , 0 , user , password , clientName );
40+ }
41+
3742 @ Deprecated
3843 public JedisClusterConnectionHandler (Set <HostAndPort > nodes , GenericObjectPoolConfig poolConfig ,
3944 int connectionTimeout , int soTimeout , String password , String clientName ,
@@ -69,18 +74,40 @@ public JedisClusterConnectionHandler(Set<HostAndPort> nodes, final GenericObject
6974 int connectionTimeout , int soTimeout , int infiniteSoTimeout , String user , String password , String clientName ,
7075 boolean ssl , SSLSocketFactory sslSocketFactory , SSLParameters sslParameters ,
7176 HostnameVerifier hostnameVerifier , JedisClusterHostAndPortMap portMap ) {
72- this (nodes , poolConfig , connectionTimeout , soTimeout , infiniteSoTimeout , user , password ,
73- clientName , ssl , sslSocketFactory , sslParameters , hostnameVerifier , (HostAndPortMapper ) portMap );
77+ this (nodes ,
78+ DefaultJedisSocketConfig .builder ().withConnectionTimeout (connectionTimeout ).withSoTimeout (soTimeout )
79+ .withSsl (ssl ).withSslSocketFactory (sslSocketFactory ).withSslParameters (sslParameters )
80+ .withHostnameVerifier (hostnameVerifier ).build (),
81+ poolConfig ,
82+ DefaultJedisSocketConfig .builder ().withConnectionTimeout (connectionTimeout ).withSoTimeout (soTimeout )
83+ .withSsl (ssl ).withSslSocketFactory (sslSocketFactory ).withSslParameters (sslParameters )
84+ .withHostnameVerifier (hostnameVerifier ).withHostAndPortMapper (portMap ).build (),
85+ infiniteSoTimeout , user , password , clientName );
7486 }
7587
7688 public JedisClusterConnectionHandler (Set <HostAndPort > nodes , final GenericObjectPoolConfig poolConfig ,
7789 int connectionTimeout , int soTimeout , int infiniteSoTimeout , String user , String password , String clientName ,
7890 boolean ssl , SSLSocketFactory sslSocketFactory , SSLParameters sslParameters ,
7991 HostnameVerifier hostnameVerifier , HostAndPortMapper portMap ) {
80- this .cache = new JedisClusterInfoCache (poolConfig , connectionTimeout , soTimeout , infiniteSoTimeout ,
81- user , password , clientName , ssl , sslSocketFactory , sslParameters , hostnameVerifier , portMap );
82- initializeSlotsCache (nodes , connectionTimeout , soTimeout , infiniteSoTimeout ,
83- user , password , clientName , ssl , sslSocketFactory , sslParameters , hostnameVerifier );
92+ this (nodes , poolConfig ,
93+ DefaultJedisSocketConfig .builder ().withConnectionTimeout (connectionTimeout ).withSoTimeout (soTimeout )
94+ .withSsl (ssl ).withSslSocketFactory (sslSocketFactory ).withSslParameters (sslParameters )
95+ .withHostnameVerifier (hostnameVerifier ).withHostAndPortMapper (portMap ).build (),
96+ infiniteSoTimeout , user , password , clientName );
97+ }
98+
99+ @ Deprecated
100+ public JedisClusterConnectionHandler (Set <HostAndPort > nodes , final JedisSocketConfig seedNodesSocketConfig ,
101+ final GenericObjectPoolConfig poolConfig , final JedisSocketConfig clusterNodesSocketConfig ,
102+ int infiniteSoTimeout , String user , String password , String clientName ) {
103+ this .cache = new JedisClusterInfoCache (poolConfig , clusterNodesSocketConfig , infiniteSoTimeout , user , password , clientName );
104+ initializeSlotsCache (nodes , seedNodesSocketConfig , infiniteSoTimeout , user , password , clientName );
105+ }
106+
107+ public JedisClusterConnectionHandler (Set <HostAndPort > nodes , final GenericObjectPoolConfig poolConfig ,
108+ final JedisSocketConfig socketConfig , int infiniteSoTimeout , String user , String password , String clientName ) {
109+ this .cache = new JedisClusterInfoCache (poolConfig , socketConfig , infiniteSoTimeout , user , password , clientName );
110+ initializeSlotsCache (nodes , socketConfig , infiniteSoTimeout , user , password , clientName );
84111 }
85112
86113 abstract Jedis getConnection ();
@@ -95,14 +122,11 @@ public Map<String, JedisPool> getNodes() {
95122 return cache .getNodes ();
96123 }
97124
98- private void initializeSlotsCache (Set <HostAndPort > startNodes ,
99- int connectionTimeout , int soTimeout , int infiniteSoTimeout , String user , String password , String clientName ,
100- boolean ssl , SSLSocketFactory sslSocketFactory , SSLParameters sslParameters , HostnameVerifier hostnameVerifier ) {
101- for (HostAndPort hostAndPort : startNodes ) {
102-
103- try (Jedis jedis = new Jedis (hostAndPort .getHost (), hostAndPort .getPort (), connectionTimeout ,
104- soTimeout , infiniteSoTimeout , ssl , sslSocketFactory , sslParameters , hostnameVerifier )) {
125+ private void initializeSlotsCache (Set <HostAndPort > startNodes , final JedisSocketConfig socketConfig ,
126+ int infiniteSoTimeout , String user , String password , String clientName ) {
105127
128+ for (HostAndPort hostAndPort : startNodes ) {
129+ try (Jedis jedis = new Jedis (hostAndPort , socketConfig , infiniteSoTimeout )) {
106130 if (user != null ) {
107131 jedis .auth (user , password );
108132 } else if (password != null ) {
0 commit comments