@Override
        public void setPartition(int partition) {
            assert partition != RecordMetadata.UNKNOWN_PARTITION;
            this.partition = partition;

            if (log.isTraceEnabled()) {
                // Log the message here, because we don't know the partition before that.
                log.trace("Attempting to append record {} with callback {} to topic {} partition {}", recordLogString, userCallback, topic, partition);
            }
        }
Callbacks that are called by the RecordAccumulator append functions:
 - user callback
 - interceptor callbacks
 - partition callback
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java