本文整理了Java中redis.clients.jedis.params.sortedset.ZAddParams.zAddParams()
方法的一些代码示例,展示了ZAddParams.zAddParams()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZAddParams.zAddParams()
方法的具体详情如下:
包路径:redis.clients.jedis.params.sortedset.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;
});
}
内容来源于网络,如有侵权,请联系作者删除!