Package com.ikanow.infinit.e.core.execute_harvest.utils

Examples of com.ikanow.infinit.e.core.execute_harvest.utils.BlockingExecutor


      _nThreads = nThreads;
    }
   
    public void run() {
          ExecutorService exec = Executors.newFixedThreadPool(_nThreads);
          BlockingExecutor bex = new BlockingExecutor(exec, 2*_nThreads);
            // (allow a few sources to get queued up)
         
          if (null != _sSourceType) {
          _logger.info("(Starting harvest thread for " + _sSourceType + ")");           
          }         
          while (!_sources.isEmpty()) {
            LinkedList<SourcePojo> sourceBatch = SourceUtils.getDistributedSourceList(_sources, _sSourceType, false);
            while (!sourceBatch.isEmpty()) {
              SourcePojo source = sourceBatch.pop();
          SourceHarvesterRunnable sourceRunner = new SourceHarvesterRunnable(source);
         
          boolean bSubmittedTask = false;
          for (int i = 0; (i < 5) && !bSubmittedTask; ++i) {
            try {
              bex.submitTask(sourceRunner, true);
              bSubmittedTask = true;
            }
            catch (Exception e) {
              try {
                  _logger.info("(Thread failure for " + _sSourceType + ", can probably recover)");           
View Full Code Here

TOP

Related Classes of com.ikanow.infinit.e.core.execute_harvest.utils.BlockingExecutor

Copyright © 2018 www.massapicom. 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.