Package redis.clients.jedis

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


    @Test
    public void multi() {
  Pipeline p = jedis.pipelined();
  p.multi();
  Response<Long> r1 = p.hincrBy("a", "f1", -1);
  Response<Long> r2 = p.hincrBy("a", "f1", -2);
  Response<List<Object>> r3 = p.exec();
  List<Object> result = p.syncAndReturnAll();

  assertEquals(new Long(-1), r1.get());
View Full Code Here


    @Test
    public void multi() {
  Pipeline p = jedis.pipelined();
  p.multi();
  Response<Long> r1 = p.hincrBy("a", "f1", -1);
  Response<Long> r2 = p.hincrBy("a", "f1", -2);
  Response<List<Object>> r3 = p.exec();
  List<Object> result = p.syncAndReturnAll();

  assertEquals(new Long(-1), r1.get());
  assertEquals(new Long(-3), r2.get());
View Full Code Here

            p.watch(keys.COUNTS_KEY, keys.BITS_KEY);

            List<Long> counts;
            List<Response<Long>> responses = new ArrayList<>(config().hashes());
            for (String position : hashesString) {
                responses.add(p.hincrBy(keys.COUNTS_KEY, position, -1));
            }
            p.sync();
            counts = responses.stream().map(Response::get).collect(Collectors.toList());

            while (true) {
View Full Code Here

            p.watch(keys.COUNTS_KEY, keys.BITS_KEY);

            List<Long> counts;
            List<Response<Long>> responses = new ArrayList<>(config().hashes());
            for (String position : hashesString) {
                responses.add(p.hincrBy(keys.COUNTS_KEY, position, -1));
            }
            p.sync();
            counts = responses.stream().map(Response::get).collect(Collectors.toList());

            while (true) {
View Full Code Here

                p.rpush(idx.cat(id).key(), key);
                p.hset(idx.cat(id).cat(Seek.FIELDS).key(), field.getKey(),
                        field.getValue());

                // adds on facets
                p.hincrBy(idx.cat(Seek.INFO).cat(field.getKey()).key(), field
                        .getValue(), 1);
                p.hincrBy(idx.cat(Seek.INFO).key(), field.getKey(), 1);
            }
            for (String tag : tags) {
                idx.cat(tag);
View Full Code Here

                        field.getValue());

                // adds on facets
                p.hincrBy(idx.cat(Seek.INFO).cat(field.getKey()).key(), field
                        .getValue(), 1);
                p.hincrBy(idx.cat(Seek.INFO).key(), field.getKey(), 1);
            }
            for (String tag : tags) {
                idx.cat(tag);
                String key = idx.key();
                p.zadd(key, order, id);
View Full Code Here

                p.zadd(key, order, id);
                p.rpush(idx.cat(id).key(), key);
                p.rpush(idx.cat(id).cat(Seek.TAGS).key(), tag);

                // adds on facets
                p.hincrBy(idx.cat(Seek.INFO).cat(Seek.TAGS).key(), tag, 1);
                p.hincrBy(idx.cat(Seek.INFO).key(), Seek.TAGS, 1);
            }
            for (Map.Entry<String, Set<String>> field : textFields.entrySet()) {
                for (String word : field.getValue()) {
                    idx.cat(field.getKey()).cat(word);
View Full Code Here

                p.rpush(idx.cat(id).key(), key);
                p.rpush(idx.cat(id).cat(Seek.TAGS).key(), tag);

                // adds on facets
                p.hincrBy(idx.cat(Seek.INFO).cat(Seek.TAGS).key(), tag, 1);
                p.hincrBy(idx.cat(Seek.INFO).key(), Seek.TAGS, 1);
            }
            for (Map.Entry<String, Set<String>> field : textFields.entrySet()) {
                for (String word : field.getValue()) {
                    idx.cat(field.getKey()).cat(word);
                    String key = idx.key();
View Full Code Here

            for (byte[] index : indexes) {
                p.zrem(SafeEncoder.encode(index), id);
            }
            p.del(idx.key());
            for (byte[] tag : tags) {
                p.hincrBy(ndx.cat(Seek.INFO).cat(Seek.TAGS).key(), SafeEncoder
                        .encode(tag), -1);
            }
            Iterator<byte[]> iterator = fields.iterator();
            while (iterator.hasNext()) {
                String field = SafeEncoder.encode(iterator.next());
View Full Code Here

            }
            Iterator<byte[]> iterator = fields.iterator();
            while (iterator.hasNext()) {
                String field = SafeEncoder.encode(iterator.next());
                String key = SafeEncoder.encode(iterator.next());
                p.hincrBy(ndx.cat(Seek.INFO).key(), field, -1);
                p.hincrBy(ndx.cat(Seek.INFO).cat(field).key(), key, -1);
            }
            p.del(idx.cat(Seek.FIELDS).key());
            p.del(idx.cat(Seek.TAGS).key());
            p.execute();
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.