Package java.util.concurrent

Examples of java.util.concurrent.ScheduledThreadPoolExecutor.shutdown()


      futures = executor.invokeAll(callables, timeoutMs,
          TimeUnit.MILLISECONDS);
    } catch (InterruptedException e) {
      // Swallow the exception here, because we can return partial results
    }
    executor.shutdown();
   
    Map<DatanodeInfo, HdfsBlocksMetadata> metadatas =
        Maps.newHashMapWithExpectedSize(datanodeBlocks.size());
    // Fill in metadatas with results from DN RPCs, where possible
    for (int i = 0; i < futures.size(); i++) {
View Full Code Here


    try {
      futures = executor.invokeAll(callables, timeout, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
      // Swallow the exception here, because we can return partial results
    }
    executor.shutdown();
   
    // Initialize metadatas list with nulls
    // This is used to later indicate if we didn't get a response from a DN
    List<HdfsBlocksMetadata> metadatas = new ArrayList<HdfsBlocksMetadata>();
    for (int i = 0; i < futures.size(); i++) {
View Full Code Here

        if (executor == null) {
            throw new IllegalStateException();
        }
        this.context = context;
        context.asynchronous();
        executor.shutdown();
        this.executor = null;
        value = null;
    }

    public synchronized ScheduledExecutorService getValue() throws IllegalStateException {
View Full Code Here

    for (int i=0; i<numThreads; i++) {
      ep.submit(new SubscriptionGenerator(numSubscriptions/numThreads));
    }
    logger.info("event=started");
    try {
      ep.shutdown();
      ep.awaitTermination(60, TimeUnit.MINUTES);
    } catch (InterruptedException ex) {
      logger.error("event=failure", ex);
    }
    long end = System.currentTimeMillis();
View Full Code Here

    }

    logger.warn("ALL TEST LAUNCHED");

    try {
      ep.shutdown();
      ep.awaitTermination(60, TimeUnit.MINUTES);
      //Thread.sleep(5000);
    } catch (InterruptedException ex) {
      logger.error("fail", ex);
      fail(ex.getMessage());
View Full Code Here

    for (int i=0; i<numSenders; i++) {
      logger.info("event=launching_sender");
      ep.submit(new MessageSender());
    }
    try {
      ep.shutdown();
      ep.awaitTermination(100, TimeUnit.DAYS);
    } catch (InterruptedException ex) {
      logger.error("event=endurance_failure queue_url=" + queueUrl, ex);
    }
    logger.info("event=done");
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.