本文整理了Java中redis.clients.jedis.Jedis.zrevrank()
方法的一些代码示例,展示了Jedis.zrevrank()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.zrevrank()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:zrevrank
[英]Return the rank (or index) of member in the sorted set at key, with scores being ordered from high to low.
When the given member does not exist in the sorted set, the special value 'nil' is returned. The returned rank (or index) of the member is 0-based for both commands.
Time complexity:
O(log(N))
[中]返回按键排序的集合中成员的排名(或索引),分数从高到低排列。
当给定成员在排序集中不存在时,将返回特殊值“nil”。对于这两个命令,成员返回的秩(或索引)都是基于0的。
时间复杂性:
O(对数(N))
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.zrevrank(key, member);
}
}.run(key);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.zrevrank(key, member);
}
}.runBinary(key);
代码示例来源:origin: sohutv/cachecloud
public Long execute(Jedis connection) {
return connection.zrevrank(keyByte, member);
}
}.runBinary(keyByte);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long zrevrank(byte[] key, byte[] member) {
Jedis j = getShard(key);
return j.zrevrank(key, member);
}
代码示例来源:origin: sohutv/cachecloud
@Override
public Long zrevrank(String key, String member) {
Jedis j = getShard(key);
return j.zrevrank(key, member);
}
代码示例来源:origin: Netflix/conductor
@Override
public Long zrevrank(String key, String member) {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
return jedis.zrevrank(key, member);
} finally {
if (jedis != null)
jedis.close();
}
}
代码示例来源:origin: jfinal/jfinal
/**
* 返回有序集 key 中成员 member 的排名。其中有序集成员按 score 值递减(从大到小)排序。
* 排名以 0 为底,也就是说, score 值最大的成员排名为 0 。
* 使用 ZRANK 命令可以获得成员按 score 值递增(从小到大)排列的排名。
*/
public Long zrevrank(Object key, Object member) {
Jedis jedis = getJedis();
try {
return jedis.zrevrank(keyToBytes(key), valueToBytes(member));
}
finally {close(jedis);}
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Long zRevRank(byte[] key, byte[] value) {
Assert.notNull(key, "Key must not be null!");
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().zrevrank(key, value)));
return null;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().zrevrank(key, value)));
return null;
}
return connection.getJedis().zrevrank(key, value);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public Long zrevrank(String key, String member) {
return jedis.zrevrank(key, member);
}
代码示例来源:origin: yrain/smart-cache
@Override
Long doInJedis(Jedis jedis) {
return jedis.zrevrank(key, member);
}
});
代码示例来源:origin: tangyanbo/springmore
@Override
public Long action(Jedis jedis) {
return jedis.zrevrank(key, member);
}
});
代码示例来源:origin: io.leopard/leopard-redis
@Override
public Object execute(Jedis jedis) {
return jedis.zrevrank(key, member);
}
});
代码示例来源:origin: mindwind/craft-atom
private Long zrevrank0(Jedis j, String key, String member) {
return j.zrevrank(key, member);
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public Long zrevrank(String key, String member) {
return jedis.zrevrank(key, member);
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Long zrevrank(String key, String member) {
String command = "zrevrank";
return instrumented(command, () -> delegated.zrevrank(key, member));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Long zrevrank(byte[] key, byte[] member) {
String command = "zrevrank";
return instrumented(command, () -> delegated.zrevrank(key, member));
}
代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence
@Override
public Long zrevrank(String key, String member) {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
return jedis.zrevrank(key, member);
} finally {
if (jedis != null)
jedis.close();
}
}
代码示例来源:origin: com.github.sogyf/goja-jfinal
/**
* 返回有序集 key 中成员 member 的排名。其中有序集成员按 score 值递减(从大到小)排序。
* 排名以 0 为底,也就是说, score 值最大的成员排名为 0 。
* 使用 ZRANK 命令可以获得成员按 score 值递增(从小到大)排列的排名。
*/
public Long zrevrank(Object key, Object member) {
Jedis jedis = getJedis();
try {
return jedis.zrevrank(keyToBytes(key), valueToBytes(member));
}
finally {close(jedis);}
}
代码示例来源:origin: com.jfinal/jfinal
/**
* 返回有序集 key 中成员 member 的排名。其中有序集成员按 score 值递减(从大到小)排序。
* 排名以 0 为底,也就是说, score 值最大的成员排名为 0 。
* 使用 ZRANK 命令可以获得成员按 score 值递增(从小到大)排列的排名。
*/
public Long zrevrank(Object key, Object member) {
Jedis jedis = getJedis();
try {
return jedis.zrevrank(keyToBytes(key), valueToBytes(member));
}
finally {close(jedis);}
}
代码示例来源:origin: yangfuhai/jboot
/**
* 返回有序集 key 中成员 member 的排名。其中有序集成员按 score 值递减(从大到小)排序。
* 排名以 0 为底,也就是说, score 值最大的成员排名为 0 。
* 使用 ZRANK 命令可以获得成员按 score 值递增(从小到大)排列的排名。
*/
public Long zrevrank(Object key, Object member) {
Jedis jedis = getJedis();
try {
return jedis.zrevrank(keyToBytes(key), valueToBytes(member));
} finally {
returnResource(jedis);
}
}
内容来源于网络,如有侵权,请联系作者删除!