Examples of ltrim()


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

  @Override
  public void ltrim(String key, long start, long end) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      jedis.ltrim(key, start, end);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

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

  @Override
  public void ltrim(String key, long start, long end) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      jedis.ltrim(key, start, end);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

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

    public void logRecent(Jedis conn, String name, String message, String severity) {
        String destination = "recent:" + name + ':' + severity;
        Pipeline pipe = conn.pipelined();
        pipe.lpush(destination, TIMESTAMP.format(new Date()) + ' ' + message);
        pipe.ltrim(destination, 0, 99);
        pipe.sync();
    }

    public void logCommon(Jedis conn, String name, String message) {
        logCommon(conn, name, message, INFO, 5000);
View Full Code Here

Examples of redis.clients.jedis.Transaction.ltrim()

    public void addUpdateContact(Jedis conn, String user, String contact) {
        String acList = "recent:" + user;
        Transaction trans = conn.multi();
        trans.lrem(acList, 0, contact);
        trans.lpush(acList, contact);
        trans.ltrim(acList, 0, 99);
        trans.exec();
    }

    public void removeContact(Jedis conn, String user, String contact) {
        conn.lrem("recent:" + user, 0, contact);
View Full Code Here

Examples of redis.clients.jedis.Transaction.ltrim()

            trans.zincrby(commonDest, 1, message);

            String recentDest = "recent:" + name + ':' + severity;
            trans.lpush(recentDest, TIMESTAMP.format(new Date()) + ' ' + message);
            trans.ltrim(recentDest, 0, 99);
            List<Object> results = trans.exec();
            // null response indicates that the transaction was aborted due to
            // the watched key changing.
            if (results == null){
                continue;
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.