suchenglong opened a new pull request, #18470:
URL: https://github.com/apache/iotdb/pull/18470
## 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:
```java
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.
<hr>
This PR has:
- [x] been self-reviewed.
- [ ] concurrent read
- [ ] concurrent write
- [ ] concurrent read and write
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]