Source:
JobGraph createJobGraph(ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc) { JobGraph jobGraph = new JobGraph(new MapConfig(config), appDesc); Set<StreamSpec> sourceStreams = getStreamSpecs(appDesc.getInputStreamIds(), streamConfig); Set<StreamSpec> sinkStreams = getStreamSpecs(appDesc.getOutputStreamIds(), streamConfig); Set<StreamSpec> intermediateStreams = Sets.intersection(sourceStreams, sinkStreams); Set<StreamSpec> inputStreams = Sets.difference(sourceStreams, intermediateStreams); Set<StreamSpec> outputStreams = Sets.difference(sinkStreams, intermediateStreams); Set<TableDescriptor> tables = appDesc.getTableDescriptors(); MapConfig generatedJobConfigs = JobConfigUtil.generateJobIdAndName(config); String jobName = generatedJobConfigs.get(JobConfig.JOB_NAME()); String jobId = generatedJobConfigs.get(JobConfig.JOB_ID(), "1"); JobNode node = jobGraph.getOrCreateJobNode(jobName, jobId); inputStreams.forEach(spec -> jobGraph.addInputStream(spec, node)); outputStreams.forEach(spec -> jobGraph.addOutputStream(spec, node)); intermediateStreams.forEach(spec -> jobGraph.addIntermediateStream(spec, node, node)); for (TableDescriptor table : tables) { jobGraph.addTable(table, node); if (table instanceof LocalTableDescriptor) { LocalTableDescriptor localTable = (LocalTableDescriptor) table; Iterable<String> sideInputs = ListUtils.emptyIfNull(localTable.getSideInputs()); for (String sideInput : sideInputs) { jobGraph.addSideInputStream(getStreamSpec(sideInput, streamConfig)); } } } if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { jobGraph.validate(); } return jobGraph; }

Target:
JobGraph createJobGraph(ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc) { JobGraph jobGraph = new JobGraph(config, appDesc); Set<StreamSpec> sourceStreams = getStreamSpecs(appDesc.getInputStreamIds(), streamConfig); Set<StreamSpec> sinkStreams = getStreamSpecs(appDesc.getOutputStreamIds(), streamConfig); Set<StreamSpec> intermediateStreams = Sets.intersection(sourceStreams, sinkStreams); Set<StreamSpec> inputStreams = Sets.difference(sourceStreams, intermediateStreams); Set<StreamSpec> outputStreams = Sets.difference(sinkStreams, intermediateStreams); Set<TableDescriptor> tables = appDesc.getTableDescriptors(); MapConfig generatedJobConfigs = JobPlanner.generateSingleJobConfig(config); String jobName = generatedJobConfigs.get(JobConfig.JOB_NAME()); String jobId = generatedJobConfigs.get(JobConfig.JOB_ID(), "1"); JobNode node = jobGraph.getOrCreateJobNode(jobName, jobId); inputStreams.forEach(spec -> jobGraph.addInputStream(spec, node)); outputStreams.forEach(spec -> jobGraph.addOutputStream(spec, node)); intermediateStreams.forEach(spec -> jobGraph.addIntermediateStream(spec, node, node)); for (TableDescriptor table : tables) { jobGraph.addTable(table, node); if (table instanceof LocalTableDescriptor) { LocalTableDescriptor localTable = (LocalTableDescriptor) table; Iterable<String> sideInputs = ListUtils.emptyIfNull(localTable.getSideInputs()); for (String sideInput : sideInputs) { jobGraph.addSideInputStream(getStreamSpec(sideInput, streamConfig)); } } } if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { jobGraph.validate(); } return jobGraph; }