Speed up Sentinel related tests
* remove FIXME sleep codes for Sentinel related tests ** add functions for Sentinel tests (JedisSentinelTestUtil) *** waitForSentinelRecognizeRedisReplication *** waitForNewPromotedMaster *** waitForSentinelsRecognizeEachOthers **** TODO: there're no command for sentinel to list recognized sentinel **** sleep 5.5 sec (sentinel pings to master every 5 sec) * set HostAndPort class to public(no longer inner) class ** reason: We cannot know pool's current master if HostAndPort class is private inner class / HostAndPort classes are duplicated (main/test) ** make getter method and parameterized constructor *** set fields once, get anytime
This commit is contained in:
@@ -4,10 +4,10 @@ import java.io.IOException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Calendar;
|
||||
|
||||
import redis.clients.jedis.HostAndPort;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.Pipeline;
|
||||
import redis.clients.jedis.tests.HostAndPortUtil;
|
||||
import redis.clients.jedis.tests.HostAndPortUtil.HostAndPort;
|
||||
|
||||
public class PipelinedGetSetBenchmark {
|
||||
private static HostAndPort hnp = HostAndPortUtil.getRedisServers().get(0);
|
||||
@@ -15,7 +15,7 @@ public class PipelinedGetSetBenchmark {
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException,
|
||||
IOException {
|
||||
Jedis jedis = new Jedis(hnp.host, hnp.port);
|
||||
Jedis jedis = new Jedis(hnp.getHost(), hnp.getPort());
|
||||
jedis.connect();
|
||||
jedis.auth("foobared");
|
||||
jedis.flushAll();
|
||||
|
||||
Reference in New Issue
Block a user