Examples of decrementAndGet()


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

    // clone the BitVector, create a new deletedDocsRef
    if (deletedDocsRef.get() > 1) {
      AtomicInteger oldRef = deletedDocsRef;
      deletedDocs = cloneDeletedDocs(deletedDocs);
      deletedDocsRef = new AtomicInteger(1);
      oldRef.decrementAndGet();
    }
    deletedDocsDirty = true;
    if (!deletedDocs.getAndSet(docNum)) {
      pendingDeleteCount++;
    }
View Full Code Here

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

        channel.getAsyncIn().write(new Buffer(message))
                .addListener(new SshFutureListener<IoWriteFuture>() {
                    public void operationComplete(IoWriteFuture future) {
                        try {
                            if (future.isWritten()) {
                                if (writes.decrementAndGet() > 0) {
                                    channel.getAsyncIn().write(new Buffer(message)).addListener(this);
                                } else {
                                    channel.getAsyncIn().close(false);
                                }
                            } else {
View Full Code Here

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

                public CloseFuture close(boolean immediately) {
                    final AtomicInteger count = new AtomicInteger(closeables.length);
                    if (closing.compareAndSet(false, true)) {
                        SshFutureListener<CloseFuture> listener = new SshFutureListener<CloseFuture>() {
                            public void operationComplete(CloseFuture f) {
                                if (count.decrementAndGet() == 0) {
                                    future.setClosed();
                                }
                            }
                        };
                        for (Closeable c : closeables) {
View Full Code Here

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

        final CloseFuture future = new DefaultCloseFuture(lock);
        if (futures.length > 0) {
            final AtomicInteger count = new AtomicInteger(futures.length);
            SshFutureListener<T> listener = new SshFutureListener<T>() {
                public void operationComplete(T f) {
                    if (count.decrementAndGet() == 0) {
                        future.setClosed();
                    }
                }
            };
            for (SshFuture<T> f : futures) {
View Full Code Here

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

                        responseHandler.response(null);
                }
                finally
                {
                    totalHintsInProgress.decrementAndGet();
                    targetHints.decrementAndGet();
                }
            }
        };

        return (Future<Void>) StageManager.getStage(Stage.MUTATION).submit(runnable);
View Full Code Here

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

               e.printStackTrace();
               this.e = e;
            }
            finally
            {
               aliveProducers.decrementAndGet();
            }
         }
      }

      class ReaderThread extends Thread
View Full Code Here

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

        executor = new ThreadPoolExecutor(getMinSpareThreads(), getMaxThreads(), maxIdleTime, TimeUnit.MILLISECONDS,taskqueue, tf) {
      @Override
      protected void afterExecute(Runnable r, Throwable t) {
        AtomicInteger atomic = submittedTasksCount;
        if(atomic!=null) {
          atomic.decrementAndGet();
        }
      }
        };
        taskqueue.setParent( (ThreadPoolExecutor) executor);
        submittedTasksCount = new AtomicInteger();
View Full Code Here

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

                        responseHandler.response(null);
                }
                finally
                {
                    totalHintsInProgress.decrementAndGet();
                    targetHints.decrementAndGet();
                }
            }
        };

        return (Future<Void>) StageManager.getStage(Stage.MUTATION).submit(runnable);
View Full Code Here

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

   */
  protected void decTaskCounters(Collection<byte[]> regions, ServerName sn) {
    for (byte[] regBytes : regions) {
      String encodedRegionName = HRegionInfo.encodeRegionName(regBytes);
      AtomicInteger regionCnt = taskCounterPerRegion.get(encodedRegionName);
      regionCnt.decrementAndGet();
    }

    taskCounterPerServer.get(sn).decrementAndGet();

    tasksDone.incrementAndGet();
View Full Code Here

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

    Thread t = new Thread(){
      @Override
      public void run(){
        Threads.sleep(1000);
        Assert.assertFalse(checkPoint.get());
        ai.decrementAndGet();
        ap.tasksDone.incrementAndGet();
        checkPoint2.set(true);
      }
    };
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.