We now allow to customise the JavaType to use for a given Class<> by using the getJavaType method. Added constructor variants to JacksonJsonRedisSerializer and Jackson2JsonRedisSerializer.
Original pull request: #113.
We added methods for PFADD, PFCOUNT and PFMERGE to RedisConnection and StringRedisConnection. HyperLogLogOperations available via RedisTemplate allow more indrect usage of HLL.
Please note that currently Jedis is the only driver that can be used for HyperLogLog commands.
Original pull request: #116.
Added additional leftPushAll and rightPushAll method overloads that accept a Collection parameter.
Previously we only accepted varargs which required users to convert collections to arrays.
Based on David Liu's pull request: #100.
Original pull request: #114.
We now support open zset's interval for JedisConnection, JredisConnection, LettuceConnection, SrpConnection and DefaultStringRedisConnection.
Original pull request: #97.
We now inspect the message of the exception thrown to determine whether the error resulted from a script not being present or an other error. In case the script is not present we simply invoke eval.
Original pull request: #108
It turned out that the version check throttled performance so we moved things around to avoid iterating multiple times and still perform the check in a non intrusive way.
Optimize initial size of HashSet and use a Set implementation to check for score duplicates.
Move jedis version check outside loop.
Original PR: #101
CLA: 90520140903040912 (Konstantin Shchepanovskyi)
Previously overriding message handler methods of the delegate passed to MessageListenerAdapter resulted in the message handler method called multiple times. We now make sure that a message handler method is only found and invoked once.
Original pull request: #95.
add support for commands:
SENTINEL FAILOVER master
SENTINEL SLAVES master
SENTINEL REMOVE name
SENTINEL MONITOR name ip port quorum
Original pull request: #92.
We’ve added RedisSentinelConfiguration holding required information for connecting to redis sentinels. This can be used to set up ConnectionFeactory for HA environments.
**Using Jedis**
Providing RedisSentinelConfiguration will force the JedisConnectionFactory to use JedisSentinelPool for managing resources.
**Using Lettuce/JRedis/SRP**
There’s currently no support for sentinel in those clients.
**CI Build**
We’ve added makefile to build and set up redis instances for testing sentinel support on travis-ci. There’s already a section for redis cluster.
The cluster section is for whatever reason currently not working as the cluster nodes won’t start.
This will be fixed when we add redis-cluster support.
_side note:_ there’s an alternative fork of lettuce at mp911de/lettuce that already has sentinel support.
* JedisConnection.eval() uses binary version of Jedis.eval()
* but JedisConnection.evalsha() uses string version of Jedis.evalsha()
* this commit changes JedisConnection.evalsha() to use binary version of Jedis.evalsha()
---
Original Pull Request: #91
CLA: 88220140729064528 (Jungtaek Lim)
We now consistently return null in implementations of RedisConnectionFactory#translateExceptionIfPossible(RuntimeException ex)
in cases where we cannot translate the given exception into a more meaningful one complying with the spec of PersistenceExceptionTranslator. Introduced the ExceptionTranslationStrategy abstraction which allows to customise the translation of exceptions through the implementations PassThroughExceptionTranslationStrategy which returns null iif the Exception could not be translated and FallbackExceptionTranslationStrategy which returns a RedisSystemException wrapping the original Exception if it couldn't be translated properly.
This fix also solves the issues DATAREDIS-295, DATAREDIS-325, DATAREDIS-326.
Original pull request: #90.
We now serialise the key and value before trying to acquire the lock to make sure that the given key and value are written in state they were at method invocation time.
Original pull request: #85.
We now validate the given RedisTemplate in the constructor of RedisAtomicLong/RedisAtomicInteger/RedisAtomicDouble to report an inappropriate RedisTemplate more eagerly.
Original pull request: #83.
Add scan to RedisMap / RedisSet / RedisZSet.
Lua scritps have to be assembled in binary way in order to avoid script errors when executing.
Add missing rules/profiles to run properly in a 2.6.x redis environment.
Original pull request: #82.
Unify naming and return types.
Update supported commands documentation.
Remove key from BoundHashOperations and use getKey() instead.
Prevent error when trying to read values when there are no values present.
Unify naming and return types. Update supported commands documentation. Remove key from BoundHashOperations and use getKey() instead.
Original pull request: #81.
ZSCAN is directly supported by jedis and can be emulated for lettuce via eval.
SRP and JRedis will throw UnsupportedOperationException.
Original pull request: #80.
HSCAN is directly supported by jedis and can be emulated for lettuce via eval.
SRP and JRedis will throw UnsupportedOperationException.
We have modified the ScanCursor implementation to take Collection instead of List.
Currently naming for scan commands is not consistent for scan, sscan and hscan. There’s a clean up task for those commands when done with all scan related commands.
Original pull request: #78.
Upgrading to latest jedis version 2.5.1. Added new conversion for Long to byte[] in JedisConverters to be able to convert long cursorIds to byte[].
Original pull request: #77.
We’ve added a customized SpringJUnit4Runner and TestRule that allow us to use a more relaxed strategy when dealing with @IfProfileValue. Basically we have added ‘+’ as sort of wildcard indicating tests should be executed for version X and all its successor.
This allows us to run test valid starting 2.6 for 2.8 as well, while those only valid for 2.8 are not executed against eg. redis 2.6.17.
Fixed compile error in ScanCursor with Java 6.
Orignal pull request: #76.
SSCAN command is natively supported by jedis and can be emulated for lettuce.
JRedis and SRP will throw UnsupportedOperationException.
sScan is available on RedisConneciton and RedisSetOperations returning basically a Cursor that allows iteration over the defined values for a given key.
Currently the jedis driver does not directly expose the binary version of sscan which leads to invalid results when using a non String compatible converter along with the RedisTemplate. We’ll change this as soon as a newer version of jedis is available.
Along the way loading behavior of ScanCursor has been fixed, preventing it from indicating next values available when there effectively are no more.
Orignal pull request: #76.
SCAN is currently only supported by jedis but can be emulated for
lettuce via eval.
Srp and JRedis will respond with UnsupportedOperationException.
We provide a Cursor implementation allowing to scroll through the
responses provided by the underlying connection. The cursor will fetch
additional results from redis server whenever its starting point has not
been reached and there are no more already loaded items available.
Only values returned by the last call to redis server are kept in memory
which allows scrolling through the entire collection without potentially
running into memory issues.
Original pull request: #71.
The introduced generic types prevent the DecoratingStringHashMapper from being useful as it can now only be created for mappers of the generic type which was not the original intention.
This breaks the retwis-j sample as well as it seems other implementations see: b0c0d23.
Original pull request: #73.
Redis connections have been left open when calling RedisTemplate.execute as the connection might have been bound to a thread, released but never been unbound. We now only bind and unbind connections in case of enabled transaction support, while just getting and releasing it for all other purposes.
Original pull request: #69.
If running in transaction mode we now do a rudimentary check if the provided number of arguments matches the ones defined for the RedisCommand to execute.
If the command passes this first check and causes an error on redis server one has to check results for Command.getOutput().hasError().
Original Pull Request: #66.
RedisTemplate now supports enabling of transaction support, which is disabled by default.
In case of enabled transaction support the RedisConnections will be bound to the current thread during ongoing outer transactions. We call MULTI at the beginning and depending on transaction state EXEC or DISCARD at its end.
To support read operations during the transaction we wrap a proxy around the bound connection piping read operations to a new (non thread bound) connection obtained by the underlying RedisConnectionFactory.
Transaction support is available for jedis, lettuce and srp, while had to be skipped for jredis due to the lack of support for MULTI.
Original pull request: #64.
We now return null if DefaultValueOperations#append() was applied to a non-existing list and thus returned null. Previously a NPE was thrown in case of pipelining or/and multi/exec calls.
Original pull request: #48.
'zCard' has been introduced in addition to 'size' as it feels more natural for people using redis. 'size' in 'ZSetOperations' / 'BoundZsetOperations' now delegate to 'zCard'.
Original Pull Request: #55
'SLAVEOF' and 'SLAVEOF NO ONE' are available via 'RedisConnection' and 'RedisOperations' for 'jedis', 'jredis', 'lettuce' and 'srp'.
Original Pull Request: #57
SetBit now returns the original bit value stored at the offset. The result will also be added in pipeline and transaction mode which means that the final result collection may now contain more entries than in prior versions.
Original Pull Request: #58
'RedisConnection' and 'RedisTemplate' have been extended by 'getClientList' retrieving client informations from redis. 'RedisClientInfo' provides access via specified getters as well as an more general approach directly using the keys (like 'qubuf').
The operation is available for 'jedis', 'lettuce' and 'srp'.
Original Pull Request: #53
Support for getting client connection name has been added for 'jedis', 'jredis' and 'srp' drivers.
Using 'jredis' will throw 'UnsupportedOperationException'.
Original Pull Request: #51
Killing a client connection can be done via 'RedisConnection' and 'RedisOperations' using 'jedis', 'lettuce' and 'srp'.
We use dedicated parameters for host and port building up the redis format (host:port) for connection identification.
Original Pull Request: #56
Workaround Jedis issue https://github.com/xetorthio/jedis/pull/575.
We now delegate calls to expire(...) to pExpireAt(...) in case the seconds parameter is > than Integer.MAX_VALUE.
We query the server time to compute the new expiration date.
Original pull request: #52.
'JRedisPool' and 'DefaultLettucePool' have been migrated to 'commons-pool2'.
'PoolConfig' has been deprecated, and will be removed in '1.4', as all required operations are available via 'GenericObjectPoolConfig'.
Along the way a minor bug within 'LettuceConnection' has been resolved, which prevented 'RedisAsyncConnections' from being properly closed/returned to pool.
Original Pull Request: #50
Created and added 'ShutdownOptions' to 'RedisServerCommands'. The full implementation is available for 'lettuce' and 'srp'.
When using 'jedis' the command is emulated using lua script via 'eval'.
For 'jredis' the method is not available and will throw 'UnsupportedOperationException'.
Original Pull Request: #47
Support for 'pSetEx' has been added for 'jedis' & 'srp'.
For 'lettuce' the command is emulated using 'eval'.
There is no support for 'pSetEx' when using 'jredis'.
'DefaultValueOperations.set' used with 'TimeUnit.MILLISECONDS' will fallback to 'setEx' in case 'pSetEx' is not supported by the driver in use.
Original pull request: #46.
'LettuceConnection' used 'ByteArrayOutput' as default for execute which did not fully read all values that might be included in the response.
To overcome this issue 'TypeHints' have been added which map a given 'CommandType' to the most recent 'CommandOutput'. As not all commands could be mapped that way due to the result depending on input parameters in some cases, it might be required to manually provide the type hint when calling execute.
Additional tests have been added to assert 'execute' works properly for 'jedis', 'jredis' and 'srp'.
Original Pull Request: #49
We now retain the potentially already configured caches during the initialisation of the RedisCacheManager bean. Previously we discarded the already configured caches which was an undesired side-effect.
Original pull request: #45.