Examples of awaitTermination()


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

        threadPool.shutdown();

        // If we get stuck, we should give the user the opportunity to get a
        // thread dump.
        if(!threadPool.awaitTermination(60, TimeUnit.SECONDS)) {
            System.out.println("Threads appear to be stuck");
            threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
        }

        return Class.forName(failureDetectorConfig.getImplementationClassName()).getSimpleName()
View Full Code Here

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

        // If we get stuck, we should give the user the opportunity to get a
        // thread dump.
        if(!threadPool.awaitTermination(60, TimeUnit.SECONDS)) {
            System.out.println("Threads appear to be stuck");
            threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
        }

        return Class.forName(failureDetectorConfig.getImplementationClassName()).getSimpleName()
               + ", " + listener.getDelta();
    }
View Full Code Here

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

                }
            });
        }

        executor.shutdown();
        executor.awaitTermination(5 * 60, TimeUnit.SECONDS);

        if(!passed.get()) {
            fail();
        }
        return testStats;
View Full Code Here

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

                throw new RemoteOperationException(errors.toString());
        } finally {
            threadPool.shutdown();

            try {
                threadPool.awaitTermination(60, TimeUnit.SECONDS);
            } catch(InterruptedException e) {
                if(logger.isWarnEnabled())
                    logger.warn(e, e);
            }
        }
View Full Code Here

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

            this.hasCompleted = true;
            this.elapsedTimeNs = System.nanoTime() - start;
            executor.shutdownNow();
            try {
                executor.awaitTermination(3, TimeUnit.SECONDS);
            } catch(InterruptedException e) {}
        } finally {
            tearDown();
        }
    }
View Full Code Here

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

        threadPool.shutdown();

        // If we get stuck, we should give the user the opportunity to get a
        // thread dump.
        if(!threadPool.awaitTermination(60, TimeUnit.SECONDS)) {
            System.out.println("Threads appear to be stuck");
            threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
        }

        long end = System.currentTimeMillis();
View Full Code Here

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

        // If we get stuck, we should give the user the opportunity to get a
        // thread dump.
        if(!threadPool.awaitTermination(60, TimeUnit.SECONDS)) {
            System.out.println("Threads appear to be stuck");
            threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
        }

        long end = System.currentTimeMillis();

        if(listener.getAvailableCount() != listener.getUnavailableCount())
View Full Code Here

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

        }

        // wait for bad key writer to shutdown
        badKeyWriterService.shutdown();
        try {
            badKeyWriterService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
        } catch(InterruptedException e) {
            e.printStackTrace();
            fail("Unexpected exception");
        }
View Full Code Here

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

        if(logger.isInfoEnabled())
            logger.info("Shutting down");

        isRunning.set(false);
        threadPool.shutdown();
        threadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);

        assertEquals(hostNamePairs.size(), failureDetector.getAvailableNodeCount());
    }

    private void test(StoreClient<String, String> store) {
View Full Code Here

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

                });
            }

            runner.shutdown();
            runner.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
            long time = (System.nanoTime() - start) / Time.NS_PER_MS;

            System.err.println("Time: " + time + " ms.");
        } finally {
            runner.shutdown();
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.