lsyldliu commented on code in PR #25579:
URL: https://github.com/apache/flink/pull/25579#discussion_r1901438246


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/CatalogFactory.java:
##########
@@ -38,20 +37,7 @@
  * instead.
  */
 @PublicEvolving
-public interface CatalogFactory extends TableFactory, Factory {
-
-    /**
-     * Creates and configures a {@link Catalog} using the given properties.
-     *
-     * @param properties normalized properties describing an external catalog.
-     * @return the configured catalog.
-     * @deprecated Use {@link this#createCatalog(Context)} instead and 
implement {@link Factory}
-     *     instead of {@link TableFactory}.
-     */
-    @Deprecated
-    default Catalog createCatalog(String name, Map<String, String> properties) 
{

Review Comment:
   Due to we have removed this deprecated method, should we change the method 
   ```
   default Catalog createCatalog(Context context) {
           throw new CatalogException("Catalog factories must implement 
createCatalog(Context)");
       }```
   to 
   
   ```Catalog createCatalog(Context context);
   ```
   
   The Catalog implementor must implement this method, so I think give it a 
default implement is not required. cc@xuyangzhong
   



##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/CatalogFactory.java:
##########
@@ -88,48 +74,14 @@ interface Context {
     }
 
     default String factoryIdentifier() {
-        if (requiredContext() == null || supportedProperties() == null) {
-            throw new CatalogException("Catalog factories must implement 
factoryIdentifier()");
-        }
-
-        return null;
+        throw new CatalogException("Catalog factories must implement 
factoryIdentifier()");
     }
 
     default Set<ConfigOption<?>> requiredOptions() {

Review Comment:
   ditto



##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/CatalogFactory.java:
##########
@@ -88,48 +74,14 @@ interface Context {
     }
 
     default String factoryIdentifier() {

Review Comment:
   We don't need give it a default implementation.



##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/CatalogFactory.java:
##########
@@ -88,48 +74,14 @@ interface Context {
     }
 
     default String factoryIdentifier() {
-        if (requiredContext() == null || supportedProperties() == null) {
-            throw new CatalogException("Catalog factories must implement 
factoryIdentifier()");
-        }
-
-        return null;
+        throw new CatalogException("Catalog factories must implement 
factoryIdentifier()");
     }
 
     default Set<ConfigOption<?>> requiredOptions() {
-        if (requiredContext() == null || supportedProperties() == null) {
-            throw new CatalogException("Catalog factories must implement 
requiredOptions()");
-        }
-
-        return null;
+        throw new CatalogException("Catalog factories must implement 
requiredOptions()");
     }
 
     default Set<ConfigOption<?>> optionalOptions() {

Review Comment:
   ditto



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