code: public boolean writeEditLogLedgerMetadata(String fullyQualifiedPath,
        EditLogLedgerMetadata editLogLedgerMetadata) throws IOException {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Attempting to write " + editLogLedgerMetadata + " to " +
            fullyQualifiedPath);
      }
      EditLogLedgerMetadataWritable writable = localWritable.get();
      writable.set(editLogLedgerMetadata);
      byte[] data = WritableUtil.writableToByteArray(writable);
      try {
        if (zooKeeper.exists(fullyQualifiedPath, false) != null) {
          LOG.warn(fullyQualifiedPath + " already exists. Will not override!");
          return false;
        }
        zooKeeper.create(fullyQualifiedPath, data, ZooDefs.Ids.OPEN_ACL_UNSAFE,
          CreateMode.PERSISTENT);
        return true;
      } catch (InterruptedException e) {
        interruptedException("Interrupted creating " + fullyQualifiedPath,
            e);
        return false; // never reached
      } catch (KeeperException.NodeExistsException e) {
        LOG.warn(fullyQualifiedPath +
            " already exists, returning false! Ignoring " + e);
        return false;
      } catch (KeeperException e) {
        keeperException("Unrecoverable ZooKeeper error creating " +
            fullyQualifiedPath, e);
        return false;
      }
    }
docs: Write an {@link EditLogLedgerMetadata} object to a specified ZNode.
  @param fullyQualifiedPath Full path to the ZNode containing the ledger
  metadata.
  @param editLogLedgerMetadata The edit log ledger metadata to write.
  @return True if we wrote successfully to the specified ZNode, or false if
  the ZNode already exists.
  @throws IOException If there is an unrecoverable error communicating with
  ZooKeeper.