You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2022/04/07 15:15:57 UTC

[beam] branch master updated: [BEAM-13015] Lookup the container for the step once when registering instead of on each execution. (#17281)

This is an automated email from the ASF dual-hosted git repository.

lcwik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 9578d82e5f9 [BEAM-13015] Lookup the container for the step once when registering instead of on each execution. (#17281)
9578d82e5f9 is described below

commit 9578d82e5f9c5b22de6056ed8070e57638e66978
Author: Sam Whittle <sc...@users.noreply.github.com>
AuthorDate: Thu Apr 7 17:15:50 2022 +0200

    [BEAM-13015] Lookup the container for the step once when registering instead of on each execution. (#17281)
---
 .../org/apache/beam/fn/harness/data/PTransformFunctionRegistry.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PTransformFunctionRegistry.java b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PTransformFunctionRegistry.java
index 46b643a7e3f..47b2254c2e7 100644
--- a/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PTransformFunctionRegistry.java
+++ b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PTransformFunctionRegistry.java
@@ -102,10 +102,10 @@ public class PTransformFunctionRegistry {
     SimpleExecutionState state =
         new SimpleExecutionState(this.executionStateName, executionTimeUrn, labelsMetadata);
     executionStates.register(state);
+    MetricsContainerImpl container = metricsContainerRegistry.getContainer(pTransformId);
 
     ThrowingRunnable wrapped =
         () -> {
-          MetricsContainerImpl container = metricsContainerRegistry.getContainer(pTransformId);
           try (Closeable metricCloseable = MetricsEnvironment.scopedMetricsContainer(container)) {
             try (Closeable trackerCloseable = this.stateTracker.enterState(state)) {
               runnable.run();