Examples of incrementAndGet()


Examples of java.util.concurrent.atomic.AtomicInteger.incrementAndGet()

        final ServiceRegistration eh1 = this.registerJobConsumer(TOPIC,
                new JobConsumer() {

            @Override
            public JobResult process(final Job job) {
                count.incrementAndGet();

                return JobResult.OK;
            }
         });
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.incrementAndGet()

        final String id = UUID.randomUUID().toString();
        final AtomicInteger counter = new AtomicInteger(Integer.MIN_VALUE);
        final HealthCheck hc = new HealthCheck() {
            @Override
            public Result execute() {
                final int v = counter.incrementAndGet();
                return new Result(Result.Status.OK, "counter is now " + v);
            }
           
        };
       
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.incrementAndGet()

              Result result = region.get(g);
              assertEquals(result.getValue(fam1, qual1).length, result.getValue(fam1, qual2).length);
              assertEquals(result.getValue(fam1, qual1).length, result.getValue(fam2, qual3).length);
            } catch (IOException e) {
              e.printStackTrace();
              failures.incrementAndGet();
              fail();
            }
          }
        }
      };
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLong.incrementAndGet()

            startLatch.countDown();
            startLatch.await();
            // half batch, half do not
            if(id % 2 == 0) {
              for(String s : expected) {
                wal.writeEntry(new WALEntry<Text>(new Text(s), seqid.incrementAndGet()));
              }
            } else {
              List<WALEntry<Text>> batch = Lists.newArrayList();
              for(String s : expected) {
                batch.add(new WALEntry<Text>(new Text(s), seqid.incrementAndGet()));
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLong.incrementAndGet()

                wal.writeEntry(new WALEntry<Text>(new Text(s), seqid.incrementAndGet()));
              }
            } else {
              List<WALEntry<Text>> batch = Lists.newArrayList();
              for(String s : expected) {
                batch.add(new WALEntry<Text>(new Text(s), seqid.incrementAndGet()));
              }
              wal.writeEntries(batch);
            }
          } catch (Exception e) {
            logger.warn("Error doing appends", e);
View Full Code Here

Examples of net.kuujo.vertigo.cluster.data.AsyncCounter.incrementAndGet()

      @Override
      public void handle(AsyncResult<Cluster> result) {
        assertTrue(result.succeeded());
        final Cluster cluster = new DefaultCluster("test", vertx, container);
        final AsyncCounter data = cluster.getCounter("test-counter-increment");
        data.incrementAndGet(new Handler<AsyncResult<Long>>() {
          @Override
          public void handle(AsyncResult<Long> result) {
            assertTrue(result.succeeded());
            assertTrue(result.result() == 1);
            data.increment(new Handler<AsyncResult<Void>>() {
View Full Code Here

Examples of net.rubyeye.xmemcached.Counter.incrementAndGet()

  public void testCounter() throws Exception {
    Counter counter = memcachedClient.getCounter("a");
    Assert.assertEquals(0, counter.get());
    Assert.assertEquals(0, counter.get());

    Assert.assertEquals(1, counter.incrementAndGet());
    Assert.assertEquals(2, counter.incrementAndGet());
    Assert.assertEquals(3, counter.incrementAndGet());

    Assert.assertEquals(2, counter.decrementAndGet());
    Assert.assertEquals(1, counter.decrementAndGet());
View Full Code Here

Examples of objd.concurrent.AtomicInt.incrementAndGet()

            while(__il__3i.hasNext()) {
                final Promise<Void> p = __il__3i.next();
                DispatchQueue.aDefault.asyncF(new P0() {
                    @Override
                    public void apply() {
                        count.incrementAndGet();
                        p.successValue(null);
                    }
                });
            }
        }
View Full Code Here

Examples of org.jgroups.blocks.atomic.Counter.incrementAndGet()

                                        "[4] Create counter [5] Delete counter\n" +
                                        "[6] Print counters [7] Get counter\n" +
                                        "[8] Increment 1M times [9] Dump pending requests [x] Exit\n");
                switch(key) {
                    case '1':
                        long val=counter.incrementAndGet();
                        System.out.println("counter: " + val);
                        break;
                    case '2':
                        val=counter.decrementAndGet();
                        System.out.println("counter: " + val);
View Full Code Here

Examples of org.wso2.throttle.ConcurrentAccessController.incrementAndGet()

                                    //rate based throttling have enabled ,
                                    //if the access rate less than maximum concurrent access ,
                                    //then it is possible to occur death situation.To avoid that reset,
                                    //if the access has denied by rate based throttling
                                    if (cac != null) {
                                        cac.incrementAndGet();
                                        // set back if this is a clustered env
                                        if (isClusteringEnable) {
                                            cc.setProperty(key, cac);
                                            //replicate the current state of ConcurrentAccessController
                                            try {
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.