當前位置: 首頁>>代碼示例>>Java>>正文


Java Jedis.zrem方法代碼示例

本文整理匯總了Java中redis.clients.jedis.Jedis.zrem方法的典型用法代碼示例。如果您正苦於以下問題:Java Jedis.zrem方法的具體用法?Java Jedis.zrem怎麽用?Java Jedis.zrem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在redis.clients.jedis.Jedis的用法示例。


在下文中一共展示了Jedis.zrem方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: zRemByMember

import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/**
 * 刪除zset 的成員
 * 
 * @param key
 * @param member
 * @return
 */
public long zRemByMember(String key, String member) {
	Jedis jedis = null;
	boolean success = true;
	long ret = 0L;
	try {
		jedis = jedisPool.getResource();
		if (jedis == null) {
			success = false;
			return ret;
		}
		ret = jedis.zrem(key, member);
	} catch (Exception e) {
		success = false;
		returnBrokenResource(jedis, "zrangeByScoreWithScores", e);
	} finally {
		releaseReidsSource(success, jedis);
	}
	return ret;
}
 
開發者ID:qq1588518,項目名稱:JRediClients,代碼行數:27,代碼來源:RedisService.java

示例2: doPoll

import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
@Override
public Request doPoll(Task task) {
    Jedis jedis = jedisPool.getResource();
    try {
        String content = null;
        Set<String> contents = jedis.zrevrange(RedisKeys.getZsetPlusPriorityKey(task), 0, 0);
        if (contents != null && !contents.isEmpty()) {
            content = contents.toArray(new String[0])[0];
            jedis.zrem(RedisKeys.getZsetPlusPriorityKey(task), content);
        } else {
            content = jedis.lpop(RedisKeys.getQueueNoPriorityKey(task));
            if (StringUtils.isBlank(content)) {
                contents = jedis.zrevrange(RedisKeys.getZsetMinusPriorityKey(task), 0, 0);
                if (contents != null && !contents.isEmpty()) {
                    content = contents.toArray(new String[0])[0];
                    jedis.zrem(RedisKeys.getZsetPlusPriorityKey(task), content);
                }
            }
        }

        return StringUtils.isNotBlank(content) ? serializer.deserialize(content) : null;
    } finally {
        jedis.close();
    }
}
 
開發者ID:brucezee,項目名稱:jspider,代碼行數:26,代碼來源:RedisPriorityScheduler.java

示例3: zRemByMemberReturnBoolean

import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/**
 * 刪除zset 的成員
 * 
 * @param key
 * @param member
 * @return
 */
public boolean zRemByMemberReturnBoolean(String key, String member) {
	Jedis jedis = null;
	boolean success = true;
	boolean ret = false;
	try {
		jedis = jedisPool.getResource();
		if (jedis == null) {
			success = false;
			return ret;
		}
		ret = (jedis.zrem(key, member) > 0);
	} catch (Exception e) {
		success = false;
		returnBrokenResource(jedis, "zrangeByScoreWithScores", e);
	} finally {
		releaseReidsSource(success, jedis);
	}
	return ret;
}
 
開發者ID:qq1588518,項目名稱:JRediClients,代碼行數:27,代碼來源:RedisService.java

示例4: zrem

import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
public void zrem(String key, String member) {
    Jedis jedis = null;
    try {
        jedis = getJedis();
        if (jedis == null) {
            logger.error("get jedis fail");
        }
        jedis.zrem(key, member);
    } catch (JedisConnectionException e) {
        if (jedis != null) {
            jedis.close();
        }
    } finally {
        returnJedisResource(jedis);
    }
}
 
開發者ID:Zephery,項目名稱:newblog,代碼行數:17,代碼來源:JedisUtil.java

示例5: zRemove

import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Long zRemove(String key, Object... data) {
	int tries = 0;
	Long retVal = null;
	boolean sucess = false;
	do {
		tries++;
		try {
			Jedis jedis = pool.getResource();
			retVal = jedis.zrem(key, SerializationUtil.serialize(data));
			jedis.close();
			sucess = true;
		} catch (JedisConnectionException ex) {
			log.error(RedisConstants.CONN_FAILED_RETRY_MSG + tries);
			if (tries == numRetries)
				throw ex;
		}
	} while (!sucess && tries <= numRetries);
	return retVal;
}
 
開發者ID:ran-jit,項目名稱:distributed-task-scheduler,代碼行數:22,代碼來源:RedisDataCache.java

示例6: onHubShutdown

import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
public void onHubShutdown(MinecraftServerS serverS)
{
    if(serverS == null)
        return;

    try
    {
        Jedis jedis = instance.getDatabaseConnector().getResource();
        jedis.zrem("lobbybalancer", serverS.getServerName());
        jedis.close();
    } catch (Exception e)
    {
        e.printStackTrace();
    }

    hubs.remove(serverS);
    serverS.unregisterNetwork();
}
 
開發者ID:SamaGames,項目名稱:Hydroangeas,代碼行數:19,代碼來源:HubBalancer.java

示例7: zrem

import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/**
 * 移除有序列表成員
 *
 * @param key     key
 * @param members 待移除的成員
 * @return Long
 */
public Long zrem(String key, String... members) {
    Jedis jedis = null;

    try {
        jedis = getConnect();
        return jedis.zrem(key, members);
    } catch (Exception e) {
        logger.error("redis zrem data failed!", e);
        return 0L;
    } finally {
        close(jedis);
    }
}
 
開發者ID:TwoDragonLake,項目名稱:tdl-seckill,代碼行數:21,代碼來源:RedisUtil.java

示例8: zrem

import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
@Override
public Long zrem(String key, String... members) {
    Jedis jedis = null;
    Long res = null;
    try {
        jedis = pool.getResource();
        res = jedis.zrem(key, members);
    } catch (Exception e) {

        LOGGER.error(e.getMessage());
    } finally {
        returnResource(pool, jedis);
    }
    return res;
}
 
開發者ID:wxiaoqi,項目名稱:ace-cache,代碼行數:16,代碼來源:RedisServiceImpl.java


注:本文中的redis.clients.jedis.Jedis.zrem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。