redis.clients.jedis.Jedis.zscore()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中redis.clients.jedis.Jedis.zscore()方法的一些代码示例,展示了Jedis.zscore()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.zscore()方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:zscore

Jedis.zscore介绍

[英]Return the score of the specified element of the sorted set at key. If the specified element does not exist in the sorted set, or the key does not exist at all, a special 'nil' value is returned.

Time complexity: O(1)
[中]返回排序集的指定元素在键处的分数。如果指定的元素在排序集中不存在,或者键根本不存在,则返回一个特殊的“nil”值。
时间复杂度:O(1)

代码示例

代码示例来源:origin: sohutv/cachecloud

@Override
 public Double execute(Jedis connection) {
  return connection.zscore(key, member);
 }
}.runBinary(key);

代码示例来源:origin: sohutv/cachecloud

@Override
 public Double execute(Jedis connection) {
  return connection.zscore(key, member);
 }
}.run(key);

代码示例来源:origin: sohutv/cachecloud

public Double execute(Jedis connection) {
    return connection.zscore(keyByte, member);
  }
}.runBinary(keyByte);

代码示例来源:origin: sohutv/cachecloud

@Override
public Double zscore(String key, String member) {
 Jedis j = getShard(key);
 return j.zscore(key, member);
}

代码示例来源:origin: sohutv/cachecloud

@Override
public Double zscore(byte[] key, byte[] member) {
 Jedis j = getShard(key);
 return j.zscore(key, member);
}

代码示例来源:origin: Netflix/conductor

@Override
public Double zscore(String key, String member) {
 Jedis jedis = null;
  try {
   jedis = jedisPool.getResource();
   return jedis.zscore(key, member);
  } finally {
   if (jedis != null)
    jedis.close();
  }
}

代码示例来源:origin: jfinal/jfinal

/**
 * 返回有序集 key 中,成员 member 的 score 值。
 * 如果 member 元素不是有序集 key 的成员,或 key 不存在,返回 nil 。
 */
public Double zscore(Object key, Object member) {
  Jedis jedis = getJedis();
  try {
    return jedis.zscore(keyToBytes(key), valueToBytes(member));
  }
  finally {close(jedis);}
}

代码示例来源:origin: signalapp/Signal-Server

public boolean isScheduled(Account account, Device device) throws RedisException {
 try {
  String endpoint = "apn_device::" + account.getNumber() + "::" + device.getId();
  try (Jedis jedis = jedisPool.getReadResource()) {
   return jedis.zscore(PENDING_NOTIFICATIONS_KEY, endpoint) != null;
  }
 } catch (JedisException e) {
  throw new RedisException(e);
 }
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Double zScore(byte[] key, byte[] value) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(value, "Value must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().zscore(key, value)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().zscore(key, value)));
      return null;
    }
    return connection.getJedis().zscore(key, value);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: io.leopard/leopard-redis

@Override
  public Object execute(Jedis jedis) {
    return jedis.zscore(key, member);
  }
});

代码示例来源:origin: com.github.sogyf/goja-mvt

@Override
  public Double action(Jedis jedis) {
    return jedis.zscore(key, score);
  }
});

代码示例来源:origin: tangyanbo/springmore

@Override
  public Double action(Jedis jedis) {
    return jedis.zscore(key, member);
  }
});

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Double zscore(String key, String member) {
 String command = "zscore";
 return instrumented(command, () -> delegated.zscore(key, member));
}

代码示例来源:origin: com.moz.qless/qless-java

public double next() {
 return this.client
   .getJedisPool()
   .getResource()
   .zscore("ql:q:" + this.queueName + "-recur", this.jid);
}

代码示例来源:origin: Baqend/Orestes-Bloomfilter

@Override
public Long getRemainingTTL(T element, TimeUnit unit) {
  try (Jedis jedis = pool.getResource()) {
    Double score = jedis.zscore(keys.TTL_KEY, element.toString());
    return scoreToRemainingTTL(score, unit);
  }
}

代码示例来源:origin: Baqend/Orestes-Bloomfilter

@Override
public boolean isKnown(T element) {
  try (Jedis jedis = pool.getResource()) {
    Double score = jedis.zscore(keys.TTL_KEY, element.toString());
    if (score == null) {
      return  false;
    }
    long endOfGracePeriod = now() - config.gracePeriod();
    return score.longValue() > endOfGracePeriod;
  }
}

代码示例来源:origin: yangfuhai/jboot

/**
 * 返回有序集 key 中,成员 member 的 score 值。
 * 如果 member 元素不是有序集 key 的成员,或 key 不存在,返回 nil 。
 */
public Double zscore(Object key, Object member) {
  Jedis jedis = getJedis();
  try {
    return jedis.zscore(keyToBytes(key), valueToBytes(member));
  } finally {
    returnResource(jedis);
  }
}

代码示例来源:origin: com.github.sogyf/goja-jfinal

/**
 * 返回有序集 key 中,成员 member 的 score 值。
 * 如果 member 元素不是有序集 key 的成员,或 key 不存在,返回 nil 。
 */
public Double zscore(Object key, Object member) {
  Jedis jedis = getJedis();
  try {
    return jedis.zscore(keyToBytes(key), valueToBytes(member));
  }
  finally {close(jedis);}
}

代码示例来源:origin: com.jfinal/jfinal

/**
 * 返回有序集 key 中,成员 member 的 score 值。
 * 如果 member 元素不是有序集 key 的成员,或 key 不存在,返回 nil 。
 */
public Double zscore(Object key, Object member) {
  Jedis jedis = getJedis();
  try {
    return jedis.zscore(keyToBytes(key), valueToBytes(member));
  }
  finally {close(jedis);}
}

代码示例来源:origin: Baqend/Orestes-Bloomfilter

private void assertHasTtl(String key) {
  assertExists(keys.TTL_KEY);
  assertNotNull(redis.safelyReturn(r -> r.zscore(keys.TTL_KEY, key)));
}

相关文章

Jedis类方法