本文整理汇总了Java中org.apache.bookkeeper.proto.BookieServer.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Java BookieServer.shutdown方法的具体用法?Java BookieServer.shutdown怎么用?Java BookieServer.shutdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.bookkeeper.proto.BookieServer
的用法示例。
在下文中一共展示了BookieServer.shutdown方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stopBKCluster
import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
/**
* Stop cluster. Also, stops all the auto recovery processes for the bookie cluster, if isAutoRecoveryEnabled is
* true.
*
* @throws Exception
*/
protected void stopBKCluster() throws Exception {
if (bkc != null) {
bkc.close();
}
for (BookieServer server : bs) {
server.shutdown();
AutoRecoveryMain autoRecovery = autoRecoveryProcesses.get(server);
if (autoRecovery != null && isAutoRecoveryEnabled()) {
autoRecovery.shutdown();
LOG.debug("Shutdown auto recovery for bookieserver:" + server.getLocalAddress());
}
}
bs.clear();
for (File f : tmpDirs) {
FileUtils.deleteDirectory(f);
}
}
示例2: killBookie
import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
/**
* Kill a bookie by its socket address. Also, stops the autorecovery process for the corresponding bookie server, if
* isAutoRecoveryEnabled is true.
*
* @param addr
* Socket Address
* @return the configuration of killed bookie
* @throws InterruptedException
*/
public ServerConfiguration killBookie(InetSocketAddress addr) throws Exception {
BookieServer toRemove = null;
int toRemoveIndex = 0;
for (BookieServer server : bs) {
if (server.getLocalAddress().equals(addr)) {
server.shutdown();
toRemove = server;
break;
}
++toRemoveIndex;
}
if (toRemove != null) {
stopAutoRecoveryService(toRemove);
bs.remove(toRemove);
return bsConfs.remove(toRemoveIndex);
}
return null;
}
示例3: restartBookies
import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
/**
* Restart bookie servers using new configuration settings. Also restart the respective auto recovery process, if
* isAutoRecoveryEnabled is true.
*
* @param newConf
* New Configuration Settings
* @throws InterruptedException
* @throws IOException
* @throws KeeperException
* @throws BookieException
*/
public void restartBookies(ServerConfiguration newConf) throws Exception {
// shut down bookie server
for (BookieServer server : bs) {
server.shutdown();
stopAutoRecoveryService(server);
}
bs.clear();
Thread.sleep(1000);
// restart them to ensure we can't
List<ServerConfiguration> bsConfsCopy = new ArrayList<ServerConfiguration>(bsConfs);
bsConfs.clear();
for (ServerConfiguration conf : bsConfsCopy) {
if (null != newConf) {
conf.loadConf(newConf);
}
startBookie(conf);
}
}
示例4: teardownBookkeeper
import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
@AfterClass
public static void teardownBookkeeper() throws Exception {
bkutil.teardown();
for (BookieServer bk : bks) {
bk.shutdown();
}
}
示例5: tearDown
import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
@After
@Override
public void tearDown() throws Exception {
LOG.info("TearDown");
if (bkc != null) {
bkc.halt();;
}
for (BookieServer server : bs) {
server.shutdown();
}
for (File f : tmpDirs) {
cleanUpDir(f);
}
// shutdown ZK server
if (serverFactory != null) {
serverFactory.shutdown();
assertTrue("waiting for server down", ClientBase.waitForServerDown(HOSTPORT, ClientBase.CONNECTION_TIMEOUT));
}
// ServerStats.unregister();
cleanUpDir(ZkTmpDir);
}
示例6: stop
import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
public void stop() throws Exception {
LOG.debug("Local ZK/BK stopping ...");
for (BookieServer bookie : bs) {
bookie.shutdown();
}
zkc.close();
zks.shutdown();
serverFactory.shutdown();
LOG.debug("Local ZK/BK stopped");
}
示例7: shutdown
import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
public void shutdown() {
BookieServer bookie = getBookie();
if (bookie == null) {
LOG.warn("Trying to shutdown a bookie " + bookieId +
" that has not been initialized!");
} else {
bookie.shutdown();
}
}