public String getKey() {
        String key = null;
        if (repeatingKeys != null) {
            key = Integer.toString(keyCounter++);
            if (keyCounter == repeatingKeys) {
                keyCounter = 0;
            }
        }
        return key;
    }
Returns a string to publish: ether 'valuePrefix'.'val' or 'val'
tools/src/main/java/org/apache/kafka/tools/VerifiableProducer.java