kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwens...@apache.org
Subject [14/50] [abbrv] kafka git commit: MINOR: Add check for empty topics iterator in ReplicaVerificationTool.
Date Mon, 11 Apr 2016 23:09:30 GMT
MINOR: Add check for empty topics iterator in ReplicaVerificationTool.

Author: Ashish Singh <asingh@cloudera.com>

Reviewers: Guozhang Wang, Gwen Shapira

Closes #1167 from SinghAsDev/minorFixRelicaLagTool


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

Branch: refs/heads/0.10.0
Commit: a4d6f1dce5b1d3f45505d732ad3dc9bcb92bfd98
Parents: b865413
Author: Ashish Singh <asingh@cloudera.com>
Authored: Fri Apr 1 14:12:49 2016 -0700
Committer: Gwen Shapira <cshapi@gmail.com>
Committed: Fri Apr 1 14:12:49 2016 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/a4d6f1dc/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala b/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala
index fe4968d..71bf0c0 100644
--- a/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala
+++ b/core/src/main/scala/kafka/tools/ReplicaVerificationTool.scala
@@ -128,6 +128,12 @@ object ReplicaVerificationTool extends Logging {
         else
           false
     )
+
+    if (filteredTopicMetadata.isEmpty) {
+      error("No topics found. " + topicWhiteListOpt + ", if specified, is either filtering
out all topics or there is no topic.")
+      System.exit(1)
+    }
+
     val topicPartitionReplicaList: Seq[TopicPartitionReplica] = filteredTopicMetadata.flatMap(
       topicMetadataResponse =>
         topicMetadataResponse.partitionsMetadata.flatMap(


Mime
View raw message