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

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

Introduction

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

Prototype

@Nullable
Set<byte[]> sUnion(byte[]... keys);

Source Link

Document

Union all sets at given keys .

Usage

From source file:com.mauersu.util.redis.DefaultSetOperations.java

public Set<V> union(K key, Collection<K> otherKeys) {
    final byte[][] rawKeys = rawKeys(key, otherKeys);
    Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {

        public Set<byte[]> doInRedis(RedisConnection connection) {
            connection.select(dbIndex);//  w w  w  .  j  av  a2 s.  c o  m
            return connection.sUnion(rawKeys);
        }
    }, true);

    return deserializeValues(rawValues);
}

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

/**
 * Union all sets at given {@code keys}.
 * <p>//  w  w w.ja  v  a  2  s .c o  m
 * See http://redis.io/commands/sunion
 * 
 * @param keys keys
 * @return Set<byte[]>
 */
public static Set<byte[]> sUnion(byte[]... keys) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sUnion(keys);
        }
    });
}

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

/**
 * Union all sets at given {@code keys}.
 * <p>/*w  w  w  .j a  va  2s .  c  o  m*/
 * See http://redis.io/commands/sunion
 * 
 * @param keys keys
 * @return Set<byte[]>
 */
public Set<byte[]> sUnion(byte[]... keys) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sUnion(keys);
        }
    });
}