Package java.util.concurrent

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


        System.gc();
        long beforeFree = Runtime.getRuntime().freeMemory();
        long beforeTotal = Runtime.getRuntime().totalMemory();
        System.gc();
        pool.invokeAll(tasks, 30L, TimeUnit.SECONDS);
        System.gc();
        long afterFree = Runtime.getRuntime().freeMemory();
        long afterTotal = Runtime.getRuntime().totalMemory();

        pool.shutdown();
View Full Code Here


        pool = Executors.newFixedThreadPool(numConcurrency);
        System.gc();
        beforeFree = Runtime.getRuntime().freeMemory();
        beforeTotal = Runtime.getRuntime().totalMemory();
        System.gc();
        pool.invokeAll(tasks, 30L, TimeUnit.SECONDS);
        System.gc();
        afterFree = Runtime.getRuntime().freeMemory();
        afterTotal = Runtime.getRuntime().totalMemory();

        pool.shutdown();
View Full Code Here

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(5);

        // submit all tasks
        service.invokeAll(tasks);

        assertMockEndpointsSatisfied();
    }

    @Override
View Full Code Here

        mock.expectedBodiesReceived(total);
        mock.expectedHeaderReceived("total", total);
        mock.expectedPropertyReceived(Exchange.AGGREGATED_SIZE, size);

        // submit all tasks
        service.invokeAll(tasks);

        assertMockEndpointsSatisfied();

        assertEquals(100, COUNTER.get());
    }
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

            Loader loader = new Loader(emf.createEntityManager());
            tasks.add(loader);
        }
        List<Future<Boolean>> results;
        try {
            results = threads.invokeAll(tasks);
            for (Future<Boolean> result : results) {
                assertTrue(result.get());
            }
        } catch (ExecutionException ee) {
            ee.getCause().printStackTrace();
View Full Code Here

        }
        System.out.println("\nInserting " + NUM_TILES_PER_THREAD * numThreads
                + " tiles spread over " + numThreads + " threads.\nConnection pooling: "
                + USE_CONNECTION_POOLING + ". Old style put: " + USE_DELETE_PUT_UNLOCK);

        List<Future<Long>> results = executorService.invokeAll(tasks);

        double totalTime = 0;
        for (Future<Long> result : results) {
            totalTime += result.get().longValue();
        }
View Full Code Here

        };
       
        workers.add(rn);
      }

      service.invokeAll(workers);
     
      synchronized (benchmarkParams)
      {
        this.workerResult = workerResult.toArray(new FunctorExecutionMark[0]);
      }
View Full Code Here

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(5);

        // submit all tasks
        service.invokeAll(tasks);

        assertMockEndpointsSatisfied();
    }

    @Override
View Full Code Here

        mock.expectedBodiesReceived(total);
        mock.expectedHeaderReceived("total", total);
        mock.expectedPropertyReceived(Exchange.AGGREGATED_SIZE, size);

        // submit all tasks
        service.invokeAll(tasks);

        assertMockEndpointsSatisfied();

        assertEquals(100, COUNTER.get());
    }
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.