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


Java BookieServer.isRunning方法代码示例

本文整理汇总了Java中org.apache.bookkeeper.proto.BookieServer.isRunning方法的典型用法代码示例。如果您正苦于以下问题:Java BookieServer.isRunning方法的具体用法?Java BookieServer.isRunning怎么用?Java BookieServer.isRunning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.bookkeeper.proto.BookieServer的用法示例。


在下文中一共展示了BookieServer.isRunning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newBookie

import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
BookieServer newBookie() throws Exception {
  int port = nextPort++;
  ServerConfiguration bookieConf = new ServerConfiguration();
  bookieConf.setBookiePort(port);
  File tmpdir = File.createTempFile("bookie" + Integer.toString(port) + "_",
                                    "test");
  tmpdir.delete();
  tmpdir.mkdir();

  bookieConf.setZkServers(zkEnsemble);
  bookieConf.setJournalDirName(tmpdir.getPath());
  bookieConf.setLedgerDirNames(new String[] { tmpdir.getPath() });

  BookieServer b = new BookieServer(bookieConf);
  b.start();
  for (int i = 0; i < 10 && !b.isRunning(); i++) {
    Thread.sleep(10000);
  }
  if (!b.isRunning()) {
    throw new IOException("Bookie would not start");
  }
  return b;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:BKJMUtil.java

示例2: startNewBookie

import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
/**
 * Helper method to startup a new bookie server with the indicated port
 * number
 * 
 * @param port
 *            Port to start the new bookie server on
 * @throws IOException
 */
private void startNewBookie(int port)
throws IOException, InterruptedException {
    File f = File.createTempFile("bookie", "test");
    tmpDirs.add(f);
    f.delete();
    f.mkdir();
    BookieServer server = new BookieServer(port, HOSTPORT, f, new File[] { f });
    server.start();
    bs.add(server);
    while(!server.isRunning()){
        Thread.sleep(500);
    }
    LOG.info("New bookie on port " + port + " has been created.");
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:23,代码来源:BookieRecoveryTest.java

示例3: newBookie

import org.apache.bookkeeper.proto.BookieServer; //导入方法依赖的package包/类
public BookieServer newBookie() throws Exception {
    ServerConfiguration bookieConf = new ServerConfiguration();
    bookieConf.setZkTimeout(zkTimeoutSec * 1000);
    bookieConf.setBookiePort(0);
    bookieConf.setAllowLoopback(true);
    File tmpdir = File.createTempFile("bookie" + UUID.randomUUID() + "_",
        "test");
    if (!tmpdir.delete()) {
        LOG.debug("Fail to delete tmpdir " + tmpdir);
    }
    if (!tmpdir.mkdir()) {
        throw new IOException("Fail to create tmpdir " + tmpdir);
    }
    tmpDirs.add(tmpdir);

    bookieConf.setZkServers(zkEnsemble);
    bookieConf.setJournalDirName(tmpdir.getPath());
    bookieConf.setLedgerDirNames(new String[]{tmpdir.getPath()});

    BookieServer b = new BookieServer(bookieConf);
    b.start();
    for (int i = 0; i < 10 && !b.isRunning(); i++) {
        Thread.sleep(10000);
    }
    if (!b.isRunning()) {
        throw new IOException("Bookie would not start");
    }
    return b;
}
 
开发者ID:twitter,项目名称:distributedlog,代码行数:30,代码来源:LocalDLMEmulator.java


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