Package com.google.common.util.concurrent

Examples of com.google.common.util.concurrent.ListeningExecutorService.shutdownNow()


      }
    } catch (Throwable t) {
      t.printStackTrace();
      failedCallables.addAll((List) callablesToRun);
    } finally {
      es.shutdownNow();
    }

    if (!failedCallables.isEmpty()) {
      LOG.error(failedCallables.size() + " callable failure(s) occurred:");
      for (PipelineCallable<?> c : failedCallables) {
View Full Code Here


         "http://mock");

   public void testApiClosesExecutorServiceOnClose() throws IOException {
      ListeningExecutorService executor = createMock(ListeningExecutorService.class);

      expect(executor.shutdownNow()).andReturn(ImmutableList.<Runnable> of()).atLeastOnce();

      replay(executor);

      DelegatingApi api = ContextBuilder.newBuilder(provider)
                                        .modules(ImmutableSet.<Module> builder()
View Full Code Here

            assertEquals(response.getError(), "");
            assertEquals(response.getOutput().trim(), "localhost".equals(sshHost) ? InetAddress.getLocalHost().getHostName()
                     : sshHost);
         }
      } finally {
         userExecutor.shutdownNow();
         client.disconnect();
      }
   }
  
   @Test
View Full Code Here

      }
    } catch (Throwable t) {
      t.printStackTrace();
      failedCallables.addAll((List) callablesToRun);
    } finally {
      es.shutdownNow();
    }

    if (!failedCallables.isEmpty()) {
      LOG.error(failedCallables.size() + " callable failure(s) occurred:");
      for (PipelineCallable<?> c : failedCallables) {
View Full Code Here

      boolean result = taskRunnerFuture.get();
      assertTrue(result);
      assertNull(taskReporter.currentCallable);
      umbilical.verifyTaskSuccessEvent();
    } finally {
      executor.shutdownNow();
    }
  }

  @Test
  public void testMultipleSuccessfulTasks() throws IOException, InterruptedException, TezException,
View Full Code Here

      result = taskRunnerFuture.get();
      assertTrue(result);
      assertNull(taskReporter.currentCallable);
      umbilical.verifyTaskSuccessEvent();
    } finally {
      executor.shutdownNow();
    }
  }

  // test tasked failed due to exception in Processor
  @Test
View Full Code Here

      }

      assertNull(taskReporter.currentCallable);
      umbilical.verifyTaskFailedEvent("Failure while running task:org.apache.tez.dag.api.TezException: TezException");
    } finally {
      executor.shutdownNow();
    }
  }

  // Test task failed due to Processor class not found
  @Test
View Full Code Here

      }
      assertNull(taskReporter.currentCallable);
      umbilical.verifyTaskFailedEvent("Failure while running task:org.apache.tez.dag.api.TezUncheckedException: "
            + "Unable to load class: NotExitedProcessor");
    } finally {
      executor.shutdownNow();
    }
  }

  @Test
  public void testHeartbeatException() throws IOException, InterruptedException, TezException {
View Full Code Here

      assertTrue(TestProcessor.wasInterrupted());
      assertNull(taskReporter.currentCallable);
      // No completion events since umbilical communication already failed.
      umbilical.verifyNoCompletionEvents();
    } finally {
      executor.shutdownNow();
    }
  }

  @Test
  public void testHeartbeatShouldDie() throws IOException, InterruptedException, TezException,
View Full Code Here

      // TODO Is this statement correct ?
      // No completion events since shouldDie was requested by the AM, which should have killed the
      // task.
      umbilical.verifyNoCompletionEvents();
    } finally {
      executor.shutdownNow();
    }
  }

  @Test
  public void testGetTaskShouldDie() throws InterruptedException, ExecutionException {
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.