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

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

Introduction

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

Prototype

@Nullable
default Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) 

Source Link

Document

Union sorted sets and store result in destination key .

Usage

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

/**
 * Union sorted {@code sets} and store result in destination {@code key}.
 * <p>//from   w w w . j ava2 s.  c  o m
 * See http://redis.io/commands/zunionstore
 * 
 * @param destKey destKey
 * @param aggregate aggregate
 * @param weights weights
 * @param sets sets
 * @return Long
 */
public static Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zUnionStore(destKey, aggregate, weights, sets);
        }
    });
}

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

/**
 * Union sorted {@code sets} and store result in destination {@code key}.
 * <p>/*w w  w .j  a va 2 s . c  o m*/
 * See http://redis.io/commands/zunionstore
 * 
 * @param destKey destKey
 * @param aggregate aggregate
 * @param weights weights
 * @param sets sets
 * @return Long
 */
public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zUnionStore(destKey, aggregate, weights, sets);
        }
    });
}