You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Fangbin Sun (JIRA)" <ji...@apache.org> on 2018/12/14 09:37:00 UTC
[jira] [Created] (KAFKA-7735) StateChangeLogMerger tool can not
work due to incorrect topic regular matches
Fangbin Sun created KAFKA-7735:
----------------------------------
Summary: StateChangeLogMerger tool can not work due to incorrect topic regular matches
Key: KAFKA-7735
URL: https://issues.apache.org/jira/browse/KAFKA-7735
Project: Kafka
Issue Type: Bug
Components: tools
Affects Versions: 2.0.0
Reporter: Fangbin Sun
When StateChangeLogMerger tool tries to obtain a topic's state-change-log, it returns nothing.
{code:java}
bin/kafka-run-class.sh com.cmss.kafka.api.StateChangeLogMerger --logs state-change.log --topic test{code}
This tool uses a topic partition regex as follows:
{code:java}
val topicPartitionRegex = new Regex("\\[(" + Topic.LEGAL_CHARS + "+),( )*([0-9]+)\\]"){code}
However the state-change-log no longer prints log in the above format. e.g. in 0.10.2.0, it prints some state-change logs by case class TopicAndPartition which overrided as follows:
{code:java}
override def toString = "[%s,%d]".format(topic, partition){code}
In a newer version (e.g. 1.0.0+) it prints most of state-change logs in the form of "partition $topic-$partition", as a workaround one can modify the topic partition regex like:
{code:java}
val topicPartitionRegex = new Regex("(partition " + Topic.LEGAL_CHARS + "+)-([0-9]+)"){code}
and match topic with "matcher.group(1).substring(10)", however some output of state changes might be a little bit redundant.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)