This is an automated email from the ASF dual-hosted git repository.
dajac pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/3.0 by this push:
new d099a9a KAFKA-10589; Rename kafka-replica-verification CLI command
line arguments for KIP-629 (#11007)
d099a9a is described below
commit d099a9a67c902ab5f2d4cb578c46cfe637540dea
Author: Omnia G H Ibrahim <[email protected]>
AuthorDate: Wed Jul 14 07:53:28 2021 +0100
KAFKA-10589; Rename kafka-replica-verification CLI command line arguments
for KIP-629 (#11007)
This patch marks --topic-white-list as deprecated argument and introduce
--topics-include for kafka-replica-verification as described in KIP-629:
https://cwiki.apache.org/confluence/display/KAFKA/KIP-629%3A+Use+racially+neutral+terms+in+our+codebase.
Reviewers: Xavier Léauté <[email protected]>, Lee Dongjin
<[email protected]>, David Jacot <[email protected]>
---
.../scala/kafka/tools/ReplicaVerificationTool.scala | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala
b/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala
index 9c3d88c..33e5012 100644
--- a/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala
+++ b/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala
@@ -89,11 +89,16 @@ object ReplicaVerificationTool extends Logging {
.describedAs("ms")
.ofType(classOf[java.lang.Integer])
.defaultsTo(1000)
- val topicWhiteListOpt = parser.accepts("topic-white-list", "White list of
topics to verify replica consistency. Defaults to all topics.")
+ val topicWhiteListOpt = parser.accepts("topic-white-list", "DEPRECATED use
--topics-include instead; ignored if --topics-include specified. List of topics
to verify replica consistency. Defaults to '.*' (all topics)")
.withRequiredArg
.describedAs("Java regex (String)")
.ofType(classOf[String])
.defaultsTo(".*")
+ val topicsIncludeOpt = parser.accepts("topics-include", "List of topics to
verify replica consistency. Defaults to '.*' (all topics)")
+ .withRequiredArg
+ .describedAs("Java regex (String)")
+ .ofType(classOf[String])
+ .defaultsTo(".*")
val initialOffsetTimeOpt = parser.accepts("time", "Timestamp for getting
the initial offsets.")
.withRequiredArg
.describedAs("timestamp/-1(latest)/-2(earliest)")
@@ -118,8 +123,12 @@ object ReplicaVerificationTool extends Logging {
}
CommandLineUtils.checkRequiredArgs(parser, options, brokerListOpt)
- val regex = options.valueOf(topicWhiteListOpt)
- val topicWhiteListFiler = new IncludeList(regex)
+ val regex = if (options.has(topicsIncludeOpt))
+ options.valueOf(topicsIncludeOpt)
+ else
+ options.valueOf(topicWhiteListOpt)
+
+ val topicsIncludeFilter = new IncludeList(regex)
try Pattern.compile(regex)
catch {
@@ -143,11 +152,11 @@ object ReplicaVerificationTool extends Logging {
}
val filteredTopicMetadata = topicsMetadata.filter { topicMetaData =>
- topicWhiteListFiler.isTopicAllowed(topicMetaData.name,
excludeInternalTopics = false)
+ topicsIncludeFilter.isTopicAllowed(topicMetaData.name,
excludeInternalTopics = false)
}
if (filteredTopicMetadata.isEmpty) {
- error(s"No topics found. $topicWhiteListOpt if specified, is either
filtering out all topics or there is no topic.")
+ error(s"No topics found. $topicsIncludeOpt if specified, is either
filtering out all topics or there is no topic.")
Exit.exit(1)
}