public boolean hasOnlineDir(int brokerId, Uuid directoryId) {
        BrokerRegistration registration = registration(brokerId);
        return registration != null && registration.hasOnlineDir(directoryId);
    }
Determines whether the specified directory is online in the specified broker.
Returns false whether the directory is not online or the broker is not registered.
metadata/src/main/java/org/apache/kafka/controller/ClusterControlManager.java