Package java.util.concurrent

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


            count++;
            Document doc = it.next();
            assertNotNull(doc);
        }
        assertEquals(size, count);
        executor.shutdownNow();
    }

    public void testXPathNodeListTest() throws Exception {
        String xml = "<foo><person id=\"1\">Claus<country>SE</country></person>"
                + "<person id=\"2\">Jonathan<country>CA</country></person></foo>";
View Full Code Here


                    long end = System.nanoTime();
                    long elapsed = TimeUnit.NANOSECONDS.toMillis(end - start);
                    System.out.println("elapsed ms: " + elapsed);

                    for (Worker worker : workers) worker.stop();
                    executor.shutdownNow();

                    // Perform one request to get the result
                    ContentExchange exchange2 = new ContentExchange(true);
                    exchange2.setMethod(HttpMethods.GET);
                    exchange2.setURL(urls[0] + "?action=result");
View Full Code Here

                        long elapsed = TimeUnit.NANOSECONDS.toMillis( end - start );
                        System.out.println( "elapsed ms: " + elapsed );

                        for ( Worker worker : workers )
                            worker.stop();
                        executor.shutdownNow();

                        // Perform one request to get the result
                        ContentExchange exchange2 = new ContentExchange( true );
                        exchange2.setMethod( HttpMethods.GET );
                        exchange2.setURL( urls[0] + "?action=result" );
View Full Code Here

                                                          httpTimeoutMs,
                                                          swapConf.getRollback(),
                                                          swapConf.getRollback());
        swapper.swapStoreData(storeName, dataDir, pushVersion);
        info("Swap complete.");
        executor.shutdownNow();
        executor.awaitTermination(10, TimeUnit.SECONDS);
    }

}
View Full Code Here

                                 + " and for store " + storeName);
                    }
                }
            } finally {
                if(service != null) {
                    service.shutdownNow();
                    service.awaitTermination(10, TimeUnit.SECONDS);
                    service = null;
                }
                if(adminClient != null) {
                    adminClient.close();
View Full Code Here

                                                                      + storePushVersion);

                                                             return nodeDirs;
                                                         } finally {
                                                             if(internalExecutor != null) {
                                                                 internalExecutor.shutdownNow();
                                                                 internalExecutor.awaitTermination(10,
                                                                                                   TimeUnit.SECONDS);
                                                             }
                                                             if(adminClient != null) {
                                                                 adminClient.close();
View Full Code Here

            logger.info("Succeeded on all nodes in " + ((end - start) / Time.MS_PER_SECOND)
                        + " seconds.");
        } finally {
            if(useAdminServices && adminClient != null)
                adminClient.close();
            executor.shutdownNow();
            executor.awaitTermination(1, TimeUnit.SECONDS);
            VoldemortIOUtils.closeQuietly(httpClient);
        }
        System.exit(0);
    }
View Full Code Here

                RebalanceUtils.printErrorLog(batchId,
                                             logger,
                                             "Could not shutdown service cleanly for rebalance task "
                                                     + batchId,
                                             null);
                service.shutdownNow();
            }
        }
    }

    private List<RebalanceTask>
View Full Code Here

        else
            es = Executors.newSingleThreadExecutor(new DaemonThreadFactory());
        try {
            reactor.execute(es,buildReactorListener());
        } finally {
            es.shutdownNow();   // upon a successful return the executor queue should be empty. Upon an exception, we want to cancel all pending tasks
        }

    }

    /**
 
View Full Code Here

            executorService.execute(new TraitRulesThread(threadIndex, MAX_REPETITIONS, kbase.newStatefulKnowledgeSession()));
        }

        executorService.shutdown();
        executorService.awaitTermination(MAX_WAIT_SECONDS, TimeUnit.SECONDS);
        final List<Runnable> queuedTasks = executorService.shutdownNow();

        assertEquals(0, queuedTasks.size());
        assertEquals(true, executorService.isTerminated());
    }
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.