Bharath Reddy Gunapati created FLINK-40149:
----------------------------------------------
Summary: Rename lookup option asyncPolling to async-polling for
Flink naming consistency
Key: FLINK-40149
URL: https://issues.apache.org/jira/browse/FLINK-40149
Project: Flink
Issue Type: Improvement
Reporter: Bharath Reddy Gunapati
h2. Problem
The HTTP lookup connector exposes a boolean option to choose sync vs async
lookup
behavior. It is declared as:
{code:java}
public static final ConfigOption<Boolean> ASYNC_POLLING =
ConfigOptions.key("asyncPolling")
.booleanType()
.defaultValue(false)
.withDescription("Whether to use Sync and Async polling
mechanism");
{code}
The option works correctly and is fully wired at runtime. The issue is naming
inconsistency, not behavior:
* It is the only camelCase table option in the HTTP connector. All other options
use kebab-case or dotted keys (e.g. lookup-method, url-args,
http.source.lookup.request.timeout).
* This diverges from Flink connector conventions (Kafka, JDBC, etc.), where
table
options are consistently kebab-case.
h2. Current behavior (live, not dead config)
The option is actively used end to end:
* HttpLookupTableSourceFactory registers ASYNC_POLLING in optionalOptions() and
reads readableConfig.get(ASYNC_POLLING) into HttpLookupConfig.useAsync.
* HttpLookupTableSource branches on useAsync:
** true -> AsyncHttpTableLookupFunction (Flink Async I/O)
** false -> blocking HttpTableLookupFunction
* GenericJsonQueryCreatorFactory and GenericJsonAndUrlQueryCreatorFactory also
branch on ASYNC_POLLING.
Example DDL today:
{code:sql}
CREATE TABLE lookup_table (...) WITH (
'connector' = 'http',
'format' = 'json',
'url' = 'http://localhost:8080/api',
'asyncPolling' = 'true'
);
{code}
h2. Proposed change
Rename the canonical key to async-polling and keep asyncPolling as a deprecated
alias using Flink's standard mechanism:
{code:java}
public static final ConfigOption<Boolean> ASYNC_POLLING =
ConfigOptions.key("async-polling")
.booleanType()
.defaultValue(false)
.withDeprecatedKeys("asyncPolling")
.withDescription("Whether to use sync or async polling
mechanism");
{code}
No runtime logic change. Only the canonical key string and documentation change.
h2. Scope of code / doc updates
* HttpLookupConnectorOptions.java - rename key + withDeprecatedKeys
* docs/content/docs/connectors/table/http.md - option table and examples
* docs/content.zh/docs/connectors/table/http.md - same
* Tests and examples - prefer async-polling; add or keep one test proving
asyncPolling still works via deprecated alias
h2. Compatibility
* Backward compatible: existing DDL using asyncPolling continues to work via
withDeprecatedKeys.
* No change to default (false) or runtime behavior.
* Release note should mention the new canonical name and that asyncPolling is
deprecated.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)