@Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); } }.run(key);
@Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); } }.runBinary(key);
@Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); } }.runBinary(key);
@Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); } }.run(key);
@Override public Long zcount(String key, String min, String max) { Jedis j = getShard(key); return j.zcount(key, min, max); }
@Override public Long zcount(byte[] key, double min, double max) { Jedis j = getShard(key); return j.zcount(key, min, max); }
@Override public Long zcount(byte[] key, byte[] min, byte[] max) { Jedis j = getShard(key); return j.zcount(key, min, max); }
@Override public Long zcount(String key, double min, double max) { Jedis j = getShard(key); return j.zcount(key, min, max); }
@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(); } }
@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(); } }
/** * 返回有序集 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);} }
numberOfKeys = jedis.zcount(redisTableHandle.getKeyName(), "-inf", "+inf");
@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); }
@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); } }
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; }
@Override public Long action(Jedis jedis) { return jedis.zcount(key, min, max); } });
@Override public Long zcount(byte[] key, double min, double max) { String command = "zcount"; return instrumented(command, () -> delegated.zcount(key, min, max)); }
@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(); } }
/** * 返回有序集 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); } }
@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); }