Package redis.clients.jedis

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


        if (terms.size() > 0) {
            String matchedKey = "terms:matched:" + targetId;
            for (String term : terms) {
                trans.sadd(matchedKey, term);
            }
            trans.expire(matchedKey, 900);
        }

        trans.incr("type:" + type + ":views:");
        for (String term : terms) {
            trans.zincrby("views:" + adId, 1, term);
View Full Code Here


        Set<String> matched = conn.smembers(matchKey);
        matched.add("");

        Transaction trans = conn.multi();
        if (Ecpm.CPA.equals(ecpm)) {
            trans.expire(matchKey, 900);
            if (action) {
                clickKey = "actions:" + adId;
            }
        }
View Full Code Here

        String temp = UUID.randomUUID().toString();
        Transaction trans = conn.multi();
        for(String skill : candidateSkills) {
            trans.sadd(temp, skill);
        }
        trans.expire(temp, 5);
        trans.sdiff("job:" + jobId, temp);

        List<Object> response = trans.exec();
        Set<String> diff = (Set<String>)response.get(response.size() - 1);
        return diff.size() == 0;
View Full Code Here

            }
            Transaction tr = j.multi();

            //sentinel expired. kick off new RevisibleProcessor job
            tr.set(redisKey, "Y");
            tr.expire(redisKey, exp); //expire after exp seconds
            // since we have called watch, tr.exec will return null in the case that someone else has modified
            // the redisKey since we started our transaction.  If it doesn't return null, the value hasn't changed out from
            // under us, so we return true since we set it
            List<Object> resp = tr.exec();
            return resp != null;
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.