Set zSetValue = redisTemplate.opsForZSet().range("zSetValue",0,-1);
System.out.println("通过range(K key, long start, long end)方法获取指定区间的元素:" + zSetValue);
21、reverseRangeByScoreWithScores(K key, double min, double max, long offset, long count)
倒序排序获取RedisZSetCommands.Tuples的从给定下标和给定长度分值区间值。
Set> typedTupleSet = redisTemplate.opsForZSet().reverseRangeByScoreWithScores("zSetValue",1,5,1,2);
iterator = typedTupleSet.iterator();
while (iterator.hasNext()){
ZSetOperations.TypedTuple typedTuple = iterator.next();
Object value = typedTuple.getValue();
double score1 = typedTuple.getScore();
System.out.println("通过reverseRangeByScoreWithScores(K key, double min, double max, long offset, long count)方法倒序排序获取RedisZSetCommands.Tuples的从给定下标和给定长度区间值:" + value + "---->" + score1 );
}
22、reverseRangeWithScores(K key, long start, long end)
索引倒序排列区间值。
Set> typedTupleSet = redisTemplate.opsForZSet().reverseRangeWithScores("zSetValue",1,5);
iterator = typedTupleSet.iterator();
while (iterator.hasNext()){
ZSetOperations.TypedTuple typedTuple = iterator.next();
Object value = typedTuple.getValue();
double score1 = typedTuple.getScore();
System.out.println("通过reverseRangeWithScores(K key, long start, long end)方法索引倒序排列区间值:" + value + "----->" + score1);
}
23、reverseRank(K key,Object o)
获取倒序排列的索引值。
long reverseRank = redisTemplate.opsForZSet().reverseRank("zSetValue","B");
System.out.println("通过reverseRank(K key, Object o)获取倒序排列的索引值:" + reverseRank);
24、intersectAndStore(K key, K otherKey, K destKey)
获取2个变量的交集存放到第3个变量里面。
redisTemplate.opsForZSet().intersectAndStore("zSetValue","typedTupleSet","intersectSet");
zSetValue = redisTemplate.opsForZSet().range("intersectSet",0,-1);
System.out.println("通过intersectAndStore(K key, K otherKey, K destKey)方法获取2个变量的交集存放到第3个变量里面:" + zSetValue);
25、intersectAndStore(K key, Collection otherKeys, K destKey)
获取多个变量的交集存放到第3个变量里面。
List list = new ArrayList();
list.add("typedTupleSet");
redisTemplate.opsForZSet().intersectAndStore("zSetValue",list,"intersectListSet");
zSetValue = redisTemplate.opsForZSet().range("intersectListSet",0,-1);
System.out.println("通过intersectAndStore(K key, Collection otherKeys, K destKey)方法获取多个变量的交集存放到第3个变量里面:" + zSetValue);
26、unionAndStore(K key, K otherKey, K destKey)
获取2个变量的合集存放到第3个变量里面。
redisTemplate.opsForZSet().unionAndStore("zSetValue","typedTupleSet","unionSet");
zSetValue = redisTemplate.opsForZSet().range("unionSet",0,-1);
System.out.println("通过unionAndStore(K key, K otherKey, K destKey)方法获取2个变量的交集存放到第3个变量里面:" + zSetValue);
27、unionAndStore(K key, Collection otherKeys, K destKey)
什么是Thrift
The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and s
org.json.JSONException: No value for items
在JSON解析中会遇到一种错误,很常见的错误
06-21 12:19:08.714 2098-2127/com.jikexueyuan.secret I/System.out﹕ Result:{"status":1,"page":1,&