Rebasing against trunk and adding new patch, also including some more changes/fixes.
Thanks for the feedback, Subru Krishnan.
Regarding the LinkedHashMap in the OpportunisticContainerContext, we actually need it to keep the ordering of the nodes. Least loaded nodes should come first when iterating over the hashmap, as they should be preferred when placing opportunistic containers.
I added checks for the ContainerTypes in TestOpportunisticContainersAllocation, as you suggested.
I suggest to keep the existing sleep logic for now, if it's OK, since it does not seem to make the code much cleaner in the particular cases it is used (also chatted with Chris Douglas about this).