Examples of decrementAndGet()


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

                }
                sync.countDown();
            }

            public void messageSendFailed(ApnsNotification message, Throwable e) {
                numSent.decrementAndGet();
            }

            public void connectionClosed(DeliveryError e, int messageIdentifier) {
            }
View Full Code Here

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

                }
                sync.getAndDecrement();
            }

            public void messageSendFailed(ApnsNotification message, Throwable e) {
                numSent.decrementAndGet();
                sync.incrementAndGet();
            }

            public void connectionClosed(DeliveryError e, int messageIdentifier) {
            }
View Full Code Here

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

                exceptionHandler.handle(result.cause());
              }
            }

            // Decrement the handler count.
            handlerCount.decrementAndGet();

            // We need to handle for cases where the end handler was called
            // before all the data was written to the file.
            if (complete.get() && handlerCount.get() == 0) {
              closeFile(filePath, file);
View Full Code Here

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

  /** Release a previously saved commit point */
  public synchronized void releaseCommitPoint(Long indexCommitVersion) {
    AtomicInteger reserveCount = savedCommits.get(indexCommitVersion);
    if (reserveCount == null) return;// this should not happen
    if (reserveCount.decrementAndGet() <= 0) {
      savedCommits.remove(indexCommitVersion);
    }
  }


View Full Code Here

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()

    node_monitors.putIfAbsent(caller, new AtomicInteger());
    AtomicInteger ami = node_monitors.get(caller);
    if (on) {
      ami.incrementAndGet();
    } else {
      ami.decrementAndGet();
    }
  }

  /*==================== Monitoring of node changes in general ==========*/

 
View Full Code Here

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

    for (Map.Entry<EHandle,AtomicInteger> ent : node_monitors.entrySet()) {
      EHandle handle = ent.getKey();
      AtomicInteger howmany = ent.getValue();
     
      ETuple nd = ETuple.make(am_nodedown, this.node());
      while (howmany.decrementAndGet() >= 0) {     
        handle.send(sender, nd);
      }
    }
   
    node_monitors.clear();
View Full Code Here

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

    if (!client.hasError()) {
      getQueue(connection).put(client);
    } else {
      AtomicInteger counter = _numberOfConnections.get(connection.getHost());
      if (counter != null) {
        counter.decrementAndGet();
      }
    }
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
View Full Code Here

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

    @Override
    public void onError(Exception exception) {
      AtomicInteger counter = _pool._numberOfConnections.get(_connection.getHost());
      if (counter != null) {
        counter.decrementAndGet();
      }
      _realCallback.onError(exception);
      _pool.closeAndRemoveTransport(_client);
    }
  }
View Full Code Here

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

      // "head Norm" can be changed:
      assert refCount == 1;
      final AtomicInteger oldRef = bytesRef;
      bytes = owner.cloneNormBytes(bytes);
      bytesRef = new AtomicInteger(1);
      oldRef.decrementAndGet();
    }
    dirty = true;
    return bytes;
  }
 
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.