List of usage examples for org.springframework.data.redis.connection RedisConnection zRem
@Nullable Long zRem(byte[] key, byte[]... values);
From source file:grails.plugin.cache.redis.GrailsRedisCache.java
@SuppressWarnings("unchecked") @Override//from w ww. ja va 2 s .c o m public void evict(Object key) { final byte[] k = computeKey(key); template.execute(new RedisCallback<Object>() { public Object doInRedis(RedisConnection connection) throws DataAccessException { connection.del(k); // remove key from set connection.zRem(setName, k); return null; } }, true); }
From source file:com.mauersu.util.redis.DefaultZSetOperations.java
public Long remove(K key, Object... values) { final byte[] rawKey = rawKey(key); final byte[][] rawValues = rawValues(values); return execute(new RedisCallback<Long>() { public Long doInRedis(RedisConnection connection) { connection.select(dbIndex);/*from w w w. jav a 2s .c o m*/ return connection.zRem(rawKey, rawValues); } }, true); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Remove given {@code values} from set at {@code key} and return the number of removed elements. * <p>//from w ww . ja va2s.co m * See http://redis.io/commands/srem * * @param key key * @param values values * @return Long */ public static Long zRem(byte[] key, byte[]... values) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.zRem(key, values); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Remove given {@code values} from set at {@code key} and return the number of removed elements. * <p>/*from w w w . j a v a 2 s. c o m*/ * See http://redis.io/commands/srem * * @param key key * @param values values * @return Long */ public Long zRem(byte[] key, byte[]... values) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.zRem(key, values); } }); }
From source file:org.springframework.data.redis.cache.RedisCache.java
public void evict(Object key) { final byte[] k = computeKey(key); template.execute(new RedisCallback<Object>() { public Object doInRedis(RedisConnection connection) throws DataAccessException { connection.del(k);//from ww w. jav a 2 s .c om // remove key from set connection.zRem(setName, k); return null; } }, true); }