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

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

Introduction

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

Prototype

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

Source Link

Document

Diff all sets for given keys .

Usage

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

public Set<V> difference(final K key, final 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);//from   w  w w .ja  v  a  2  s. c o m
            return connection.sDiff(rawKeys);
        }
    }, true);

    return deserializeValues(rawValues);
}

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

/**
 * Diff all sets for given {@code keys}.
 * <p>//from w ww  . j a  va2s. com
 * See http://redis.io/commands/sdiff
 * 
 * @param keys keys
 * @return Set<byte[]>
 */
public static Set<byte[]> sDiff(byte[]... keys) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sDiff(keys);
        }
    });
}

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

/**
 * Diff all sets for given {@code keys}.
 * <p>//www. jav  a  2  s  .c om
 * See http://redis.io/commands/sdiff
 * 
 * @param keys keys
 * @return Set<byte[]>
 */
public Set<byte[]> sDiff(byte[]... keys) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sDiff(keys);
        }
    });
}