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


Java ZooKeeperServer.BasicDataTreeBuilder方法代码示例

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


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

示例1: prepareLeader

import org.apache.zookeeper.server.ZooKeeperServer; //导入方法依赖的package包/类
private LeaderZooKeeperServer prepareLeader(File tmpDir, QuorumPeer peer)
throws IOException, NoSuchFieldException, IllegalAccessException {
    FileTxnSnapLog logFactory = new FileTxnSnapLog(tmpDir, tmpDir);
    peer.setTxnFactory(logFactory);
    Field addrField = peer.getClass().getDeclaredField("myQuorumAddr");
    addrField.setAccessible(true);
    addrField.set(peer, new InetSocketAddress(PortAssignment.unique()));
    ZKDatabase zkDb = new ZKDatabase(logFactory);
    LeaderZooKeeperServer zk = new LeaderZooKeeperServer(logFactory, peer, new ZooKeeperServer.BasicDataTreeBuilder(), zkDb);
    return zk;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:12,代码来源:Zab1_0Test.java

示例2: createFollower

import org.apache.zookeeper.server.ZooKeeperServer; //导入方法依赖的package包/类
private ConversableFollower createFollower(File tmpDir, QuorumPeer peer)
throws IOException {
    FileTxnSnapLog logFactory = new FileTxnSnapLog(tmpDir, tmpDir);
    peer.setTxnFactory(logFactory);
    ZKDatabase zkDb = new ZKDatabase(logFactory);
    FollowerZooKeeperServer zk = new FollowerZooKeeperServer(logFactory, peer, new ZooKeeperServer.BasicDataTreeBuilder(), zkDb);
    peer.setZKDatabase(zkDb);
    return new ConversableFollower(peer, zk);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:10,代码来源:Zab1_0Test.java

示例3: createObserver

import org.apache.zookeeper.server.ZooKeeperServer; //导入方法依赖的package包/类
private ConversableObserver createObserver(File tmpDir, QuorumPeer peer)
        throws IOException {
    FileTxnSnapLog logFactory = new FileTxnSnapLog(tmpDir, tmpDir);
    peer.setTxnFactory(logFactory);
    DataTreeBuilder treeBuilder = new ZooKeeperServer.BasicDataTreeBuilder();
    ZKDatabase zkDb = new ZKDatabase(logFactory);
    ObserverZooKeeperServer zk = new ObserverZooKeeperServer(logFactory, peer, treeBuilder, zkDb);
    peer.setZKDatabase(zkDb);
    return new ConversableObserver(peer, zk);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:11,代码来源:Zab1_0Test.java

示例4: prepareLeader

import org.apache.zookeeper.server.ZooKeeperServer; //导入方法依赖的package包/类
private LeaderZooKeeperServer prepareLeader(File tmpDir, QuorumPeer peer)
        throws IOException, NoSuchFieldException, IllegalAccessException {
    FileTxnSnapLog logFactory = new FileTxnSnapLog(tmpDir, tmpDir);
    peer.setTxnFactory(logFactory);
    Field addrField = peer.getClass().getDeclaredField("myQuorumAddr");
    addrField.setAccessible(true);
    addrField.set(peer, new InetSocketAddress(PortAssignment.unique()));
    ZKDatabase zkDb = new ZKDatabase(logFactory);
    LeaderZooKeeperServer zk = new LeaderZooKeeperServer(logFactory, peer,
            new ZooKeeperServer.BasicDataTreeBuilder(), zkDb);
    return zk;
}
 
开发者ID:l294265421,项目名称:ZooKeeper,代码行数:13,代码来源:QuorumCnxManagerTest.java

示例5: makeFollower

import org.apache.zookeeper.server.ZooKeeperServer; //导入方法依赖的package包/类
protected Follower makeFollower(FileTxnSnapLog logFactory) throws IOException {
    return new Follower(this, new FollowerZooKeeperServer(logFactory, 
            this,new ZooKeeperServer.BasicDataTreeBuilder(), this.zkDb));
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:5,代码来源:QuorumPeer.java

示例6: makeLeader

import org.apache.zookeeper.server.ZooKeeperServer; //导入方法依赖的package包/类
protected Leader makeLeader(FileTxnSnapLog logFactory) throws IOException {
    return new Leader(this, new LeaderZooKeeperServer(logFactory,
            this,new ZooKeeperServer.BasicDataTreeBuilder(), this.zkDb));
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:5,代码来源:QuorumPeer.java

示例7: makeObserver

import org.apache.zookeeper.server.ZooKeeperServer; //导入方法依赖的package包/类
protected Observer makeObserver(FileTxnSnapLog logFactory) throws IOException {
    return new Observer(this, new ObserverZooKeeperServer(logFactory,
            this, new ZooKeeperServer.BasicDataTreeBuilder(), this.zkDb));
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:5,代码来源:QuorumPeer.java


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