Repository: kafka Updated Branches: refs/heads/0.11.0 384293911 -> 358ccf093
Revert "KAFKA-5098; ProducerRecord should validate the topic name" We need to verify that this doesn't cause a performance regression, so reverting until that is done. This reverts commit c4b6df975d2738a42184f246df06581c4be1d540. Project: http://git-wip-us.apache.org/repos/asf/kafka/repo Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/358ccf09 Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/358ccf09 Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/358ccf09 Branch: refs/heads/0.11.0 Commit: 358ccf0932c6fb65f5b42dfec31adc1561d7e4f5 Parents: 3842939 Author: Ismael Juma <[email protected]> Authored: Sun Jun 4 17:25:01 2017 +0100 Committer: Ismael Juma <[email protected]> Committed: Sun Jun 4 17:25:01 2017 +0100 ---------------------------------------------------------------------- .../org/apache/kafka/clients/producer/ProducerRecord.java | 9 --------- 1 file changed, 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kafka/blob/358ccf09/clients/src/main/java/org/apache/kafka/clients/producer/ProducerRecord.java ---------------------------------------------------------------------- diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/ProducerRecord.java b/clients/src/main/java/org/apache/kafka/clients/producer/ProducerRecord.java index 5cac3ac..85428e5 100644 --- a/clients/src/main/java/org/apache/kafka/clients/producer/ProducerRecord.java +++ b/clients/src/main/java/org/apache/kafka/clients/producer/ProducerRecord.java @@ -16,11 +16,9 @@ */ package org.apache.kafka.clients.producer; -import org.apache.kafka.common.errors.InvalidTopicException; import org.apache.kafka.common.header.Header; import org.apache.kafka.common.header.Headers; import org.apache.kafka.common.header.internals.RecordHeaders; -import org.apache.kafka.common.internals.Topic; /** * A key/value pair to be sent to Kafka. This consists of a topic name to which the record is being sent, an optional @@ -64,17 +62,10 @@ public class ProducerRecord<K, V> { * @param key The key that will be included in the record * @param value The record contents * @param headers the headers that will be included in the record - * @throws IllegalArgumentException if the topic name is null or invalid - * @throws IllegalArgumentException if the partition or timestamp is negative */ public ProducerRecord(String topic, Integer partition, Long timestamp, K key, V value, Iterable<Header> headers) { if (topic == null) throw new IllegalArgumentException("Topic cannot be null."); - try { - Topic.validate(topic); - } catch (InvalidTopicException e) { - throw new IllegalArgumentException(e.getMessage()); - } if (timestamp != null && timestamp < 0) throw new IllegalArgumentException( String.format("Invalid timestamp: %d. Timestamp should always be non-negative or null.", timestamp));
