Java Code Examples for redis.clients.jedis.JedisCluster#del()

The following examples show how to use redis.clients.jedis.JedisCluster#del() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DoTestJedisHookProxy.java    From uavstack with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unused")
private static void foo3() {

    System.out.println("TEST JedisCluster ======================================================");

    JedisCluster jc = new JedisCluster(new HostAndPort("127.0.0.1", 6380));
    jc.set("foo", "bar");
    String val = jc.get("foo");
    System.out.println(val);

    jc.set("foo1", "bar");
    jc.set("foo2", "bar");
    jc.set("foo3", "bar");
    jc.set("foo4", "bar");
    jc.set("foo5", "bar");

    jc.del("foo");
    jc.del("foo1");
    jc.del("foo2");
    jc.del("foo3");
    jc.del("foo4");
    jc.del("foo5");

    try {
        jc.close();
    }
    catch (IOException e) {
        e.printStackTrace();
    }
}
 
Example 2
Source File: RedisShardBackplane.java    From bazel-buildfarm with Apache License 2.0 5 votes vote down vote up
private ExecuteEntry deprequeueOperation(JedisCluster jedis) throws InterruptedException {

    String executeEntryJson = prequeue.dequeue(jedis);
    if (executeEntryJson == null) {
      return null;
    }

    ExecuteEntry.Builder executeEntryBuilder = ExecuteEntry.newBuilder();
    try {
      JsonFormat.parser().merge(executeEntryJson, executeEntryBuilder);
      ExecuteEntry executeEntry = executeEntryBuilder.build();
      String operationName = executeEntry.getOperationName();

      Operation operation = keepaliveOperation(operationName);
      // publish so that watchers reset their timeout
      publishReset(jedis, operation);

      // destroy the processing entry and ttl
      if (!prequeue.removeFromDequeue(jedis, executeEntryJson)) {
        logger.log(
            Level.SEVERE,
            format("could not remove %s from %s", operationName, prequeue.getDequeueName()));
        return null;
      }
      jedis.del(processingKey(operationName)); // may or may not exist
      return executeEntry;
    } catch (InvalidProtocolBufferException e) {
      logger.log(Level.SEVERE, "error parsing execute entry", e);
      return null;
    }
  }
 
Example 3
Source File: RedisClusterTest.java    From Thunder with Apache License 2.0 5 votes vote down vote up
protected void del(JedisCluster cluster) {
    for (int i = 0; i < 200; i++) {
        cluster.del("A1(" + i + ")");
        cluster.del("A2(" + i + ")");
    }
    LOG.info("Clear all data");
}
 
Example 4
Source File: RedisShardBackplane.java    From bazel-buildfarm with Apache License 2.0 4 votes vote down vote up
private void removeActionResult(JedisCluster jedis, ActionKey actionKey) {
  jedis.del(acKey(actionKey));
}