redis.clients.jedis.params.sortedset.ZAddParams.zAddParams()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(386)

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

ZAddParams.zAddParams介绍

暂无

代码示例

代码示例来源:origin: Netflix/conductor

public Long zaddnx(String key, double score, String member) {
  ZAddParams params = ZAddParams.zAddParams().nx();
  Long retVal = dynoClient.zadd(key, score, member, params);
  return retVal;
}

代码示例来源:origin: Netflix/conductor

@Test
public void testZadd() {
 jedisCluster.zadd("key", new HashMap<>());
 jedisCluster.zadd("key", new HashMap<>(), ZAddParams.zAddParams());
 jedisCluster.zadd("key", 1337, "members");
 jedisCluster.zadd("key", 1337, "members", ZAddParams.zAddParams());
}

代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence

public Long zaddnx(String key, double score, String member) {
  ZAddParams params = ZAddParams.zAddParams().nx();
  Long retVal = dynoClient.zadd(key, score, member, params);
  return retVal;
}

代码示例来源:origin: dufyun/learn-tech-collection

public Long zupdate(String key, double score, String value) {
  return jedisCluster.zadd(key, score, value,ZAddParams.zAddParams().xx());
}

代码示例来源:origin: Netflix/dyno-queues

ZAddParams zParams = ZAddParams.zAddParams().nx();

代码示例来源:origin: Netflix/dyno-queues

ZAddParams zParams = ZAddParams.zAddParams().nx();

代码示例来源:origin: Netflix/dyno-queues

@Override
public boolean setTimeout(String messageId, long timeout) {
  return execute("setTimeout", "(a shard in) " + queueName, () -> {
    String json = nonQuorumConn.hget(messageStoreKey, messageId);
    if(json == null) {
      return false;
    }
    Message message = om.readValue(json, Message.class);
    message.setTimeout(timeout);
    for (String shard : allShards) {
      String queueShard = getQueueShardKey(queueName, shard);
      Double score = quorumConn.zscore(queueShard, messageId);
      if(score != null) {
        double priorityd = message.getPriority() / 100;
        double newScore = Long.valueOf(clock.millis() + timeout).doubleValue() + priorityd;
        ZAddParams params = ZAddParams.zAddParams().xx();
        quorumConn.zadd(queueShard, newScore, messageId, params);
        json = om.writeValueAsString(message);
        quorumConn.hset(messageStoreKey, message.getId(), json);
        return true;
      }
    }
    return false;
  });
}

相关文章