Package redis.clients.jedis

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


    }

    try {
      // atomically remove ticket
      Transaction t = jedis.multi();
      t.del(key(repository, KeyType.ticket, ticket.number));
      t.del(key(repository, KeyType.journal, ticket.number));
      t.exec();

      success = true;
      log.debug("deleted ticket {} from Redis @ {}", "" + ticket.number, getUrl());
View Full Code Here


    try {
      // atomically remove ticket
      Transaction t = jedis.multi();
      t.del(key(repository, KeyType.ticket, ticket.number));
      t.del(key(repository, KeyType.journal, ticket.number));
      t.exec();

      success = true;
      log.debug("deleted ticket {} from Redis @ {}", "" + ticket.number, getUrl());
    } catch (JedisException e) {
View Full Code Here

    boolean success = false;
    try {
      Set<String> keys = jedis.keys(repository.name + ":*");
      if (keys.size() > 0) {
        Transaction t = jedis.multi();
        t.del(keys.toArray(new String[keys.size()]));
        t.exec();
      }
      success = true;
    } catch (JedisException e) {
      log.error("failed to delete all tickets in Redis @ " + getUrl(), e);
View Full Code Here

    boolean success = false;
    try {
      Set<String> keys = jedis.keys(repository.name + ":*");
      if (keys.size() > 0) {
        Transaction t = jedis.multi();
        t.del(keys.toArray(new String[keys.size()]));
        t.exec();
      }
      success = true;
    } catch (JedisException e) {
      log.error("failed to delete all tickets in Redis @ " + getUrl(), e);
View Full Code Here

    }

    try {
      // atomically remove ticket
      Transaction t = jedis.multi();
      t.del(key(repository, KeyType.ticket, ticket.number));
      t.del(key(repository, KeyType.journal, ticket.number));
      t.exec();

      success = true;
      log.debug("deleted ticket {} from Redis @ {}", "" + ticket.number, getUrl());
View Full Code Here

    try {
      // atomically remove ticket
      Transaction t = jedis.multi();
      t.del(key(repository, KeyType.ticket, ticket.number));
      t.del(key(repository, KeyType.journal, ticket.number));
      t.exec();

      success = true;
      log.debug("deleted ticket {} from Redis @ {}", "" + ticket.number, getUrl());
    } catch (JedisException e) {
View Full Code Here

        lockName = "lock:" + lockName;
        while (true) {
            conn.watch(lockName);
            if (identifier.equals(conn.get(lockName))) {
                Transaction trans = conn.multi();
                trans.del(lockName);
                List<Object> result = trans.exec();
                // null response indicates that the transaction was aborted due
                // to the watched key changing.
                if (result == null){
                    continue;
View Full Code Here

            if (!String.valueOf(uid).equals(conn.hget(key, "uid"))) {
                return false;
            }

            Transaction trans = conn.multi();
            trans.del(key);
            trans.zrem("profile:" + uid, String.valueOf(statusId));
            trans.zrem("home:" + uid, String.valueOf(statusId));
            trans.hincrBy("user:" + uid, "posts", -1);
            trans.exec();
View Full Code Here

        while (true){
            conn.watch(lockKey);
            if (identifier.equals(conn.get(lockKey))){
                Transaction trans = conn.multi();
                trans.del(lockKey);
                List<Object> results = trans.exec();
                if (results == null){
                    continue;
                }
                return true;
View Full Code Here

            trans.zunionstore(
                destination,
                new ZParams().aggregate(ZParams.Aggregate.MAX),
                destination, tkey2);

            trans.del(tkey1, tkey2);
            trans.zincrby(destination, 1, "count");
            trans.zincrby(destination, value, "sum");
            trans.zincrby(destination, value * value, "sumsq");

            List<Object> results = trans.exec();
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.