当前位置: 首页>>代码示例>>Java>>正文


Java BookieServer.shutdown方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:25,代码来源:BookKeeperClusterTestCase.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:28,代码来源:BookKeeperClusterTestCase.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:31,代码来源:BookKeeperClusterTestCase.java

示例4: teardownBookkeeper

import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
@AfterClass
public static void teardownBookkeeper() throws Exception {
  bkutil.teardown();
  for (BookieServer bk : bks) {
    bk.shutdown();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestBookKeeperSpeculativeRead.java

示例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);
    

}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:28,代码来源:BaseTestCase.java

示例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");
}
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:12,代码来源:LocalBookkeeperEnsemble.java

示例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();
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:10,代码来源:MiniBookKeeperCluster.java


注:本文中的org.apache.bookkeeper.proto.BookieServer.shutdown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。