private static void runZKServer(QuorumPeerConfig zkConfig)
    throws IOException, AdminServer.AdminServerException {

    /**
     * Start and schedule the purge task autopurge.purgeInterval is 0 by default,so in fact the
     * DatadirCleanupManager task will not be started to clean the logs by default. Config is
     * recommended only for standalone server.
     */

    DatadirCleanupManager purgeMgr = new DatadirCleanupManager(zkConfig.getDataDir(),
      zkConfig.getDataLogDir(), zkConfig.getSnapRetainCount(), zkConfig.getPurgeInterval());
    purgeMgr.start();

    if (zkConfig.isDistributed()) {
      QuorumPeerMain qp = new QuorumPeerMain();
      qp.runFromConfig(zkConfig);
    } else {
      ZooKeeperServerMain zk = new ZooKeeperServerMain();
      ServerConfig serverConfig = new ServerConfig();
      serverConfig.readFrom(zkConfig);
      zk.runFromConfig(serverConfig);
    }
  }
Parse ZooKeeper configuration from HBase XML config and run a QuorumPeer.
@param args String[] of command line arguments. Not used.
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java