/** * Stops the Spark server and clears all routes */ public static void stop() { getInstance().stop(); }
public void shutdown() { server.stop(); if(elasticsearchProxyResource != null) { elasticsearchProxyResource.close(); } }
/** * Stops the Spark server and clears all routes */ public static void stop() { getInstance().stop(); }
@Override public void terminate() { if (!isInitialized()) { return; } service.stop(); initialized = false; }
public void stop() { if(hgqlService != null) { LOGGER.info("Attempting to shut down service at http://localhost:" + hgqlService.port() + "..."); hgqlService.stop(); LOGGER.info("Shut down server"); } } }
public void stop() { if(hgqlService != null) { LOGGER.info("Attempting to shut down service at http://localhost:" + hgqlService.port() + "..."); hgqlService.stop(); LOGGER.info("Shut down server"); } } }
/** * Shut down if enough time has passed since certain events (startup or handling an analysis request). When EC2 * billing was in hourly increments, the worker would only consider shutting down every 60 minutes. But EC2 * billing is now by the second, so we check more frequently (during regular polling). */ public void considerShuttingDown() { long now = System.currentTimeMillis(); if (now > shutdownAfter) { LOG.info("Machine has been idle for at least {} minutes (single point) and {} minutes (regional), " + "shutting down.", SINGLE_KEEPALIVE_MINUTES , REGIONAL_KEEPALIVE_MINUTES); // Stop accepting any new single-point requests while shutdown is happening. // TODO maybe actively tell the broker this worker is shutting down. sparkHttpService.stop(); try { Process process = new ProcessBuilder("sudo", "/sbin/shutdown", "-h", "now").start(); process.waitFor(); } catch (Exception ex) { LOG.error("Unable to terminate worker", ex); // TODO email us or something } finally { System.exit(0); } } }
/** * Shut down if enough time has passed since certain events (startup or handling an analysis request). When EC2 * billing was in hourly increments, the worker would only consider shutting down every 60 minutes. But EC2 * billing is now by the second, so we check more frequently (during regular polling). */ public void considerShuttingDown() { long now = System.currentTimeMillis(); if (now > shutdownAfter) { LOG.info("Machine has been idle for at least {} minutes (single point) and {} minutes (regional), " + "shutting down.", SINGLE_KEEPALIVE_MINUTES , REGIONAL_KEEPALIVE_MINUTES); // Stop accepting any new single-point requests while shutdown is happening. // TODO maybe actively tell the broker this worker is shutting down. sparkHttpService.stop(); try { Process process = new ProcessBuilder("sudo", "/sbin/shutdown", "-h", "now").start(); process.waitFor(); } catch (Exception ex) { LOG.error("Unable to terminate worker", ex); // TODO email us or something } finally { System.exit(0); } } }
@PreDestroy public void destroy() { if (configuration.isEnabled()) { service.stop(); service.awaitStop(); LOGGER.info("Web admin server stopped"); } }
@Override public void terminate() { if (!isInitialized()) { return; } v1RequestHandler.terminate(); service.stop(); initialized = false; }
@After public void tearDown() throws Exception { httpServer.stop(); }
@After public void tearDown() throws Exception { httpServer.stop(); }