本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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;
}
示例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));
}
示例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));
}
示例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));
}