List of usage examples for org.springframework.data.redis.core RedisCallback RedisCallback
RedisCallback
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Intersect all given sets at {@code keys} and store result in {@code destKey}. * <p>//from w w w. j ava2 s . c om * See http://redis.io/commands/sinterstore * * @param destKey destKey * @param keys keys * @return Long */ public Long sInterStore(byte[] destKey, byte[]... keys) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.sInterStore(destKey, keys); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Union all sets at given {@code keys}. * <p>//from www . java 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); } }); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Union all sets at given {@code keys} and store result in {@code destKey}. * <p>//from w w w. jav a2 s . c o m * See http://redis.io/commands/sunionstore * * @param destKey destKey * @param keys keys * @return Long */ public static Long sUnionStore(byte[] destKey, byte[]... keys) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.sUnionStore(destKey, keys); } }); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Diff all sets for given {@code keys}. * <p>/*from ww w .jav a 2 s .c o m*/ * 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
/** * Union all sets at given {@code keys} and store result in {@code destKey}. * <p>/* w ww . j a v a 2s. co m*/ * See http://redis.io/commands/sunionstore * * @param destKey destKey * @param keys keys * @return Long */ public Long sUnionStore(byte[] destKey, byte[]... keys) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.sUnionStore(destKey, keys); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Diff all sets for given {@code keys}. * <p>/*from w ww. j a va 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); } }); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Diff all sets for given {@code keys} and store result in {@code destKey} * <p>/*from w w w. j av a2 s.co m*/ * See http://redis.io/commands/sdiffstore * * @param destKey destKey * @param keys keys * @return Long */ public static Long sDiffStore(byte[] destKey, byte[]... keys) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.sDiffStore(destKey, keys); } }); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Get all elements of set at {@code key}. * <p>/*from w w w .jav a 2 s .com*/ * See http://redis.io/commands/smembers * * @param key key * @return Set<byte[]> */ public static Set<byte[]> sMembers(byte[] key) { return redisTemplate.execute(new RedisCallback<Set<byte[]>>() { @Override public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException { return redis.sMembers(key); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Diff all sets for given {@code keys} and store result in {@code destKey} * <p>/*from www. j a v a 2 s. c o m*/ * See http://redis.io/commands/sdiffstore * * @param destKey destKey * @param keys keys * @return Long */ public Long sDiffStore(byte[] destKey, byte[]... keys) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.sDiffStore(destKey, keys); } }); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Get random element from set at {@code key}. * <p>//ww w.j av a2 s . co m * See http://redis.io/commands/srandmember * * @param key key * @return byte[] */ public static byte[] sRandMember(byte[] key) { return redisTemplate.execute(new RedisCallback<byte[]>() { @Override public byte[] doInRedis(RedisConnection redis) throws DataAccessException { return redis.sRandMember(key); } }); }