Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis


            if (config.getServletConfig().getInitParameter(REDIS_SERVER) != null) {
                uri = URI.create(config.getServletConfig().getInitParameter(REDIS_SERVER));
            }
        }

        jedisSubscriber = new Jedis(uri.getHost(), uri.getPort());
        try {
            jedisSubscriber.connect();
        } catch (IOException e) {
            logger.error("failed to connect subscriber", e);
        }

        jedisSubscriber.auth(authToken);
        jedisSubscriber.flushAll();

        jedisPublisher = new Jedis(uri.getHost(), uri.getPort());
        try {
            jedisPublisher.connect();
        } catch (IOException e) {
            logger.error("failed to connect publisher", e);
        }
View Full Code Here


        this.bc = bc;
        uri = URI.create(address);

        if (uri == null) return;

        jedisSubscriber = new Jedis(uri.getHost(), uri.getPort());
        try {
            jedisSubscriber.connect();
        } catch (IOException e) {
            logger.error("failed to connect to subscriber: " + jedisSubscriber, e);
        }

        jedisSubscriber.auth(auth);
        jedisSubscriber.flushAll();

        jedisPublisher = new Jedis(uri.getHost(), uri.getPort());
        try {
            jedisPublisher.connect();
        } catch (IOException e) {
            logger.error("failed to connect to publisher: " + jedisPublisher, e);
        }
View Full Code Here

            revert(jedis);
        }
    }

    public String get(String key) {
        Jedis jedis = borrow();
        try {
            return jedis.get(key);
        } finally {
            revert(jedis);
        }
    }
View Full Code Here

            revert(jedis);
        }
    }

    public String bGet(String key) {
        Jedis jedis = borrow();
        try {
            byte[] value = jedis.get(key.getBytes());
            if (value != null) return GZip.decodeWithGZip(value);
            return null;
        } finally {
            revert(jedis);
        }
View Full Code Here

            revert(jedis);
        }
    }

    public String set(String key, String value) {
        Jedis jedis = borrow();
        try {
            return jedis.set(key, value);
        } finally {
            revert(jedis);
        }
    }
View Full Code Here

            revert(jedis);
        }
    }

    public void del(String key) {
        Jedis jedis = borrow();
        try {
            jedis.del(key);
        } finally {
            revert(jedis);
        }
    }
View Full Code Here

            revert(jedis);
        }
    }

    public String bSet(String key, String value) {
        Jedis jedis = borrow();
        try {
            return jedis.set(key.getBytes(), GZip.encodeWithGZip(value));
        } finally {
            revert(jedis);
        }
    }
View Full Code Here

            revert(jedis);
        }
    }

    public boolean exits(String key) {
        Jedis jedis = borrow();
        try {
            return jedis.exists(key);
        } finally {
            revert(jedis);
        }
    }
View Full Code Here

            revert(jedis);
        }
    }

    public List<String> mget(String[] keys) {
        Jedis jedis = borrow();
        try {
            return jedis.mget(keys);
        } finally {
            revert(jedis);
        }
    }
View Full Code Here

            revert(jedis);
        }
    }

    public String info() {
        Jedis jedis = borrow();
        try {
            return jedis.info();
        } finally {
            revert(jedis);
        }
    }
View Full Code Here

TOP

Related Classes of redis.clients.jedis.Jedis

Copyright © 2018 www.massapicom. 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.