コード例 #1
0
 protected void startBookieServer() throws Exception {
   int port = PortManager.nextFreePort();
   File tmpDir =
       org.apache.hedwig.util.FileUtils.createTempDirectory(getClass().getName() + port, "test");
   org.apache.bookkeeper.conf.ServerConfiguration conf =
       newServerConfiguration(
           port, zkUtil.getZooKeeperConnectString(), tmpDir, new File[] {tmpDir});
   conf.setAllowLoopback(true);
   bks.add(startBookie(conf));
   bkConfs.add(conf);
 }
コード例 #2
0
 protected org.apache.bookkeeper.conf.ServerConfiguration newServerConfiguration(
     int port, String zkServers, File journalDir, File[] ledgerDirs) {
   org.apache.bookkeeper.conf.ServerConfiguration conf =
       new org.apache.bookkeeper.conf.ServerConfiguration();
   conf.setAllowLoopback(true);
   conf.setBookiePort(port);
   conf.setZkServers(zkServers);
   conf.setJournalDirName(journalDir.getPath());
   String[] ledgerDirNames = new String[ledgerDirs.length];
   for (int i = 0; i < ledgerDirs.length; i++) {
     ledgerDirNames[i] = ledgerDirs[i].getPath();
   }
   conf.setLedgerDirNames(ledgerDirNames);
   return conf;
 }