return new MockLeader(peer, zk);
}
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(33556));
ZKDatabase zkDb = new ZKDatabase(logFactory);