Jedis 4 Breaking Changes
- The
BinaryJedisandBinaryJedisClusterclasses have been removed.
The methods from these classes are available in the Jedis and JedisCluster classes
respectively.
- The following cases now throws an
IllegalStateExceptioninstead of aJedisDataException. Cannot use Jedis when in Multi. Please use Transaction or reset Jedis state.-
Cannot use Jedis when in Pipeline. Please use Pipeline or reset Jedis state. -
The Redis transaction methods
multi(),exec()anddiscard()have been removed fromPipeline. -
The
execGetResponse()method has been removed fromTransaction. -
The
watch()andunwatch()methods from theTransactionclass are unsupported within MULTI (i.e., after themulti()method). However,watch()andunwatch ()can still be used before calling MULTI. -
The
JedisClusterconstructors withGenericObjectPoolConfig<Jedis>now acceptGenericObjectPoolConfig<Connection>. -
All
JedisClusterconstructors now throw aJedisClusterOperationExceptionif unable to connect to any of the providedHostAndPort(s). Previously, the connection would go into an unusable state. -
JedisCluster.getClusterNodes()returnsMap<String, ConnectionPool>instead ofMap<String, JedisPool>. -
JedisCluster.getConnectionFromSlot(int)returnsConnectioninstead ofJedis. -
JedisNoReachableClusterNodeExceptionhas been removed.JedisClusterOperationException, with a similar message, is thrown instead. -
JedisClusterMaxAttemptsExceptionhas been removed.JedisClusterOperationException, with a similar message, is thrown instead. -
JedisExhaustedPoolExceptionhas been removed. AJedisExceptionwith a similar message is thrown instead. -
Many sorted set methods return a Java
Listinstead of aSet. See the complete list. -
Many methods return primitive values) (
long/boolean/doubleinstead ofLong/Boolean/Double). See the complete list. -
scriptExists(byte[])method now returnsBooleaninstead ofLong. -
scriptExists(byte[]...)method now returnsList<Boolean>instead ofList<Long>. -
In the
xaddmethod with StreamEntryID parameter, sending untypednullraises an exception.
Casting the null to StreamEntryID ((StreamEntryID) null) resolves this issue.
- In the
xrangeandxrevrangemethods with StreamEntryID parameters, sending untypednulls for both start and end parameters raises an exception.
Casting the nulls to StreamEntryID ((StreamEntryID) null) resolves this issue.
-
The return type of
Jedis.shutdown()is nowvoid. Previously, it would return null. -
The
evalandevalshamethods are now non-blocking. These methods were blocking in Jedis 3.x. -
The
HostAndPort.localhostconstant has been removed. -
The following methods have been removed from HostAndPort class:
extractParts()parseString()convertHost()setLocalhost()getLocalhost()-
getLocalHostQuietly() -
The following classes have been moved to the
redis.clients.jedis.argspackage. BitOPGeoUnit-
ListPosition -
The following classes have been moved to the
redis.clients.jedis.paramspackage. BitPosParamsScanParamsSortingParams-
ZParams -
The following classes have been moved to the
redis.clients.jedis.respspackage. AccessControlLogEntryAccessControlUserGeoRadiusResponseScanResultSlowlogStreamConsumersInfoStreamEntryStreamGroupInfoStreamInfoStreamPendingEntryStreamPendingSummary-
Tuple -
Jedis and JedisPool constructors with a
Stringparameter, and nointparameter, only support a URL or URI string. - Jedis(String)
- JedisPool(String)
- JedisPool(String, SSLSocketFactory, SSLParameters, HostnameVerifier)
-
JedisPool(GenericObjectPoolConfig
, String) -
The
ClientandBinaryClientclasses have been removed. -
redis.clients.jedis.commandspackage has been reimplemented, meaning that theCommandsinterfaces have been restructured. -
The
ShardedJedisPool,Sharded,ShardedJedis,BinaryShardedJedis,ShardInfo,JedisShardInfoclasses have been removed. -
Introduced
JedisShardingclass to replaceShardedJedisPool.Earlier code without the use of "name" and "weight" (in ShardInfo/JedisShardInfo) are transferable to the new class.
-
ShardedJedisPipelineclass has been removed. -
Introduced
ShardedPipelineclass to replaceShardedJedisPipeline. -
The type of
Protocol.CHARSEThas been changed tojava.nio.charset.Charset. -
Jedis.debug(DebugParams)method has been removed. -
The
DebugParamsclass has been removed. -
The
Jedis.sync()method has been removed. -
The
Jedis.pubsubNumSub(String...)method now returnsMap<String, Long>instead ofMap<String, String>. -
setDataSourcemethod in Jedis class now hasprotectedaccess. -
JedisPoolAbstractclass has been removed. UsePool<Jedis>. -
The
Pool.initPool()method has been removed. -
The
Pool.getNumActive()method now returns0(via GenericObjectPool) when the pool is closed. -
The
Connection.getRawObjectMultiBulkReply()method has been removed. UseConnection.getUnflushedObjectMultiBulkReply()method. -
The
Queable.getResponse(Builder<T> builder)method has been renamed toQueable.enqueResponse(Builder<T> builder). -
All methods in Queable are now
final: clean()generateResponse(Object data)enqueResponse(Builder<T> builder)-
getPipelinedResponseLength() -
These BuilderFactory implementations have been removed:
OBJECT(useRAW_OBJECT)BYTE_ARRAY_ZSET(useBINARY_LISTorBINARY_SET)BYTE_ARRAY_MAP(useBINARY_MAP)STRING_ZSET(useSTRING_LISTorSTRING_SET)EVAL_RESULT(useENCODED_OBJECT)-
EVAL_BINARY_RESULT(useRAW_OBJECT) -
All String variables representing Cluster, Sentinel and PubSub subcommands in Protocol class have been removed.
-
ClientKillParams.Typehas been removed. UseClientType. -
ClusterResethas been removed. UseClusterResetType. -
The
JedisClusterHostAndPortMapinterface has been removed. Use theHostAndPortMapperinterface. -
JedisClusterHashTagUtilclass has been renamed toJedisClusterHashTag. -
The
KeyMergeUtilclass has been removed.