From 3385ee130b84c2c83620a094ebaef63cfc966f61 Mon Sep 17 00:00:00 2001 From: Ismael Juma Date: Mon, 8 May 2017 11:03:16 +0100 Subject: [PATCH] KAFKA-3763: Remove deprecated APIs for 0.11.0.0 In the end, 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. --- .../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(-) 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 b2c8937d51a9a..e06900cad3985 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 { + "host1:port1,host2:port2,.... 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."; 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 6619b4c2a3bde..0c59f33824d8f 100644 --- a/clients/src/main/java/org/apache/kafka/common/Cluster.java +++ b/clients/src/main/java/org/apache/kafka/common/Cluster.java @@ -45,20 +45,6 @@ public final class Cluster { private final Map nodesById; 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 nodes, - Collection partitions, - Set unauthorizedTopics) { - this(null, false, nodes, partitions, unauthorizedTopics, Collections.emptySet(), null); - } - - /** * Create a new cluster with the given id, nodes and partitions * @param nodes The nodes in the cluster 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 cd1ae4e529646..2136a72b0e4b8 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 MetricName(String name, String group, String description, Map getTags(String... keyValue) { - if ((keyValue.length % 2) != 0) - throw new IllegalArgumentException("keyValue needs to be specified in pairs"); - Map tags = new HashMap(); - - 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 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()); - } - - /** - * @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()); - } - public String name() { return this.name; } diff --git a/docs/upgrade.html b/docs/upgrade.html index 227c7281da04c..87353eae281e7 100644 --- a/docs/upgrade.html +++ b/docs/upgrade.html @@ -66,6 +66,7 @@
Notable changes in individual messages is only reduced by the overhead of the batch format. This similarly affects the producer's batch.size configuration.
  • GC log rotation is enabled by default, see KAFKA-3754 for details.
  • +
  • Deprecated constructors of MetricName and Cluster classes have been removed.
  • New Protocol Versions