本文整理了Java中redis.clients.jedis.Jedis.zrem()
方法的一些代码示例,展示了Jedis.zrem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.zrem()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:zrem
[英]Remove the specified member from the sorted set value stored at key. If member was not a member of the set no operation is performed. If key does not not hold a set value an error is returned.
Time complexity O(log(N)) with N being the number of elements in the sorted set
[中]从存储在键处的已排序集值中删除指定的成员。如果成员不是集合的成员,则不执行任何操作。如果键不包含设置值,则返回错误。
时间复杂度O(log(N)),N是排序集中的元素数
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.zrem(key, member);
}
}.run(key);
代码示例来源: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: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.zrem(key, member);
}
}.runBinary(key);
代码示例来源:origin: sohutv/cachecloud
public Long execute(Jedis connection) {
return connection.zrem(keyByte, member);
}
}.runBinary(keyByte);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long zrem(String key, String... members) {
Jedis j = getShard(key);
return j.zrem(key, members);
}
代码示例来源:origin: sohutv/cachecloud
@Override
public Long zrem(byte[] key, byte[]... members) {
Jedis j = getShard(key);
return j.zrem(key, members);
}
代码示例来源:origin: caoxinyu/RedisClient
@Override
protected void command() {
jedis.select(db);
jedis.zrem(key, members);
}
代码示例来源:origin: Netflix/conductor
@Override
public Long zrem(String key, String... member) {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
return jedis.zrem(key, member);
} finally {
if (jedis != null)
jedis.close();
}
}
代码示例来源:origin: code4craft/webmagic
private String getRequest(Jedis jedis, Task task)
{
String url;
Set<String> urls = jedis.zrevrange(getZsetPlusPriorityKey(task), 0, 0);
if(urls.isEmpty())
{
url = jedis.lpop(getQueueNoPriorityKey(task));
if(StringUtils.isBlank(url))
{
urls = jedis.zrevrange(getZsetMinusPriorityKey(task), 0, 0);
if(!urls.isEmpty())
{
url = urls.toArray(new String[0])[0];
jedis.zrem(getZsetMinusPriorityKey(task), url);
}
}
}
else
{
url = urls.toArray(new String[0])[0];
jedis.zrem(getZsetPlusPriorityKey(task), url);
}
return url;
}
代码示例来源:origin: jfinal/jfinal
/**
* 移除有序集 key 中的一个或多个成员,不存在的成员将被忽略。
* 当 key 存在但不是有序集类型时,返回一个错误。
*/
public Long zrem(Object key, Object... members) {
Jedis jedis = getJedis();
try {
return jedis.zrem(keyToBytes(key), valuesToBytesArray(members));
}
finally {close(jedis);}
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Long zRem(byte[] key, byte[]... values) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(values, "Values must not be null!");
Assert.noNullElements(values, "Values must not contain null elements!");
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().zrem(key, values)));
return null;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().zrem(key, values)));
return null;
}
return connection.getJedis().zrem(key, values);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: sanluan/PublicCMS
@Override
public V remove(K key) {
Jedis jedis = jedisPool.getResource();
byte[] byteKey = getKey(key);
V value = null;
if (1 == jedis.zrem(byteRegion, keySerializer.serialize(key))) {
value = valueSerializer.deserialize(jedis.get(byteKey));
jedis.del(byteKey);
}
jedis.close();
return value;
}
代码示例来源:origin: sanluan/PublicCMS
@Override
public V remove(K key) {
Jedis jedis = jedisPool.getResource();
byte[] byteKey = getKey(key);
V value = null;
if (1 == jedis.zrem(byteRegion, keySerializer.serialize(key))) {
value = valueSerializer.deserialize(jedis.get(byteKey));
jedis.del(byteKey);
}
jedis.close();
return value;
}
代码示例来源:origin: jwpttcg66/NettyGameServer
/**
* 删除zset 的成员
* @param key
* @param member
* @return
*/
public long zRemByMember (String key ,String member){
Jedis jedis = null;
boolean sucess = true;
try {
jedis = jedisPool.getResource();
return jedis.zrem(key, member);
} catch (Exception e) {
sucess = false;
returnBrokenResource(jedis, "zrangeByScoreWithScores", e);
} finally {
if (sucess && jedis != null) {
returnResource(jedis);
}
}
return 0;
}
代码示例来源:origin: jwpttcg66/NettyGameServer
/**
* 删除zset 的成员
* @param key
* @param member
* @return
*/
public boolean zRemByMemberReturnBoolean (String key ,String member){
Jedis jedis = null;
boolean sucess = true;
boolean result = false;
try {
jedis = jedisPool.getResource();
result = (jedis.zrem(key, member) !=0);
} catch (Exception e) {
sucess = false;
returnBrokenResource(jedis, "zrangeByScoreWithScores", e);
} finally {
if (sucess && jedis != null) {
returnResource(jedis);
}
}
return result;
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public Object execute(Jedis jedis) {
return jedis.zrem(key, members);
}
});
代码示例来源:origin: Impetus/Kundera
((Jedis) connection).zrem(getHashKey(tableName, colName), rowKey); // delete
代码示例来源:origin: gresrun/jesque
public static void doRemoveDelayedEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) {
final String key = JesqueUtils.createKey(namespace, QUEUE, queue);
// remove task only if this queue is either delayed or unused
if (JedisUtils.canUseAsDelayedQueue(jedis, key)) {
jedis.zrem(key, jobJson);
} else {
throw new IllegalArgumentException(queue + " cannot be used as a delayed queue");
}
}
代码示例来源:origin: yangfuhai/jboot
/**
* 移除有序集 key 中的一个或多个成员,不存在的成员将被忽略。
* 当 key 存在但不是有序集类型时,返回一个错误。
*/
public Long zrem(Object key, Object... members) {
Jedis jedis = getJedis();
try {
return jedis.zrem(keyToBytes(key), valuesToBytesArray(members));
} finally {
returnResource(jedis);
}
}
代码示例来源:origin: com.jfinal/jfinal
/**
* 移除有序集 key 中的一个或多个成员,不存在的成员将被忽略。
* 当 key 存在但不是有序集类型时,返回一个错误。
*/
public Long zrem(Object key, Object... members) {
Jedis jedis = getJedis();
try {
return jedis.zrem(keyToBytes(key), valuesToBytesArray(members));
}
finally {close(jedis);}
}
内容来源于网络,如有侵权,请联系作者删除!