本文整理了Java中redis.clients.jedis.Jedis.sort()
方法的一些代码示例,展示了Jedis.sort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.sort()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:sort
[英]Sort a Set or a List.
Sort the elements contained in the List, Set, or Sorted Set value at key. By default sorting is numeric with elements being compared as double precision floating point numbers. This is the simplest form of SORT.
[中]
代码示例来源:origin: sohutv/cachecloud
@Override
public List<byte[]> execute(Jedis connection) {
return connection.sort(key);
}
}.runBinary(key);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.sort(key, sortingParameters, dstkey);
}
}.run(2, key, dstkey);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.sort(key, sortingParameters, dstkey);
}
}.runBinary(2, key, dstkey);
代码示例来源:origin: sohutv/cachecloud
@Override
public List<String> execute(Jedis connection) {
return connection.sort(key, sortingParameters);
}
}.run(key);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.sort(key, dstkey);
}
}.run(2, key, dstkey);
代码示例来源:origin: sohutv/cachecloud
@Override
public List<String> execute(Jedis connection) {
return connection.sort(key);
}
}.run(key);
代码示例来源:origin: sohutv/cachecloud
@Override
public List<byte[]> execute(Jedis connection) {
return connection.sort(key, sortingParameters);
}
}.runBinary(key);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.sort(key, dstkey);
}
}.runBinary(2, key, dstkey);
代码示例来源:origin: sohutv/cachecloud
public List<byte[]> execute(Jedis connection) {
return connection.sort(keyByte);
}
}.runBinary(keyByte);
代码示例来源:origin: sohutv/cachecloud
public List<byte[]> execute(Jedis connection) {
return connection.sort(keyByte, sortingParameters);
}
}.runBinary(keyByte);
代码示例来源:origin: sohutv/cachecloud
@Override
public List<String> sort(String key) {
Jedis j = getShard(key);
return j.sort(key);
}
代码示例来源:origin: sohutv/cachecloud
@Override
public List<String> sort(String key, SortingParams sortingParameters) {
Jedis j = getShard(key);
return j.sort(key, sortingParameters);
}
代码示例来源:origin: sohutv/cachecloud
@Override
public List<byte[]> sort(byte[] key) {
Jedis j = getShard(key);
return j.sort(key);
}
代码示例来源:origin: sohutv/cachecloud
@Override
public List<byte[]> sort(byte[] key, SortingParams sortingParameters) {
Jedis j = getShard(key);
return j.sort(key, sortingParameters);
}
代码示例来源:origin: Netflix/conductor
@Override
public List<String> sort(String key) {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
return jedis.sort(key);
} finally {
if (jedis != null)
jedis.close();
}
}
代码示例来源:origin: Netflix/conductor
@Override
public List<String> sort(String key, SortingParams sortingParameters) {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
return jedis.sort(key, sortingParameters);
} finally {
if (jedis != null)
jedis.close();
}
}
代码示例来源:origin: caoxinyu/RedisClient
@Override
protected void command() {
jedis.select(db);
SortingParams sp = new SortingParams();
sp.alpha();
sp.limit(start, end-start);
page = jedis.sort(key, sp);
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Long sort(byte[] key, @Nullable SortParameters params, byte[] storeKey) {
Assert.notNull(key, "Key must not be null!");
SortingParams sortParams = JedisConverters.toSortingParams(params);
try {
if (isPipelined()) {
if (sortParams != null) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().sort(key, sortParams, storeKey)));
} else {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().sort(key, storeKey)));
}
return null;
}
if (isQueueing()) {
if (sortParams != null) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().sort(key, sortParams, storeKey)));
} else {
transaction(connection.newJedisResult(connection.getRequiredTransaction().sort(key, storeKey)));
}
return null;
}
return (sortParams != null ? connection.getJedis().sort(key, sortParams, storeKey)
: connection.getJedis().sort(key, storeKey));
} catch (Exception ex) {
throw connection.convertJedisAccessException(ex);
}
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public List<byte[]> sort(byte[] key, SortParameters params) {
Assert.notNull(key, "Key must not be null!");
SortingParams sortParams = JedisConverters.toSortingParams(params);
try {
if (isPipelined()) {
if (sortParams != null) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().sort(key, sortParams)));
} else {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().sort(key)));
}
return null;
}
if (isQueueing()) {
if (sortParams != null) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().sort(key, sortParams)));
} else {
transaction(connection.newJedisResult(connection.getRequiredTransaction().sort(key)));
}
return null;
}
return (sortParams != null ? connection.getJedis().sort(key, sortParams) : connection.getJedis().sort(key));
} catch (Exception ex) {
throw connection.convertJedisAccessException(ex);
}
}
代码示例来源:origin: mindwind/craft-atom
private Long sort_desc_destination(Jedis j, String key, boolean desc, String destination) {
SortingParams sp = new SortingParams();
if (desc) {
sp.desc();
}
return j.sort(key, sp, destination);
}
内容来源于网络,如有侵权,请联系作者删除!