@Override public void pipelineCommand(Pipeline pipeline, List<String> pipelineKeys) { for (String key : pipelineKeys) { pipeline.del(key); } }
@Override public Long del(byte[]... keys) { Assert.noNullElements(keys, "Keys must not be null!"); Assert.noNullElements(keys, "Keys must not contain null elements!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().del(keys))); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().del(keys))); return null; } return connection.getJedis().del(keys); } catch (Exception ex) { throw connection.convertJedisAccessException(ex); } }
@Override Response<Long> execute(Pipeline jedisPipeline) throws DynoException { return jedisPipeline.del(key); } }.execute(key, OpName.DEL);
@Override Response<Long> execute(Pipeline jedisPipeline) throws DynoException { return jedisPipeline.del(key); } }.execute(key, OpName.DEL);
@Override public Response<Long> del(String key) { String command = "del"; return instrumented(command, () -> delegated.del(key)); }
@Override public Response<Long> del(String... keys) { String command = "del"; return instrumented(command, () -> delegated.del(keys)); }
@Override public Response<Long> del(byte[]... keys) { String command = "del"; return instrumented(command, () -> delegated.del(keys)); }
@Override public Response<Long> del(byte[] key) { String command = "del"; return instrumented(command, () -> delegated.del(key)); }
p.del(KEY_DATA);
String userResourceKey = userKey(userId, r); pipeline.del(userResourceKey);
String userResourceKey = userKey(userId, r); pipeline.del(userResourceKey);
@Override public void remove(@NonNull String id) { try { redisClientDelegate.withCommandsClient(jedis -> { Map<String, String> userRolesById = jedis.hgetAll(userKey(id, ResourceType.ROLE)); redisClientDelegate.withMultiKeyPipeline(p -> { p.srem(allUsersKey(), id); for (String roleName : userRolesById.keySet()) { p.srem(roleKey(roleName), id); } for (ResourceType r : ResourceType.values()) { p.del(userKey(id, r)); } p.srem(adminKey(), id); p.sync(); }); }); } catch (Exception e) { log.error("Storage exception reading " + id + " entry.", e); } }
@Override public void remove(@NonNull String id) { try { redisClientDelegate.withCommandsClient(jedis -> { Map<String, String> userRolesById = jedis.hgetAll(userKey(id, ResourceType.ROLE)); redisClientDelegate.withMultiKeyPipeline(p -> { p.srem(allUsersKey(), id); for (String roleName : userRolesById.keySet()) { p.srem(roleKey(roleName), id); } for (ResourceType r : ResourceType.values()) { p.del(userKey(id, r)); } p.srem(adminKey(), id); p.sync(); }); }); } catch (Exception e) { log.error("Storage exception reading " + id + " entry.", e); } }
@Override Object execute() { if (delOld) { RedisLock lock = new RedisLock(key, shardedJedisPool); lock.lock(); try { Pipeline pipeline = jedis.getShard(key).pipelined(); pipeline.del(key); for (String value : values) { pipeline.rpush(key, value); } pipeline.sync(); } finally { lock.unlock(); } } else { jedis.rpush(key, values); } return null; } }.getResult();
@Override public Long del(byte[]... keys) { Assert.noNullElements(keys, "Keys must not be null!"); Assert.noNullElements(keys, "Keys must not contain null elements!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().del(keys))); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().del(keys))); return null; } return connection.getJedis().del(keys); } catch (Exception ex) { throw connection.convertJedisAccessException(ex); } }
@Override public Long del(byte[]... keys) { Assert.noNullElements(keys, "Keys must not be null!"); Assert.noNullElements(keys, "Keys must not contain null elements!"); try { if (isPipelined()) { pipeline(connection.newJedisResult(connection.getRequiredPipeline().del(keys))); return null; } if (isQueueing()) { transaction(connection.newJedisResult(connection.getRequiredTransaction().del(keys))); return null; } return connection.getJedis().del(keys); } catch (Exception ex) { throw connection.convertJedisAccessException(ex); } }
p.getSet("a", "2"); p.get("a"); p.del("a"); p.get("a");