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

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

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

JedisCluster.zrangeByScore介绍

暂无

代码示例

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count) {
  Assert.notNull(key, "Key must not be null!");
  if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!");
  }
  try {
    return connection.getCluster().zrangeByScore(key, min, max, Long.valueOf(offset).intValue(),
        Long.valueOf(count).intValue());
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, double min, double max) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().zrangeByScore(key, min, max);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, String min, String max, long offset, long count) {
  Assert.notNull(key, "Key must not be null!");
  if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!");
  }
  try {
    return connection.getCluster().zrangeByScore(key, JedisConverters.toBytes(min), JedisConverters.toBytes(max),
        Long.valueOf(offset).intValue(), Long.valueOf(count).intValue());
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, String min, String max) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().zrangeByScore(key, JedisConverters.toBytes(min), JedisConverters.toBytes(max));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, Range range, Limit limit) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(range, "Range cannot be null for ZRANGEBYSCORE.");
  byte[] min = JedisConverters.boundaryToBytesForZRange(range.getMin(), JedisConverters.NEGATIVE_INFINITY_BYTES);
  byte[] max = JedisConverters.boundaryToBytesForZRange(range.getMax(), JedisConverters.POSITIVE_INFINITY_BYTES);
  try {
    if (limit.isUnlimited()) {
      return connection.getCluster().zrangeByScore(key, min, max);
    }
    return connection.getCluster().zrangeByScore(key, min, max, limit.getOffset(), limit.getCount());
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: hhfcyong/xxxx-dubbo

/**
 * 返回有序集 key 中,所有 score 值介于 min 和 max 之间(包括等于 min 或 max )的成员。有序集成员按 score 值递增(从小到大)次序排列
 * @param key
 * @param min
 * @param max
 * @return 指定区间内,带有 score 值(可选)的有序集成员的列表
 */
public Set<String> zrangeByScore(String key,double min,double max){
  return jedisCluster.zrangeByScore(key, min, max);
}
/**

代码示例来源:origin: hhfcyong/xxxx-dubbo

/**
 * 返回有序集 key 中,所有 score 值介于 min 和 max 之间(包括等于 min 或 max )的成员。有序集成员按 score 值递增(从小到大)次序排列
 * 可选的 LIMIT 参数指定返回结果的数量及区间(就像SQL中的 SELECT LIMIT offset, count ),注意当 offset 很大时,定位 offset 的操作可能需要遍历整个有序集,此过程最坏复杂度为 O(N) 时间
 * @param key
 * @param min
 * @param max
 * @return 指定区间内,带有 score 值(可选)的有序集成员的列表
 */
public Set<String> zrangeByScore(String key,String min,String max,int offset,int count){
  return jedisCluster.zrangeByScore(key, min, max, offset, count);
}
/**

代码示例来源:origin: net.oschina.j2cache/j2cache-core

@Override
public Set<byte[]> zrangeByScore(byte[] bytes, double v, double v1, int i, int i1) {
  return cluster.zrangeByScore(bytes, v,v1,i,i1);
}

代码示例来源:origin: net.oschina.j2cache/j2cache-core

@Override
public Set<byte[]> zrangeByScore(byte[] bytes, byte[] bytes1, byte[] bytes2, int i, int i1) {
  return cluster.zrangeByScore(bytes, bytes1, bytes2, i,i1);
}

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count) {
  Assert.notNull(key, "Key must not be null!");
  if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!");
  }
  try {
    return connection.getCluster().zrangeByScore(key, min, max, Long.valueOf(offset).intValue(),
        Long.valueOf(count).intValue());
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

/**
 * 返回有序集 key 中,所有 score 值介于 min 和 max 之间(包括等于 min 或 max )的成员。
 * 有序集成员按 score 值递增(从小到大)次序排列。
 */
@SuppressWarnings("rawtypes")
public Set zrangeByScore(Object key, double min, double max) {
  Set<byte[]> data = jedisCluster.zrangeByScore(keyToBytes(key), min, max);
  Set<Object> result = new LinkedHashSet<Object>();    // 有序集合必须 LinkedHashSet
  valueSetFromBytesSet(data, result);
  return result;
}

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, double min, double max) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().zrangeByScore(key, min, max);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Set<byte[]> zRangeByScore(byte[] key, double min, double max) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().zrangeByScore(key, min, max);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, String min, String max, long offset, long count) {
  Assert.notNull(key, "Key must not be null!");
  if (offset > Integer.MAX_VALUE || count > Integer.MAX_VALUE) {
    throw new IllegalArgumentException("Count/Offset cannot exceed Integer.MAX_VALUE!");
  }
  try {
    return connection.getCluster().zrangeByScore(key, JedisConverters.toBytes(min), JedisConverters.toBytes(max),
        Long.valueOf(offset).intValue(), Long.valueOf(count).intValue());
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: com.github.yamingd.argo/argo-redis

@Override
public Set<String> zrangeByScore(String key, double min, double max) {
  Set<byte[]> bs = jedisCluster.zrangeByScore(SafeEncoder.encode(key), min, max);
  return fromBytes(bs);
}

代码示例来源:origin: org.nanoframework/nano-orm-jedis

@Override
public Set<String> zrangeByScore(final String key, final String min, final String max, final int offset, final int count) {
  Assert.hasText(key);
  Assert.hasText(min);
  Assert.hasText(max);
  try {
    return cluster.zrangeByScore(key, min, max, offset, count);
  } catch (final Throwable e) {
    throw new RedisClientException(e.getMessage(), e);
  }
}

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

@Override
public Set<byte[]> zRangeByScore(byte[] key, String min, String max) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().zrangeByScore(key, JedisConverters.toBytes(min), JedisConverters.toBytes(max));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Set<byte[]> zRangeByScore(byte[] key, String min, String max) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return connection.getCluster().zrangeByScore(key, JedisConverters.toBytes(min), JedisConverters.toBytes(max));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: org.nanoframework/nano-orm-jedis

@Override
public Set<String> zrangeByScore(final String key, final String min, final String max) {
  Assert.hasText(key);
  Assert.hasText(min);
  Assert.hasText(max);
  try {
    return cluster.zrangeByScore(key, min, max);
  } catch (final Throwable e) {
    throw new RedisClientException(e.getMessage(), e);
  }
}

代码示例来源:origin: com.github.yamingd.argo/argo-redis

@Override
public Set<String> zrangeByScore(String key, String min, String max) {
  Set<byte[]> bs = jedisCluster.zrangeByScore(SafeEncoder.encode(key), SafeEncoder.encode(min), SafeEncoder.encode(max));
  return fromBytes(bs);
}

相关文章

微信公众号

最新文章

更多

JedisCluster类方法