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

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

                Author: ASF GitHub Bot
            Created on: 01/May/18 22:06
            Start Date: 01/May/18 22:06
    Worklog Time Spent: 10m 
      Work Description: bsidhom commented on a change in pull request #5226: 
[BEAM-3972] Translate portable batch pipelines by proto
URL: https://github.com/apache/beam/pull/5226#discussion_r185347003
 
 

 ##########
 File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkExecutionEnvironments.java
 ##########
 @@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.flink;
+
+import java.util.List;
+import org.apache.flink.api.java.CollectionEnvironment;
+import org.apache.flink.api.java.ExecutionEnvironment;
+import org.apache.flink.runtime.state.AbstractStateBackend;
+import org.apache.flink.streaming.api.TimeCharacteristic;
+import 
org.apache.flink.streaming.api.environment.CheckpointConfig.ExternalizedCheckpointCleanup;
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** Utilities for Flink execution environments. */
+public class FlinkExecutionEnvironments {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(FlinkExecutionEnvironments.class);
+
+  /**
+   * If the submitted job is a batch processing job, this method creates the 
adequate Flink {@link
+   * org.apache.flink.api.java.ExecutionEnvironment} depending on the 
user-specified options.
+   */
+  public static ExecutionEnvironment 
createBatchExecutionEnvironment(FlinkPipelineOptions options) {
+
+    LOG.info("Creating a Batch Execution Environment.");
+
+    String masterUrl = options.getFlinkMaster();
+    ExecutionEnvironment flinkBatchEnv;
+
+    // depending on the master, create the right environment.
+    if ("[local]".equals(masterUrl)) {
+      flinkBatchEnv = ExecutionEnvironment.createLocalEnvironment();
+    } else if ("[collection]".equals(masterUrl)) {
+      flinkBatchEnv = new CollectionEnvironment();
+    } else if ("[auto]".equals(masterUrl)) {
+      flinkBatchEnv = ExecutionEnvironment.getExecutionEnvironment();
+    } else if (masterUrl.matches(".*:\\d*")) {
+      String[] parts = masterUrl.split(":");
+      List<String> stagingFiles = options.getFilesToStage();
 
 Review comment:
   In the case of auto, the runner is either executing locally (i.e., all the 
jars are already available on the current classpath) or the job is submitted 
via `flink run`. In the `flink run` case, you pass staging files to the `flink` 
preparation script and that is done automatically.
   
   In any case, we will likely not want this in the portable runner. The 
runner/job service should not have its classpath polluted by user code. 
Instead, the files should only be staged via the DistributedCache. I might 
revert this change and just have the portable runner use its own 
`ExecutionEnvironment` construction semantics. I think that makes sense here.

----------------------------------------------------------------
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: 97263)
    Time Spent: 5h 50m  (was: 5h 40m)

> Flink runner translates batch pipelines directly by proto
> ---------------------------------------------------------
>
>                 Key: BEAM-3972
>                 URL: https://issues.apache.org/jira/browse/BEAM-3972
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-flink
>            Reporter: Ben Sidhom
>            Assignee: Ben Sidhom
>            Priority: Major
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> The non-portable runner uses reydrated pipelines which lack necessary 
> information. The portable Flink runner needs to translate pipelines directly 
> by proto in order to wire components into individual executable stages 
> correctly.



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

Reply via email to