/** Wait for task to complete. */ public void join() throws InterruptedException { LOG.info("TetherTaskRunner: Start join."); inputServer.join(); LOG.info("TetherTaskRunner: Finish join."); }
/** * Request that the specified Server stop, and attempt to wait for it to exit. * @param server A running NettyServer */ public static void stopServer(Server server) { try { server.close(); server.join(); } catch (InterruptedException ex) { logger.error("Thread interrupted. Exception follows.", ex); Thread.currentThread().interrupt(); } }
@Override public void stop() { logger.info("Avro source {} stopping: {}", getName(), this); if (server != null) { server.close(); try { server.join(); server = null; } catch (InterruptedException e) { logger.info("Avro source " + getName() + ": Interrupted while waiting " + "for Avro server to stop. Exiting. Exception follows.", e); Thread.currentThread().interrupt(); } } if (socketChannelFactory != null) { socketChannelFactory.releaseExternalResources(); socketChannelFactory = null; } sourceCounter.stop(); if (connectionCountUpdater != null) { connectionCountUpdater.shutdownNow(); connectionCountUpdater = null; } super.stop(); logger.info("Avro source {} stopped. Metrics: {}", getName(), sourceCounter); }
server.join(); } catch (InterruptedException ex) { logger.warn("Thread interrupted during join()", ex);
public static void stopTestFlumeServer(Server server) { try { server.close(); server.join(); } catch (InterruptedException ex) { LOG.error("Thread interrupted. Exception follows.", ex); Thread.currentThread().interrupt(); } }
@PreDestroy public void stop() { // Previously the server.close call was disable for the following reason, just leaving this comment here for // historical reasons: // It would be nice to wait for client threads to end, but since these client threads pass into // HBase client code which is notoriously difficult to interrupt, we skip this step server.close(); // Actual work is now being performed on the threads of the ExecutorService if (executorService != null) { // Interrupt the threads. It would be nicer to wait for them to complete, but I experienced endless // hangs on shutdown, to be investigated later. executorService.shutdownNow(); // executionHandler.releaseExternalResources(); } try { server.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
@Override protected void doStop() throws FlumeException { srv.close(); try { srv.join(); } catch (InterruptedException e) { throw new FlumeException("Interrupted while waiting for Netty Server to" + " shutdown.", e); } }
@Override public void stop() { logger.info("Avro source {} stopping: {}", getName(), this); if (server != null) { server.close(); try { server.join(); server = null; } catch (InterruptedException e) { logger.info("Avro source " + getName() + ": Interrupted while waiting " + "for Avro server to stop. Exiting. Exception follows.", e); Thread.currentThread().interrupt(); } } if (socketChannelFactory != null) { socketChannelFactory.releaseExternalResources(); socketChannelFactory = null; } sourceCounter.stop(); if (connectionCountUpdater != null) { connectionCountUpdater.shutdownNow(); connectionCountUpdater = null; } super.stop(); logger.info("Avro source {} stopped. Metrics: {}", getName(), sourceCounter); }
public void stop() throws InterruptedException { Closer.close(sepConsumer); Closer.close(remoteSchemaCache); Closer.close(remoteTypeManager); Closer.close(typeManager); Closer.close(remoteRepositoryManager); Closer.close(repositoryManager); if (lilyServer != null) { lilyServer.close(); lilyServer.join(); } Closer.close(repositoryMaster); Closer.close(zk); Closer.close(hbaseProxy); coreSetup = false; repositoryManagerSetup = false; typeManagerSetup = false; }