Repository: beam Updated Branches: refs/heads/master 1b0400fee -> f33039bfd
Use LinkedHashMap for step contexts in BaseExecutionContext This gives a performance improvement when all step contexts need to be traversed, such as for state cleanup operations. Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/84255c4b Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/84255c4b Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/84255c4b Branch: refs/heads/master Commit: 84255c4bcbd10b37179a0ee883e3bd577c9c6172 Parents: 3b61f6a Author: Kenneth Knowles <k...@google.com> Authored: Wed May 3 07:54:50 2017 -0700 Committer: Kenneth Knowles <k...@google.com> Committed: Wed May 3 07:57:36 2017 -0700 ---------------------------------------------------------------------- .../java/org/apache/beam/runners/core/BaseExecutionContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/84255c4b/runners/core-java/src/main/java/org/apache/beam/runners/core/BaseExecutionContext.java ---------------------------------------------------------------------- diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/BaseExecutionContext.java b/runners/core-java/src/main/java/org/apache/beam/runners/core/BaseExecutionContext.java index aa1474c..8d68256 100644 --- a/runners/core-java/src/main/java/org/apache/beam/runners/core/BaseExecutionContext.java +++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/BaseExecutionContext.java @@ -20,7 +20,7 @@ package org.apache.beam.runners.core; import java.io.IOException; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.transforms.DoFn.Context; @@ -53,7 +53,7 @@ import org.apache.beam.sdk.values.TupleTag; public abstract class BaseExecutionContext<T extends ExecutionContext.StepContext> implements ExecutionContext { - private Map<String, T> cachedStepContexts = new HashMap<>(); + private Map<String, T> cachedStepContexts = new LinkedHashMap<>(); /** * Implementations should override this to create the specific type