mchades commented on code in PR #14575:
URL: https://github.com/apache/gravitino/pull/14575#discussion_r4464695511


##########
catalogs/catalog-kafka/src/main/java/org/apache/gravitino/catalog/kafka/KafkaCatalogCapability.java:
##########
@@ -31,4 +33,25 @@ public CapabilityResult managedStorage(Scope scope) {
     return CapabilityResult.unsupported(
         String.format("Kafka catalog does not support managed storage for 
%s.", scope));
   }
+
+  /**
+   * Checks names against Gravitino's default rules and Kafka's topic 
character restrictions.
+   *
+   * @param scope The scope of the capability.
+   * @param name The name to check.
+   * @return Whether the name is supported in the given scope.
+   */
+  @Override
+  public CapabilityResult specificationOnName(Scope scope, String name) {
+    CapabilityResult result = Capability.super.specificationOnName(scope, 
name);
+    if (!result.supported() || scope != Scope.TOPIC) {
+      return result;
+    }
+
+    if (!name.matches(TOPIC_NAME_PATTERN)) {
+      return CapabilityResult.unsupported(
+          "Kafka topic names must contain only ASCII alphanumerics, '.', '_' 
and '-'.");

Review Comment:
   Updated the message to describe the actual rule: 1–128 ASCII letters/digits, 
`_`, or `-`. Topic validation is now independent of the default check, allowing 
a leading `-` while retaining Gravitino's no-dot and 128-character limits.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to