Package redis.clients.jedis

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


    @Before
    public void setUp() throws Exception {
  Jedis jedis = new Jedis(redis1.getHost(), redis1.getPort());
  jedis.auth("foobared");
  jedis.flushAll();
  jedis.disconnect();
  jedis = new Jedis(redis2.getHost(), redis2.getPort());
  jedis.auth("foobared");
  jedis.flushAll();
  jedis.disconnect();
View Full Code Here


  jedis.auth("foobared");
  jedis.flushAll();
  jedis.disconnect();
  jedis = new Jedis(redis2.getHost(), redis2.getPort());
  jedis.auth("foobared");
  jedis.flushAll();
  jedis.disconnect();

  JedisShardInfo shardInfo1 = new JedisShardInfo(redis1.getHost(),
    redis1.getPort());
  JedisShardInfo shardInfo2 = new JedisShardInfo(redis2.getHost(),
View Full Code Here

  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();
  j.disconnect();
View Full Code Here

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

    }

    @Test
View Full Code Here

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

    protected void assertEquals(List<byte[]> expected, List<byte[]> actual) {
  assertEquals(expected.size(), actual.size());
View Full Code Here

    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();

  Pipeline p = jedis.pipelined();
  for (int n = 0; n <= TOTAL_OPERATIONS; n++) {
View Full Code Here

    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();

  for (int n = 0; n <= TOTAL_OPERATIONS; n++) {
      String key = "foo" + n;
View Full Code Here

    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();
  // withoutPool();
  withPool();
View Full Code Here

        purgeRedis();
    }

    protected void purgeRedis() {
        Jedis jedis = jedisPool.getResource();
        jedis.flushAll();
        jedisPool.returnResource(jedis);
    }
}
View Full Code Here

    public boolean flushall() {
        String result = "";
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            result = jedis.flushAll();
            LOG.info("redis client name: " + this.getCacheName() + " flushall.");

        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
            this.jedisPool.returnBrokenResource(jedis);
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.