xetorthio/jedis — pull request #460 by HeartSaVioR (2013-09-24 16:48:42+00:00)
Title: Let JedisSentinelPool take care of multi-failover

This pull request is for fixing #459

JedisSentinelPool seems to run perfectly before failover occured.
And, first failover (switching master) is normally completed.

But after failover, MasterListeners' Threads (and Subscription from Sentinel) are gone during re-initialize Pool.
Therefore Jedis never handles failover again!

I have modified JedisSentinelPool to restart MasterListeners when pool is re-initialized.
(At first, I removed listeners shutdown from destroy method and test is fine.
But I realized that destroy method is only method to cleanup, so I changed strategy.)

Thread object that already started cannot restarted in Java.
So I made another clone method that copies only host & port & config fields.

I modified unit test to failover twice and success.
To run failover twice without external operation, master needs to have two slaves. (another one)
I configured Makefile and pom.xml, HostAndPortUtil, etc.

I have tested all unit tests, and nothing happened.
My environment is OSX 10.8, Redis 2.6.16, JDK 1.6.0_51.

If you have a question about this request, feel free to ask me.