Package java.util.concurrent

Examples of java.util.concurrent.ExecutorService.invokeAll()


  public void testConcurrentInsertionOfBlobsToTheSameNewFanOutDirectory()
      throws Exception {
    ExecutorService e = Executors.newCachedThreadPool();
    for (int i=0; i < 100; ++i) {
      ObjectDirectory db = createBareRepository().getObjectDatabase();
      for (Future f : e.invokeAll(blobInsertersForTheSameFanOutDir(db))) {
        f.get();
      }
    }
  }
View Full Code Here


            });
        }
        Scheduler.Task syncTimeoutTask = clientFactory.getScheduler().schedule(timeout, TIMEOUT / 2, TimeUnit.MILLISECONDS);
        {
            long begin = System.nanoTime();
            List<Future<Object>> futures = threadPool.invokeAll(tasks);
            for (Future<Object> future : futures)
                future.get(iterations, TimeUnit.SECONDS);
            Assert.assertTrue(latch.await(count * iterations, TimeUnit.SECONDS));
            long end = System.nanoTime();
            System.err.printf("SYN+GET+DATA+GET completed in %d ms%n", TimeUnit.NANOSECONDS.toMillis(end - begin));
View Full Code Here

            });
        }
        Scheduler.Task asyncTimeoutTask = clientFactory.getScheduler().schedule(timeout, TIMEOUT / 2, TimeUnit.MILLISECONDS);
        {
            long begin = System.nanoTime();
            List<Future<Object>> futures = threadPool.invokeAll(tasks);
            for (Future<Object> future : futures)
                future.get(iterations, TimeUnit.SECONDS);
            Assert.assertTrue(latch.await(count * iterations, TimeUnit.SECONDS));
            long end = System.nanoTime();
            System.err.printf("SYN+COMPLETED+DATA completed in %d ms%n", TimeUnit.NANOSECONDS.toMillis(end - begin));
View Full Code Here

                };

                tasks.add(callable);
            }
            try {
                for (Future<OrganizationModel> future : ex.invokeAll(tasks)) {
                    models.add(future.get());
                }
            } catch (Exception e) {
                log.error("Error processing getAllOrganizationsForCreateDateRange:", e);
            }
View Full Code Here

            tasks.add(task);
        }

        // run the tasks
        ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
        List<Future<String>> futures = executorService.invokeAll(tasks, 10, TimeUnit.SECONDS);

        // verify results
        assertThat(futures, hasSize(threadCount));

        for (int threadIndex = 0; threadIndex < threadCount; threadIndex++) {
View Full Code Here

                                                                                        eliteCount,
                                                                                        epochLength,
                                                                                        islandPopulations);
            try
            {
                List<Future<List<EvaluatedCandidate<T>>>> futures = threadPool.invokeAll(islandEpochs);

                evaluatedCombinedPopulation.clear();
                List<List<EvaluatedCandidate<T>>> evaluatedPopulations
                    = new ArrayList<List<EvaluatedCandidate<T>>>(islands.size());
                for (Future<List<EvaluatedCandidate<T>>> future : futures)
View Full Code Here

      // Resolve hooks folder
      String stackHooksToUse = stackExtensionHelper.resolveHooksFolder(stack);
      stack.setStackHooksFolder(stackHooksToUse);
    }

    es.invokeAll(lookupList);

    es.shutdown();
  }

  /**
 
View Full Code Here

      aggregatedBus.post(new AggregatedStartEvent(slaves.size(),
          // TODO: this doesn't account for replicated suites.
          testCollection.testClasses.size()));

      try {
        List<Future<Void>> all = executor.invokeAll(slaves);
        executor.shutdown();

        for (int i = 0; i < slaves.size(); i++) {
          Future<Void> f = all.get(i);
          try {
View Full Code Here

      callables.add(new TestCompatibilitySingletonFactoryCallable());
    }

    // Now run the callables.
    ExecutorService executorService = Executors.newFixedThreadPool(100);
    List<Future<String>> futures = executorService.invokeAll(callables);

    // Wait for them all to finish.
    for (Future<String> f : futures) {
      resultStrings.add(f.get());
    }
View Full Code Here

                try {
                    ExecutorService executor = Executors.newCachedThreadPool();
                    List<Future<Boolean>> statuses = null;
                    try {
                        statuses = executor.invokeAll(Arrays.asList(new Monitor(server.getURL())));
                    } catch (InterruptedException ex) {
                        Logger.getLogger(view.UptimeMart.class.getName()).log(Level.SEVERE, null, ex);
                    }

                    //Set the status of the server
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.