Skip to content

Commit

Permalink
Set the GenericObjectPoolConfig type (#2391)
Browse files Browse the repository at this point in the history
* Set the GenericObjectPoolConfig type

* remove unused import

* fiux merge

* Apply suggestions from code review

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
  • Loading branch information
gkorland and sazzad16 authored Mar 8, 2021
1 parent 264019b commit 71a86d4
Show file tree
Hide file tree
Showing 20 changed files with 500 additions and 461 deletions.
24 changes: 12 additions & 12 deletions src/main/java/redis/clients/jedis/BinaryJedisCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,55 +40,55 @@ public BinaryJedisCluster(Set<HostAndPort> nodes) {
}

public BinaryJedisCluster(Set<HostAndPort> nodes, int timeout) {
this(nodes, timeout, DEFAULT_MAX_ATTEMPTS, new GenericObjectPoolConfig());
this(nodes, timeout, DEFAULT_MAX_ATTEMPTS, new GenericObjectPoolConfig<Jedis>());
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int timeout, int maxAttempts,
final GenericObjectPoolConfig poolConfig) {
final GenericObjectPoolConfig<Jedis> poolConfig) {
this(jedisClusterNode, timeout, timeout, maxAttempts, poolConfig);
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout,
int soTimeout, int maxAttempts, final GenericObjectPoolConfig poolConfig) {
int soTimeout, int maxAttempts, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, null, poolConfig);
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, GenericObjectPoolConfig poolConfig) {
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, GenericObjectPoolConfig<Jedis> poolConfig) {
this(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, password, null, poolConfig);
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, String clientName, GenericObjectPoolConfig poolConfig) {
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, String clientName, GenericObjectPoolConfig<Jedis> poolConfig) {
this(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, null, password, clientName, poolConfig);
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String user, String password, String clientName, GenericObjectPoolConfig poolConfig) {
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String user, String password, String clientName, GenericObjectPoolConfig<Jedis> poolConfig) {
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
connectionTimeout, soTimeout, user, password, clientName);
this.maxAttempts = maxAttempts;
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int infiniteSoTimeout, int maxAttempts, String user, String password, String clientName, GenericObjectPoolConfig poolConfig) {
int infiniteSoTimeout, int maxAttempts, String user, String password, String clientName, GenericObjectPoolConfig<Jedis> poolConfig) {
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName);
this.maxAttempts = maxAttempts;
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, String clientName, GenericObjectPoolConfig poolConfig,
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, String clientName, GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl) {
this(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, password, clientName, poolConfig, ssl, null, null, null, null);
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts,
String user, String password, String clientName, GenericObjectPoolConfig poolConfig, boolean ssl) {
String user, String password, String clientName, GenericObjectPoolConfig<Jedis> poolConfig, boolean ssl) {
this(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, user, password, clientName, poolConfig, ssl, null, null, null, null);
}

/**
* @deprecated This constructor will be removed in future.
*/
@Deprecated
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, String clientName, GenericObjectPoolConfig poolConfig,
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, String clientName, GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
this(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, null, password, clientName,
poolConfig, ssl, sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap);
Expand All @@ -99,7 +99,7 @@ public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeo
*/
@Deprecated
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, String user, String password, String clientName, GenericObjectPoolConfig poolConfig,
int maxAttempts, String user, String password, String clientName, GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
this(jedisClusterNode, connectionTimeout, soTimeout, 0, maxAttempts, user, password, clientName, poolConfig,
Expand All @@ -111,7 +111,7 @@ public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeo
*/
@Deprecated
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int infiniteSoTimeout, int maxAttempts, String user, String password, String clientName, GenericObjectPoolConfig poolConfig,
int infiniteSoTimeout, int maxAttempts, String user, String password, String clientName, GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap);
Expand Down
52 changes: 26 additions & 26 deletions src/main/java/redis/clients/jedis/JedisCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,47 @@ public JedisCluster(HostAndPort node, int timeout, int maxAttempts) {
this(Collections.singleton(node), timeout, maxAttempts);
}

public JedisCluster(HostAndPort node, final GenericObjectPoolConfig poolConfig) {
public JedisCluster(HostAndPort node, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(Collections.singleton(node), poolConfig);
}

public JedisCluster(HostAndPort node, int timeout, final GenericObjectPoolConfig poolConfig) {
public JedisCluster(HostAndPort node, int timeout, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(Collections.singleton(node), timeout, poolConfig);
}

public JedisCluster(HostAndPort node, int timeout, int maxAttempts,
final GenericObjectPoolConfig poolConfig) {
final GenericObjectPoolConfig<Jedis> poolConfig) {
this(Collections.singleton(node), timeout, maxAttempts, poolConfig);
}

public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
int maxAttempts, final GenericObjectPoolConfig poolConfig) {
int maxAttempts, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(Collections.singleton(node), connectionTimeout, soTimeout, maxAttempts, poolConfig);
}

public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
int maxAttempts, String password, final GenericObjectPoolConfig poolConfig) {
int maxAttempts, String password, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(Collections.singleton(node), connectionTimeout, soTimeout, maxAttempts, password, poolConfig);
}

public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig) {
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(Collections.singleton(node), connectionTimeout, soTimeout, maxAttempts, password, clientName, poolConfig);
}

public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig poolConfig) {
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(Collections.singleton(node), connectionTimeout, soTimeout, maxAttempts, user, password, clientName, poolConfig);
}

public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl) {
this(Collections.singleton(node), connectionTimeout, soTimeout, maxAttempts, password, clientName, poolConfig, ssl);
}

public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout, int maxAttempts,
String user, String password, String clientName, final GenericObjectPoolConfig poolConfig, boolean ssl) {
String user, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig, boolean ssl) {
this(Collections.singleton(node), connectionTimeout, soTimeout, maxAttempts, user, password, clientName, poolConfig, ssl);
}

Expand All @@ -88,7 +88,7 @@ public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout, int
*/
@Deprecated
public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
this(Collections.singleton(node), connectionTimeout, soTimeout, maxAttempts, password, clientName, poolConfig,
Expand All @@ -100,7 +100,7 @@ public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
*/
@Deprecated
public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig poolConfig,
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
this(Collections.singleton(node), connectionTimeout, soTimeout, maxAttempts, user, password, clientName, poolConfig,
Expand All @@ -120,56 +120,56 @@ public JedisCluster(Set<HostAndPort> nodes, int timeout) {
}

public JedisCluster(Set<HostAndPort> nodes, int timeout, int maxAttempts) {
this(nodes, timeout, maxAttempts, new GenericObjectPoolConfig());
this(nodes, timeout, maxAttempts, new GenericObjectPoolConfig<Jedis>());
}

public JedisCluster(Set<HostAndPort> nodes, final GenericObjectPoolConfig poolConfig) {
public JedisCluster(Set<HostAndPort> nodes, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(nodes, DEFAULT_TIMEOUT, DEFAULT_MAX_ATTEMPTS, poolConfig);
}

public JedisCluster(Set<HostAndPort> nodes, int timeout, final GenericObjectPoolConfig poolConfig) {
public JedisCluster(Set<HostAndPort> nodes, int timeout, final GenericObjectPoolConfig<Jedis> poolConfig) {
this(nodes, timeout, DEFAULT_MAX_ATTEMPTS, poolConfig);
}

public JedisCluster(Set<HostAndPort> jedisClusterNode, int timeout, int maxAttempts,
final GenericObjectPoolConfig poolConfig) {
final GenericObjectPoolConfig<Jedis> poolConfig) {
super(jedisClusterNode, timeout, maxAttempts, poolConfig);
}

public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, final GenericObjectPoolConfig poolConfig) {
int maxAttempts, final GenericObjectPoolConfig<Jedis> poolConfig) {
super(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, poolConfig);
}

public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, String password, final GenericObjectPoolConfig poolConfig) {
int maxAttempts, String password, final GenericObjectPoolConfig<Jedis> poolConfig) {
super(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, password, poolConfig);
}

public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig) {
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig) {
super(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, password, clientName, poolConfig);
}

public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig poolConfig) {
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig) {
super(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, user, password, clientName, poolConfig);
}

public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int infiniteSoTimeout, int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig poolConfig) {
int infiniteSoTimeout, int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig) {
super(jedisClusterNode, connectionTimeout, soTimeout, infiniteSoTimeout, maxAttempts, user, password, clientName, poolConfig);
}

public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl) {
super(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, password, clientName, poolConfig, ssl);
}

public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, String user, String password, String clientName,
final GenericObjectPoolConfig poolConfig, boolean ssl) {
final GenericObjectPoolConfig<Jedis> poolConfig, boolean ssl) {
super(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, user, password, clientName, poolConfig, ssl);
}

Expand All @@ -178,7 +178,7 @@ public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, in
*/
@Deprecated
public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
super(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, password, clientName, poolConfig,
Expand All @@ -190,7 +190,7 @@ public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, in
*/
@Deprecated
public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int infiniteSoTimeout,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig,
int maxAttempts, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
this(jedisClusterNode, connectionTimeout, soTimeout, infiniteSoTimeout, maxAttempts, null, password,
Expand All @@ -202,7 +202,7 @@ public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, in
*/
@Deprecated
public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig poolConfig,
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
super(jedisClusterNode, connectionTimeout, soTimeout, maxAttempts, user,password, clientName, poolConfig,
Expand All @@ -214,7 +214,7 @@ public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, in
*/
@Deprecated
public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout, int infiniteSoTimeout,
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig poolConfig,
int maxAttempts, String user, String password, String clientName, final GenericObjectPoolConfig<Jedis> poolConfig,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
super(jedisClusterNode, connectionTimeout, soTimeout, infiniteSoTimeout, maxAttempts, user, password,
Expand Down
Loading

0 comments on commit 71a86d4

Please sign in to comment.