Java Code Examples for redis.clients.jedis.Jedis#sdiff()

The following examples show how to use redis.clients.jedis.Jedis#sdiff() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JedisUtils.java    From fw-spring-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * 通过key获取set中的差集
 * </p>
 * <p>
 * 以第一个set为标准
 * </p>
 *
 * @param keys
 *            可以使一个string 则返回set中所有的value 也可以是string数组
 * @return
 */
public Set<String> sdiff(String... keys) {
    Jedis jedis = null;
    Set<String> res = null;
    try {
        jedis = jedisPool.getResource();
        res = jedis.sdiff(keys);
    } catch (Exception e) {

        log.error(e.getMessage());
    } finally {
        returnResource(jedisPool, jedis);
    }
    return res;
}
 
Example 2
Source File: JedisUtil.java    From Project with Apache License 2.0 5 votes vote down vote up
/**
 * 返回从第一组和所有的给定集合之间的差异的成员
 * 
 * @param  keys
 * @return 差异的成员集合
 */
public Set<String> sdiff(String... keys) {
	Jedis jedis = getJedis();
	Set<String> set = jedis.sdiff(keys);
	jedis.close();
	return set;
}
 
Example 3
Source File: RedisServiceImpl.java    From ace-cache with Apache License 2.0 5 votes vote down vote up
@Override
public Set<String> sdiff(String... keys) {
    Jedis jedis = null;
    Set<String> res = null;
    try {
        jedis = pool.getResource();
        res = jedis.sdiff(keys);
    } catch (Exception e) {

        LOGGER.error(e.getMessage());
    } finally {
        returnResource(pool, jedis);
    }
    return res;
}
 
Example 4
Source File: DefaultRedis.java    From craft-atom with MIT License 4 votes vote down vote up
private Set<String> sdiff0(Jedis j, String... keys) {
	return j.sdiff(keys);
}
 
Example 5
Source File: JedisUtil.java    From BigData with GNU General Public License v3.0 3 votes vote down vote up
/**
 * 返回从第一组和所有的给定集合之间的差异的成员
 * 
 * @param String
 *            ... keys
 * @return 差异的成员集合
 * */
public Set<String> sdiff(String... keys) {
	Jedis jedis = getJedis();
	Set<String> set = jedis.sdiff(keys);
	returnJedis(jedis);
	return set;
}