public void set(final String key, final long serializable) { cache.withRunnable( new RedisRunnable() { @Override public void run(Jedis jedis) { jedis.hset(id, key, Long.toString(serializable)); } }); }
public void remove(final String key) { cache.withRunnable( new RedisRunnable() { @Override public void run(Jedis jedis) { jedis.hdel(id, key); } }); }
public void clear() { cache.withRunnable( new RedisRunnable() { @Override public void run(Jedis jedis) { jedis.del(id); } }); }
public void removeAll(final Iterable<String> keys) { cache.withRunnable( new RedisRunnable() { @Override public void run(Jedis jedis) { Pipeline pipeline = jedis.pipelined(); for (String s : keys) { pipeline.hdel(id, s); } pipeline.syncAndReturnAll(); } }); }