[ 
https://issues.apache.org/jira/browse/BEAM-5396?focusedWorklogId=171037&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-171037
 ]

ASF GitHub Bot logged work on BEAM-5396:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Nov/18 10:19
            Start Date: 30/Nov/18 10:19
    Worklog Time Spent: 10m 
      Work Description: mxm commented on a change in pull request #7169: 
[BEAM-5396] Savepoint restore option in Flink runner
URL: https://github.com/apache/beam/pull/7169#discussion_r237810589
 
 

 ##########
 File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkExecutionEnvironments.java
 ##########
 @@ -263,4 +284,81 @@ private static void applyLatencyTrackingInterval(
     long latencyTrackingInterval = options.getLatencyTrackingInterval();
     config.setLatencyTrackingInterval(latencyTrackingInterval);
   }
+
+  /**
+   * TODO: https://issues.apache.org/jira/browse/BEAM-5396
+   *
+   * <p>Remote stream environment that supports job execution with restore 
from savepoint. This
+   * class can be removed once Flink provides this functionality.
+   */
+  private static class BeamFlinkRemoteStreamEnvironment extends 
RemoteStreamEnvironment {
+    private final SavepointRestoreSettings restoreSettings;
+
+    public BeamFlinkRemoteStreamEnvironment(
+        String host,
+        int port,
+        Configuration clientConfiguration,
+        SavepointRestoreSettings restoreSettings,
+        String... jarFiles) {
+      super(host, port, clientConfiguration, jarFiles, null);
+      this.restoreSettings = restoreSettings;
+    }
+
+    // copied from RemoteStreamEnvironment and augmented to pass savepoint 
restore settings
+    @Override
+    protected JobExecutionResult executeRemotely(StreamGraph streamGraph, 
List<URL> jarFiles)
+        throws ProgramInvocationException {
+
+      List<URL> globalClasspaths = Collections.emptyList();
+      String host = super.getHost();
+      int port = super.getPort();
+
+      if (LOG.isInfoEnabled()) {
+        LOG.info("Running remotely at {}:{}", host, port);
+      }
+
+      ClassLoader usercodeClassLoader =
+          JobWithJars.buildUserCodeClassLoader(
+              jarFiles, globalClasspaths, getClass().getClassLoader());
+
+      Configuration configuration = new Configuration();
+      configuration.addAll(super.getClientConfiguration());
+
+      configuration.setString(JobManagerOptions.ADDRESS, host);
+      configuration.setInteger(JobManagerOptions.PORT, port);
+
+      configuration.setInteger(RestOptions.PORT, port);
+
+      final ClusterClient<?> client;
+      try {
+        if 
(CoreOptions.LEGACY_MODE.equals(configuration.getString(CoreOptions.MODE))) {
+          client = new StandaloneClusterClient(configuration);
+        } else {
+          client = new RestClusterClient<>(configuration, 
"RemoteStreamEnvironment");
+        }
+      } catch (Exception e) {
+        throw new ProgramInvocationException(
+            "Cannot establish connection to JobManager: " + e.getMessage(), e);
+      }
+
+      
client.setPrintStatusDuringExecution(getConfig().isSysoutLoggingEnabled());
+
+      try {
+        return client
+            .run(streamGraph, jarFiles, globalClasspaths, usercodeClassLoader, 
restoreSettings)
+            .getJobExecutionResult();
+      } catch (ProgramInvocationException e) {
+        throw e;
+      } catch (Exception e) {
+        String term = e.getMessage() == null ? "." : (": " + e.getMessage());
+        throw new ProgramInvocationException("The program execution failed" + 
term, e);
 
 Review comment:
   Not sure about the `term` string. I think we can drop it.

----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 171037)
    Time Spent: 40m  (was: 0.5h)

> Flink portable runner savepoint / upgrade support
> -------------------------------------------------
>
>                 Key: BEAM-5396
>                 URL: https://issues.apache.org/jira/browse/BEAM-5396
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-flink
>            Reporter: Thomas Weise
>            Assignee: Thomas Weise
>            Priority: Major
>              Labels: portability, portability-flink
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> The portable Flink runner needs to support Flink savepoints for production 
> use. It should be possible to upgrade a stateful portable Beam pipeline that 
> runs on Flink, which involves taking a savepoint and then starting the new 
> version of the pipeline from that savepoint. The potential issues with 
> pipeline evolution and migration are similar to those when using the Flink 
> DataStream API (schema / name changes etc.).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to