redis.clients.jedis.Pipeline.del()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(289)

本文整理了Java中redis.clients.jedis.Pipeline.del()方法的一些代码示例,展示了Pipeline.del()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Pipeline.del()方法的具体详情如下:
包路径:redis.clients.jedis.Pipeline
类名称:Pipeline
方法名:del

Pipeline.del介绍

暂无

代码示例

代码示例来源:origin: sohutv/cachecloud

@Override
public void pipelineCommand(Pipeline pipeline, List<String> pipelineKeys) {
  for (String key : pipelineKeys) {
    pipeline.del(key);
  }
}

代码示例来源:origin: spring-projects/spring-data-redis

@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);
  }
}

代码示例来源:origin: com.netflix.dyno/dyno-jedis

@Override
  Response<Long> execute(Pipeline jedisPipeline) throws DynoException {
    return jedisPipeline.del(key);
  }
}.execute(key, OpName.DEL);

代码示例来源:origin: com.netflix.dyno/dyno-jedis

@Override
  Response<Long> execute(Pipeline jedisPipeline) throws DynoException {
    return jedisPipeline.del(key);
  }
}.execute(key, OpName.DEL);

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Response<Long> del(String key) {
 String command = "del";
 return instrumented(command, () -> delegated.del(key));
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Response<Long> del(String... keys) {
 String command = "del";
 return instrumented(command, () -> delegated.del(keys));
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Response<Long> del(byte[]... keys) {
 String command = "del";
 return instrumented(command, () -> delegated.del(keys));
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Response<Long> del(byte[] key) {
 String command = "del";
 return instrumented(command, () -> delegated.del(key));
}

代码示例来源:origin: pyloque/captain

public void delete(String key) {
  redis.pipeline(pipe -> {
    pipe.del(keyForItem(key));
    pipe.del(keyForVersion(key));
    pipe.srem(globalAllKeys, key);
    pipe.incr(globalVersionKey);
  });
}

代码示例来源:origin: com.github.ddth/ddth-lucext-core

p.del(KEY_DATA);

代码示例来源:origin: com.netflix.spinnaker.fiat/fiat-roles

String userResourceKey = userKey(userId, r);
pipeline.del(userResourceKey);

代码示例来源:origin: spinnaker/fiat

String userResourceKey = userKey(userId, r);
pipeline.del(userResourceKey);

代码示例来源:origin: com.netflix.spinnaker.fiat/fiat-roles

@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);
 }
}

代码示例来源:origin: spinnaker/fiat

@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);
 }
}

代码示例来源:origin: com.github.biezhi/unique-support-redis

@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();

代码示例来源:origin: org.springframework.data/spring-data-redis

@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);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@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);
  }
}

代码示例来源:origin: tonivade/claudb

p.getSet("a", "2");
p.get("a");
p.del("a");
p.get("a");

相关文章

Pipeline类方法