sunchao commented on code in PR #4624:
URL: https://github.com/apache/hadoop/pull/4624#discussion_r929362325
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/MutableRatesWithAggregation.java:
##########
@@ -71,11 +74,20 @@ public void init(Class<?> protocol) {
if (protocolCache.contains(protocol)) {
return;
}
- protocolCache.add(protocol);
- for (Method method : protocol.getDeclaredMethods()) {
- String name = method.getName();
- LOG.debug(name);
- addMetricIfNotExists(name);
+
+ List<Class<?>> protocols = new ArrayList<>();
+ protocols.add(protocol);
+ if (protocol.getDeclaredMethods().length == 0) {
Review Comment:
make add some comments for this since it's not very obvious why we do it.
--
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]