Package redis.clients.jedis

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


        final Jedis jedis = createJedis(CONFIG);
        try {
            Assert.assertEquals("2", jedis.get(createKey(CONFIG.getNamespace(), STAT, FAILED)));
            Assert.assertEquals("2", jedis.get(createKey(CONFIG.getNamespace(), STAT, PROCESSED)));
        } finally {
            jedis.quit();
        }
    }

    private static void doWork(final List<Job> jobs, final Map<String, ? extends Class<? extends Runnable>> jobTypes,
            final WorkerListener listener, final WorkerEvent... events) {
View Full Code Here


        Jedis jedis = createJedis(config);
        try { // Assert that we enqueued the job
            Assert.assertEquals(Long.valueOf(10),
                    jedis.zcount(createKey(config.getNamespace(), QUEUE, delayTestQueue), "-inf", "+inf"));
        } finally {
            jedis.quit();
        }

        // Create and start worker
        final Worker worker = new WorkerImpl(config, Arrays.asList(delayTestQueue),
                new MapBasedJobFactory(map(entry("TestAction", TestAction.class))));
View Full Code Here

          Jedis jedis = new Jedis(redisHost);

          logger.info("Subscribing to redis channel " + redisChannel);
          jedis.subscribe(jedisPubSub, redisChannel);
          logger.info("Subscribe returned, closing down");
          jedis.quit();
        } catch (Exception e) {
          logger.error("Redis subscription had an error " + e.getMessage());
          fail("redis subscribe hit an error " + e.getMessage());
        }
      }
View Full Code Here

    private static final int SEARCHES = 10000;

    public static void main(String[] args) throws IOException {
        Jedis jedis = new Jedis("localhost");
        jedis.flushAll();
        jedis.quit();
        jedis.disconnect();

        List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>();
        shards.add(new JedisShardInfo("localhost"));
        Config config = new Config();
View Full Code Here

        for (int n = 0; n < SEARCHES; n++) {
            seek.remove(String.valueOf(n), "84689862");
        }
        long elapsed = System.nanoTime() - start;

        jedis.quit();
        jedis.disconnect();

        System.out.println(((1000 * SEARCHES) / (elapsed / 1000000))
                + " indexaciones por segundo");
    }
View Full Code Here

    private static final int SEARCHES = 10000;

    public static void main(String[] args) throws IOException {
        Jedis jedis = new Jedis("localhost");
        jedis.flushAll();
        jedis.quit();
        jedis.disconnect();

        List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>();
        shards.add(new JedisShardInfo("localhost"));
        Config config = new Config();
View Full Code Here

            entry.shardBy("s");
            entry.save();
        }
        long elapsed = System.nanoTime() - start;

        jedis.quit();
        jedis.disconnect();

        System.out.println(((1000 * SEARCHES) / (elapsed / 1000000))
                + " indexaciones por segundo");
    }
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.