Skip to content

support streamnode - #18470

Open
suchenglong wants to merge 1 commit into
apache:masterfrom
suchenglong:clsu/metric_support_streamnode
Open

support streamnode#18470
suchenglong wants to merge 1 commit into
apache:masterfrom
suchenglong:clsu/metric_support_streamnode

Conversation

@suchenglong

Copy link
Copy Markdown
Contributor

Description

Content1: Refactor - refactor metric framework to support additional prefixes

In MetricConfigDescriptor, the node-type property prefixes "cn_" and "dn_" were previously inlined as string
literals in three call sites: the two boolean isConfigNode overloads of loadProps/loadHotProps (which forward to
the String prefix overloads via a ternary), and the if (prefix.equals(...)) guard inside generateFromProperties
that limits the internal-reporter config to DataNode.

These literals are now declared as two private static final String constants near the top of the class:

private static final String CONFIG_NODE_PREFIX = "cn_";
private static final String DATA_NODE_PREFIX = "dn_";

The three use sites now reference the constants instead of the literals. No other strings in the file (property keys
such as metric_reporter_list, default values, comments mentioning "cn_"/"dn_"/"sn_" in javadoc) were touched,
per the scope of the change.


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write

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.

1 participant