Examples of incrementAndGet()


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

                    {
                        @Override
                        public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleeper)
                        {
                            semaphore.release();
                            if ( retries.incrementAndGet() == MAX_RETRIES )
                            {
                                try
                                {
                                    server = new TestingServer(serverPort);
                                }
View Full Code Here

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

    AtomicInteger counter = logFileIDReferenceCounts.get(fileID);
    if(counter == null) {
      counter = new AtomicInteger(0);
      logFileIDReferenceCounts.put(fileID, counter);
    }
    counter.incrementAndGet();
  }
  @Override
  protected void decrementFileID(int fileID) {
    AtomicInteger counter = logFileIDReferenceCounts.get(fileID);
    Preconditions.checkState(counter != null, "null counter ");
View Full Code Here

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

          // Make sure that regions are assigned to server
          if (value != null && value.length > 0) {
            hostAndPort = Bytes.toString(value);
          }
          if (!(info.isOffline() || info.isSplit()) && hostAndPort != null) {
            actualRegCount.incrementAndGet();
          }
          return true;
        }
      };
      MetaScanner.metaScan(conf, visitor, desc.getName());
View Full Code Here

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

                        {
                            i = new AtomicInteger(1);
                            invalidMutations.put(ex.cfId, i);
                        }
                        else
                            i.incrementAndGet();
                        continue;
                    }
                   
                    if (logger.isDebugEnabled())
                        logger.debug(String.format("replaying mutation for %s.%s: %s",
View Full Code Here

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

                // with the class name in the map.
                newThreadId = 1;
                threadIds.put(cls, new AtomicInteger(newThreadId));
            } else {
                // Just increment the lat ID, and get it.
                newThreadId = threadId.incrementAndGet();
            }
        }

        // Now we can compute the name for this thread
        return cls.getSimpleName() + '-' + newThreadId;
View Full Code Here

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

        class TestExecutor implements Executor {
           
            private AtomicInteger count = new AtomicInteger();
           
            public void execute(Runnable command) {
                int c = count.incrementAndGet();
                LOG.info("asyn call time " + c);
                command.run();
            }
           
            public int getCount() {
View Full Code Here

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

        //System.err.println("e=" + e.toString());

        AtomicInteger counter = _keyCounts.get(e.key());
        assert null != counter : "No counter for key: " + e.key();
        counter.incrementAndGet();

        AtomicInteger srcidCount = _srcidCounts.get((short)e.getSourceId());
        assert null != srcidCount : "No counter for source:" + e.getSourceId();
        srcidCount.incrementAndGet();
        _metadataSchema = ((DbusEventAvroDecoder)eventDecoder).getLatestMetadataSchema();
View Full Code Here

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

        assert null != counter : "No counter for key: " + e.key();
        counter.incrementAndGet();

        AtomicInteger srcidCount = _srcidCounts.get((short)e.getSourceId());
        assert null != srcidCount : "No counter for source:" + e.getSourceId();
        srcidCount.incrementAndGet();
        _metadataSchema = ((DbusEventAvroDecoder)eventDecoder).getLatestMetadataSchema();
        return super.onDataEvent(e, eventDecoder);
    }

    public VersionedSchema getMetadataSchema()
View Full Code Here

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

        final ServiceRegistration ehReg = this.registerJobConsumer(TOPIC, new JobConsumer() {

            @Override
            public JobResult process(final Job job) {
                if ( job.getTopic().equals(TOPIC) ) {
                    counter.incrementAndGet();
                }
                return JobResult.OK;
            }

        });
View Full Code Here

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

        final AtomicInteger count = new AtomicInteger(0);
        final ServiceRegistration reg2 = this.registerEventHandler(NotificationConstants.TOPIC_JOB_FINISHED,
                new EventHandler() {
                    @Override
                    public void handleEvent(Event event) {
                        count.incrementAndGet();
                    }
                 });

        try {
            // we start "some" jobs
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.