Package java.util.concurrent

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


              } catch (ExecutionException e) {
                throw new IOException(e);
              }
            } while (!executorDone);
    }
          executor.shutdown();
        }
        HiveInterruptUtils.checkInterrupted();
        for (Map.Entry<String, ContentSummary> entry : resultMap.entrySet()) {
          ContentSummary cs = entry.getValue();
View Full Code Here


    for (final byte[] region : splitLogsMap.keySet()) {
      Callable splitter = createNewSplitter(rootDir, logWriters, splitLogsMap, region, fs, conf);
      writeFutureResult.put(region, threadPool.submit(splitter));
    }

    threadPool.shutdown();
    // Wait for all threads to terminate
    try {
      for (int j = 0; !threadPool.awaitTermination(5, TimeUnit.SECONDS); j++) {
        String message = "Waiting for hlog writers to terminate, elapsed " + j * 5 + " seconds";
        if (j < 30) {
View Full Code Here

            count += ids.size();
            executorService.execute(new Sweeper(ids, exceptionQueue));
        }

        try {
            executorService.shutdown();
            executorService.awaitTermination(100, TimeUnit.MINUTES);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
View Full Code Here

    final ThreadPoolExecutor execIdentifiersLoader = Executors.newFixedThreadPool( 1, "identifierloader" );
    try {
      execIdentifiersLoader.execute( primaryKeyOutputter );
    }
    finally {
      execIdentifiersLoader.shutdown();
    }
  }

  private void startTransformationToLuceneWork(BatchTransactionalContext transactionalContext, ErrorHandler errorHandler) {
    final Runnable documentOutputter = new OptionallyWrapInJTATransaction( transactionalContext,
View Full Code Here

      for ( int i = 0; i < documentBuilderThreads; i++ ) {
        execFirstLoader.execute( documentOutputter );
      }
    }
    finally {
      execFirstLoader.shutdown();
    }
  }


}
View Full Code Here

        if (packager != null) {
            packager.execute(executor, descriptors);
        }

        executor.shutdown();
        try {
            executor.awaitTermination(10, TimeUnit.MINUTES);
        } catch (InterruptedException ie) {
            throw new RuntimeException("Building plugins interrupted");
        }
View Full Code Here

      //splitStoreFile(sf, splitdir);
      StoreFileSplitter sfs = new StoreFileSplitter(sf, splitdir);
      futures.add(threadPool.submit(sfs));
    }
    // Shutdown the pool
    threadPool.shutdown();

    // Wait for all the tasks to finish
    try {
      boolean stillRunning = !threadPool.awaitTermination(
          this.fileSplitTimeout, TimeUnit.MILLISECONDS);
View Full Code Here

                        connector.start();
                    }
                }
                if (networkConnectorStartExecutor != null) {
                    // executor done when enqueued tasks are complete
                    networkConnectorStartExecutor.shutdown();
                    networkConnectorStartExecutor = null;
                }

                for (Iterator<ProxyConnector> iter = getProxyConnectors().iterator(); iter.hasNext();) {
                    ProxyConnector connector = iter.next();
View Full Code Here

                boolean tasksCompleted = false;
                try {
                    // sample all resources with threadpool
                    final List<Future<AsynSamplerResultHolder>> retExec = exec.invokeAll(liste);
                    // call normal shutdown (wait ending all tasks)
                    exec.shutdown();
                    // put a timeout if tasks couldn't terminate
                    exec.awaitTermination(AWAIT_TERMINATION_TIMEOUT, TimeUnit.SECONDS);
                    CookieManager cookieManager = getCookieManager();
                    // add result to main sampleResult
                    for (Future<AsynSamplerResultHolder> future : retExec) {
View Full Code Here

                        connector.start();
                    }
                }
                if (networkConnectorStartExecutor != null) {
                    // executor done when enqueued tasks are complete
                    networkConnectorStartExecutor.shutdown();
                    networkConnectorStartExecutor = null;
                }

                for (Iterator<ProxyConnector> iter = getProxyConnectors().iterator(); iter.hasNext();) {
                    ProxyConnector connector = iter.next();
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.