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); }