BurningCN commented on code in PR #10389:
URL: https://github.com/apache/dubbo/pull/10389#discussion_r933858753
##########
dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java:
##########
@@ -514,8 +525,12 @@ protected void appendAnnotation(Class<?> annotationClass,
Object annotation) {
* @see AbstractConfig#appendParameters(Map, Object, String)
*/
public Map<String, String> getMetaData() {
+ return getMetaData(null);
+ }
+
+ public Map<String, String> getMetaData(String prefix) {
Map<String, String> metaData = new HashMap<>();
- appendAttributes(metaData, this);
+ appendAttributes(metaData, this, prefix);
return metaData;
}
Review Comment:
在原来`getMetaData()`的基础上,再添加一个带有`prefix`参数的重载的`getMetaData(String
prefix)`方法。这样`ConfigConfigurationAdapter`在获取带前缀的元数据的时候直接调用此方法(`getMetaData(String
prefix)`)就可以了,不需要再像原来的逻辑 `getMetaData()` + 遍历`entry`对每个`key`拼上`prefix`。
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]