Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis.ping()


    Jedis jedis = null;
    try {
      String[] hostAndPort = node.split(":");
      jedis = new Jedis(hostAndPort[0], Integer.valueOf(hostAndPort[1]));
      jedis.connect();
      jedis.ping();
      return true;
    }
    catch (Exception ex) {
      return false;
    }
View Full Code Here


    Jedis jedis = null;
    try {

      jedis = new Jedis(node.getHost(), node.getPort());
      jedis.connect();
      jedis.ping();
    } catch (Exception e) {

      return false;
    } finally {
View Full Code Here

    Jedis temp = null;
    try {
      temp = getJedis(node);
      temp.connect();
      return temp.ping().equalsIgnoreCase("pong");
    } catch (Exception e) {
      return false;
    } finally {
      if (temp != null) {
        temp.disconnect();
View Full Code Here

  private Jedis getActiveSentinel() {

    Assert.notNull(this.sentinelConfig);
    for (RedisNode node : this.sentinelConfig.getSentinels()) {
      Jedis jedis = new Jedis(node.getHost(), node.getPort());
      if (jedis.ping().equalsIgnoreCase("pong")) {
        return jedis;
      }
    }

    throw new InvalidDataAccessResourceUsageException("no sentinel found");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.