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

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

Introduction

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

Prototype

@Nullable
Long pfAdd(byte[] key, byte[]... values);

Source Link

Document

Adds given values to the HyperLogLog stored at given key .

Usage

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

/**
 * Adds given {@literal values} to the HyperLogLog stored at given {@literal key}.
 * //from   w  w  w  .j a  v a  2s .  c o  m
 * @param key key
 * @param values values
 * @return Long
 */
public static Long pfAdd(byte[] key, byte[]... values) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.pfAdd(key, values);
        }
    });
}

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

/**
 * Adds given {@literal values} to the HyperLogLog stored at given {@literal key}.
 * /*  w ww . j  av a  2 s  . co  m*/
 * @param key key
 * @param values values
 * @return Long
 */
public Long pfAdd(byte[] key, byte[]... values) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.pfAdd(key, values);
        }
    });
}