Package java.util.concurrent

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


        }
      });
    }

    List<Future<Void>> results = executor.invokeAll(tasks);
    executor.shutdown();
    executor.awaitTermination(5, TimeUnit.MINUTES);

    for (Future<Void> result : results) {
      result.get();
View Full Code Here


              history.contains(histEntry));
        }
      });
    }

    List<Future<Void>> results = executor.invokeAll(tasks);
    executor.shutdown();
    executor.awaitTermination(5, TimeUnit.MINUTES);

    for (Future<Void> result : results) {
      result.get();
View Full Code Here

                    return null;
                }
            });
        }
       
        for (Future<Object> future : pool.invokeAll(tasks)) {
            try {
                future.get();
            } catch (ExecutionException ex) {
                ex.printStackTrace();
                pool.shutdown();
View Full Code Here

          return null;
        }
      });
    }

    List<Future<Void>> futures = executorService.invokeAll(callables);
    executorService.shutdown();
    executorService.awaitTermination(99999, TimeUnit.DAYS);

    for (Future<Void> future : futures) {
      try {
View Full Code Here

          aggregatedBus.post(new SlaveIdle());
          return null;
        }
      });
    }
    for (Future<Void> f : executor.invokeAll(slaves)) {
      f.get();
    }
    executor.shutdown();
   
    assertFalse(hadErrors.get());
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

          return null;
        }
      });
    }

    for (Future<Void> result : executor.invokeAll(callables)) {
      result.get(); // will throw if failed
    }

    for (Integer key : keys) {
      Assert.assertFalse(cache.containsKey(key));
View Full Code Here

            return null;
          }
        });
      }
    }
    es.invokeAll(callables);
    es.shutdownNow();
  }

  @Test
  public void testBeaconScan() {
View Full Code Here

            }
          }
        });
    }
    ExecutorService service = Executors.newFixedThreadPool(numThreads);
    List<Future<ThreadStatus>> statuses = service.invokeAll(threads, 60,
                                                      TimeUnit.SECONDS);
    int numCompleted = 0;
    for (Future<ThreadStatus> s : statuses) {
      assertTrue(s.isDone());
      assertTrue("Thread threw invalid exception",
View Full Code Here

    callables = wrapWithStatsCallables(callables, noEstimateCounter);
    int numProcessors = Runtime.getRuntime().availableProcessors();
    ExecutorService executor = Executors.newFixedThreadPool(numProcessors);
    log.info("Starting timing of {} tasks in {} threads", callables.size(), numProcessors);
    try {
      List<Future<Void>> futures = executor.invokeAll(callables);
      // Go look for exceptions here, really
      for (Future<Void> future : futures) {
        future.get();
      }
    } catch (InterruptedException ie) {
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.