Skip to content

MINOR: refactor warning message#21661

Open
brandboat wants to merge 1 commit intoapache:trunkfrom
brandboat:minor-kafka-19655
Open

MINOR: refactor warning message#21661
brandboat wants to merge 1 commit intoapache:trunkfrom
brandboat:minor-kafka-19655

Conversation

@brandboat
Copy link
Member

@brandboat brandboat commented Mar 6, 2026

Refactor warnIfConfigDefinedInWrongRole to ensure consistent warning
messages

def warnIfConfigDefinedInWrongRole(expectedRole: ProcessRole, configName: String, extraMessage: String = ""): Unit = {
if (originals.containsKey(configName)) {
warn(s"$configName is defined in ${processRoles.mkString(", ")}. It should be defined in the $expectedRole role.")
warn(s"$configName is defined in ${processRoles.mkString(", ")}. It should be defined in the $expectedRole role." + (if (extraMessage.isEmpty) "" else s" $extraMessage"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "role. $extraMessage" should be good enought.

Copy link
Contributor

@akhileshchg akhileshchg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants