Package redis.clients.jedis

Examples of redis.clients.jedis.Pipeline.expire()


      Pipeline pipe = jedis.pipelined();
      pipe.del(key);
      for (String entry : entries) {
        pipe.sadd(key, entry);
      }
      pipe.expire(key, (int) TimeUnit.DAYS.toSeconds(7));
      pipe.sync();
    }
  }

  @Override
View Full Code Here


      String key = buildRedisUserRootCategoryKey(user);

      Pipeline pipe = jedis.pipelined();
      pipe.del(key);
      pipe.set(key, MAPPER.writeValueAsString(category));
      pipe.expire(key, (int) TimeUnit.MINUTES.toSeconds(30));
      pipe.sync();
    } catch (JsonProcessingException e) {
      log.error(e.getMessage(), e);
    }
  }
View Full Code Here

      String key = buildRedisUnreadCountKey(sub);

      Pipeline pipe = jedis.pipelined();
      pipe.del(key);
      pipe.set(key, MAPPER.writeValueAsString(count));
      pipe.expire(key, (int) TimeUnit.MINUTES.toSeconds(30));
      pipe.sync();
    } catch (Exception e) {
      log.error(e.getMessage(), e);
    }
  }
View Full Code Here

                    // elements in the result
                    count = (Long) execute.get(execute.size() - 3);
                } else {
                    pipeline.del(tmpkey);
                    pipeline.rename(rkey, rkeyCached);
                    pipeline.expire(rkeyCached, cache);
                    pipeline.del(rkey);
                    List<Object> execute = pipeline.execute();
                    // get zrange or zrevrange result
                    rawresult = (List<byte[]>) execute.get(execute.size() - 5);
                    // get the last zunionstore output, which is the number of
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.