kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-5619; Deprecate --new-consumer option in all tools
Date Fri, 04 Aug 2017 11:46:59 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 5766f212d -> 332a8129d


KAFKA-5619; Deprecate --new-consumer option in all tools

Added deprecation and warning message when the --new-consumer
option is used with the ConsumerGroupCommand and
the ConsumerPerformance tools.

Author: Paolo Patierno <ppatierno@live.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3555 from ppatierno/kafka-5619


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

Branch: refs/heads/trunk
Commit: 332a8129d3769163c622688bc7bf53a435f44b34
Parents: 5766f21
Author: Paolo Patierno <ppatierno@live.com>
Authored: Fri Aug 4 12:43:56 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Fri Aug 4 12:46:47 2017 +0100

----------------------------------------------------------------------
 core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala | 8 +++++++-
 core/src/main/scala/kafka/tools/ConsumerPerformance.scala  | 9 ++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/332a8129/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala b/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
index 3cf1101..d1cd803 100755
--- a/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
+++ b/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
@@ -709,7 +709,8 @@ object ConsumerGroupCommand extends Logging {
       "Pass in just a topic to delete the given topic's partition offsets and ownership information
" +
       "for every consumer group. For instance --topic t1" + nl +
       "WARNING: Group deletion only works for old ZK-based consumer groups, and one has to
use it carefully to only delete groups that are not active."
-    val NewConsumerDoc = "Use new consumer. This option requires that the 'bootstrap-server'
option is used."
+    val NewConsumerDoc = "Use the new consumer implementation. This is the default, so this
option is deprecated and " +
+      "will be removed in a future release."
     val TimeoutMsDoc = "The timeout that can be set for some use cases. For example, it can
be used when describing the group " +
       "to specify the maximum amount of time in milliseconds to wait before the group stabilizes
(when the group is just created, " +
       "or is going through some changes)."
@@ -808,6 +809,11 @@ object ConsumerGroupCommand extends Logging {
       } else {
         CommandLineUtils.checkRequiredArgs(parser, options, bootstrapServerOpt)
 
+        if (options.has(newConsumerOpt)) {
+          Console.err.println("The --new-consumer option is deprecated and will be removed
in a future major release." +
+            "The new consumer is used by default if the --bootstrap-server option is provided.")
+        }
+
         if (options.has(deleteOpt))
           CommandLineUtils.printUsageAndDie(parser, s"Option '$deleteOpt' is only valid with
'$zkConnectOpt'. Note that " +
             "there's no need to delete group metadata for the new consumer as the group is
deleted when the last " +

http://git-wip-us.apache.org/repos/asf/kafka/blob/332a8129/core/src/main/scala/kafka/tools/ConsumerPerformance.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/ConsumerPerformance.scala b/core/src/main/scala/kafka/tools/ConsumerPerformance.scala
index c818661..2880c94 100644
--- a/core/src/main/scala/kafka/tools/ConsumerPerformance.scala
+++ b/core/src/main/scala/kafka/tools/ConsumerPerformance.scala
@@ -233,7 +233,8 @@ object ConsumerPerformance {
       .describedAs("count")
       .ofType(classOf[java.lang.Integer])
       .defaultsTo(1)
-    val newConsumerOpt = parser.accepts("new-consumer", "Use the new consumer implementation.
This is the default.")
+    val newConsumerOpt = parser.accepts("new-consumer", "Use the new consumer implementation.
This is the default, so " +
+      "this option is deprecated and will be removed in a future release.")
     val consumerConfigOpt = parser.accepts("consumer.config", "Consumer config properties
file.")
       .withRequiredArg
       .describedAs("config file")
@@ -253,6 +254,12 @@ object ConsumerPerformance {
       new Properties
     if (!useOldConsumer) {
       CommandLineUtils.checkRequiredArgs(parser, options, bootstrapServersOpt)
+
+      if (options.has(newConsumerOpt)) {
+        Console.err.println("The --new-consumer option is deprecated and will be removed
in a future major release." +
+          "The new consumer is used by default if the --bootstrap-server option is provided.")
+      }
+
       import org.apache.kafka.clients.consumer.ConsumerConfig
       props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, options.valueOf(bootstrapServersOpt))
       props.put(ConsumerConfig.GROUP_ID_CONFIG, options.valueOf(groupIdOpt))


Mime
View raw message