@Override public void run() { mainService.stopAndWait(); } });
@Deprecated @Override public final State stopAndWait() { return delegate.stopAndWait(); }
private void stopQuietly(Service service) { try { service.stopAndWait(); } catch (Exception e) { LOG.debug("Error stopping the preview runner.", e); } }
/** * Stops the given service and wait for the completion. If there is exception, just log. */ private void stopService(Service service) { try { service.stopAndWait(); } catch (Throwable t) { LOG.warn("Exception when stopping service {}", service); } } }
/** * Stops a {@link Service} and waits for the completion. If there is exception during stop, it will get logged. */ protected final void stopService(Service service) { try { service.stopAndWait(); } catch (Throwable t) { LOG.error("Failed when stopping service {}", service, t); } }
@Deprecated @Override public final State stopAndWait() { return delegate.stopAndWait(); }
@Deprecated @Override public final State stopAndWait() { return delegate.stopAndWait(); }
@Deprecated @Override public final State stopAndWait() { return delegate.stopAndWait(); }
private void stopCoreServices() { // Stop all services. Reverse the order. for (Service service : (Iterable<Service>) coreServices::descendingIterator) { try { service.stopAndWait(); } catch (Exception e) { LOG.warn("Exception raised when stopping service {} during program termination.", service, e); } } logAppenderInitializer.close(); }
private void stopCoreServices() { // Stop all services. Reverse the order. for (Service service : (Iterable<Service>) coreServices::descendingIterator) { try { service.stopAndWait(); } catch (Exception e) { LOG.warn("Exception raised when stopping service {} during program termination.", service, e); } } logAppenderInitializer.close(); }
@Deprecated @Override public State stopAndWait() { return delegate().stopAndWait(); }
@Override protected void doStop() throws Exception { if (service.state() != Service.State.TERMINATED && service.state() != Service.State.FAILED) { LOG.debug("stopping controller service for program {}.", getProgramRunId()); service.stopAndWait(); LOG.debug("stopped controller service for program {}, waiting for it to finish running listener hooks.", getProgramRunId()); serviceStoppedLatch.await(30, TimeUnit.SECONDS); LOG.debug("controller service for program {} finished running listener hooks.", getProgramRunId()); } }
@Override protected void doStop() throws Exception { if (service.state() != Service.State.TERMINATED && service.state() != Service.State.FAILED) { LOG.debug("stopping controller service for program {}.", getProgramRunId()); service.stopAndWait(); LOG.debug("stopped controller service for program {}, waiting for it to finish running listener hooks.", getProgramRunId()); serviceStoppedLatch.await(30, TimeUnit.SECONDS); LOG.debug("controller service for program {} finished running listener hooks.", getProgramRunId()); } }
@Override protected void shutDown() throws Exception { shutDownUnrequiredServices(); datasetService.stopAndWait(); if (messagingService instanceof Service) { ((Service) messagingService).stopAndWait(); } levelDBTableService.close(); }
@Override protected void shutDown() throws Exception { shutDownUnrequiredServices(); datasetService.stopAndWait(); if (messagingService instanceof Service) { ((Service) messagingService).stopAndWait(); } levelDBTableService.close(); }
@AfterClass public static void afterClass() throws Exception { AppFabricTestBase.afterClass(); if (scheduler instanceof Service) { ((Service) scheduler).stopAndWait(); } }
@Test public void testStopWhileRetrying() throws InterruptedException { // This test the service can be stopped during failure retry CountDownLatch failureLatch = new CountDownLatch(1); Service service = new RetryOnStartFailureService( createServiceSupplier(1000, new CountDownLatch(1), failureLatch, false), RetryStrategies.fixDelay(10, TimeUnit.MILLISECONDS)); service.startAndWait(); Assert.assertTrue(failureLatch.await(1, TimeUnit.SECONDS)); service.stopAndWait(); }
@AfterClass public static void finish() { if (messagingService instanceof Service) { ((Service) messagingService).stopAndWait(); } datasetService.stopAndWait(); txManager.stopAndWait(); }
@AfterClass public static void cleanupClass() { provisioningService.stopAndWait(); datasetService.stopAndWait(); txManager.stopAndWait(); if (messagingService instanceof Service) { ((Service) messagingService).stopAndWait(); } }
@After public void stop() { runtimeServer.stopAndWait(); datasetService.stopAndWait(); txManager.stopAndWait(); if (messagingService instanceof Service) { ((Service) messagingService).stopAndWait(); } }