/**
* If block is set, wait until the server comes up
*/
protected void createInstanceFromConfig(boolean block) throws IOException,
InterruptedException {
final ServerConfig serverConfig = new ServerConfig();
if (standalone) {
zkServerMain = new FlumeZKServerMain();
} else {
quorumPeer = new FlumeZKQuorumPeerMain();
}
new Thread() {
public void run() {
if (standalone) {
this.setName("ZooKeeper standalone thread");
LOG.info("Starting ZooKeeper server");
serverConfig.readFrom(config);
try {
zkServerMain.runFromConfig(serverConfig);
} catch (IOException e) {
LOG.error("Couldn't start ZooKeeper server!", e);
}