Skip to content

MINOR: Various code cleanups in core and clients#5850

Merged
ijuma merged 2 commits intoapache:trunkfrom
mimaison:minor_cleanups
Oct 29, 2018
Merged

MINOR: Various code cleanups in core and clients#5850
ijuma merged 2 commits intoapache:trunkfrom
mimaison:minor_cleanups

Conversation

@mimaison
Copy link
Copy Markdown
Member

  • Removed unused imports
  • Use string interpolations instead of concatenations

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

- Removed unused imports
- Use string interpolations instead of concatenations
Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

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

Thanks for the PRs, just a few nits.

zkUtils.createPersistentPath(zkPath, jsonPartitionData)
} else {
info("Topic update " + jsonPartitionData.toString)
info(s"Topic update ${jsonPartitionData.toString}")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

toString can be removed in both cases.


updateToken(token)
info(s"Delegation token renewed for token : " + tokenInfo.tokenId + " for owner :" + tokenInfo.owner)
info(s"Delegation token renewed for token : ${tokenInfo.tokenId} for owner :${tokenInfo.owner}")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Existing issue, but we can maybe fix it now, there should be a space after the : not before. A few more cases in this file.

maxLag = -1L
for ((topicPartition, fetchResponsePerReplica) <- recordsCache) {
debug("Verifying " + topicPartition)
debug(s"Verifying ${topicPartition}")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need for braces.

props.load(resourceStream);
} catch (Exception e) {
log.warn("Error while loading kafka-version.properties :" + e.getMessage());
log.warn("Error while loading kafka-version.properties :{}", e.getMessage());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Existing issue, space should be after the colon.

log.info("Kafka version : " + AppInfoParser.getVersion());
log.info("Kafka commitId : " + AppInfoParser.getCommitId());
log.info("Kafka version : {}", AppInfoParser.getVersion());
log.info("Kafka commitId : {}", AppInfoParser.getCommitId());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Existing issue: space after colon. No need for () in getVersion and getCommitId.

@mimaison
Copy link
Copy Markdown
Member Author

Thanks for the quick review. I've pushed an update

Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

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

LGTM

@ijuma ijuma merged commit 9a0ea25 into apache:trunk Oct 29, 2018
@mimaison mimaison deleted the minor_cleanups branch October 29, 2018 19:17
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…and clients (apache#5850)

Also removed a few unused imports and tweaked the log message slightly.

Reviewers: Ismael Juma <ismael@juma.me.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants