本文整理匯總了Java中redis.clients.jedis.Jedis.zscore方法的典型用法代碼示例。如果您正苦於以下問題:Java Jedis.zscore方法的具體用法?Java Jedis.zscore怎麽用?Java Jedis.zscore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類redis.clients.jedis.Jedis
的用法示例。
在下文中一共展示了Jedis.zscore方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: zExists
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Boolean zExists(String key, Object data) {
int tries = 0;
boolean sucess = false;
boolean retVal = false;
do {
tries++;
try {
Jedis jedis = pool.getResource();
retVal = (jedis.zscore(key, SerializationUtil.serialize(data)) != null);
jedis.close();
sucess = true;
} catch (JedisConnectionException ex) {
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
if (tries == numRetries)
throw ex;
}
} while (!sucess && tries <= numRetries);
return retVal;
}
示例2: zScore
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Double zScore(String key, Object data) {
int tries = 0;
boolean sucess = false;
Double retVal = null;
do {
tries++;
try {
Jedis jedis = pool.getResource();
retVal = jedis.zscore(key, SerializationUtil.serialize(data));
jedis.close();
sucess = true;
} catch (JedisConnectionException ex) {
log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
if (tries == numRetries) {
throw ex;
}
}
} while (!sucess && tries <= numRetries);
return retVal;
}
示例3: zscore
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
@Override
public Double zscore(String key, String member) {
Jedis jedis = null;
Double res = null;
try {
jedis = pool.getResource();
res = jedis.zscore(key, member);
} catch (Exception e) {
LOGGER.error(e.getMessage());
} finally {
returnResource(pool, jedis);
}
return res;
}