Examples of sadd()


Examples of org.jredis.JRedis.sadd()

                db.lpush(RedisIndexKeys.META_INDICES_AUTO, indexName);
                db.set(RedisIndexKeys.META_AUTO + indexName + ":class", className);
                if(null != keys){
                    String key_list = RedisIndexKeys.META_AUTO + indexName + ":keys";
                    for(String key : keys){
                        db.sadd(key_list, key);
                    }
                }
            } else {
                db.lpush(RedisIndexKeys.META_INDICES_MANUAL, indexName);
                db.set(RedisIndexKeys.META_MANUAL + indexName + ":class", className);
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

    public Set<String> sCopy(String key, String new_key) {
        Jedis jedis = borrow();
        try {
            Set<String> oldSets = jedis.smembers(key);
            for (String str : oldSets) {
                jedis.sadd(new_key, str);
            }
            return oldSets;
        } finally {
            revert(jedis);
        }
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

    }

    // Redis Set Operations
    public Long sadd(String member) {
        Jedis jedis = getResource();
        Long reply = jedis.sadd(key(), member);
        returnResource(jedis);
        return reply;
    }

    public Long srem(String member) {
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

    }

    public void appendIpAddress(String ipAddress) {
        Jedis jedis = jedisPool.getResource();
        try {
            jedis.sadd("ipAddresses", ipAddress);
        } catch (JedisConnectionException je) {
            if (null != jedis) {
                jedisPool.returnBrokenResource(jedis);
                jedis = null;
            }
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

    public boolean isDuplicate(Request request, Task task) {
        Jedis jedis = pool.getResource();
        try {
            boolean isDuplicate = jedis.sismember(getSetKey(task), request.getUrl());
            if (!isDuplicate) {
                jedis.sadd(getSetKey(task), request.getUrl());
            }
            return isDuplicate;
        } finally {
            pool.returnResource(jedis);
        }
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

        final Jedis jedis = TestUtils.createJedis(config);

        // Submit a job containing incorrect JSON.
        String incorrectJson = "{";
        jedis.sadd(JesqueUtils.createKey(config.getNamespace(), QUEUES), queue);
        jedis.rpush(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue), incorrectJson);

        final Worker worker = new WorkerImpl(config, Arrays.asList(queue),
                new MapBasedJobFactory(JesqueUtils.map(JesqueUtils.entry("SleepAction", SleepAction.class))));
        final Thread workerThread = new Thread(worker);
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

        final Jedis jedis = jedisPool.getResource();
        try {
            jedis.set(ackLookupKey(channelId), Long.toString(version));
            final List<String> hashValues = jedis.hmget(chidLookupKey(channelId), UAID_KEY);
            final String uaid = hashValues.get(0);
            jedis.sadd(acksLookupKey(uaid), channelId);
            return uaid;
        } finally {
            jedisPool.returnResource(jedis);
        }
    }
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

    }
  }
 
  protected void updateIdentifiers(ExternalId security) {
    Jedis jedis = _jedisPool.getResource();
    jedis.sadd(generateAllSchemesKey(), security.getScheme().getName());
    jedis.sadd(generatePerSchemeKey(security.getScheme().getName()), security.getValue());
    _jedisPool.returnResource(jedis);
  }

  @Override
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

  }
 
  protected void updateIdentifiers(ExternalId security) {
    Jedis jedis = _jedisPool.getResource();
    jedis.sadd(generateAllSchemesKey(), security.getScheme().getName());
    jedis.sadd(generatePerSchemeKey(security.getScheme().getName()), security.getValue());
    _jedisPool.returnResource(jedis);
  }

  @Override
  public Set<String> getAllIdentifiers(String identifierScheme) {
View Full Code Here

Examples of redis.clients.jedis.Jedis.sadd()

      try {
       
        for (ExternalId externalId : security.getExternalIdBundle()) {
          String redisKey = toRedisKey(externalId);
         
          jedis.sadd(redisKey, uniqueId.toString());
          if (jedis.scard(redisKey) > 1) {
            s_logger.warn("Multiple securities with same ExternalId {}. Probable misuse.", externalId);
          }
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.