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


Java ServerConfiguration.setUseHostNameAsBookieID方法代码示例

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


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

示例1: startBookie

import org.apache.bookkeeper.conf.ServerConfiguration; //导入方法依赖的package包/类
public void startBookie() throws Exception {
        ServerConfiguration conf = new ServerConfiguration();
        conf.setBookiePort(5621);
        conf.setUseHostNameAsBookieID(true);

        Path targetDir = path.resolve("bookie_data");
        conf.setZkServers("localhost:1282");
        conf.setLedgerDirNames(new String[]{targetDir.toAbsolutePath().toString()});
        conf.setJournalDirName(targetDir.toAbsolutePath().toString());        
        conf.setFlushInterval(10000);
        conf.setGcWaitTime(5);
        conf.setJournalFlushWhenQueueEmpty(true);
//        conf.setJournalBufferedEntriesThreshold(1);
        conf.setAutoRecoveryDaemonEnabled(false);
        conf.setEnableLocalTransport(true);

        conf.setAllowLoopback(true);
        conf.setProperty("journalMaxGroupWaitMSec", 10); // default 200ms            

        ClientConfiguration adminConf = new ClientConfiguration(conf);
        BookKeeperAdmin.format(adminConf, false, true);
        this.bookie = new BookieServer(conf);
        this.bookie.start();
    }
 
开发者ID:diennea,项目名称:herddb,代码行数:25,代码来源:ZKTestEnv.java

示例2: startBookie

import org.apache.bookkeeper.conf.ServerConfiguration; //导入方法依赖的package包/类
public void startBookie() throws Exception {
        ServerConfiguration conf = new ServerConfiguration();
        conf.setBookiePort(5621);
        conf.setUseHostNameAsBookieID(true);

        Path targetDir = path.resolve("bookie_data");
        conf.setZkServers("localhost:1282");
        conf.setLedgerDirNames(new String[]{targetDir.toAbsolutePath().toString()});
        conf.setJournalDirName(targetDir.toAbsolutePath().toString());
        conf.setFlushInterval(1000);
        conf.setJournalFlushWhenQueueEmpty(true);
        conf.setGcWaitTime(10);
        conf.setAutoRecoveryDaemonEnabled(false);
        
        // in unit tests we do not need real network for bookies
        conf.setEnableLocalTransport(true);
//        conf.setDisableServerSocketBind(true);

        conf.setAllowLoopback(true);

        ClientConfiguration adminConf = new ClientConfiguration(conf);
        BookKeeperAdmin.format(adminConf, false, true);
        this.bookie = new BookieServer(conf);
        this.bookie.start();
    }
 
开发者ID:diennea,项目名称:majordodo,代码行数:26,代码来源:ZKTestEnv.java

示例3: startBookie

import org.apache.bookkeeper.conf.ServerConfiguration; //导入方法依赖的package包/类
public void startBookie() throws Exception {
    ServerConfiguration conf = new ServerConfiguration();
    conf.setBookiePort(5621);
    conf.setUseHostNameAsBookieID(true);

    Path targetDir = path.resolve("bookie_data");
    conf.setZkServers("localhost:1282");
    conf.setLedgerDirNames(new String[]{targetDir.toAbsolutePath().toString()});
    conf.setJournalDirName(targetDir.toAbsolutePath().toString());
    conf.setFlushInterval(1000);
    conf.setAutoRecoveryDaemonEnabled(false);

    conf.setAllowLoopback(true);

    ClientConfiguration adminConf = new ClientConfiguration(conf);
    BookKeeperAdmin.format(adminConf, false, true);
    this.bookie = new BookieServer(conf);
    this.bookie.start();
}
 
开发者ID:diennea,项目名称:majordodo,代码行数:20,代码来源:ZKTestEnv.java

示例4: startBookie

import org.apache.bookkeeper.conf.ServerConfiguration; //导入方法依赖的package包/类
public void startBookie(boolean format) throws Exception {
        if (bookie != null) {
            throw new Exception("bookie already started");
        }
        ServerConfiguration conf = new ServerConfiguration();
        conf.setBookiePort(5621);
        conf.setUseHostNameAsBookieID(true);

        Path targetDir = path.resolve("bookie_data");
        conf.setZkServers("localhost:1282");
        conf.setLedgerDirNames(new String[]{targetDir.toAbsolutePath().toString()});
        conf.setJournalDirName(targetDir.toAbsolutePath().toString());
        conf.setFlushInterval(10000);
        conf.setGcWaitTime(5);
        conf.setJournalFlushWhenQueueEmpty(true);
//        conf.setJournalBufferedEntriesThreshold(1);
        conf.setAutoRecoveryDaemonEnabled(false);
        conf.setEnableLocalTransport(true);

        conf.setAllowLoopback(true);
        conf.setProperty("journalMaxGroupWaitMSec", 10); // default 200ms            

        if (format) {
            ClientConfiguration adminConf = new ClientConfiguration(conf);
            BookKeeperAdmin.format(adminConf, false, true);
        }
        this.bookie = new BookieServer(conf);
        this.bookie.start();
    }
 
开发者ID:diennea,项目名称:herddb,代码行数:30,代码来源:ZKTestEnv.java


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