Package java.util.concurrent.atomic

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


        AtomicLong value = accessCounts.get(path);
        if (value == null) {
            value = accessCounts.putIfAbsent(path, new AtomicLong(1));
        }
        if (value != null) {
            return value.incrementAndGet();
        }
        return 1;
    }

    public TestAmazonS3(AmazonS3 delegate, Settings componentSettings) {
View Full Code Here


     */
    /*package*/static void record( int propertyCount,
                                    int childrenCount ) {
        Stats key = new Stats(propertyCount, childrenCount);
        AtomicLong existing = DATA.putIfAbsent(key, new AtomicLong(1l));
        if (existing != null) existing.incrementAndGet();
    }

    public boolean isRecording() {
        return RECORD;
    }
View Full Code Here

            try
            {
               boolean firstTime = true;
               while (true)
               {
                  long id = messageIdGenerator.incrementAndGet();

                  // Each thread will Keep paging until all the messages are depaged.
                  // This is possible because the depage thread is not actually reading the pages.
                  // Just using the internal API to remove it from the page file system
                  ServerMessage msg = createMessage(id, storeImpl, destination, createRandomBuffer(id, 5));
View Full Code Here

      storeImpl2.startPaging();

      Assert.assertEquals(numberOfPages, storeImpl2.getNumberOfPages());

      long lastMessageId = messageIdGenerator.incrementAndGet();
      ServerMessage lastMsg = createMessage(lastMessageId, storeImpl, destination, createRandomBuffer(lastMessageId, 5));

      storeImpl2.forceAnotherPage();

      storeImpl2.page(lastMsg, new RoutingContextImpl(null));
View Full Code Here

                if (c == null)
                {
                    c = new AtomicLong();
                    timeoutsPerHost.put(ip, c);
                }
                c.incrementAndGet();
                // we only create AtomicLong instances here, so that the write
                // access to the hashmap happens single-threadedly.
                if (recentTimeoutsPerHost.get(ip) == null)
                    recentTimeoutsPerHost.put(ip, new AtomicLong());
View Full Code Here

                    {
                        final ServerMessage message = entry.getMessage();
                        if(message != null)
                        {
                            txn.dequeue(entry);
                            count.incrementAndGet();

                        }
                        return false;
                    }
                });
View Full Code Here

                    // do not run timer task as it was not allowed
                    return;
                }

                try {
                    long count = counter.incrementAndGet();

                    boolean fire = endpoint.getRepeatCount() <= 0 || count <= endpoint.getRepeatCount();
                    if (fire) {
                        sendTimerExchange(count);
                    } else {
View Full Code Here

            scanProgress.incrementAndGet();
            scanProgress.incrementAndGet();
            scanProgress.incrementAndGet();
            scanProgress.incrementAndGet();

            deleteProgress.incrementAndGet();
            deleteProgress.incrementAndGet();
            deleteProgress.incrementAndGet();

            wrapper.release(this.getClass().getCanonicalName());
        } catch(Exception e) {
View Full Code Here

            scanProgress.incrementAndGet();
            scanProgress.incrementAndGet();
            scanProgress.incrementAndGet();

            deleteProgress.incrementAndGet();
            deleteProgress.incrementAndGet();
            deleteProgress.incrementAndGet();

            wrapper.release(this.getClass().getCanonicalName());
        } catch(Exception e) {
            fail("Unexpected failure occurred : " + e);
View Full Code Here

            scanProgress.incrementAndGet();
            scanProgress.incrementAndGet();

            deleteProgress.incrementAndGet();
            deleteProgress.incrementAndGet();
            deleteProgress.incrementAndGet();

            wrapper.release(this.getClass().getCanonicalName());
        } catch(Exception e) {
            fail("Unexpected failure occurred : " + e);
        }
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.