public void stopServices() { log.debug("Stopping HTTP server"); Closer.close(server); log.debug("Stopping indexer supervisor"); Closer.close(indexerSupervisor); log.debug("Stopping indexer master"); Closer.close(indexerMaster); log.debug("Stopping indexer model"); Closer.close(indexerModel); log.debug("Stopping HBase table pool"); Closer.close(tablePool); log.debug("Stopping ZooKeeper connection"); Closer.close(zk); }
public void stopServices() { log.debug("Stopping HTTP server"); Closer.close(server); log.debug("Stopping indexer supervisor"); Closer.close(indexerSupervisor); log.debug("Stopping indexer master"); Closer.close(indexerMaster); log.debug("Stopping indexer model"); Closer.close(indexerModel); log.debug("Stopping HBase table pool"); Closer.close(tablePool); log.debug("Stopping ZooKeeper connection"); Closer.close(zk); }
public void close() { List<JMXConnector> list = new ArrayList<JMXConnector>(connections.values()); connections.clear(); for (JMXConnector conn : list) { Closer.close(conn); } } }
public void close() { List<JMXConnector> list = new ArrayList<JMXConnector>(connections.values()); connections.clear(); for (JMXConnector conn : list) { Closer.close(conn); } } }
@PreDestroy public void stop() { try { if (leaderElection != null) leaderElection.stop(); } catch (InterruptedException e) { log.info("Interrupted while shutting down leader election."); } Closer.close(jobClient); }
public void stop() { Closer.close(zkWatcher); if (running) { running = false; Closer.close(rpcServer); try { // This ZK node will likely already be gone if the index has been removed // from ZK, but we'll try to remove it here to be sure zk.delete(zkNodePath, -1); } catch (Exception e) { log.debug("Exception while removing zookeeper node", e); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } sepMetrics.shutdown(); for (ThreadPoolExecutor executor : executors) { executor.shutdown(); } }
@Override public boolean hasSubscription(String name) throws IOException { ReplicationAdmin replicationAdmin = new ReplicationAdmin(hbaseConf); try { String internalName = toInternalSubscriptionName(name); return replicationAdmin.listPeerConfigs().containsKey(internalName); } finally { Closer.close(replicationAdmin); } }
public void stop() { Closer.close(zkWatcher); if (running) { running = false; Closer.close(rpcServer); try { // This ZK node will likely already be gone if the index has been removed // from ZK, but we'll try to remove it here to be sure zk.delete(zkNodePath, -1); } catch (Exception e) { log.debug("Exception while removing zookeeper node", e); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } sepMetrics.shutdown(); for (ThreadPoolExecutor executor : executors) { executor.shutdown(); } }
@PreDestroy public void stop() { try { if (leaderElection != null) leaderElection.stop(); } catch (InterruptedException e) { log.info("Interrupted while shutting down leader election."); } executor.shutdown(); try { if (!executor.awaitTermination(60, TimeUnit.SECONDS)) { executor.shutdownNow(); if (!executor.awaitTermination(60, TimeUnit.SECONDS)) { log.error("Could not shut down executor service"); } } } catch (InterruptedException e) { executor.shutdownNow(); Thread.currentThread().interrupt(); } Closer.close(jobClient); }
@Override public boolean hasSubscription(String name) throws IOException { ReplicationAdmin replicationAdmin = new ReplicationAdmin(hbaseConf); try { String internalName = toInternalSubscriptionName(name); return replicationAdmin.listPeers().containsKey(internalName); } finally { Closer.close(replicationAdmin); } }
private static void rollHLog(Configuration conf) throws Exception { HBaseAdmin admin = new HBaseAdmin(conf); try { Collection<ServerName> serverNames = admin.getClusterStatus().getServers(); if (serverNames.size() != 1) { throw new RuntimeException("Expected exactly one region server, but got: " + serverNames.size()); } admin.rollHLogWriter(serverNames.iterator().next().getServerName()); } finally { Closer.close(admin); } } }
Closer.close(replicationAdmin);
Closer.close(replicationAdmin);
Closer.close(replicationAdmin);