Examples of zscore()


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

       
        String currencyIdKey = toRedisKey(currency);
        String uniqueId = jedis.hget(currencyIdKey, UNIQUE_ID);
        if (uniqueId != null) {
          String daysKey = toRedisKey(UniqueId.parse(uniqueId)) + "-DAYS";
          if (jedis.zscore(daysKey, dateToCheck.toString()) != null) {
            result = true;
          }
        }
       
        getJedisPool().returnResource(jedis);
View Full Code Here

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

          String uniqueIdKey = toRedisKey(uniqueId);
          Map<String, String> hash = jedis.hgetAll(uniqueIdKey);
          if (holidayType.name().equals(hash.get(TYPE))) {
            foundHoliday = true;
            String daysKey = uniqueIdKey + "-DAYS";
            if (jedis.zscore(daysKey, dateToCheck.toString()) != null) {
              result = true;
            }
            break;
          }
        }
View Full Code Here

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

    @Test
    public void pipelineResponseWithData() {
  jedis.zadd("zset", 1, "foo");

  Pipeline p = jedis.pipelined();
  Response<Double> score = p.zscore("zset", "foo");
  p.sync();

  assertNotNull(score.get());
    }
View Full Code Here

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

    @Test
    public void pipelineResponseWithoutData() {
  jedis.zadd("zset", 1, "foo");

  Pipeline p = jedis.pipelined();
  Response<Double> score = p.zscore("zset", "bar");
  p.sync();

  assertNull(score.get());
    }
View Full Code Here

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

       }
       //else find the score for previous receipt,
       //   if not exist, same as no previous receipt
       //   else use zrangeByScore with limit
       else if (previousReceiptHandle != null) {
         Double previousScore = jedis.zscore(key, previousReceiptHandle);
         if (previousScore == null) {
           memIds = jedis.zrangeByScore(key, System.currentTimeMillis() - retention * 1000L, System.currentTimeMillis(), 0, num);
           if (memIds != null){
             memIdsRet = new ArrayList<String>(memIds);
           }
View Full Code Here

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

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

    @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

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

        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

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

        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

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

                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
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.