You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jg...@apache.org on 2017/05/08 17:39:23 UTC

kafka git commit: KAFKA-3763; Remove deprecated APIs for 0.11.0.0

Repository: kafka
Updated Branches:
  refs/heads/trunk 3bcadbfb4 -> 59b918ec2


KAFKA-3763; Remove deprecated APIs for 0.11.0.0

This only removes deprecated methods,
fields and constructors in a small number of classes.

Deprecated producer configs is tracked via KAFKA-3353
and the old clients and related (tools, etc.) won't
be removed in 0.11.0.0.

Author: Ismael Juma <is...@juma.me.uk>

Reviewers: Jason Gustafson <ja...@confluent.io>

Closes #2995 from ijuma/kafka-3763-remove-deprecated-0.11


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

Branch: refs/heads/trunk
Commit: 59b918ec2be5ec69fd5b62613e7665510f5217c0
Parents: 3bcadbf
Author: Ismael Juma <is...@juma.me.uk>
Authored: Mon May 8 10:29:31 2017 -0700
Committer: Jason Gustafson <ja...@confluent.io>
Committed: Mon May 8 10:29:31 2017 -0700

----------------------------------------------------------------------
 .../kafka/clients/CommonClientConfigs.java      |  5 --
 .../java/org/apache/kafka/common/Cluster.java   | 14 -----
 .../org/apache/kafka/common/MetricName.java     | 64 --------------------
 docs/upgrade.html                               |  1 +
 4 files changed, 1 insertion(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/59b918ec/clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java b/clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
index b2c8937..e06900c 100644
--- a/clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
+++ b/clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
@@ -36,11 +36,6 @@ public class CommonClientConfigs {
                                                        + "<code>host1:port1,host2:port2,...</code>. Since these servers are just used for the initial connection to "
                                                        + "discover the full cluster membership (which may change dynamically), this list need not contain the full set of "
                                                        + "servers (you may want more than one, though, in case a server is down).";
-    /**
-     * @deprecated This will be removed in a future release. Please use {@link #BOOTSTRAP_SERVERS_DOC}
-     */
-    @Deprecated
-    public static final String BOOSTRAP_SERVERS_DOC = BOOTSTRAP_SERVERS_DOC;
 
     public static final String METADATA_MAX_AGE_CONFIG = "metadata.max.age.ms";
     public static final String METADATA_MAX_AGE_DOC = "The period of time in milliseconds after which we force a refresh of metadata even if we haven't seen any partition leadership changes to proactively discover any new brokers or partitions.";

http://git-wip-us.apache.org/repos/asf/kafka/blob/59b918ec/clients/src/main/java/org/apache/kafka/common/Cluster.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/common/Cluster.java b/clients/src/main/java/org/apache/kafka/common/Cluster.java
index 6619b4c..0c59f33 100644
--- a/clients/src/main/java/org/apache/kafka/common/Cluster.java
+++ b/clients/src/main/java/org/apache/kafka/common/Cluster.java
@@ -46,20 +46,6 @@ public final class Cluster {
     private final ClusterResource clusterResource;
 
     /**
-     * Create a new cluster with the given nodes and partitions
-     * @param nodes The nodes in the cluster
-     * @param partitions Information about a subset of the topic-partitions this cluster hosts
-     * @deprecated Use the Cluster constructor with 5 parameters
-     */
-    @Deprecated
-    public Cluster(Collection<Node> nodes,
-                   Collection<PartitionInfo> partitions,
-                   Set<String> unauthorizedTopics) {
-        this(null, false, nodes, partitions, unauthorizedTopics, Collections.<String>emptySet(), null);
-    }
-
-
-    /**
      * Create a new cluster with the given id, nodes and partitions
      * @param nodes The nodes in the cluster
      * @param partitions Information about a subset of the topic-partitions this cluster hosts

http://git-wip-us.apache.org/repos/asf/kafka/blob/59b918ec/clients/src/main/java/org/apache/kafka/common/MetricName.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/common/MetricName.java b/clients/src/main/java/org/apache/kafka/common/MetricName.java
index cd1ae4e..2136a72 100644
--- a/clients/src/main/java/org/apache/kafka/common/MetricName.java
+++ b/clients/src/main/java/org/apache/kafka/common/MetricName.java
@@ -16,7 +16,6 @@
  */
 package org.apache.kafka.common;
 
-import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.kafka.common.utils.Utils;
@@ -85,69 +84,6 @@ public final class MetricName {
         this.tags = Utils.notNull(tags);
     }
 
-    /**
-     * @deprecated This method will be removed in a future release.
-     * Please create MetricName by method {@link org.apache.kafka.common.metrics.Metrics#metricName(String, String, String, String...)}
-     *
-     * @param name          The name of the metric
-     * @param group         logical group name of the metrics to which this metric belongs
-     * @param description   A human-readable description to include in the metric
-     * @param keyValue      additional key/value attributes of the metric (must come in pairs)
-     */
-    @Deprecated
-    public MetricName(String name, String group, String description, String... keyValue) {
-        this(name, group, description, getTags(keyValue));
-    }
-
-    private static Map<String, String> getTags(String... keyValue) {
-        if ((keyValue.length % 2) != 0)
-            throw new IllegalArgumentException("keyValue needs to be specified in pairs");
-        Map<String, String> tags = new HashMap<String, String>();
-
-        for (int i = 0; i < keyValue.length; i += 2)
-            tags.put(keyValue[i], keyValue[i + 1]);
-
-        return tags;
-    }
-
-    /**
-     * @deprecated This method will be removed in a future release.
-     * Please create MetricName by method {@link org.apache.kafka.common.metrics.Metrics#metricName(String, String, Map)}
-     *
-     * @param name  The name of the metric
-     * @param group logical group name of the metrics to which this metric belongs
-     * @param tags  key/value attributes of the metric
-     */
-    @Deprecated
-    public MetricName(String name, String group, Map<String, String> tags) {
-        this(name, group, "", tags);
-    }
-
-    /**
-     * @deprecated This method will be removed in a future release.
-     * Please create MetricName by method {@link org.apache.kafka.common.metrics.Metrics#metricName(String, String, String)}
-     *
-     * @param name        The name of the metric
-     * @param group       logical group name of the metrics to which this metric belongs
-     * @param description A human-readable description to include in the metric
-     */
-    @Deprecated
-    public MetricName(String name, String group, String description) {
-        this(name, group, description, new HashMap<String, String>());
-    }
-
-    /**
-     * @deprecated This method will be removed in a future release.
-     * Please create MetricName by method {@link org.apache.kafka.common.metrics.Metrics#metricName(String, String)}
-     *
-     * @param name  The name of the metric
-     * @param group logical group name of the metrics to which this metric belongs
-     */
-    @Deprecated
-    public MetricName(String name, String group) {
-        this(name, group, "", new HashMap<String, String>());
-    }
-
     public String name() {
         return this.name;
     }

http://git-wip-us.apache.org/repos/asf/kafka/blob/59b918ec/docs/upgrade.html
----------------------------------------------------------------------
diff --git a/docs/upgrade.html b/docs/upgrade.html
index 116d2ff..9c0ffdf 100644
--- a/docs/upgrade.html
+++ b/docs/upgrade.html
@@ -68,6 +68,7 @@
         individual messages is only reduced by the overhead of the batch format. This similarly affects the
         producer's <code>batch.size</code> configuration.</li>
     <li>GC log rotation is enabled by default, see KAFKA-3754 for details.</li>
+    <li>Deprecated constructors of MetricName and Cluster classes have been removed.</li>
 </ul>
 
 <h5><a id="upgrade_1100_new_protocols" href="#upgrade_1100_new_protocols">New Protocol Versions</a></h5>