Jedis 4 Breaking Changes
- The
BinaryJedis
andBinaryJedisCluster
classes have been removed.
The methods from these classes are available in the Jedis
and JedisCluster
classes
respectively.
- The following cases now throws an
IllegalStateException
instead 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 theTransaction
class are unsupported within MULTI (i.e., after themulti()
method). However,watch()
andunwatch ()
can still be used before calling MULTI. -
The
JedisCluster
constructors withGenericObjectPoolConfig<Jedis>
now acceptGenericObjectPoolConfig<Connection>
. -
All
JedisCluster
constructors now throw aJedisClusterOperationException
if 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)
returnsConnection
instead ofJedis
. -
JedisNoReachableClusterNodeException
has been removed.JedisClusterOperationException
, with a similar message, is thrown instead. -
JedisClusterMaxAttemptsException
has been removed.JedisClusterOperationException
, with a similar message, is thrown instead. -
JedisExhaustedPoolException
has been removed. AJedisException
with a similar message is thrown instead. -
Many sorted set methods return a Java
List
instead of aSet
. See the complete list. -
Many methods return primitive values) (
long
/boolean
/double
instead ofLong
/Boolean
/Double
). See the complete list. -
scriptExists(byte[])
method now returnsBoolean
instead ofLong
. -
scriptExists(byte[]...)
method now returnsList<Boolean>
instead ofList<Long>
. -
In the
xadd
method with StreamEntryID parameter, sending untypednull
raises an exception.
Casting the null
to StreamEntryID ((StreamEntryID) null
) resolves this issue.
- In the
xrange
andxrevrange
methods with StreamEntryID parameters, sending untypednull
s for both start and end parameters raises an exception.
Casting the null
s to StreamEntryID ((StreamEntryID) null
) resolves this issue.
-
The return type of
Jedis.shutdown()
is nowvoid
. Previously, it would return null. -
The
eval
andevalsha
methods are now non-blocking. These methods were blocking in Jedis 3.x. -
The
HostAndPort.localhost
constant 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.args
package. BitOP
GeoUnit
-
ListPosition
-
The following classes have been moved to the
redis.clients.jedis.params
package. BitPosParams
ScanParams
SortingParams
-
ZParams
-
The following classes have been moved to the
redis.clients.jedis.resps
package. AccessControlLogEntry
AccessControlUser
GeoRadiusResponse
ScanResult
Slowlog
StreamConsumersInfo
StreamEntry
StreamGroupInfo
StreamInfo
StreamPendingEntry
StreamPendingSummary
-
Tuple
-
Jedis and JedisPool constructors with a
String
parameter, and noint
parameter, only support a URL or URI string. - Jedis(String)
- JedisPool(String)
- JedisPool(String, SSLSocketFactory, SSLParameters, HostnameVerifier)
-
JedisPool(GenericObjectPoolConfig
, String) -
The
Client
andBinaryClient
classes have been removed. -
redis.clients.jedis.commands
package has been reimplemented, meaning that theCommands
interfaces have been restructured. -
The
ShardedJedisPool
,Sharded
,ShardedJedis
,BinaryShardedJedis
,ShardInfo
,JedisShardInfo
classes have been removed. -
Introduced
JedisSharding
class to replaceShardedJedisPool
.Earlier code without the use of "name" and "weight" (in ShardInfo/JedisShardInfo) are transferable to the new class.
-
ShardedJedisPipeline
class has been removed. -
Introduced
ShardedPipeline
class to replaceShardedJedisPipeline
. -
The type of
Protocol.CHARSET
has been changed tojava.nio.charset.Charset
. -
Jedis.debug(DebugParams)
method has been removed. -
The
DebugParams
class has been removed. -
The
Jedis.sync()
method has been removed. -
The
Jedis.pubsubNumSub(String...)
method now returnsMap<String, Long>
instead ofMap<String, String>
. -
setDataSource
method in Jedis class now hasprotected
access. -
JedisPoolAbstract
class 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_LIST
orBINARY_SET
)BYTE_ARRAY_MAP
(useBINARY_MAP
)STRING_ZSET
(useSTRING_LIST
orSTRING_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.Type
has been removed. UseClientType
. -
ClusterReset
has been removed. UseClusterResetType
. -
The
JedisClusterHostAndPortMap
interface has been removed. Use theHostAndPortMapper
interface. -
JedisClusterHashTagUtil
class has been renamed toJedisClusterHashTag
. -
The
KeyMergeUtil
class has been removed.