Examples of multi()


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

    }

    boolean success = false;
    try {
      Set<String> oldKeys = jedis.keys(oldRepository.name + ":*");
      Transaction t = jedis.multi();
      for (String oldKey : oldKeys) {
        String newKey = newRepository.name + oldKey.substring(oldKey.indexOf(':'));
        t.rename(oldKey, newKey);
      }
      t.exec();
View Full Code Here

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

      return false;
    }

    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;
View Full Code Here

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

      String object = TicketSerializer.serialize(ticket);
      String journal = TicketSerializer.serialize(change);

      // atomically store ticket
      Transaction t = jedis.multi();
      t.set(key(repository, KeyType.ticket, ticketId), object);
      t.rpush(key(repository, KeyType.journal, ticketId), journal);
      t.exec();

      log.debug("updated ticket {} in Redis @ {}", "" + ticketId, getUrl());
View Full Code Here

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

    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) {
View Full Code Here

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

    }

    boolean success = false;
    try {
      Set<String> oldKeys = jedis.keys(oldRepository.name + ":*");
      Transaction t = jedis.multi();
      for (String oldKey : oldKeys) {
        String newKey = newRepository.name + oldKey.substring(oldKey.indexOf(':'));
        t.rename(oldKey, newKey);
      }
      t.exec();
View Full Code Here

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

    public static List<?> tx(JedisAtom jedisAtom) {
        List<?> result = null;
        Jedis jedis = pool.getResource();
        try {
            Transaction trans = jedis.multi();
            jedisAtom.action(trans);
            result = trans.exec();
        }catch (Exception e){
            LOG.error(e.getMessage(), e);
        }finally {
View Full Code Here

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

      final Jedis j = pool.getResource();
      try {
        j.select(db);
        List<Object> results;
        do {
          results = j.multi(new TransactionBlock() {
            @Override
            public void execute() throws JedisException {
              mget(row + s, row + v, row + d);
            }
          });
View Full Code Here

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

          j.set(schemaKey + z, doc);
        }
        final String finalSchemaKey = schemaKey;
        List<Object> results;
        do {
          results = j.multi(new TransactionBlock() {
            @Override
            public void execute() throws JedisException {
              incr(row + v);
              mset(row + s, finalSchemaKey, row + d, new String(serialize(value), UTF8));
            }
View Full Code Here

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

            (versionStr != null && !versionStr.equals(String.valueOf(version))) // version in db doesn't match
            ) {
          return false;
        }
        final String finalSchemaKey = schemaKey;
        List<Object> results = j.multi(new TransactionBlock() {
          @Override
          public void execute() throws JedisException {
            mset(row + v, String.valueOf(version + 1), row + s, finalSchemaKey, row + d, new String(serialize(value), UTF8));
          }
        });
View Full Code Here

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

      Jedis j = pool.getResource();
      try {
        j.select(db);
        List<Object> results;
        do {
          results = j.multi(new TransactionBlock() {
            @Override
            public void execute() throws JedisException {
              del(row + v); // Delete the version first and it is deleted
              del(row + d);
              del(row + s);
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.