code: public void init() throws IOException {
      try {
        if (zooKeeper.exists(zooKeeperParentPath, false) == null) {
          zooKeeper.create(zooKeeperParentPath, new byte[] { '0' },
              ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          LOG.info("Created ZNode " + zooKeeperParentPath);
        }
        if (zooKeeper.exists(ledgerParentPath, false) == null) {
          zooKeeper.create(ledgerParentPath, new byte[] { '0' },
              ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
          LOG.info("Created ZNode" + ledgerParentPath);
        }
      } catch (InterruptedException e) {
        interruptedException("Interrupted ensuring that ZNodes " +
            zooKeeperParentPath + " and " + ledgerParentPath + " exist!", e);
      } catch (KeeperException e) {
        keeperException(
            "Unrecoverable ZooKeeper error ensuring that ZNodes "
                + zooKeeperParentPath + " and " + ledgerParentPath + " exist!",
            e);
      }
    }
docs: Create znodes for storing ledger metadata if they have not been
  created before
  @throws IOException If there an unrecoverable error talking to ZooKeeper