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

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

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

Jedis.zremrangeByScore介绍

[英]Remove all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).

Time complexity:

O(log(N))+O(M) with N being the number of elements in the sorted set and M the number of elements removed by the operation
[中]

代码示例

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

@Override
 public Long execute(Jedis connection) {
  return connection.zremrangeByScore(key, start, end);
 }
}.runBinary(key);

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

@Override
 public Long execute(Jedis connection) {
  return connection.zremrangeByScore(key, start, end);
 }
}.runBinary(key);

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

@Override
 public Long execute(Jedis connection) {
  return connection.zremrangeByScore(key, start, end);
 }
}.run(key);

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

@Override
 public Long execute(Jedis connection) {
  return connection.zremrangeByScore(key, start, end);
 }
}.run(key);

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

@Override
public Long zremrangeByScore(String key, double start, double end) {
 Jedis j = getShard(key);
 return j.zremrangeByScore(key, start, end);
}

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

@Override
public Long zremrangeByScore(byte[] key, double start, double end) {
 Jedis j = getShard(key);
 return j.zremrangeByScore(key, start, end);
}

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

@Override
public Long zremrangeByScore(String key, String start, String end) {
 Jedis j = getShard(key);
 return j.zremrangeByScore(key, start, end);
}

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

@Override
public Long zremrangeByScore(byte[] key, byte[] start, byte[] end) {
 Jedis j = getShard(key);
 return j.zremrangeByScore(key, start, end);
}

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

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

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

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

代码示例来源:origin: Dreampie/Resty

private void delGroupKey(Object jedis, String group, String key) {
 String groupKeys = group + Constant.CONNECTOR + "keys";
 byte[] groupRawKeys = groupKeys.getBytes();
 if (jedis instanceof ShardedJedis) {
  ((ShardedJedis) jedis).zrem(groupRawKeys, Serializer.serialize(key));
  ((ShardedJedis) jedis).zremrangeByScore(groupRawKeys, 0, System.currentTimeMillis());
 } else if (jedis instanceof Jedis) {
  ((Jedis) jedis).zrem(groupRawKeys, Serializer.serialize(key));
  ((Jedis) jedis).zremrangeByScore(groupRawKeys, 0, System.currentTimeMillis());
 }
}

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

@Override
public Long zRemRangeByScore(byte[] key, Range range) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(range, "Range for ZREMRANGEBYSCORE must not be null!");
  byte[] min = JedisConverters.boundaryToBytesForZRange(range.getMin(), JedisConverters.NEGATIVE_INFINITY_BYTES);
  byte[] max = JedisConverters.boundaryToBytesForZRange(range.getMax(), JedisConverters.POSITIVE_INFINITY_BYTES);
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().zremrangeByScore(key, min, max)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().zremrangeByScore(key, min, max)));
      return null;
    }
    return connection.getJedis().zremrangeByScore(key, min, max);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
  public Long action(Jedis jedis) {
    return jedis.zremrangeByScore(key, start, end);
  }
});

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

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

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

@Override
public Long zremrangeByScore(String key, String start, String end) {
 String command = "zremrangeByScore";
 return instrumented(command, () -> delegated.zremrangeByScore(key, start, end));
}

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

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

代码示例来源:origin: org.nutz/nutz-integration-jedis

public Long zremrangeByScore(String key, String start, String end) {
  Jedis jedis = getJedis();
  try {
    return jedis.zremrangeByScore(key, start, end);
  } finally {Streams.safeClose(jedis);}
}

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

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

代码示例来源:origin: cn.dreampie/resty-cache

private void delGroupKey(Object jedis, String group, String key) {
 String groupKeys = group + Constant.CONNECTOR + "keys";
 byte[] groupRawKeys = groupKeys.getBytes();
 if (jedis instanceof ShardedJedis) {
  ((ShardedJedis) jedis).zrem(groupRawKeys, Serializer.serialize(key));
  ((ShardedJedis) jedis).zremrangeByScore(groupRawKeys, 0, System.currentTimeMillis());
 } else if (jedis instanceof Jedis) {
  ((Jedis) jedis).zrem(groupRawKeys, Serializer.serialize(key));
  ((Jedis) jedis).zremrangeByScore(groupRawKeys, 0, System.currentTimeMillis());
 }
}

代码示例来源:origin: Baqend/Orestes-Bloomfilter

@Override
public void cleanupTTLs() {
  try (Jedis jedis = pool.getResource()) {
    jedis.zremrangeByScore(keys.TTL_KEY, 0, now() - config.gracePeriod());
  }
}

相关文章

Jedis类方法