You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/01/14 19:26:07 UTC
[GitHub] [helix] pkuwm commented on a change in pull request #557: Add
instance capacity gauge
pkuwm commented on a change in pull request #557: Add instance capacity gauge
URL: https://github.com/apache/helix/pull/557#discussion_r366528083
##########
File path: helix-core/src/main/java/org/apache/helix/monitoring/mbeans/dynamicMBeans/DynamicMBeanProvider.java
##########
@@ -159,28 +163,30 @@ public synchronized void unregister() {
@Override
public Object getAttribute(String attribute)
- throws AttributeNotFoundException, MBeanException, ReflectionException {
+ throws AttributeNotFoundException {
if (SENSOR_NAME_TAG.equals(attribute)) {
return getSensorName();
}
- if (!_attributeMap.containsKey(attribute)) {
- return null;
+ DynamicMetric metric = _attributeMap.get(attribute);
+ if (metric == null) {
+ throw new AttributeNotFoundException("Attribute[" + attribute + "] is not found.");
Review comment:
Test results:
1. MBeanInfo async with the list.
Running 2 threads: thread 1 awaits while it is updating attributes "A" and "B" (not completed); meanwhile, thread 2 updates attributes "C", "D" and completes. Finally, "C", "D" could be fetched correctly, while getting "A" and "B" throws AttributeNotFoundException. thread 1 completes updating. Fetching "A", "B" correctly, and throwing AttributeNotFoundException for fetching "C", "D"
2. Fix async.
Has run a few tests. It works fine and confirms to fetch the data correctly.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org