Examples of pipelined()


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

  jedis.auth("foobared");
  jedis.flushAll();

  long begin = Calendar.getInstance().getTimeInMillis();

  Pipeline p = jedis.pipelined();
  for (int n = 0; n <= TOTAL_OPERATIONS; n++) {
      String key = "foo" + n;
      p.set(key, "bar" + n);
      p.get(key);
  }
View Full Code Here

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

  public List<Object> execute(PipelineAction pipelineAction) throws JedisException {
    Jedis jedis = null;
    boolean broken = false;
    try {
      jedis = jedisPool.getResource();
      Pipeline pipeline = jedis.pipelined();
      pipelineAction.action(pipeline);
      return pipeline.syncAndReturnAll();
    } catch (JedisException e) {
      broken = handleJedisException(e);
      throw e;
View Full Code Here

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

  public void execute(PipelineActionNoResult pipelineAction) throws JedisException {
    Jedis jedis = null;
    boolean broken = false;
    try {
      jedis = jedisPool.getResource();
      Pipeline pipeline = jedis.pipelined();
      pipelineAction.action(pipeline);
      pipeline.sync();
    } catch (JedisException e) {
      broken = handleJedisException(e);
      throw e;
View Full Code Here

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

     * @param callback executable instance unider Pipeline
     */
    private void runWithPipeline(final JedisPipelinedCallback callback) {
        final Jedis jedis = jedisPool.getResource();
        try {
            final Pipeline pipeline = jedis.pipelined();
            callback.execute(pipeline);
            // use #sync(), not #exec()
            pipeline.sync();
        } finally {
            jedisPool.returnResource(jedis);
View Full Code Here

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

          String dateAsIntText = Integer.toString(LocalDateToIntConverter.convertToInt(entry.getKey()));
          htsMap.put(dateAsIntText, Double.toString(entry.getValue()));
          dates.put(Double.valueOf(dateAsIntText), dateAsIntText);
        }
       
        Pipeline pipeline = jedis.pipelined();
        pipeline.multi();
        String redisHtsDatapointKey = toRedisHtsDatapointKey(redisKey);
        pipeline.hmset(redisHtsDatapointKey, htsMap);
       
        String redisHtsDaysKey = toRedisHtsDaysKey(redisKey);
View Full Code Here

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

  @SuppressWarnings("unchecked")
  public Map<ExternalId, Map<String, String>> getLastKnownValues(final List<ExternalId> securities) {
    Map<ExternalId, Map<String, String>> result = Maps.newHashMap();
    JedisPool jedisPool = _redisConnector.getJedisPool();
    Jedis jedis = jedisPool.getResource();
    Pipeline pipeline = jedis.pipelined();
    //start transaction
    pipeline.multi();
    for (ExternalId identifier : securities) {
      String redisKey = generateRedisKey(identifier.getScheme().getName(), identifier.getValue(), getNormalizationRuleSetId());
      pipeline.hgetAll(redisKey);
View Full Code Here

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

        Jedis shard = jedis.getShard(idx.key());
        try {
            if (shard.exists(idx.cat(id).key())) {
                seek.remove(id, sfields);
            }
            Pipeline p = shard.pipelined();
            for (Map.Entry<String, String> field : fields.entrySet()) {
                idx.cat(field.getKey()).cat(field.getValue());
                String key = idx.key();
                p.zadd(key, order, id);
                p.rpush(idx.cat(id).key(), key);
View Full Code Here

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

            } catch (NumberFormatException e) {
                info.setTotal(0);
            }
            final Map<String, String> facets = shard.hgetAll(idx.cat(Seek.INFO)
                    .key());
            Pipeline p = shard.pipelined();
            for (String facetField : facets.keySet()) {
                p.hgetAll(idx.cat(Seek.INFO).cat(facetField).key());
            }
            List<Object> data = p.execute();
            getPool().returnResource(jedis);
View Full Code Here

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

        try {
            final Jedis shard = jedis.getShard(idx.key());
            shard.del(idx.cat(Seek.INFO).cat(Seek.TOTAL).key());
            final Map<String, String> facets = shard.hgetAll(idx.cat(Seek.INFO)
                    .key());
            Pipeline p = shard.pipelined();
            for (String facetField : facets.keySet()) {
                p.del(idx.cat(Seek.INFO).cat(facetField).key());
            }
            p.del(idx.cat(Seek.INFO).key());
            p.execute();
View Full Code Here

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

        Nest ndx = idx.fork();
        idx = ndx.cat(id).fork();
        ShardedJedis jedis = Seek.getPool().getResource();
        Jedis shard = jedis.getShard(ndx.key());
        try {
            Pipeline p = shard.pipelined();
            // List<String> indexes =
            p.lrange(idx.key(), 0, -1);
            // Map<String, String> fields =
            p.hgetAll(idx.cat(Seek.FIELDS).key());
            // List<String> tags =
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.