8000 Improve test reliability by resolving nondeterministic of HashMap by MyEnthusiastic · Pull Request #316 · apache/tez · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve test reliability by resolving nondeterministic of HashMap #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -577,7 +578,7 @@ Deque<String> verify(boolean restricted) throws IllegalStateException {

// check for valid vertices, duplicate vertex names,
// and prepare for cycle detection
Map<String, AnnotatedVertex> vertexMap = new HashMap<String, AnnotatedVertex>();
Map<String, AnnotatedVertex> vertexMap = new LinkedHashMap<String, AnnotatedVertex>();
Map<Vertex, Set<String>> inboundVertexMap = new HashMap<Vertex, Set<String>>();
Map<Vertex, Set<String>> outboundVertexMap = new HashMap<Vertex, Set<String>>();
for (Vertex v : vertices.values()) {
Expand Down Expand Up @@ -909,7 +910,7 @@ public synchronized DAGPlan createDag(Configuration tezConf, Credentials extraCr
TezConfiguration.TEZ_TASK_RESOURCE_CPU_VCORES,
TezConfiguration.TEZ_TASK_RESOURCE_CPU_VCORES_DEFAULT));
}
Map<String, LocalResource> vertexLRs = Maps.newHashMap();
Map<String, LocalResource> vertexLRs = Maps.newLinkedHashMap();
vertexLRs.putAll(vertex.getTaskLocalFiles());
List<DataSourceDescriptor> dataSources = vertex.getDataSources();
for (DataSourceDescriptor dataSource : dataSources) {
Expand Down Expand Up @@ -1007,7 +1008,7 @@ public synchronized DAGPlan createDag(Configuration tezConf, Credentials extraCr
taskConfigBuilder.addAllLocalResource(DagTypeConverters.convertToDAGPlan(vertexLRs));
}

Map<String, String> taskEnv = Maps.newHashMap(vertex.getTaskEnvironment());
Map<String, String> taskEnv = Maps.newLinkedHashMap(vertex.getTaskEnvironment());
TezYARNUtils.setupDefaultEnv(taskEnv, tezConf,
TezConfiguration.TEZ_TASK_LAUNCH_ENV,
TezConfiguration.TEZ_TASK_LAUNCH_ENV_DEFAULT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -2701,7 +2702,7 @@ private void parseVertexEdges() {
VertexPlan vertexPlan = dagPlan.getVertex(i);
Vertex vertex = vertices.get(vertexPlan.getName());
Map<Vertex, Edge> inVertices =
new HashMap<Vertex, Edge>();
new LinkedHashMap<>();

Map<Vertex, Edge> outVertices =
new HashMap<Vertex, Edge>();
Expand Down
0