Examples of compareAndSet()


Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

                completion.submit(new Callable<Exchange>() {
                    public Exchange call() throws Exception {
                        // only start the aggregation task when the task is being executed to avoid staring
                        // the aggregation task to early and pile up too many threads
                        if (aggregationTaskSubmitted.compareAndSet(false, true)) {
                            // but only submit the task once
                            aggregateExecutorService.submit(aggregateOnTheFlyTask);
                        }

                        if (!running.get()) {
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

                public boolean isClosing() {
                    return closing.get();
                }
                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();
                                }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

                }
                public boolean isClosing() {
                    return closing.get();
                }
                public CloseFuture close(final boolean immediately) {
                    if (closing.compareAndSet(false, true)) {
                        final Iterator<Closeable> iterator = Arrays.asList(closeables).iterator();
                        SshFutureListener<CloseFuture> listener = new SshFutureListener<CloseFuture>() {
                            public void operationComplete(CloseFuture previousFuture) {
                                while (iterator.hasNext()) {
                                    Closeable c = iterator.next();
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

  boolean wasClosedHandlerCalled(HRegionInfo hri) {
    AtomicBoolean b = closedRegionHandlerCalled.get(hri);
    //compareAndSet to be sure that unit tests don't see stale values. Means,
    //we will return true exactly once unless the handler code resets to true
    //this value.
    return b == null ? false : b.compareAndSet(true, false);
  }

  //For unit tests only
  boolean wasOpenedHandlerCalled(HRegionInfo hri) {
    AtomicBoolean b = openedRegionHandlerCalled.get(hri);
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

  boolean wasOpenedHandlerCalled(HRegionInfo hri) {
    AtomicBoolean b = openedRegionHandlerCalled.get(hri);
    //compareAndSet to be sure that unit tests don't see stale values. Means,
    //we will return true exactly once unless the handler code resets to true
    //this value.
    return b == null ? false : b.compareAndSet(true, false);
  }

  //For unit tests only
  void initializeHandlerTrackers() {
    closedRegionHandlerCalled = new HashMap<HRegionInfo, AtomicBoolean>();
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

                completion.submit(new Callable<Exchange>() {
                    public Exchange call() throws Exception {
                        // only start the aggregation task when the task is being executed to avoid staring
                        // the aggregation task to early and pile up too many threads
                        if (aggregationTaskSubmitted.compareAndSet(false, true)) {
                            // but only submit the task once
                            aggregateExecutorService.submit(aggregateOnTheFlyTask);
                        }

                        if (!running.get()) {
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

  boolean wasClosedHandlerCalled(HRegionInfo hri) {
    AtomicBoolean b = closedRegionHandlerCalled.get(hri);
    //compareAndSet to be sure that unit tests don't see stale values. Means,
    //we will return true exactly once unless the handler code resets to true
    //this value.
    return b == null ? false : b.compareAndSet(true, false);
  }

  //For unit tests only
  boolean wasOpenedHandlerCalled(HRegionInfo hri) {
    AtomicBoolean b = openedRegionHandlerCalled.get(hri);
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

  boolean wasOpenedHandlerCalled(HRegionInfo hri) {
    AtomicBoolean b = openedRegionHandlerCalled.get(hri);
    //compareAndSet to be sure that unit tests don't see stale values. Means,
    //we will return true exactly once unless the handler code resets to true
    //this value.
    return b == null ? false : b.compareAndSet(true, false);
  }

  //For unit tests only
  void initializeHandlerTrackers() {
    closedRegionHandlerCalled = new HashMap<HRegionInfo, AtomicBoolean>();
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

                completion.submit(new Callable<Exchange>() {
                    public Exchange call() throws Exception {
                        // only start the aggregation task when the task is being executed to avoid staring
                        // the aggregation task to early and pile up too many threads
                        if (aggregationTaskSubmitted.compareAndSet(false, true)) {
                            // but only submit the task once
                            aggregateExecutorService.submit(aggregateOnTheFlyTask);
                        }

                        if (!running.get()) {
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicBoolean.compareAndSet()

  boolean wasClosedHandlerCalled(HRegionInfo hri) {
    AtomicBoolean b = closedRegionHandlerCalled.get(hri);
    //compareAndSet to be sure that unit tests don't see stale values. Means,
    //we will return true exactly once unless the handler code resets to true
    //this value.
    return b == null ? false : b.compareAndSet(true, false);
  }

  //For unit tests only
  boolean wasOpenedHandlerCalled(HRegionInfo hri) {
    AtomicBoolean b = openedRegionHandlerCalled.get(hri);
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.