Package redis.clients.jedis

Examples of redis.clients.jedis.Transaction.zrem()


    public boolean releaseFairSemaphore(
        Jedis conn, String semname, String identifier)
    {
        Transaction trans = conn.multi();
        trans.zrem(semname, identifier);
        trans.zrem(semname + ":owner", identifier);
        List<Object> results = trans.exec();
        return (Long)results.get(results.size() - 1) == 1;
    }
View Full Code Here


    public boolean releaseFairSemaphore(
        Jedis conn, String semname, String identifier)
    {
        Transaction trans = conn.multi();
        trans.zrem(semname, identifier);
        trans.zrem(semname + ":owner", identifier);
        List<Object> results = trans.exec();
        return (Long)results.get(results.size() - 1) == 1;
    }

    public String executeLater(
View Full Code Here

                        conn.hdel(hkey, samples.subList(0, remove).toArray(new String[0]));
                        if (remove == samples.size()){
                            conn.watch(hkey);
                            if (conn.hlen(hkey) == 0) {
                                Transaction trans = conn.multi();
                                trans.zrem("known:", hash);
                                trans.exec();
                                index--;
                            }else{
                                conn.unwatch();
                            }
View Full Code Here

            Transaction trans = conn.multi();
            trans.hincrBy(seller, "funds", (int)price);
            trans.hincrBy(buyer, "funds", (int)-price);
            trans.sadd(inventory, itemId);
            trans.zrem("market:", item);
            List<Object> results = trans.exec();
            // null response indicates that the transaction was aborted due to
            // the watched key changing.
            if (results == null){
                continue;
View Full Code Here

            } else {
                transaction.del(oldAttrsKey);
            }

            transaction.zadd(RedisSessionKeys.getSessionsKey(), lastAccessTime, id);
            transaction.zrem(RedisSessionKeys.getSessionsKey(), this.id);

            transaction.exec();

            pool.returnResource(jedis);
        } catch (Throwable e) {
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.