public boolean markAndGetBrokerAuthStatus(int brokerId, boolean isForce) {
        boolean needAuth = false;
        AtomicBoolean authStatus = nextWithAuthInfo2BMap.get(brokerId);
        if (authStatus == null) {
            AtomicBoolean tmpAuthStatus = new AtomicBoolean(false);
            authStatus =
                    nextWithAuthInfo2BMap.putIfAbsent(brokerId, tmpAuthStatus);
            if (authStatus == null) {
                authStatus = tmpAuthStatus;
            }
        }
        if (isForce) {
            needAuth = true;
            authStatus.set(false);
        } else if (authStatus.get()) {
            if (authStatus.compareAndSet(true, false)) {
                needAuth = true;
            }
        }
        return needAuth;
    }
Book and get Broker's authentication status

@param brokerId     the broker id to query
@param isForce    whether force authentication
@return           whether to require authentication
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/consumer/RmtDataCache.java