credentialsProvider, int database,
String clientName, boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
- HostnameVerifier hostnameVerifier, HostAndPortMapper hostAndPortMapper) {
+ HostnameVerifier hostnameVerifier, HostAndPortMapper hostAndPortMapper,
+ ClientSetInfoConfig clientSetInfoConfig) {
this.redisProtocol = protocol;
this.connectionTimeoutMillis = connectionTimeoutMillis;
this.socketTimeoutMillis = soTimeoutMillis;
@@ -40,6 +43,7 @@ private DefaultJedisClientConfig(RedisProtocol protocol, int connectionTimeoutMi
this.sslParameters = sslParameters;
this.hostnameVerifier = hostnameVerifier;
this.hostAndPortMapper = hostAndPortMapper;
+ this.clientSetInfoConfig = clientSetInfoConfig;
}
@Override
@@ -113,6 +117,11 @@ public HostAndPortMapper getHostAndPortMapper() {
return hostAndPortMapper;
}
+ @Override
+ public ClientSetInfoConfig getClientSetInfoConfig() {
+ return clientSetInfoConfig;
+ }
+
public static Builder builder() {
return new Builder();
}
@@ -138,6 +147,8 @@ public static class Builder {
private HostAndPortMapper hostAndPortMapper = null;
+ private ClientSetInfoConfig clientSetInfoConfig = ClientSetInfoConfig.DEFAULT;
+
private Builder() {
}
@@ -149,7 +160,7 @@ public DefaultJedisClientConfig build() {
return new DefaultJedisClientConfig(redisProtocol, connectionTimeoutMillis, socketTimeoutMillis,
blockingSocketTimeoutMillis, credentialsProvider, database, clientName, ssl,
- sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMapper);
+ sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMapper, clientSetInfoConfig);
}
/**
@@ -239,6 +250,11 @@ public Builder hostAndPortMapper(HostAndPortMapper hostAndPortMapper) {
this.hostAndPortMapper = hostAndPortMapper;
return this;
}
+
+ public Builder clientSetInfoConfig(ClientSetInfoConfig setInfoConfig) {
+ this.clientSetInfoConfig = setInfoConfig;
+ return this;
+ }
}
public static DefaultJedisClientConfig create(int connectionTimeoutMillis, int soTimeoutMillis,
@@ -248,7 +264,7 @@ public static DefaultJedisClientConfig create(int connectionTimeoutMillis, int s
return new DefaultJedisClientConfig(null,
connectionTimeoutMillis, soTimeoutMillis, blockingSocketTimeoutMillis,
new DefaultRedisCredentialsProvider(new DefaultRedisCredentials(user, password)), database,
- clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMapper);
+ clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMapper, null);
}
public static DefaultJedisClientConfig copyConfig(JedisClientConfig copy) {
@@ -256,6 +272,7 @@ public static DefaultJedisClientConfig copyConfig(JedisClientConfig copy) {
copy.getConnectionTimeoutMillis(), copy.getSocketTimeoutMillis(),
copy.getBlockingSocketTimeoutMillis(), copy.getCredentialsProvider(),
copy.getDatabase(), copy.getClientName(), copy.isSsl(), copy.getSslSocketFactory(),
- copy.getSslParameters(), copy.getHostnameVerifier(), copy.getHostAndPortMapper());
+ copy.getSslParameters(), copy.getHostnameVerifier(), copy.getHostAndPortMapper(),
+ copy.getClientSetInfoConfig());
}
}
diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java
index e8c15864e3..c024894caa 100644
--- a/src/main/java/redis/clients/jedis/Jedis.java
+++ b/src/main/java/redis/clients/jedis/Jedis.java
@@ -352,7 +352,7 @@ public byte[] ping(final byte[] message) {
/**
* Select the DB with having the specified zero-based numeric index. For default every new
- * connection connection is automatically selected to DB 0.
+ * connection is automatically selected to DB 0.
* @param index
* @return OK
*/
@@ -569,7 +569,7 @@ public long del(final byte[] key) {
/**
* This command is very similar to DEL: it removes the specified keys. Just like DEL a key is
- * ignored if it does not exist. However the command performs the actual memory reclaiming in a
+ * ignored if it does not exist. However, the command performs the actual memory reclaiming in a
* different thread, so it is not blocking, while DEL is. This is where the command name comes
* from: the command just unlinks the keys from the keyspace. The actual removal will happen later
* asynchronously.
@@ -925,7 +925,7 @@ public String setex(final byte[] key, final long seconds, final byte[] value) {
}
/**
- * Set the the respective keys to the respective values. MSET will replace old values with new
+ * Set the respective keys to the respective values. MSET will replace old values with new
* values, while {@link Jedis#msetnx(byte[][]) MSETNX} will not perform any operation at all even
* if just a single key already exists.
*
@@ -973,10 +973,10 @@ public long msetnx(final byte[]... keysvalues) {
* DECRBY work just like {@link Jedis#decr(byte[]) DECR} but instead to decrement by 1 the
* decrement is integer.
*
- * DECR commands are limited to 64 bit signed integers.
+ * DECR commands are limited to 64-bit signed integers.
*
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
- * Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
+ * Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented,
* and then converted back as a string.
*
* Time complexity: O(1)
@@ -997,10 +997,10 @@ public long decrBy(final byte[] key, final long decrement) {
* Decrement the number stored at key by one. If the key does not exist or contains a value of a
* wrong type, set the key to the value of "0" before to perform the decrement operation.
*
- * DECR commands are limited to 64 bit signed integers.
+ * DECR commands are limited to 64-bit signed integers.
*
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
- * Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
+ * Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented,
* and then converted back as a string.
*
* Time complexity: O(1)
@@ -1020,10 +1020,10 @@ public long decr(final byte[] key) {
* INCRBY work just like {@link Jedis#incr(byte[]) INCR} but instead to increment by 1 the
* increment is integer.
*
- * INCR commands are limited to 64 bit signed integers.
+ * INCR commands are limited to 64-bit signed integers.
*
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
- * Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
+ * Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented,
* and then converted back as a string.
*
* Time complexity: O(1)
@@ -1069,10 +1069,10 @@ public double incrByFloat(final byte[] key, final double increment) {
* Increment the number stored at key by one. If the key does not exist or contains a value of a
* wrong type, set the key to the value of "0" before to perform the increment operation.
*
- * INCR commands are limited to 64 bit signed integers.
+ * INCR commands are limited to 64-bit signed integers.
*
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
- * Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
+ * Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented,
* and then converted back as a string.
*
* Time complexity: O(1)
@@ -1222,7 +1222,7 @@ public List hmget(final byte[] key, final byte[]... fields) {
* before applying the operation. Since the value argument is signed you can use this command to
* perform both increments and decrements.
*
- * The range of values supported by HINCRBY is limited to 64 bit signed integers.
+ * The range of values supported by HINCRBY is limited to 64-bit signed integers.
*
* Time complexity: O(1)
* @param key
@@ -2646,7 +2646,7 @@ public KeyValue bzpopmin(final double timeout, final byte[]... ke
* instructed to require a password before to allow clients to issue commands. This is done using
* the requirepass directive in the Redis configuration file. If the password given by the connection
* is correct the server replies with an OK status code reply and starts accepting commands from
- * the connection. Otherwise an error is returned and the clients needs to try a new password. Note
+ * the connection. Otherwise, an error is returned and the clients needs to try a new password. Note
* that for the high performance nature of Redis it is possible to try a lot of passwords in
* parallel in very short time, so make sure to generate a strong and very long password so that
* this attack is infeasible.
@@ -3617,9 +3617,9 @@ public String configResetStat() {
*
*
* CONFIG REWRITE is also able to rewrite the configuration file from scratch if the original one
- * no longer exists for some reason. However if the server was started without a configuration
+ * no longer exists for some reason. However, if the server was started without a configuration
* file at all, the CONFIG REWRITE will just return an error.
- * @return OK when the configuration was rewritten properly. Otherwise an error is returned.
+ * @return OK when the configuration was rewritten properly. Otherwise, an error is returned.
*/
@Override
public String configRewrite() {
@@ -5002,7 +5002,7 @@ public long del(final String key) {
/**
* This command is very similar to DEL: it removes the specified keys. Just like DEL a key is
- * ignored if it does not exist. However the command performs the actual memory reclaiming in a
+ * ignored if it does not exist. However, the command performs the actual memory reclaiming in a
* different thread, so it is not blocking, while DEL is. This is where the command name comes
* from: the command just unlinks the keys from the keyspace. The actual removal will happen later
* asynchronously.
@@ -5362,7 +5362,7 @@ public String setex(final String key, final long seconds, final String value) {
}
/**
- * Set the the respective keys to the respective values. MSET will replace old values with new
+ * Set the respective keys to the respective values. MSET will replace old values with new
* values, while {@link Jedis#msetnx(String...) MSETNX} will not perform any operation at all even
* if just a single key already exists.
*
@@ -5384,7 +5384,7 @@ public String mset(final String... keysvalues) {
}
/**
- * Set the the respective keys to the respective values. {@link Jedis#mset(String...) MSET} will
+ * Set the respective keys to the respective values. {@link Jedis#mset(String...) MSET} will
* replace old values with new values, while MSETNX will not perform any operation at all even if
* just a single key already exists.
*
@@ -5409,10 +5409,10 @@ public long msetnx(final String... keysvalues) {
* IDECRBY work just like {@link Jedis#decr(String) INCR} but instead to decrement by 1 the
* decrement is integer.
*
- * INCR commands are limited to 64 bit signed integers.
+ * INCR commands are limited to 64-bit signed integers.
*
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
- * Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
+ * Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented,
* and then converted back as a string.
*
* Time complexity: O(1)
@@ -5433,10 +5433,10 @@ public long decrBy(final String key, final long decrement) {
* Decrement the number stored at key by one. If the key does not exist or contains a value of a
* wrong type, set the key to the value of "0" before to perform the decrement operation.
*
- * INCR commands are limited to 64 bit signed integers.
+ * INCR commands are limited to 64-bit signed integers.
*
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
- * Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
+ * Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented,
* and then converted back as a string.
*
* Time complexity: O(1)
@@ -5456,10 +5456,10 @@ public long decr(final String key) {
* INCRBY work just like {@link Jedis#incr(String) INCR} but instead to increment by 1 the
* increment is integer.
*
- * INCR commands are limited to 64 bit signed integers.
+ * INCR commands are limited to 64-bit signed integers.
*
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
- * Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
+ * Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented,
* and then converted back as a string.
*
* Time complexity: O(1)
@@ -5501,10 +5501,10 @@ public double incrByFloat(final String key, final double increment) {
* Increment the number stored at key by one. If the key does not exist or contains a value of a
* wrong type, set the key to the value of "0" before to perform the increment operation.
*
- * INCR commands are limited to 64 bit signed integers.
+ * INCR commands are limited to 64-bit signed integers.
*
* Note: this is actually a string operation, that is, in Redis there are not "integer" types.
- * Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented,
+ * Simply the string stored at the key is parsed as a base 10 64-bit signed integer, incremented,
* and then converted back as a string.
*
* Time complexity: O(1)
@@ -5654,7 +5654,7 @@ public List hmget(final String key, final String... fields) {
* before applying the operation. Since the value argument is signed you can use this command to
* perform both increments and decrements.
*
- * The range of values supported by HINCRBY is limited to 64 bit signed integers.
+ * The range of values supported by HINCRBY is limited to 64-bit signed integers.
*
* Time complexity: O(1)
* @param key
diff --git a/src/main/java/redis/clients/jedis/JedisClientConfig.java b/src/main/java/redis/clients/jedis/JedisClientConfig.java
index beb0eabba6..0ad6e979f6 100644
--- a/src/main/java/redis/clients/jedis/JedisClientConfig.java
+++ b/src/main/java/redis/clients/jedis/JedisClientConfig.java
@@ -80,4 +80,11 @@ default HostAndPortMapper getHostAndPortMapper() {
return null;
}
+ /**
+ * Modify the behavior of internally executing CLIENT SETINFO command.
+ * @return CLIENT SETINFO config
+ */
+ default ClientSetInfoConfig getClientSetInfoConfig() {
+ return ClientSetInfoConfig.DEFAULT;
+ }
}
diff --git a/src/main/java/redis/clients/jedis/JedisSentinelPool.java b/src/main/java/redis/clients/jedis/JedisSentinelPool.java
index 6f921ddd97..586750540c 100644
--- a/src/main/java/redis/clients/jedis/JedisSentinelPool.java
+++ b/src/main/java/redis/clients/jedis/JedisSentinelPool.java
@@ -31,8 +31,8 @@ public class JedisSentinelPool extends Pool {
private final Object initPoolLock = new Object();
public JedisSentinelPool(String masterName, Set sentinels,
- final JedisClientConfig masteClientConfig, final JedisClientConfig sentinelClientConfig) {
- this(masterName, sentinels, new JedisFactory(masteClientConfig), sentinelClientConfig);
+ final JedisClientConfig masterClientConfig, final JedisClientConfig sentinelClientConfig) {
+ this(masterName, sentinels, new JedisFactory(masterClientConfig), sentinelClientConfig);
}
public JedisSentinelPool(String masterName, Set sentinels,
@@ -167,9 +167,9 @@ public JedisSentinelPool(String masterName, Set sentinels,
}
public JedisSentinelPool(String masterName, Set