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