use of io.cdap.cdap.etl.planner.PipelinePlanner in project cdap by caskdata.
the class SmartWorkflow method createPlan.
private PipelinePlan createPlan() {
PipelinePlanner planner;
Set<String> actionTypes = ImmutableSet.of(Action.PLUGIN_TYPE, Constants.SPARK_PROGRAM_PLUGIN_TYPE);
Set<String> multiPortTypes = ImmutableSet.of(SplitterTransform.PLUGIN_TYPE);
if (useSpark) {
// if the pipeline uses spark, we don't need to break the pipeline up into phases, we can just have
// a single phase.
planner = new PipelinePlanner(supportedPluginTypes, ImmutableSet.of(), ImmutableSet.of(), actionTypes, multiPortTypes);
} else {
planner = new PipelinePlanner(supportedPluginTypes, ImmutableSet.of(BatchAggregator.PLUGIN_TYPE, BatchJoiner.PLUGIN_TYPE), ImmutableSet.of(SparkCompute.PLUGIN_TYPE, SparkSink.PLUGIN_TYPE), actionTypes, multiPortTypes);
}
return planner.plan(spec);
}
Aggregations