* Implement Closeable from Jedis, ShardedJedis with Pooled
** resources from JedisPool, JedisSentinelPool, ShardedJedis, ShardedJedisPool
* Connection class : check whether Jedis Connection is broken
** when it's time to throw JedisConnectionException, mark Connection to broken
cursor
* overload all *scan method to change "int" cursor to "string" cursor
* set @Deprecated and leave reason to deprecate and when to remove to
current *scan method
* modify unit tests to make it work with new *scan method
This allows a Jedis object to participate in try-with-resources when
using Java 7+. This change is fully backwards compatible to Java 6 and
previous releases of the Jedis client.
* Implements new sentinel commands (failover, monitor, remove, set)
* unit test included
** added 2 redis-server and 1 sentinel for failover test
* with some refactoring
** SentinelCommands : refactor to have interface
** HostAndPortUtil : same format to cluster setup
If Thread A calls a subscribe method on Jedis it will block on a socket read
call waiting for messages or subscription notifications. Thread B is now free
to call additional methods on JedisPubSub to change the current subscriptions
that thread A is waiting for. Essentially Thread A will do reads on the
socket and Thread B will do writes.
An issue occurs in that while Thread A is doing reads, in the
getObjectMultiBulkReply() method there is an implicit flush() call. This
means both Thread A and Thread B may do a write to the socket. Under this
situation if Thread A does a flush while Thread B is writing the internal
buffer will be corrupted. The fix is to make thread A never call flush().
This allows Thread A to be solely reads and Thread B to be solely writes.
Additionally since Thread B is sending commands, the internal pipeline count
is incremented and never decremented. So when Thread A terminates it's read
it resets the pipeline count.
- Add asking to cluster commands
- Make jedis cluster return connection to original pool
- Add tests for MOVED and ASK cluster responses
- Refactor connection handler to recalculate connections based on slots
This commit makes the first usable version of Jedis along with Redis Cluster
multi)
* BinaryClient / BinaryJedis : added feature to reset its state
(watched, multi)
* JedisPool / JedisSentinelPool : calls new feature (reset state) when
Jedis object returns to pool
* Unit Test included
* In BinaryJedis.multi(TransactionBlock), multi & exec already fired before exception occured, so sending discard has no effect, and made another error
** add unit test (error inside TransactionBlock)
*** Transaction with error - Redis discards transaction automatically (execabort)
*** Transaction with error - Redis doesn't roll back (force to execute all)