本文整理了Java中io.vertx.redis.RedisClient.zcount
方法的一些代码示例,展示了RedisClient.zcount
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RedisClient.zcount
方法的具体详情如下:
包路径:io.vertx.redis.RedisClient
类名称:RedisClient
方法名:zcount
[英]Count the members in a sorted set with scores within the given values
[中]计算排序集中的成员,分数在给定值内
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Count the members in a sorted set with scores within the given values
* @param key Key string
* @param min Minimum score
* @param max Maximum score
* @param handler Handler for the result of this call.
* @return
*/
public io.vertx.rxjava.redis.RedisClient zcount(String key, double min, double max, Handler<AsyncResult<Long>> handler) {
delegate.zcount(key, min, max, handler);
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Count the members in a sorted set with scores within the given values
* @param key Key string
* @param min Minimum score
* @param max Maximum score
* @param handler Handler for the result of this call.
* @return
*/
public io.vertx.rxjava.redis.RedisClient zcount(String key, double min, double max, Handler<AsyncResult<Long>> handler) {
delegate.zcount(key, min, max, handler);
return this;
}
代码示例来源:origin: org.swisspush/gateleen-monitoring
/**
* Update the count of active queues. Reads the count from redis and stores it to JMX.
*/
public void updateQueueCountInformation() {
long timestamp = System.currentTimeMillis() - MAX_AGE_MILLISECONDS;
redisClient.zcount(QUEUES_KEY_PREFIX, timestamp, Double.MAX_VALUE, reply -> {
if(reply.failed()){
log.error("Error gathering count of active queues");
} else {
final long count = reply.result();
vertx.eventBus().publish(Address.monitoringAddress(), new JsonObject().put(METRIC_NAME, prefix + ACTIVE_QUEUE_COUNT_METRIC).put(METRIC_ACTION, SET).put("n", count));
}
});
}
代码示例来源:origin: org.swisspush/redisques
private void getQueuesCount(Message<JsonObject> event) {
Result<Optional<Pattern>, String> result = MessageUtil.extractFilterPattern(event);
if (result.isErr()) {
event.reply(createErrorReply().put(ERROR_TYPE, BAD_INPUT).put(MESSAGE, result.getErr()));
return;
}
/*
* to filter values we have to use "getQueues" operation
*/
if (result.getOk().isPresent()) {
getQueues(event, true, result);
} else {
redisClient.zcount(getQueuesKey(), getMaxAgeTimestamp(), Double.MAX_VALUE, new GetQueuesCountHandler(event));
}
}
内容来源于网络,如有侵权,请联系作者删除!