public String createPersistentSequential(String path, boolean createParents) throws ZkInterruptedException,
                                                                                IllegalArgumentException, ZkException,
                                                                                RuntimeException {
        try {
            return create(path, null, CreateMode.PERSISTENT_SEQUENTIAL);
        } catch (ZkNoNodeException e) {
            if (!createParents) {
                throw e;
            }
            String parentDir = path.substring(0, path.lastIndexOf('/'));
            createPersistent(parentDir, createParents);
            return createPersistentSequential(path, createParents);
        }
    }
Create a persistent Sequential node.

@param path
@param createParents if true all parent dirs are created as well and no {@link ZkNodeExistsException} is thrown
in case the path already exists
@throws ZkInterruptedException if operation was interrupted, or a required reconnection got interrupted
@throws IllegalArgumentException if called from anything except the ZooKeeper event thread
@throws ZkException if any ZooKeeper exception occurred
@throws RuntimeException if any other exception occurs
shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java