private boolean create(Path path, Duration ttl, Stat stat) {
        if (exists(path)) return false;

        String absolutePath = path.getAbsolute();
        try {
            CreateBuilder b = framework().create();
            if (ttl != null) {
                long millis = ttl.toMillis();
                if (millis <= 0 || millis > EphemeralType.TTL.maxValue())
                    throw new IllegalArgumentException(ttl.toString());
                b.withTtl(millis).withMode(CreateMode.PERSISTENT_WITH_TTL);
            }
            if (stat == null) b.creatingParentsIfNeeded()                    .forPath(absolutePath, new byte[0]);
            else              b.creatingParentsIfNeeded().storingStatIn(stat).forPath(absolutePath, new byte[0]);
        } catch (org.apache.zookeeper.KeeperException.NodeExistsException e) {
            // Path created between exists() and create() call, do nothing
        } catch (Exception e) {
            throw new RuntimeException("Could not create " + absolutePath, e);
        }
        return true;
    }
Creates an empty node at a path, creating any parents as necessary.
If the node already exists nothing is done.
Returns whether a change was attempted.
zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java