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

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

Introduction

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

Prototype

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

Source Link

Document

Intersect sorted sets and store result in destination key .

Usage

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

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

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

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