[
https://issues.apache.org/jira/browse/YARN-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15922852#comment-15922852
]
Jonathan Hung edited comment on YARN-6327 at 3/13/17 8:19 PM:
--------------------------------------------------------------
Hi [~Naganarasimha], this actually broke some stuff I was testing in YARN-5952,
I believe even with single threaded operation an iterator must be used if you
want to remove elements from a map within a loop (e.g.
http://stackoverflow.com/questions/6092642/how-to-remove-a-key-from-hashmap-while-iterating-over-it),
otherwise you can get {{ConcurrentModificationException}}.
was (Author: jhung):
Hi [~Naganarasimha], this actually broke some stuff I was testing in YARN-5952,
I believe even with single threaded operation an iterator must be used if you
want to remove elements from a map within a loop (e.g.
http://stackoverflow.com/questions/6092642/how-to-remove-a-key-from-hashmap-while-iterating-over-it).
> Removing queues from CapacitySchedulerQueueManager and ParentQueue should be
> done with iterator
> -----------------------------------------------------------------------------------------------
>
> Key: YARN-6327
> URL: https://issues.apache.org/jira/browse/YARN-6327
> Project: Hadoop YARN
> Issue Type: Bug
> Components: capacityscheduler
> Reporter: Jonathan Hung
> Assignee: Jonathan Hung
> Attachments: YARN-6327.001.patch, YARN-6327.002.patch
>
>
> e.g. in {{CapacitySchedulerQueueManager}} {noformat} for
> (Map.Entry<String, CSQueue> e : existingQueues.entrySet()) {
> String queueName = e.getKey();
> if (!newQueues.containsKey(queueName)) {
> existingQueues.remove(queueName);
> }
> }{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]