public static int checkExists(ZooKeeperWatcher zkw, String zkNode) throws KeeperException {
        try {
            Stat s = zkw.getRecoverableZooKeeper().exists(zkNode, null);
            return s != null ? s.getVersion() : -1;
        } catch (KeeperException e) {
            logger.warn(zkw.prefix("Unable to set watcher on zkNode (" + zkNode + ")"), e);
            zkw.keeperException(e);
            return -1;
        } catch (InterruptedException e) {
            logger.warn(zkw.prefix("Unable to set watcher on zkNode (" + zkNode + ")"), e);
            zkw.interruptedException(e);
            return -1;
        }
    }
Check if the specified node exists. Sets no watches.
<p/>
Returns true if node exists, false if not. Returns an exception if there is an unexpected
zookeeper exception.

@param zkw   zk reference
@param zkNode path of node to watch
@return version of the node if it exists, -1 if does not exist
@throws KeeperException if unexpected zookeeper exception
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/zookeeper/ZKUtil.java