private void add(int brokerId, Uuid topicId, int newPartition) {
        TimelineHashMap<Uuid, int[]> topicMap = elrMembers.get(brokerId);
        if (topicMap == null) {
            topicMap = new TimelineHashMap<>(snapshotRegistry, 0);
            elrMembers.put(brokerId, topicMap);
        }
        int[] partitions = topicMap.get(topicId);
        int[] newPartitions;
        if (partitions == null) {
            newPartitions = new int[1];
        } else {
            newPartitions = new int[partitions.length + 1];
            System.arraycopy(partitions, 0, newPartitions, 0, partitions.length);
        }
        newPartitions[newPartitions.length - 1] = newPartition;
        topicMap.put(topicId, newPartitions);
    }
Update our records of a partition's ELR.

@param topicId       The topic ID of the partition.
@param partitionId   The partition ID of the partition.
@param prevElr       The previous ELR, or null if the partition is new.
@param nextElr       The new ELR, or null if the partition is being removed.
metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java