@Before public void before() { // ebm = new DefaultEventMulticaster(); final String clusters; if (StringUtils.endsWithIgnoreCase("online", profile)) { clusters = "10.18.10.206:6379 10.18.10.207:6379 10.18.10.208:6379 10.18.10.209:6379 10.18.10.234:6379 10.18.10.236:6379"; } else if (StringUtils.endsWithIgnoreCase("pre", profile)) { clusters = "10.18.10.127:6379 10.18.10.127:6479 10.18.10.127:6579"; } else if (StringUtils.endsWithIgnoreCase("test", profile)) { clusters = "10.8.100.129:6379 10.8.100.129:6479 10.8.100.129:6579"; } else { clusters = "10.8.100.180:7000 10.8.100.180:7001 10.8.100.180:7002"; } Set<HostAndPort> nodes = new HashSet<HostAndPort>(); for (String str : clusters.split("[,\\s\\t]+")) { final String[] arr = str.split(":"); nodes.add(new HostAndPort(arr[0], Integer.parseInt(arr[1]))); } BinaryJedisCluster jedisCluster = new BinaryJedisCluster(nodes); ebm = new DefaultEventMulticaster(new RedisEventBus(jedisCluster)); }
/** * */ public JedisClusterProvider(String groupName, JedisPoolConfig jedisPoolConfig, String[] servers, int timeout) { this.groupName = groupName; Set<HostAndPort> nodes = this.parseHostAndPort(servers); jedisCluster = new JedisCluster(nodes, timeout, maxRedirections, jedisPoolConfig); binaryJedisCluster = new BinaryJedisCluster(nodes, timeout, maxRedirections, jedisPoolConfig); }
/** * */ public JedisClusterProvider(String groupName,JedisPoolConfig jedisPoolConfig, String[] servers, int timeout) { this.groupName = groupName; Set<HostAndPort> nodes = this.parseHostAndPort(servers); jedisCluster = new JedisCluster(nodes, timeout, maxRedirections,jedisPoolConfig); binaryJedisCluster = new BinaryJedisCluster(nodes, timeout, maxRedirections,jedisPoolConfig); }
@Override public BinaryJedisCluster getBinary() { return binaryJedisCluster; }
public RedisEventBus(BinaryJedisCluster jedisCluster) { super(true); this.jedisCluster = jedisCluster; }