Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.metrics.MetricResults;
import org.apache.beam.sdk.transforms.PTransformOverrideRegistrar;
import org.apache.beam.sdk.util.UserCodeException;
import org.apache.samza.application.StreamApplication;
import org.apache.samza.config.Config;
Expand Down Expand Up @@ -105,7 +106,12 @@ public State waitUntilFinish(@Nullable Duration duration) {

@Override
public State waitUntilFinish() {
return waitUntilFinish(null);
// LI-specific: clear the PTransformOverrideRegistrar when pipeline is terminal.
PipelineResult.State pipelineResult = waitUntilFinish(null);
if (pipelineResult.isTerminal()) {
PTransformOverrideRegistrar.clear();
}
return pipelineResult;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.metrics.MetricResults;
import org.apache.beam.sdk.transforms.PTransformOverrideRegistrar;
import org.apache.beam.sdk.util.UserCodeException;
import org.apache.spark.SparkException;
import org.apache.spark.api.java.JavaSparkContext;
Expand Down Expand Up @@ -89,7 +90,12 @@ public PipelineResult.State getState() {

@Override
public PipelineResult.State waitUntilFinish() {
return waitUntilFinish(Duration.millis(-1));
// LI-specific: clear the PTransformOverrideRegistrar when pipeline is terminal.
PipelineResult.State pipelineResult = waitUntilFinish(Duration.millis(-1));
if (pipelineResult.isTerminal()) {
PTransformOverrideRegistrar.clear();
}
return pipelineResult;
}

@Override
Expand Down