List of usage examples for org.springframework.data.redis.connection RedisConnection bitCount
@Nullable Long bitCount(byte[] key, long start, long end);
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Count the number of set bits (population counting) of value stored at {@code key} between {@code begin} and * {@code end}.// w w w .jav a 2s.com * <p> * See http://redis.io/commands/bitcount * * @param key must not be {@literal null}. * @param begin begin * @param end end * @return Long */ public static Long bitCount(byte[] key, long begin, long end) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.bitCount(key, begin, end); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Count the number of set bits (population counting) of value stored at {@code key} between {@code begin} and * {@code end}.//from w ww.j a va 2 s. co m * <p> * See http://redis.io/commands/bitcount * * @param key must not be {@literal null}. * @param begin begin * @param end end * @return Long */ public Long bitCount(byte[] key, long begin, long end) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.bitCount(key, begin, end); } }); }