FANNG1 commented on code in PR #12541:
URL: https://github.com/apache/gravitino/pull/12541#discussion_r3977644941


##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/plugin/restcatalog/BuiltinRESTCatalogProviders.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.spark.connector.plugin.restcatalog;
+
+import java.util.Collections;
+import java.util.Map;
+
+final class BuiltinRESTCatalogProviders {
+
+  private static final String LANCE_FORMAT = "lance";

Review Comment:
   Not in this PR. This PR wires only the Lance provider; the built-in registry 
is structured so another format-specific provider, such as Iceberg, can be 
added later with its own runtime and configuration contract.



##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/plugin/restcatalog/CatalogRegistrationPolicy.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.spark.connector.plugin.restcatalog;
+
+import org.apache.gravitino.annotation.DeveloperApi;
+
+/** Decides whether an advertised REST catalog is registered, and under what 
Spark name. */
+@DeveloperApi
+public interface CatalogRegistrationPolicy {
+
+  /**
+   * Returns whether to register an advertised catalog automatically.
+   *
+   * @param format the lakehouse format that advertised the catalog
+   * @param catalogName the catalog name advertised by the format's REST server
+   * @return true to register the catalog, false to skip it
+   */
+  boolean shouldRegister(String format, String catalogName);

Review Comment:
   The default is `true`: every discovered catalog is registered under its 
discovered name unless that Spark catalog name is already explicitly configured 
by the user. I will make this default explicit in the policy Javadoc.



-- 
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