Package java.util.concurrent.atomic

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


            });

            total.incrementAndGet();
        }

        for (int i = 0; i < total.intValue(); i++) {
            Future<Exchange> future = completion.take();
            Exchange subExchange = future.get();
            if (aggregationStrategy != null) {
                doAggregate(result, subExchange);
            }
View Full Code Here


                        @Override
                        public void lineRead(String line) throws Exception {
                            lineData.put(
                                    String.valueOf(lineNumber),
                                    generateRowObject(sourceFileDataPair, line,
                                            lineNumber.intValue()));
                            result.put("lineCount", lineNumber.intValue());
                            lineNumber.incrementAndGet();
                        }
                    });
            sd.put("sourceFileLineCount", lineNumber.get());
View Full Code Here

                        public void lineRead(String line) throws Exception {
                            lineData.put(
                                    String.valueOf(lineNumber),
                                    generateRowObject(sourceFileDataPair, line,
                                            lineNumber.intValue()));
                            result.put("lineCount", lineNumber.intValue());
                            lineNumber.incrementAndGet();
                        }
                    });
            sd.put("sourceFileLineCount", lineNumber.get());
        } catch (Exception e) {
View Full Code Here

            LOG.trace("Starting to submit parallel tasks");

            while (it.hasNext()) {
                final ProcessorExchangePair pair = it.next();
                final Exchange subExchange = pair.getExchange();
                updateNewExchange(subExchange, total.intValue(), pairs, it);

                completion.submit(new Callable<Exchange>() {
                    public Exchange call() throws Exception {
                        // only start the aggregation task when the task is being executed to avoid staring
                        // the aggregation task to early and pile up too many threads
View Full Code Here

    }
    for (Thread t : threads) {
      t.join();
    }
    long time = System.currentTimeMillis() - startTime;
    System.out.println((1000.0 * count.intValue() / time) + " requests / sec");
    assertTrue(exceptions.isEmpty());
  }

  protected String getOneResult(String key, String[] indices) throws KattaException {
    List<String> data = _client.get(key, indices);
View Full Code Here

    }
    for (Thread t : threads) {
      t.join();
    }
    long time = System.currentTimeMillis() - startTime;
    System.out.println((1000.0 * count.intValue() / time) + " requests / sec");
    assertTrue(exceptions.isEmpty());
  }

  protected String getOneResult(IMapFileServer server, String key, String[] shards) throws Exception {
    TextArrayWritable texts = server.get(new Text(key), shards);
View Full Code Here

      @Override
      public IndexSearcher answer(InvocationOnMock invocation) throws Throwable {
        final IndexSearcher indexSearcher = seacherFactory.createSearcher((String) invocation.getArguments()[0],
                (File) invocation.getArguments()[1]);
        synchronized (shardsWithTiemoutCount) {
          if (shardsWithTiemoutCount.intValue() >= 2) {
            // 2 from 4 shards will get tiemout
            return indexSearcher;
          }
          shardsWithTiemoutCount.incrementAndGet();
        }
View Full Code Here

                  }
                }

              }.start();

              while (counter.intValue() < parallelRuns) {
                try {
                  Thread.sleep(100);
                } catch (InterruptedException e) {
                  Thread.currentThread().interrupt();
                }
View Full Code Here

                WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
              }
            }

          }.start();
          while (counter.intValue() < parallelRuns) {
            try {
              Thread.sleep(100);
            } catch (InterruptedException e) {
              Thread.currentThread().interrupt();
            }
View Full Code Here

      @Override
      public void close() throws IOException {}
    };
    MetaScanner.metaScan(TEST_UTIL.getConfiguration(), visitor);
    LOG.info("There are " + regionOnPrimaryNum.intValue() + " out of " +
        totalRegionNum.intValue() + " regions running on the primary" +
        " region servers" );
    return regionOnPrimaryNum.intValue() ;
  }

  /**
 
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.