[
https://issues.apache.org/jira/browse/BEAM-4267?focusedWorklogId=109786&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-109786
]
ASF GitHub Bot logged work on BEAM-4267:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jun/18 16:47
Start Date: 07/Jun/18 16:47
Worklog Time Spent: 10m
Work Description: axelmagn closed pull request #5573: [BEAM-4267]
Implement flink context factory methods
URL: https://github.com/apache/beam/pull/5573
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/functions/FlinkExecutableStageContext.java
b/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/functions/FlinkExecutableStageContext.java
index 0fd4961f699..5ea6de3b4bb 100644
---
a/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/functions/FlinkExecutableStageContext.java
+++
b/runners/flink/src/main/java/org/apache/beam/runners/flink/translation/functions/FlinkExecutableStageContext.java
@@ -20,6 +20,7 @@
import java.io.Serializable;
import org.apache.beam.runners.core.construction.graph.ExecutableStage;
import org.apache.beam.runners.flink.ArtifactSourcePool;
+import org.apache.beam.runners.fnexecution.control.DockerJobBundleFactory;
import org.apache.beam.runners.fnexecution.control.StageBundleFactory;
import org.apache.beam.runners.fnexecution.provisioning.JobInfo;
import org.apache.beam.runners.fnexecution.state.StateRequestHandler;
@@ -27,6 +28,11 @@
/** The Flink context required in order to execute {@link ExecutableStage
stages}. */
public class FlinkExecutableStageContext {
+ private final DockerJobBundleFactory dockerJobBundleFactory;
+
+ private FlinkExecutableStageContext(DockerJobBundleFactory
dockerJobBundleFactory) {
+ this.dockerJobBundleFactory = dockerJobBundleFactory;
+ }
/**
* Creates {@link FlinkExecutableStageContext} instances. Serializable so
that factories can be
@@ -37,11 +43,18 @@
}
public static Factory batchFactory() {
- return null;
+ return jobInfo -> {
+ try {
+ DockerJobBundleFactory dockerJobBundleFactory =
DockerJobBundleFactory.create(jobInfo);
+ return new FlinkExecutableStageContext(dockerJobBundleFactory);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ };
}
public StageBundleFactory getStageBundleFactory(ExecutableStage
executableStage) {
- throw new UnsupportedOperationException();
+ return dockerJobBundleFactory.forStage(executableStage);
}
public StateRequestHandler getStateRequestHandler(
diff --git
a/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DockerJobBundleFactory.java
b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DockerJobBundleFactory.java
index c0a69ca1822..76262af139a 100644
---
a/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DockerJobBundleFactory.java
+++
b/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DockerJobBundleFactory.java
@@ -38,7 +38,6 @@
import org.apache.beam.runners.fnexecution.GrpcFnServer;
import org.apache.beam.runners.fnexecution.ServerFactory;
import org.apache.beam.runners.fnexecution.artifact.ArtifactRetrievalService;
-import org.apache.beam.runners.fnexecution.artifact.ArtifactSource;
import
org.apache.beam.runners.fnexecution.control.ProcessBundleDescriptors.ExecutableProcessBundleDescriptor;
import
org.apache.beam.runners.fnexecution.control.SdkHarnessClient.BundleProcessor;
import org.apache.beam.runners.fnexecution.data.GrpcDataService;
@@ -80,7 +79,7 @@
private final LoadingCache<Environment, WrappedSdkHarnessClient>
environmentCache;
- public static DockerJobBundleFactory create(JobInfo jobInfo, ArtifactSource
artifactSource)
+ public static DockerJobBundleFactory create(JobInfo jobInfo)
throws Exception {
ServerFactory serverFactory = getServerFactory();
IdGenerator stageIdGenerator = IdGenerators.incrementingLongs();
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 109786)
Time Spent: 2h 40m (was: 2.5h)
> Implement a reusable library that can run an ExecutableStage with a given
> Environment
> -------------------------------------------------------------------------------------
>
> Key: BEAM-4267
> URL: https://issues.apache.org/jira/browse/BEAM-4267
> Project: Beam
> Issue Type: Improvement
> Components: runner-flink
> Reporter: Axel Magnuson
> Assignee: Ben Sidhom
> Priority: Major
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> Build off of the interfaces introduced in
> [BEAM-3327|https://github.com/apache/beam/pull/5152] to provide a reusable
> execution library to runners.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)