Apply Sentinel runtime configuration API introduced on Redis 2.8.4

* 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
This commit is contained in:
Jungtaek Lim
2014-01-22 00:23:40 +09:00
parent 01842e4731
commit a50cf3b15e
8 changed files with 244 additions and 65 deletions

View File

@@ -46,8 +46,11 @@ public class JedisSentinelTestUtil {
List<String> sentinelMasterInfos = sentinelJedis
.sentinelGetMasterAddrByName(masterName);
if (sentinelMasterInfos == null)
continue;
if (sentinelMasterInfos == null) {
System.out
.println("Cannot retrieve Sentinel's master address info, sleep...");
continue;
}
newMaster = new HostAndPort(sentinelMasterInfos.get(0),
Integer.parseInt(sentinelMasterInfos.get(1)));