@Override public void close() { instance.get().close(); }
@Override protected void shutDown() { this.serviceBuilder.close(); stopBookKeeper(); val zk = this.zkClient; if (zk != null) { zk.close(); this.zkClient = null; } StatsProvider sp = this.statsProvider; if (sp != null) { sp.close(); this.statsProvider = null; } Runtime.getRuntime().removeShutdownHook(this.stopBookKeeperProcess); }
public void shutdown() { if (!this.closed) { this.serviceBuilder.close(); log.info("StreamSegmentService shut down."); if (this.listener != null) { this.listener.close(); log.info("PravegaConnectionListener closed."); } if (this.statsProvider != null) { statsProvider.close(); statsProvider = null; log.info("Metrics statsProvider is now closed."); } if (this.zkClient != null) { this.zkClient.close(); this.zkClient = null; log.info("ZooKeeper Client shut down."); } if (this.segmentStatsFactory != null) { segmentStatsFactory.close(); } if (this.serviceConfig.isSecureZK()) { ZKTLSUtils.unsetSecureZKClientProperties(); } this.closed = true; } }
@After public void tearDown() throws Exception { if (this.statsProvider != null) { statsProvider.close(); statsProvider = null; log.info("Metrics statsProvider is now closed."); } if (this.controllerWrapper != null) { this.controllerWrapper.close(); this.controllerWrapper = null; } if (this.server != null) { this.server.close(); this.server = null; } if (this.zkTestServer != null) { this.zkTestServer.close(); this.zkTestServer = null; } }
@After public void tearDown() throws Exception { if (this.statsProvider != null) { statsProvider.close(); statsProvider = null; log.info("Metrics statsProvider is now closed."); } ExecutorServiceHelpers.shutdown(executor); controllerWrapper.close(); server.close(); serviceBuilder.close(); zkTestServer.close(); }
} finally { if (statsProvider != null) { statsProvider.close();