You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "hackergin (via GitHub)" <gi...@apache.org> on 2024/10/28 09:01:28 UTC
[PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
hackergin opened a new pull request, #25579:
URL: https://github.com/apache/flink/pull/25579
## What is the purpose of the change
*Remove all deprecated methods in `CatalogFactory`*
## Brief change log
*Remove all deprecated methods in `CatalogFactory`*
## Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "hackergin (via GitHub)" <gi...@apache.org>.
hackergin commented on PR #25579:
URL: https://github.com/apache/flink/pull/25579#issuecomment-2567499547
@flinkbot run azure
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "hackergin (via GitHub)" <gi...@apache.org>.
hackergin commented on PR #25579:
URL: https://github.com/apache/flink/pull/25579#issuecomment-2443033568
Test failed because of https://issues.apache.org/jira/browse/FLINK-36613
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #25579:
URL: https://github.com/apache/flink/pull/25579#issuecomment-2440954682
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "54a2406853ca9b43cadf7379c2ab2361d7d75c86",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "54a2406853ca9b43cadf7379c2ab2361d7d75c86",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 54a2406853ca9b43cadf7379c2ab2361d7d75c86 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "hackergin (via GitHub)" <gi...@apache.org>.
hackergin commented on code in PR #25579:
URL: https://github.com/apache/flink/pull/25579#discussion_r1901441909
##########
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:
Since these methods already exist in the `Factory` interface, I directly removed them from `CatalogFactory`.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "hackergin (via GitHub)" <gi...@apache.org>.
hackergin commented on PR #25579:
URL: https://github.com/apache/flink/pull/25579#issuecomment-2443033303
@xuyangzhong Please help review the pr if you are free.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "xuyangzhong (via GitHub)" <gi...@apache.org>.
xuyangzhong commented on code in PR #25579:
URL: https://github.com/apache/flink/pull/25579#discussion_r1901467382
##########
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:
https://lists.apache.org/thread/tlk64byvxtbkox3wyv2jfoqfdtf523bf
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "hackergin (via GitHub)" <gi...@apache.org>.
hackergin commented on PR #25579:
URL: https://github.com/apache/flink/pull/25579#issuecomment-2568595567
@xuyangzhong I have rebased the latest master, and the CI passed successfully.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "xuyangzhong (via GitHub)" <gi...@apache.org>.
xuyangzhong commented on code in PR #25579:
URL: https://github.com/apache/flink/pull/25579#discussion_r1901446373
##########
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:
Excuse me, although I think it's better to delete it directly, it would be best to discuss it in the email to inform more people. What do you think? @hackergin @lsyldliu
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "tinaselenge (via GitHub)" <gi...@apache.org>.
tinaselenge commented on code in PR #25579:
URL: https://github.com/apache/flink/pull/25579#discussion_r1843739058
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/FactoryUtil.java:
##########
@@ -486,48 +486,41 @@ public static Catalog createCatalog(
Map<String, String> options,
ReadableConfig configuration,
ClassLoader classLoader) {
- // Use the legacy mechanism first for compatibility
- try {
- final CatalogFactory legacyFactory =
- TableFactoryService.find(CatalogFactory.class, options, classLoader);
- return legacyFactory.createCatalog(catalogName, options);
- } catch (NoMatchingTableFactoryException e) {
- // No matching legacy factory found, try using the new stack
+ // No matching legacy factory found, try using the new stack
Review Comment:
Do we still need this comment since we are no longer checking if legacy factory is found?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "lsyldliu (via GitHub)" <gi...@apache.org>.
lsyldliu merged PR #25579:
URL: https://github.com/apache/flink/pull/25579
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36501][table] Remove all deprecated methods in `CatalogFactory` [flink]
Posted by "lsyldliu (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org