You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/08/29 06:10:41 UTC

[GitHub] [kafka] showuon commented on a diff in pull request #12053: MINOR: Displaying default configs better in MetadataShell

showuon commented on code in PR #12053:
URL: https://github.com/apache/kafka/pull/12053#discussion_r956926934


##########
shell/src/main/java/org/apache/kafka/shell/MetadataNodeManager.java:
##########
@@ -268,7 +269,7 @@ private void handleCommitImpl(MetadataRecordType type, ApiMessage message)
                             "Can't handle ConfigResource.Type " + record.resourceType());
                 }
                 DirectoryNode configDirectory = data.root.mkdirs("configs").
-                    mkdirs(typeString).mkdirs(record.resourceName());
+                    mkdirs(typeString).mkdirs(Utils.isBlank(record.resourceName()) ? "<default>" : record.resourceName());

Review Comment:
   nit: `Utils.isBlank` will be true when `str == null || str.trim().isEmpty()`. Although I don't think the resource name will be null here, I think it'd better not to allow null resource name here. So, maybe:
   ```
   record.resourceName().isBlank() ? "<default>" : record.resourceName()
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org