You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by al...@apache.org on 2019/09/18 07:53:33 UTC
[flink] 04/08: [hotfix] Remove unused static methods from
LocalExecutor
This is an automated email from the ASF dual-hosted git repository.
aljoscha pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 2d92a2558d6f1f61a58b3958743cb763d31b0063
Author: Aljoscha Krettek <al...@apache.org>
AuthorDate: Thu Sep 5 17:17:23 2019 +0200
[hotfix] Remove unused static methods from LocalExecutor
---
.../org/apache/flink/client/LocalExecutor.java | 48 ----------------------
1 file changed, 48 deletions(-)
diff --git a/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java b/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java
index 3997c23..08b8448 100644
--- a/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java
+++ b/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java
@@ -28,7 +28,6 @@ import org.apache.flink.configuration.RestOptions;
import org.apache.flink.configuration.TaskManagerOptions;
import org.apache.flink.optimizer.DataStatistics;
import org.apache.flink.optimizer.Optimizer;
-import org.apache.flink.optimizer.dag.DataSinkNode;
import org.apache.flink.optimizer.plan.OptimizedPlan;
import org.apache.flink.optimizer.plandump.PlanJSONDumpGenerator;
import org.apache.flink.optimizer.plantranslate.JobGraphGenerator;
@@ -38,8 +37,6 @@ import org.apache.flink.runtime.minicluster.MiniCluster;
import org.apache.flink.runtime.minicluster.MiniClusterConfiguration;
import org.apache.flink.runtime.minicluster.RpcServiceSharing;
-import java.util.List;
-
import static org.apache.flink.util.Preconditions.checkNotNull;
/**
@@ -159,49 +156,4 @@ public class LocalExecutor extends PlanExecutor {
return new PlanJSONDumpGenerator().getOptimizerPlanAsJSON(op);
}
-
- // --------------------------------------------------------------------------------------------
- // Static variants that internally bring up an instance and shut it down after the execution
- // --------------------------------------------------------------------------------------------
-
- /**
- * Executes the given dataflow plan.
- *
- * @param plan The dataflow plan.
- * @return The execution result.
- *
- * @throws Exception Thrown, if either the startup of the local execution context, or the execution
- * caused an exception.
- */
- public static JobExecutionResult execute(Plan plan) throws Exception {
- return new LocalExecutor().executePlan(plan);
- }
-
- /**
- * Creates a JSON representation of the given dataflow's execution plan.
- *
- * @param plan The dataflow plan.
- * @return The dataflow's execution plan, as a JSON string.
- * @throws Exception Thrown, if the optimization process that creates the execution plan failed.
- */
- public static String optimizerPlanAsJSON(Plan plan) throws Exception {
- final int parallelism = plan.getDefaultParallelism() == ExecutionConfig.PARALLELISM_DEFAULT ? 1 : plan.getDefaultParallelism();
-
- Optimizer pc = new Optimizer(new DataStatistics(), new Configuration());
- pc.setDefaultParallelism(parallelism);
- OptimizedPlan op = pc.compile(plan);
-
- return new PlanJSONDumpGenerator().getOptimizerPlanAsJSON(op);
- }
-
- /**
- * Creates a JSON representation of the given dataflow plan.
- *
- * @param plan The dataflow plan.
- * @return The dataflow plan (prior to optimization) as a JSON string.
- */
- public static String getPlanAsJSON(Plan plan) {
- List<DataSinkNode> sinks = Optimizer.createPreOptimizedPlan(plan);
- return new PlanJSONDumpGenerator().getPactPlanAsJSON(sinks);
- }
}