Example usage for org.springframework.data.redis.connection RedisConnection pfCount

List of usage examples for org.springframework.data.redis.connection RedisConnection pfCount

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection pfCount.

Prototype

@Nullable
Long pfCount(byte[]... keys);

Source Link

Document

Return the approximated cardinality of the structures observed by the HyperLogLog at key(s) .

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Return the approximated cardinality of the structures observed by the HyperLogLog at {@literal key(s)}.
 * //from ww  w . jav a 2  s  .  c  om
 * @param keys keys
 * @return Long
 */
public static Long pfCount(byte[]... keys) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.pfCount(keys);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Return the approximated cardinality of the structures observed by the HyperLogLog at {@literal key(s)}.
 * //from  w  w  w  .  j  a  v  a2s . c o m
 * @param keys keys
 * @return Long
 */
public Long pfCount(byte[]... keys) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.pfCount(keys);
        }
    });
}