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

x33g5p2x  于2022-01-21 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(138)

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

Jedis.zcount介绍

暂无

代码示例

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

@Override
 public Long execute(Jedis connection) {
  return connection.zcount(key, min, max);
 }
}.run(key);

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

@Override
 public Long execute(Jedis connection) {
  return connection.zcount(key, min, max);
 }
}.runBinary(key);

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

@Override
 public Long execute(Jedis connection) {
  return connection.zcount(key, min, max);
 }
}.runBinary(key);

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

@Override
 public Long execute(Jedis connection) {
  return connection.zcount(key, min, max);
 }
}.run(key);

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

@Override
public Long zcount(String key, String min, String max) {
 Jedis j = getShard(key);
 return j.zcount(key, min, max);
}

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

@Override
public Long zcount(byte[] key, double min, double max) {
 Jedis j = getShard(key);
 return j.zcount(key, min, max);
}

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

@Override
public Long zcount(byte[] key, byte[] min, byte[] max) {
 Jedis j = getShard(key);
 return j.zcount(key, min, max);
}

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

@Override
public Long zcount(String key, double min, double max) {
 Jedis j = getShard(key);
 return j.zcount(key, min, max);
}

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

@Override
public Long zcount(String key, String min, String max) {
 Jedis jedis = null;
  try {
   jedis = jedisPool.getResource();
   return jedis.zcount(key, min, max);
  } finally {
   if (jedis != null)
    jedis.close();
  }
}

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

@Override
public Long zcount(String key, double min, double max) {
 Jedis jedis = null;
  try {
   jedis = jedisPool.getResource();
   return jedis.zcount(key, min, max);
  } finally {
   if (jedis != null)
    jedis.close();
  }
}

代码示例来源:origin: jfinal/jfinal

/**
 * 返回有序集 key 中, score 值在 min 和 max 之间(默认包括 score 值等于 min 或 max )的成员的数量。
 * 关于参数 min 和 max 的详细使用方法,请参考 ZRANGEBYSCORE 命令。
 */
public Long zcount(Object key, double min, double max) {
  Jedis jedis = getJedis();
  try {
    return jedis.zcount(keyToBytes(key), min, max);
  }
  finally {close(jedis);}
}

代码示例来源:origin: prestodb/presto

numberOfKeys = jedis.zcount(redisTableHandle.getKeyName(), "-inf", "+inf");

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

@Override
public Long zCount(byte[] key, Range range) {
  Assert.notNull(key, "Key must not be null!");
  if (isPipelined() || isQueueing()) {
    throw new UnsupportedOperationException(
        "ZCOUNT not implemented in jedis for binary protocol on transaction and pipeline");
  }
  // TODO: Implement zcount for pipeline/tx.
  byte[] min = JedisConverters.boundaryToBytesForZRange(range.getMin(), JedisConverters.NEGATIVE_INFINITY_BYTES);
  byte[] max = JedisConverters.boundaryToBytesForZRange(range.getMax(), JedisConverters.POSITIVE_INFINITY_BYTES);
  return connection.getJedis().zcount(key, min, max);
}

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

@Override
public Long zCount(byte[] key, double min, double max) {
  Assert.notNull(key, "Key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().zcount(key, min, max)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().zcount(key, min, max)));
      return null;
    }
    return connection.getJedis().zcount(key, min, max);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: jwpttcg66/NettyGameServer

public long zcount(String key){
  long size = 0;
  Jedis jedis = null;
  boolean sucess = true;
  try {
    jedis = jedisPool.getResource();
    size = jedis.zcount(key, 0, Long.MAX_VALUE);
  } catch (Exception e) {
    sucess = false;
    returnBrokenResource(jedis, "zcount key:"+key, e);
  } finally {
    if (sucess && jedis != null) {
      returnResource(jedis);
    }
  }
  return size;
}

代码示例来源:origin: tangyanbo/springmore

@Override
  public Long action(Jedis jedis) {
    return jedis.zcount(key, min, max);
  }
});

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

@Override
public Long zcount(byte[] key, double min, double max) {
 String command = "zcount";
 return instrumented(command, () -> delegated.zcount(key, min, max));
}

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

@Override
public Long zcount(String key, String min, String max) {
 Jedis jedis = null;
  try {
   jedis = jedisPool.getResource();
   return jedis.zcount(key, min, max);
  } finally {
   if (jedis != null)
    jedis.close();
  }
}

代码示例来源:origin: yangfuhai/jboot

/**
 * 返回有序集 key 中, score 值在 min 和 max 之间(默认包括 score 值等于 min 或 max )的成员的数量。
 * 关于参数 min 和 max 的详细使用方法,请参考 ZRANGEBYSCORE 命令。
 */
public Long zcount(Object key, double min, double max) {
  Jedis jedis = getJedis();
  try {
    return jedis.zcount(keyToBytes(key), min, max);
  } finally {
    returnResource(jedis);
  }
}

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

@Override
public Long zCount(byte[] key, Range range) {
  Assert.notNull(key, "Key must not be null!");
  if (isPipelined() || isQueueing()) {
    throw new UnsupportedOperationException(
        "ZCOUNT not implemented in jedis for binary protocol on transaction and pipeline");
  }
  // TODO: Implement zcount for pipeline/tx.
  byte[] min = JedisConverters.boundaryToBytesForZRange(range.getMin(), JedisConverters.NEGATIVE_INFINITY_BYTES);
  byte[] max = JedisConverters.boundaryToBytesForZRange(range.getMax(), JedisConverters.POSITIVE_INFINITY_BYTES);
  return connection.getJedis().zcount(key, min, max);
}

相关文章

微信公众号

最新文章

更多

Jedis类方法