Package redis.clients.jedis

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


   */
  public Hashtable<String, Object> scoreAndRankForIn(String leaderboardName, String member, boolean useZeroIndexForRank) {
    Hashtable<String, Object> data = new Hashtable<String, Object>();
   
    Transaction transaction = _jedis.multi();
        transaction.zscore(leaderboardName, member);
        transaction.zrevrank(leaderboardName, member);
        List<Object> response = transaction.exec();
               
    data.put("member", member);
    data.put("score", response.get(0));   
View Full Code Here


    @SuppressWarnings("unchecked")
    public void updateCpms(Jedis conn, String adId) {
        Transaction trans = conn.multi();
        trans.hget("type:", adId);
        trans.zscore("ad:base_value:", adId);
        trans.smembers("terms:" + adId);
        List<Object> response = trans.exec();
        String type = (String)response.get(0);
        Double baseValue = (Double)response.get(1);
        Set<String> words = (Set<String>)response.get(2);
View Full Code Here

        String viewKey = "views:" + adId;
        String clickKey = which + ':' + adId;

        trans = conn.multi();
        trans.zscore(viewKey, "");
        trans.zscore(clickKey, "");
        response = trans.exec();
        Double adViews = (Double)response.get(0);
        Double adClicks = (Double)response.get(1);
View Full Code Here

        String viewKey = "views:" + adId;
        String clickKey = which + ':' + adId;

        trans = conn.multi();
        trans.zscore(viewKey, "");
        trans.zscore(clickKey, "");
        response = trans.exec();
        Double adViews = (Double)response.get(0);
        Double adClicks = (Double)response.get(1);

        double adEcpm = 0;
View Full Code Here

                baseValue);
            conn.zadd("idx:ad:value:", adEcpm, adId);
        }
        for (String word : words) {
            trans = conn.multi();
            trans.zscore(viewKey, word);
            trans.zscore(clickKey, word);
            response = trans.exec();
            Double views = (Double)response.get(0);
            Double clicks = (Double)response.get(1);
View Full Code Here

            conn.zadd("idx:ad:value:", adEcpm, adId);
        }
        for (String word : words) {
            trans = conn.multi();
            trans.zscore(viewKey, word);
            trans.zscore(clickKey, word);
            response = trans.exec();
            Double views = (Double)response.get(0);
            Double clicks = (Double)response.get(1);

            if (clicks == null || clicks < 1){
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.