@Override
        public boolean test(int brokerId) {
            if (!isAcceptableLeader.test(brokerId)) {
                return false;
            }
            if (ElasticStreamSwitch.isEnabled()) {
                // AutoMQ don't have local files
                return true;
            }
            Uuid replicaDirectory = partition.directory(brokerId);
            return clusterControl.hasOnlineDir(brokerId, replicaDirectory);
        }
Updates the directory to partition mapping for a single partition.
Assignments to reserved directory IDs are ignored, since they cannot
be used for directories, there's no use in maintaining a set of
partitions assigned to them.
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java