private void updatePartitionInfo(
        Uuid topicId,
        Integer partitionId,
        PartitionRegistration prevPartInfo,
        PartitionRegistration newPartInfo
    ) {
        HashSet<Integer> validationSet = new HashSet<>();
        Arrays.stream(newPartInfo.isr).forEach(validationSet::add);
        Arrays.stream(newPartInfo.elr).forEach(validationSet::add);
        if (validationSet.size() != newPartInfo.isr.length + newPartInfo.elr.length) {
            log.error("{}-{} has overlapping ISR={} and ELR={}", topics.get(topicId).name, partitionId,
                Arrays.toString(newPartInfo.isr), Arrays.toString(newPartInfo.elr));
        }
        brokersToIsrs.update(topicId, partitionId, prevPartInfo == null ? null : prevPartInfo.isr,
            newPartInfo.isr, prevPartInfo == null ? NO_LEADER : prevPartInfo.leader, newPartInfo.leader);
        brokersToElrs.update(topicId, partitionId, prevPartInfo == null ? null : prevPartInfo.elr,
            newPartInfo.elr);
    }
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