List of usage examples for org.apache.zookeeper.server ServerCnxnFactory shutdown
public abstract void shutdown();
From source file:com.googlecode.jmxtrans.model.output.kafka.EmbeddedZookeeper.java
License:Open Source License
@Override public void after() { LOGGER.info("Stopping Zookeeper"); ServerCnxnFactory serverCnxFactory = getServerCnxnFactory(); if (serverCnxFactory != null) { serverCnxFactory.shutdown(); }/*from w w w.j a v a 2 s.c om*/ }
From source file:org.apache.apex.malhar.contrib.kafka.KafkaOperatorTestBase.java
License:Apache License
public void stopZookeeper() { for (ServerCnxnFactory zkf : zkFactory) { if (zkf != null) { zkf.shutdown(); }//from w w w .j a v a 2 s . c o m } }
From source file:org.apache.apex.malhar.kafka.KafkaOperatorTestBase.java
License:Apache License
public static void stopZookeeper() { for (ZooKeeperServer zs : zkServer) { if (zs != null) { zs.shutdown();//ww w . ja v a 2 s . c o m } } for (ServerCnxnFactory zkf : zkFactory) { if (zkf != null) { zkf.closeAll(); zkf.shutdown(); } } zkServer = new ZooKeeperServer[2]; zkFactory = new ServerCnxnFactory[2]; }
From source file:org.apache.hadoop.ha.ClientBaseWithFixes.java
License:Apache License
static void shutdownServerInstance(ServerCnxnFactory factory, String hostPort) { if (factory != null) { ZKDatabase zkDb;//from w ww. j a v a 2 s .c o m { ZooKeeperServer zs = getServer(factory); zkDb = zs.getZKDatabase(); } factory.shutdown(); try { zkDb.close(); } catch (IOException ie) { LOG.warn("Error closing logs ", ie); } final int PORT = getPort(hostPort); Assert.assertTrue("waiting for server down", ClientBaseWithFixes.waitForServerDown("127.0.0.1:" + PORT, CONNECTION_TIMEOUT)); } }