Package java.util.concurrent

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


                }
            }
        }
        finally
        {
            executor.shutdownNow();
        }

        assert splits.size() > 0;
        Collections.shuffle(splits, new Random(System.nanoTime()));
        return splits;
View Full Code Here


    cluster.setShutdownExecutor(mockService);

    EasyMock.expect(future.get()).andReturn(0).anyTimes();
    EasyMock.expect(mockService.submit(EasyMock.anyObject(Callable.class))).andReturn(future).anyTimes();
    EasyMock.expect(mockService.shutdownNow()).andReturn(Collections.<Runnable> emptyList()).once();

    EasyMock.replay(mockService);

    cluster.stop();
View Full Code Here

    try {
      executor.submit(new SplitTask(new SplitEnv(tableName, tableId, executor, latch, exception), splits));

      while (!latch.await(100, TimeUnit.MILLISECONDS)) {
        if (exception.get() != null) {
          executor.shutdownNow();
          Exception excep = exception.get();
          if (excep instanceof TableNotFoundException)
            throw (TableNotFoundException) excep;
          else if (excep instanceof AccumuloException)
            throw (AccumuloException) excep;
View Full Code Here

    s.stop();
    try {
      Field f = s.getClass().getDeclaredField("executorService_");
      f.setAccessible(true);
      ExecutorService es = (ExecutorService) f.get(s);
      es.shutdownNow();
    } catch (Exception e) {
      TServerUtils.log.error("Unable to call shutdownNow", e);
    }
  }
}
View Full Code Here

      engine.shutdown();
    }
    finally
    {
      scheduledExecutorService.shutdownNow();
      executorService.shutdownNow();
    }
  }

  /**
   * A task that blocks forever when it is executed, tying up whatever thread
View Full Code Here

                continue;
            }

            ExecutorService es = (ExecutorService) e;
            for (;;) {
                es.shutdownNow();
                try {
                    if (es.awaitTermination(1, TimeUnit.SECONDS)) {
                        break;
                    }
                } catch (InterruptedException ex) {
View Full Code Here

                    }
                }

                if (loop != null) {
                    loop.done = true;
                    executor.shutdownNow();
                    try {
                        for (;;) {
                            loop.selector.wakeup();
                            try {
                                if (executor.awaitTermination(1, TimeUnit.SECONDS)) {
View Full Code Here

        result.get(2000, TimeUnit.MILLISECONDS);
      } catch (TimeoutException te) {
        // it is ok, expected.
      }
      waitForCounter(tot_mgr_wait_for_zk_delete, 0, 1, 10000);
      executor.shutdownNow();
      executor = null;

      // make sure the runnable is finished with no exception thrown.
      result.get();
    } finally {
View Full Code Here

      result.get();
    } finally {
      if (executor != null) {
        // interrupt the thread in case the test fails in the middle.
        // it has no effect if the thread is already terminated.
        executor.shutdownNow();
      }
      fs.delete(logDir, true);
    }
  }
View Full Code Here

        result.get(2000, TimeUnit.MILLISECONDS);
      } catch (TimeoutException te) {
        // it is ok, expected.
      }
      waitForCounter(tot_mgr_wait_for_zk_delete, 0, 1, 10000);
      executor.shutdownNow();
      executor = null;

      // make sure the runnable is finished with no exception thrown.
      result.get();
    } finally {
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.