public static void updatePersistentPath(final ZooKeeperWatcher zkw, final String path,
            final String data) throws Exception {
        byte[] bytes = (data == null ? null : StringUtils.getBytesUtf8(data));
        try {
            ZKUtil.setData(zkw, path, bytes);
        } catch (final NoNodeException e) {
            createParentPath(zkw, path);
            ZKUtil.createAndWatch(zkw, path, bytes);
        } catch (final Exception e) {
            throw e;
        }
    }
Update the value of a persistent node with the given path and data. create parent directory
if necessary. Never throw NodeExistException.
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/zookeeper/ZKUtil.java