Package redis.clients.jedis

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


        final byte[] key = (type + "." + firstEvent.getAggregateIdentifier()).getBytes(IOUtils.UTF8);
        jedis.watch(key);
        Long eventCount = jedis.llen(key);
        if ((firstEvent.getSequenceNumber() != 0 && eventCount == null)
                || firstEvent.getSequenceNumber() != eventCount) {
            jedis.unwatch();
            throw new ConcurrencyException(
                    String.format("Concurrent modification detected for Aggregate identifier [%s], sequence: [%s]",
                                  firstEvent.getAggregateIdentifier(),
                                  firstEvent.getSequenceNumber()));
        }
View Full Code Here


                if (oldState == null && oldStateStr != null) {
                    throw new SetFailedException();
                }
                if (oldState != null) {
                    if (oldStateStr == null || QCacheState.valueOf(oldStateStr) != oldState) {
                        j.unwatch();
                        throw new SetFailedException();
                    }
                }
            }
            Transaction tr = j.multi();
View Full Code Here

            Jedis j = jedis.getShard(redisKey);
            j.watch(redisKey);
          
            String val = j.get(redisKey);
            if (val != null) {
                j.unwatch();
                return false;
            }
            Transaction tr = j.multi();

            //sentinel expired. kick off new RevisibleProcessor job
View Full Code Here

         if (oldState == null && oldStateStr != null) {
           throw new SetFailedException();
         }
         if (oldState != null) {
           if (oldStateStr == null || QCacheState.valueOf(oldStateStr) != oldState) {
             j.unwatch();
             throw new SetFailedException();
           }
         }
       }
       Transaction tr = j.multi();
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.