Examples of incrementAndGet()


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

        final Character cc = Character.toLowerCase(c);
        final AtomicInteger i = this.letter.get(cc);
        if (i == null) {
            this.letter.put(cc, new AtomicInteger(1));
        } else {
            i.incrementAndGet();
        }
        this.letters++;
    }

    public void add(final String word) {
View Full Code Here

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

   
    public void inc(final E obj) {
        if (obj == null) return;
        AtomicInteger score = this.map.get(obj);
        if (score != null) {
            score.incrementAndGet();
            return;
        }
        synchronized (map) {
            score = this.map.get(obj);
            if (score == null) {
View Full Code Here

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

            if (score == null) {
                this.map.put(obj, new AtomicInteger(1));
                return;
            }
        }
        score.incrementAndGet();
    }
   
    public void dec(final E obj) {
        if (obj == null) return;
        AtomicInteger score;
View Full Code Here

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

      AtomicInteger counter = counters.get(outputWriter.getJdbcUrl());
      if (counter == null) {
        counter = new AtomicInteger();
        counters.put(outputWriter.getJdbcUrl(), counter);
      }
      counter.incrementAndGet();

      return outputWriter;
    }
  }
View Full Code Here

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

      public synchronized void createDatastore(Datastore datastore) {
        if (_datastore != null) {
          assertEquals(_datastore, datastore);
        }
        _datastore = datastore;
        datastoreCount.incrementAndGet();
      }
    };

    final InputColumn<?>[] columns = scenarioHelper.getColumns().toArray(new InputColumn[0]);
View Full Code Here

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

      chmQueryCount.put(sConnection, ai);

      al = new AtomicLong(0);
      chmQueryTime.put(sConnection, al);
    } else {
      ai.incrementAndGet();

      al = chmQueryTime.get(sConnection);
    }

    if (al == null) {
View Full Code Here

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

                }
                PrintWriter writer = event.getResource().getResponse().getWriter();
                writer.write(event.getMessage().toString());
                writer.flush();
                try {
                     broadcastCount.incrementAndGet();
                } finally {
                    if (broadcastCount.get() == 4) {
                        event.getResource().resume();
                    }
                }
View Full Code Here

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

        AtomicInteger i = count.get();
        if (i == null) {
            i = new AtomicInteger(0);
            count.set(i);
        }
        i.incrementAndGet();
    }

    private void decrement() {
        AtomicInteger i = count.get();
        if (i == null) {
View Full Code Here

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

                    bufferedWrites.putIfAbsent(indexName, times);
                }
            }
        }

        int t = times.incrementAndGet();

        if (t > writeTreshold)
        {
            commit(indexName, false);
            times.set(0);
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
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.