YARN-3465. Use LinkedHashMap to preserve order of resource requests. (Zhihai Xu via kasha)

(cherry picked from commit 6495940eae)
This commit is contained in:
Karthik Kambatla 2015-04-09 00:07:49 -07:00
parent 4e099c113b
commit 53e0bf5c17
2 changed files with 5 additions and 1 deletions

View File

@ -114,6 +114,9 @@ Release 2.8.0 - UNRELEASED
YARN-2890. MiniYarnCluster should turn on timeline service if YARN-2890. MiniYarnCluster should turn on timeline service if
configured to do so. (Mit Desai via hitesh) configured to do so. (Mit Desai via hitesh)
YARN-3465. Use LinkedHashMap to preserve order of resource requests.
(Zhihai Xu via kasha)
Release 2.7.0 - UNRELEASED Release 2.7.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ -638,7 +639,7 @@ public class ContainerImpl implements Container {
return ContainerState.LOCALIZATION_FAILED; return ContainerState.LOCALIZATION_FAILED;
} }
Map<LocalResourceVisibility, Collection<LocalResourceRequest>> req = Map<LocalResourceVisibility, Collection<LocalResourceRequest>> req =
new HashMap<LocalResourceVisibility, new LinkedHashMap<LocalResourceVisibility,
Collection<LocalResourceRequest>>(); Collection<LocalResourceRequest>>();
if (!container.publicRsrcs.isEmpty()) { if (!container.publicRsrcs.isEmpty()) {
req.put(LocalResourceVisibility.PUBLIC, container.publicRsrcs); req.put(LocalResourceVisibility.PUBLIC, container.publicRsrcs);