Examples of decrementAndGet()


Examples of com.hazelcast.core.IAtomicLong.decrementAndGet()

    @Test
    @ClientCompatibleTest
    public void testDecrementAndGet(){
        HazelcastInstance hzInstance = createHazelcastInstance();
        IAtomicLong atomicNumber = hzInstance.getAtomicLong(randomString());
        assertEquals(-1,atomicNumber.decrementAndGet());
        assertEquals(-2,atomicNumber.decrementAndGet());
    }

    @Test
    @ClientCompatibleTest
View Full Code Here

Examples of edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger.decrementAndGet()

            public boolean iterate() {
                if( queue.get()==0 ) {
                    return false;
                } else {
                    while(queue.get()>0) {
                        queue.decrementAndGet();
                        counter.incrementAndGet();
                    }
                    iterations.incrementAndGet();
                    if (counter.get()==ENQUEUE_COUNT)
                        doneCountDownLatch.countDown();
View Full Code Here

Examples of io.vertx.core.shareddata.Counter.decrementAndGet()

    getVertx().sharedData().getCounter("foo", ar -> {
      Counter counter = ar.result();
      assertNullPointerException(() -> counter.get(null));
      assertNullPointerException(() -> counter.incrementAndGet(null));
      assertNullPointerException(() -> counter.getAndIncrement(null));
      assertNullPointerException(() -> counter.decrementAndGet(null));
      assertNullPointerException(() -> counter.addAndGet(1, null));
      assertNullPointerException(() -> counter.getAndAdd(1, null));
      assertNullPointerException(() -> counter.compareAndSet(1, 1, null));
      testComplete();
    });
View Full Code Here

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

    }
  }

  private void disposeIfNecessary(IndexSearcher currentSearcher) {
    AtomicInteger referenceCount = fSearchers.get(currentSearcher);
    if (referenceCount.decrementAndGet() == 0 && fSearcher != currentSearcher) {
      try {
        /*
         * May be called by getCurrentSearcher at the same time, but safe
         * because dispose is safe to be called many times for the same
         * searcher.
 
View Full Code Here

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

            if (score == null) {
                this.map.put(obj, new AtomicInteger(-1));
                return;
            }
        }
        score.decrementAndGet();
    }
   
    public void set(final E obj, final int newScore) {
        if (obj == null) return;
        AtomicInteger score;
View Full Code Here

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

        AtomicInteger i = count.get();
        if (i == null) {
            // we should never get here...
            throw new IllegalStateException();
        }
        i.decrementAndGet();
    }
}
View Full Code Here

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

  }
  @Override
  protected void decrementFileID(int fileID) {
    AtomicInteger counter = logFileIDReferenceCounts.get(fileID);
    Preconditions.checkState(counter != null, "null counter ");
    int count = counter.decrementAndGet();
    if(count == 0) {
      logFileIDReferenceCounts.remove(fileID);
    }
  }
View Full Code Here

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

  }
  @Override
  protected void decrementFileID(int fileID) {
    AtomicInteger counter = logFileIDReferenceCounts.get(fileID);
    Preconditions.checkState(counter != null, "null counter ");
    int count = counter.decrementAndGet();
    if(count == 0) {
      logFileIDReferenceCounts.remove(fileID);
    }
  }
View Full Code Here

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

            public void matchCreated( MatchCreatedEvent event ) {
                i.incrementAndGet();
            }

            public void matchCancelled( MatchCancelledEvent event ) {
                i.decrementAndGet();
            }
        } );

        ksession.insert(new SimpleEvent());
        ksession.fireAllRules();
View Full Code Here

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

                        if ("sling/orderedtest/start".equals(job.getTopic()) ) {
                            cb.block();
                            return JobResult.OK;
                        }
                        if ( parallelCount.incrementAndGet() > 1 ) {
                            parallelCount.decrementAndGet();
                            return JobResult.FAILED;
                        }
                        final String topic = job.getTopic();
                        if ( topic.endsWith("sub1") ) {
                            final int i = (Integer)job.getProperty(Job.PROPERTY_JOB_RETRY_COUNT);
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.