adoroszlai commented on a change in pull request #2895:
URL: https://github.com/apache/ozone/pull/2895#discussion_r764565958
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/ResourceLimitCache.java
##########
@@ -79,7 +79,11 @@ public V remove(K key) {
@Override
public void removeIf(Predicate<K> predicate) {
Objects.requireNonNull(predicate);
- map.keySet().removeIf(predicate);
+ for (K key : new ArrayList<>(map.keySet())) {
Review comment:
Thanks @lokeshj1703 for the review.
We could loop over `map.keySet()` directly, the `for-each` loop (`:`) uses
iterator behind the scenes either way. I wrapped key set in the list to avoid
concurrent modification issues.
--
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]