Package redis.clients.jedis

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


  shards.add(new JedisShardInfo(redis1.getHost(), redis1.getPort()));
  shards.add(new JedisShardInfo(redis2.getHost(), redis2.getPort()));
  shards.get(0).setPassword("foobared");
  shards.get(1).setPassword("foobared");
  Jedis j = new Jedis(shards.get(0));
  j.connect();
  j.flushAll();
  j.disconnect();
  j = new Jedis(shards.get(1));
  j.connect();
  j.flushAll();
View Full Code Here


  Jedis j = new Jedis(shards.get(0));
  j.connect();
  j.flushAll();
  j.disconnect();
  j = new Jedis(shards.get(1));
  j.connect();
  j.flushAll();
  j.disconnect();

    }
View Full Code Here

      jedis.set("a-test-" + i, "0");
  }
  pool.returnResource(jedis);
  // check quantity for each shard
  Jedis j = new Jedis(shards.get(0));
  j.connect();
  Long c1 = j.dbSize();
  j.disconnect();
  j = new Jedis(shards.get(1));
  j.connect();
  Long c2 = j.dbSize();
View Full Code Here

  Jedis j = new Jedis(shards.get(0));
  j.connect();
  Long c1 = j.dbSize();
  j.disconnect();
  j = new Jedis(shards.get(1));
  j.connect();
  Long c2 = j.dbSize();
  j.disconnect();
  // shutdown shard 2 and check thay the pool returns an instance with c1
  // items on one shard
  // alter shard 1 and recreate pool
View Full Code Here

  jedis.disconnect();
    }

    protected Jedis createJedis() {
  Jedis j = new Jedis(hnp.getHost(), hnp.getPort());
  j.connect();
  j.auth("foobared");
  j.flushAll();
  return j;
    }
View Full Code Here

    private static final int TOTAL_OPERATIONS = 200000;

    public static void main(String[] args) throws UnknownHostException,
      IOException {
  Jedis jedis = new Jedis(hnp.getHost(), hnp.getPort());
  jedis.connect();
  jedis.auth("foobared");
  jedis.flushAll();

  long begin = Calendar.getInstance().getTimeInMillis();
View Full Code Here

    private static final int TOTAL_OPERATIONS = 100000;

    public static void main(String[] args) throws UnknownHostException,
      IOException {
  Jedis jedis = new Jedis(hnp.getHost(), hnp.getPort());
  jedis.connect();
  jedis.auth("foobared");
  jedis.flushAll();

  long begin = Calendar.getInstance().getTimeInMillis();
View Full Code Here

    private static HostAndPort hnp = HostAndPortUtil.getRedisServers().get(0);
    private static final int TOTAL_OPERATIONS = 100000;

    public static void main(String[] args) throws Exception {
  Jedis j = new Jedis(hnp.getHost(), hnp.getPort());
  j.connect();
  j.auth("foobared");
  j.flushAll();
  j.quit();
  j.disconnect();
  long t = System.currentTimeMillis();
View Full Code Here

              return false;
            } else {
              // Otherwise, connect to Redis and get all
              // the name/value pairs for this hash key
              Jedis jedis = new Jedis(host);
              jedis.connect();
              String strKey = hashKeys.next();
              currentHashMonth = MONTH_FROM_STRING.get(strKey);
              hashIterator = jedis.hgetAll(strKey).entrySet()
                  .iterator();
              jedis.disconnect();
View Full Code Here

        LOG.info("Connecting to " + host + " and reading from "
            + hashKey);

        Jedis jedis = new Jedis(host);
        jedis.connect();
        jedis.getClient().setTimeoutInfinite();

        // Get all the key value pairs from the Redis instance and store
        // them in memory
        totalKVs = jedis.hlen(hashKey);
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.