/** * Note we restart all flows. There is no concept of "the flow completed". It is only steps * within the flows that may have already completed and so may not have needed to be rerun. * */ private void buildSubJobBatchWorkUnits() { List<Flow> flows = this.split.getFlows(); parallelBatchWorkUnits = new ArrayList<BatchFlowInSplitWorkUnit>(); // Build all sub jobs from flows in split synchronized (subJobs) { for (Flow flow : flows) { subJobs.add(PartitionedStepBuilder.buildFlowInSplitSubJob(jobContext, this.split, flow)); } // Go back to earlier idea that we may have seen this id before, and need a special "always restart" behavior // for split-flows. for (JSLJob job : subJobs) { int count = batchKernel.getJobInstanceCount(job.getId()); FlowInSplitBuilderConfig config = new FlowInSplitBuilderConfig(job, completedWorkQueue, rootJobExecutionId); if (count == 0) { parallelBatchWorkUnits.add(batchKernel.buildNewFlowInSplitWorkUnit(config)); } else if (count == 1) { parallelBatchWorkUnits.add(batchKernel.buildOnRestartFlowInSplitWorkUnit(config)); } else { throw new IllegalStateException("There is an inconsistency somewhere in the internal subjob creation"); } } } }
/** * Note we restart all flows. There is no concept of "the flow completed". It is only steps * within the flows that may have already completed and so may not have needed to be rerun. * */ private void buildSubJobBatchWorkUnits() { List<Flow> flows = this.split.getFlows(); parallelBatchWorkUnits = new ArrayList<BatchFlowInSplitWorkUnit>(); // Build all sub jobs from flows in split synchronized (subJobs) { for (Flow flow : flows) { subJobs.add(PartitionedStepBuilder.buildFlowInSplitSubJob(jobExecution.getExecutionId(), jobContext, this.split, flow)); } for (JSLJob job : subJobs) { int count = batchKernel.getJobInstanceCount(job.getId()); FlowInSplitBuilderConfig config = new FlowInSplitBuilderConfig(job, completedWorkQueue, rootJobExecutionId); if (count == 0) { parallelBatchWorkUnits.add(batchKernel.buildNewFlowInSplitWorkUnit(config)); } else if (count == 1) { parallelBatchWorkUnits.add(batchKernel.buildOnRestartFlowInSplitWorkUnit(config)); } else { throw new IllegalStateException("There is an inconsistency somewhere in the internal subjob creation"); } } } }
private void buildSubJobBatchWorkUnits() { List<Flow> flows = this.split.getFlows(); splitFlowWorkUnits = new ArrayList<BatchSplitFlowWorkUnit>(); for (Flow flow : flows) { // 1. First, we build the subjob JSLJob model for flows in split JSLJob splitFlowJSLJob = ParallelStepBuilder.buildFlowInSplitSubJob(runtimeWorkUnitExecution.getTopLevelInstanceId(), runtimeWorkUnitExecution.getWorkUnitJobContext(), this.split, flow); subJobs.add(splitFlowJSLJob); // 2. Next, we build a (persisted) execution and a work unit (thread) around it. SplitFlowConfig splitFlowConfig = new SplitFlowConfig(runtimeWorkUnitExecution.getTopLevelNameInstanceExecutionInfo(), split.getId(), flow.getId(), runtimeWorkUnitExecution.getCorrelationId()); BatchSplitFlowWorkUnit workUnit = getBatchKernelService().createSplitFlowWorkUnit(splitFlowConfig, splitFlowJSLJob, completedWorkQueue); splitFlowWorkUnits.add(workUnit); } }
@Override public Split substituteProperties(final Split split, final Properties submittedProps, final Properties parentProps) { // resolve all the properties used in attributes and update the JAXB model split.setId(this.replaceAllProperties(split.getId(), submittedProps, parentProps)); split.setNextFromAttribute(this.replaceAllProperties(split.getNextFromAttribute(), submittedProps, parentProps)); // Resolve all the properties defined for this step Properties currentProps = parentProps; for (final Flow flow : split.getFlows()) { PropertyResolverFactory.createFlowPropertyResolver(this.isPartitionedStep).substituteProperties(flow, submittedProps, currentProps); } return split; }
@Override public Split substituteProperties(final Split split, final Properties submittedProps, final Properties parentProps) { // resolve all the properties used in attributes and update the JAXB model split.setId(this.replaceAllProperties(split.getId(), submittedProps, parentProps)); split.setNextFromAttribute(this.replaceAllProperties(split.getNextFromAttribute(), submittedProps, parentProps)); // Resolve all the properties defined for this step Properties currentProps = parentProps; for (final Flow flow : split.getFlows()) { PropertyResolverFactory.createFlowPropertyResolver(this.isPartitionedStep).substituteProperties(flow, submittedProps, currentProps); } return split; }
@Override public Split substituteProperties(final Split split, final Properties submittedProps, final Properties parentProps) { // resolve all the properties used in attributes and update the JAXB model split.setId(this.replaceAllProperties(split.getId(), submittedProps, parentProps)); split.setNextFromAttribute(this.replaceAllProperties(split.getNextFromAttribute(), submittedProps, parentProps)); // Resolve all the properties defined for this step Properties currentProps = parentProps; for (final Flow flow : split.getFlows()) { PropertyResolverFactory.createFlowPropertyResolver(this.isPartitionedStep).substituteProperties(flow, submittedProps, currentProps); } return split; }