kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch trunk updated: KAFKA-6057: Users forget `--execute` in the offset reset tool (#4069)
Date Mon, 26 Feb 2018 17:00:55 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3600316  KAFKA-6057: Users forget `--execute` in the offset reset tool (#4069)
3600316 is described below

commit 3600316a1490e81e4efafc15dd0ac31025b76e1c
Author: Gilles Degols <gilles-degols@users.noreply.github.com>
AuthorDate: Mon Feb 26 18:00:39 2018 +0100

    KAFKA-6057: Users forget `--execute` in the offset reset tool (#4069)
    
    Add a small warning note when the user does not use the --execute flag.
---
 core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala b/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
index 6818631..cb9fbe3 100755
--- a/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
+++ b/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
@@ -1033,16 +1033,16 @@ object ConsumerGroupCommand extends Logging {
         CommandLineUtils.printUsageAndDie(parser, s"Option $deleteOpt either takes $groupOpt,
$topicOpt, or both")
 
       if (options.has(resetOffsetsOpt)) {
-        if (!options.has(dryRunOpt) && !options.has(executeOpt)) {
-          Console.err.println("WARN: In a future major release, the default behavior of this
command will be to " +
-            "prompt the user before executing the reset rather than doing a dry run. You
should add the --dry-run " +
-            "option explicitly if you are scripting this command and want to keep the current
default behavior " +
-            "without prompting.")
-        }
-
         if (options.has(dryRunOpt) && options.has(executeOpt))
           CommandLineUtils.printUsageAndDie(parser, s"Option $resetOffsetsOpt only accepts
one of $executeOpt and $dryRunOpt")
 
+        if (!options.has(dryRunOpt) && !options.has(executeOpt)) {
+          Console.err.println("WARN: No action will be performed as the --execute option
is missing." +
+            "In a future major release, the default behavior of this command will be to prompt
the user before " +
+            "executing the reset rather than doing a dry run. You should add the --dry-run
option explicitly " +
+            "if you are scripting this command and want to keep the current default behavior
without prompting.")
+        }
+
         CommandLineUtils.checkRequiredArgs(parser, options, groupOpt)
         CommandLineUtils.checkInvalidArgs(parser, options, resetToOffsetOpt, allResetOffsetScenarioOpts
- resetToOffsetOpt)
         CommandLineUtils.checkInvalidArgs(parser, options, resetToDatetimeOpt, allResetOffsetScenarioOpts
- resetToDatetimeOpt)

-- 
To stop receiving notification emails like this one, please contact
jgus@apache.org.

Mime
View raw message