twalthr commented on a change in pull request #16214:
URL: https://github.com/apache/flink/pull/16214#discussion_r655360790
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/FactoryUtil.java
##########
@@ -578,15 +621,27 @@ public void validateExcept(String... prefixesToSkip) {
prefixesToSkip.length > 0, "Prefixes to skip can not be
empty.");
final List<String> prefixesList = Arrays.asList(prefixesToSkip);
consumedOptionKeys.addAll(
- configuration.keySet().stream()
+ allOptions.keySet().stream()
.filter(key ->
prefixesList.stream().anyMatch(key::startsWith))
.collect(Collectors.toSet()));
validate();
}
- /** Returns all options of the catalog. */
+ /** Returns all options currently being consumed by the factory. */
public ReadableConfig getOptions() {
- return configuration;
+ return allOptions;
+ }
+ }
+
+ /**
+ * Helper utility for validating all options for a {@link CatalogFactory}.
+ *
+ * @see #createCatalogFactoryHelper(CatalogFactory, CatalogFactory.Context)
+ */
+ public static class CatalogFactoryHelper extends
FactoryHelper<CatalogFactory> {
Review comment:
The upper class is already declared `@PublicEvolving`.
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/FactoryUtil.java
##########
@@ -578,15 +621,27 @@ public void validateExcept(String... prefixesToSkip) {
prefixesToSkip.length > 0, "Prefixes to skip can not be
empty.");
final List<String> prefixesList = Arrays.asList(prefixesToSkip);
consumedOptionKeys.addAll(
- configuration.keySet().stream()
+ allOptions.keySet().stream()
.filter(key ->
prefixesList.stream().anyMatch(key::startsWith))
.collect(Collectors.toSet()));
validate();
}
- /** Returns all options of the catalog. */
+ /** Returns all options currently being consumed by the factory. */
public ReadableConfig getOptions() {
- return configuration;
+ return allOptions;
+ }
+ }
+
+ /**
+ * Helper utility for validating all options for a {@link CatalogFactory}.
+ *
+ * @see #createCatalogFactoryHelper(CatalogFactory, CatalogFactory.Context)
+ */
+ public static class CatalogFactoryHelper extends
FactoryHelper<CatalogFactory> {
Review comment:
The outer class is already declared `@PublicEvolving`.
##########
File path:
flink-table/flink-table-common/src/test/java/org/apache/flink/table/factories/TestDynamicTableFactory.java
##########
@@ -50,10 +50,16 @@
public static final String IDENTIFIER = "test-connector";
public static final ConfigOption<String> TARGET =
- ConfigOptions.key("target").stringType().noDefaultValue();
+ ConfigOptions.key("target")
+ .stringType()
+ .noDefaultValue()
+ .withDeprecatedKeys("deprecated-target");
Review comment:
I agree. It should be easier to hook into the discovery process.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]