public int partition(String topic, Cluster cluster) {
        Integer part = indexCache.get(topic);
        if (part == null) {
            return nextPartition(topic, cluster, -1);
        }
        return part;
    }
An internal class that implements a cache used for sticky partitioning behavior. The cache tracks the current sticky
partition for any given topic. This class should not be used externally.
clients/src/main/java/org/apache/kafka/clients/producer/internals/StickyPartitionCache.java