TisonKun commented on a change in pull request #10251: [FLINK-14851][FLINK-14850] Implement Executors and wire them to the ContextEnvironment URL: https://github.com/apache/flink/pull/10251#discussion_r348933979
########## File path: flink-clients/src/main/java/org/apache/flink/client/deployment/ExecutorUtils.java ########## @@ -0,0 +1,59 @@ +/* + * 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.flink.client.deployment; + +import org.apache.flink.api.dag.Pipeline; +import org.apache.flink.client.FlinkPipelineTranslationUtil; +import org.apache.flink.client.cli.ExecutionConfigAccessor; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.runtime.jobgraph.JobGraph; + +import javax.annotation.Nonnull; + +import static org.apache.flink.util.Preconditions.checkNotNull; + +/** + * Utility class with method related to job execution. + */ +public class ExecutorUtils { + + /** + * Creates the {@link JobGraph} corresponding to the provided {@link Pipeline}. + * + * @param pipeline the pipeline whose job graph we are computing + * @param configuration the configuration with the necessary information such as jars and + * classpaths to be included, the parallelism of the job and potential + * savepoint settings used to bootstrap its state. + * @return the corresponding {@link JobGraph}. + */ + public static JobGraph getJobGraph(@Nonnull final Pipeline pipeline, @Nonnull final Configuration configuration) { Review comment: I have seen too much `getJobGraph` utilities so far 🤣 Maybe as a follow up we try to batch them into one `JobGraphUtils`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
