HDDS 6060 Error getting metrics from source SCMContainerMetrics#2897
HDDS 6060 Error getting metrics from source SCMContainerMetrics#2897ghuangups wants to merge 1 commit intoapache:masterfrom
Conversation
bharatviswa504
left a comment
There was a problem hiding this comment.
LGTM. One thing is to build the metric of state count will be expensive.
@ghuangups With the fix, have you seen the issue fixed?
|
|
||
| if (this.attributeMap.containsKey(key)) { | ||
| return Collections.unmodifiableNavigableSet(this.attributeMap.get(key)); | ||
| NavigableSet<ContainerID> returneSet = new TreeSet<>(); |
There was a problem hiding this comment.
One thing is to build the metric of state count will be expensive.
We could avoid copy on read by making ContainerAttribute store ConcurrentSkipListSet instead of TreeSet.
| if (this.attributeMap.containsKey(key)) { | ||
| return Collections.unmodifiableNavigableSet(this.attributeMap.get(key)); | ||
| NavigableSet<ContainerID> returneSet = new TreeSet<>(); | ||
| TreeSet<ContainerID> tmpSet = (TreeSet<ContainerID>) |
There was a problem hiding this comment.
Is the cast necessary?
| TreeSet<ContainerID> tmpSet = (TreeSet<ContainerID>) | |
| NavigableSet<ContainerID> tmpSet = |
|
@ghuangups have you had a chance to look at the comments? |
|
/pending |
|
Thank you very much for the patch. I am closing this PR temporarily as there was no activity recently and it is waiting for response from its author. It doesn't mean that this PR is not important or ignored: feel free to reopen the PR at any time. It only means that attention of committers is not required. We prefer to keep the review queue clean. This ensures PRs in need of review are more visible, which results in faster feedback for all PRs. If you need ANY help to finish this PR, please contact the community on the mailing list or the slack channel." |
What changes were proposed in this pull request?
Instead of just returning a wrapped set, ContainerAttribute#getCollection is returning NavigableSet.
[## What is the link to the Apache JIRA]
https://issues.apache.org/jira/browse/HDDS-6060
How was this patch tested?
(Please explain how this patch was tested. Ex: unit tests, manual tests)
(If this patch involves UI changes, please attach a screen-shot; otherwise, remove this)