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

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

Introduction

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

Prototype

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

Source Link

Document

Returns the members intersecting all given sets at keys .

Usage

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

public Set<V> intersect(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);//from ww  w .  j a v  a 2 s  .c o  m
            return connection.sInter(rawKeys);
        }
    }, true);

    return deserializeValues(rawValues);
}

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

/**
 * Returns the members intersecting all given sets at {@code keys}.
 * <p>// www  .ja  v a2 s .c  om
 * See http://redis.io/commands/sinter
 * 
 * @param keys keys
 * @return Set<byte[]>
 */
public static Set<byte[]> sInter(byte[]... keys) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sInter(keys);
        }
    });
}

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

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