jerryshao commented on code in PR #5705:
URL: https://github.com/apache/gravitino/pull/5705#discussion_r1863266053


##########
api/src/main/java/org/apache/gravitino/CatalogProvider.java:
##########
@@ -26,7 +26,36 @@
  */
 @Evolving
 public interface CatalogProvider {
+  enum CatalogName {
+    HIVE("hive"),
+    HADOOP("hadoop"),
+    KAFKA("kafka"),
+    JDBC_DORIS("jdbc-doris"),
+    JDBC_MYSQL("jdbc-mysql"),
+    JDBC_OCEANBASE("jdbc-oceanbase"),
+    JDBC_POSTGRESQL("jdbc-postgresql"),
+    LAKEHOUSE_ICEBERG("lakehouse-iceberg"),
+    LAKEHOUSE_HUDI("lakehouse-hudi"),
+    LAKEHOUSE_PAIMON("lakehouse-paimon");
+    private final String name;
 
+    CatalogName(String name) {
+      this.name = name;
+    }
+
+    public String getName() {
+      return this.name;
+    }
+
+    public static CatalogName fromName(String name) {
+      for (CatalogName catalogName : CatalogName.values()) {
+        if (catalogName.getName().equals(name)) {
+          return catalogName;
+        }
+      }
+      throw new IllegalArgumentException("Unknown catalog provider: " + name);
+    }
+  }

Review Comment:
   This basically breaks the interface constraints, do we have better solutions?



-- 
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: commits-unsubscr...@gravitino.apache.org

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

Reply via email to