Package redis.clients.jedis

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


        byte[] data = null;
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            long begin = System.currentTimeMillis();
            data = jedis.lpop(SafeEncoder.encode(key));
            long end = System.currentTimeMillis();
            LOG.info("getValueFromCache spends: " + (end - begin)
                    + " millionseconds.");
        } catch (Exception e) {
            // do jedis.quit() and jedis.disconnect()
View Full Code Here


        Jedis connection = null;
        try {
            connection = pool.getResource();
            String line = null;
            if(getMode.equals(GetMode.RANDOM_REMOVE)) {
                line = connection.lpop(redisKey);               
            } else {
                line = connection.srandmember(redisKey);
            }
            if(line == null) { // i.e. no more data (nil)
                throw new JMeterStopThreadException("End of redis data detected, thread will exit");
View Full Code Here

    @Override
    public synchronized Request poll(Task task) {
        Jedis jedis = pool.getResource();
        try {
            String url = jedis.lpop(getQueueKey(task));
            if (url == null) {
                return null;
            }
            String key = ITEM_PREFIX + task.getUUID();
            String field = DigestUtils.shaHex(url);
View Full Code Here

        byte[] data = null;
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            long begin = System.currentTimeMillis();
            data = jedis.lpop(SafeEncoder.encode(key));
            long end = System.currentTimeMillis();
            LOG.info("getValueFromCache spends: " + (end - begin)
                    + " millionseconds.");
        } catch (Exception e) {
            // do jedis.quit() and jedis.disconnect()
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.