Package java.util.concurrent.atomic

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


        }
      };

      @Override
      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        long requestNumber = _requestCounter.incrementAndGet();
        String requestId = prefix + "-" + requestNumber;
        String connectionString;
        if (controller) {
          ControllerServerContext controllerServerContext = ControllerServerContext.getShardServerContext();
          connectionString = controllerServerContext.getConnectionString();
View Full Code Here


      blockCacheKey.setFile(file);

      if (blockCache.fetch(blockCacheKey, buffer)) {
        hitsInCache.incrementAndGet();
      } else {
        missesInCache.incrementAndGet();
      }

      byte[] testData = testData(random, blockSize, newData);
      long t1 = System.nanoTime();
      boolean store = blockCache.store(blockCacheKey, 0, testData, 0, blockSize);
View Full Code Here

                long start = System.currentTimeMillis();
                try {
                    long end = System.currentTimeMillis();
                    while (end - start < 3000) {
                        if (consumer.receive(1000) != null) {
                            received.incrementAndGet();
                        }
                        Thread.sleep(100);
                        end = System.currentTimeMillis();
                    }
                    consumer.close();
View Full Code Here

                            + node.getMessageId().getProducerSequenceId());
                }
                assertEquals("is in order", enqueueCounter.get(), node
                        .getMessageId().getProducerSequenceId());
                receivedLatch.countDown();
                enqueueCounter.incrementAndGet();
                node.decrementReferenceCount();
            }

            public void add(ConnectionContext context, Destination destination)
                    throws Exception {
View Full Code Here

    {
        final AtomicLong newCount = new AtomicLong(1) ;
        final AtomicLong count = eprs.putIfAbsent(epr, newCount) ;
        if (count != null)
        {
            count.incrementAndGet() ;
        }
    }

    /**
     * Class representing the service information
View Full Code Here

    {
        final AtomicLong newCount = new AtomicLong(1) ;
        final AtomicLong count = eprs.putIfAbsent(epr, newCount) ;
        if (count != null)
        {
            count.incrementAndGet() ;
        }
    }

    /**
     * Remove the service info from the current map.
View Full Code Here

                try {
                    if(LOG.isDebugEnabled()) {
                        LOG.debug("Got my message: " + message);
                    }
                    receivedOneCondition.countDown();
                    received.incrementAndGet();
                    waitCondition.await(5, TimeUnit.MINUTES);
                    if(LOG.isDebugEnabled()) {
                        LOG.debug("acking message: " + message);
                    }
                    message.acknowledge();
View Full Code Here

        final AtomicLong received = new AtomicLong();
        sub = session.createDurableSubscriber(destination, "mySub");
        sub.setMessageListener(new MessageListener() {
            @Override
            public void onMessage(Message message) {
                received.incrementAndGet();
            }
        });

        LOG.info("Waiting for messages to arrive");
View Full Code Here

        System.out.println("Starting: " + INDEX_COUNT + " consumers");
        for (int i = 0; i < INDEX_COUNT; i++) {
            consumers[i] = new Consumer("test-" + i) {
                public void onConsumed(long counter) {
                    consumedRecords.incrementAndGet();
                }
            };
            consumers[i].start();
        }
View Full Code Here

            @Override
            public void collect(int docNumber) throws IOException
            {
                deleteLucandraDocument(indexName, docNumber, autoCommit);
                numRemoved.incrementAndGet();
               
                //delete the id reference
                rm.delete(new QueryPath(CassandraUtils.schemaInfoColumnFamily, ByteBufferUtil.bytes(Integer.toString(docNumber))), System.currentTimeMillis()-1);
              
            }
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.