kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: Revert "KAFKA-5098; ProducerRecord should validate the topic name"
Date Sun, 04 Jun 2017 16:24:14 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 9b58372dc -> d7ec9feaf


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 941e2177c0cf57eff818192258300d256971a11e.


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/d7ec9fea
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/d7ec9fea
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/d7ec9fea

Branch: refs/heads/trunk
Commit: d7ec9feaf1c2d2fc79218a798394f4665e4d72d0
Parents: 9b58372
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Sun Jun 4 17:15:31 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Sun Jun 4 17:15:31 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/d7ec9fea/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));


Mime
View raw message