Browse Source

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 <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2995 from ijuma/kafka-3763-remove-deprecated-0.11
pull/2397/merge
Ismael Juma 8 years ago committed by Jason Gustafson
parent
commit
59b918ec2b
  1. 5
      clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
  2. 14
      clients/src/main/java/org/apache/kafka/common/Cluster.java
  3. 64
      clients/src/main/java/org/apache/kafka/common/MetricName.java
  4. 1
      docs/upgrade.html

5
clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java

@ -36,11 +36,6 @@ public class CommonClientConfigs { @@ -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.";

14
clients/src/main/java/org/apache/kafka/common/Cluster.java

@ -45,20 +45,6 @@ public final class Cluster { @@ -45,20 +45,6 @@ public final class Cluster {
private final Map<Integer, Node> 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<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

64
clients/src/main/java/org/apache/kafka/common/MetricName.java

@ -16,7 +16,6 @@ @@ -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 { @@ -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;
}

1
docs/upgrade.html

@ -68,6 +68,7 @@ @@ -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>

Loading…
Cancel
Save