private void processExistsFromCreate(CuratorFramework client, String path) throws Exception {
    byte[] actual;
    try {
      actual = client.getData().forPath(path);
    } catch (Exception ex) {
      LOG.error("Error getting data for the node; will retry creating", ex);
      startCreateCurrentNode();
      return;
    }
    if (Arrays.equals(actual, data)) {
      handleCreatedNode(path);
    } else {
      LOG.info("Data at {} is from a different node: {} (we are {})", path, new String(actual, CHARSET), dataStr);
      nodePath.getAndSet(null);
      chooseSlotToTake(); // Try another slot.
      startCreateCurrentNode();
    }
  }
We would have used the curator ephemeral node with some extra logic but it doesn't handle
the EXISTS condition, which is crucial here; so we c/p parts of Curator and add our logic.
llap-client/src/java/org/apache/hadoop/hive/llap/registry/impl/SlotZnode.java