Skip to content

[hotfix] [metrics] Document boolean parsing and extend MetricConfigTest#27804

Open
lurui1997 wants to merge 1 commit intoapache:masterfrom
lurui1997:hotfix/metric-config-boolean-doc-and-tests
Open

[hotfix] [metrics] Document boolean parsing and extend MetricConfigTest#27804
lurui1997 wants to merge 1 commit intoapache:masterfrom
lurui1997:hotfix/metric-config-boolean-doc-and-tests

Conversation

@lurui1997
Copy link

What is the purpose of the change

Clarify in JavaDoc how MetricConfig#getBoolean handles numeric values (they stringify to "1" / "0", which Boolean#parseBoolean does not treat as true/false). Extend MetricConfigTest with regression cases for short/byte integers, BigInteger longs, and boolean edge cases ("1", boxed 1/0).

Brief change log

  • Expanded JavaDoc on getBoolean in MetricConfig
  • Added parameterized test rows in MetricConfigTest

Verifying this change

This change added tests and can be verified as follows:

  • mvn -pl flink-metrics/flink-metrics-core -Dtest=MetricConfigTest test

Does this pull request potentially affect one of the following parts:

  • Dependencies: no
  • The public API: no (behavior unchanged; JavaDoc and tests only)
  • The serializers: no
  • The runtime per-record code paths: no
  • Deployment or recovery: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • JavaDoc only on existing API

Made with Cursor

@lurui1997
Copy link
Author

Behavior of getBoolean is unchanged; new rows lock in current parsing for numeric and string edge cases. If the community wants numeric 1/0 to map to booleans, that would be a separate behavior change + JIRA.

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 22, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants