/** * @return true if this is a partitioned step */ protected boolean isPartitionedStep() { return (getStep().getPartition() != null); }
/** * @return the partition plan, built either from the JSL or the user-provided PartitionMapper. */ private PartitionPlanDescriptor buildPartitionPlan() { final PartitionMapper partitionMapperModel = getStep().getPartition().getMapper(); final com.ibm.jbatch.jsl.model.PartitionPlan partitionPlanModel = getStep().getPartition().getPlan(); if (partitionMapperModel != null) { return buildPartitionPlanFromMapper(partitionMapperModel); } else if (partitionPlanModel != null) { return buildPartitionPlanFromPlanElement(partitionPlanModel); } else { throw new IllegalArgumentException("Need plan or mapper but found neither."); } }
/** * Need to perform this check because of the way we manipulate the model in building our "subjob" for * the partition. */ private static boolean isTruePartitionOfTopLevelStep(Step step) { Partition partition = step.getPartition(); if (partition.getMapper() != null ) { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found partitioned step with mapper" , step); } return true; } else if (partition.getPlan() != null) { if (partition.getPlan().getPartitions() != null) { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found partitioned step with plan", step); } return true; } else { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found plan with partitions stripped out. Must be a partition on the partition work unit thread", step); } return false; } } else { throw new IllegalArgumentException("Partition does not contain either a mapper or a plan. Aborting."); } } }
@Override protected void invokeCoreStep() throws BatchContainerServiceException { //TODO If this step is partitioned create partition artifacts Partition partition = step.getPartition(); if (partition != null) { //partition.getConcurrencyElements(); } try { invokeBatchlet(step.getBatchlet()); } finally { invokeCollectorIfPresent(); } }
@Override protected void invokeCoreStep() throws BatchContainerServiceException { //TODO If this step is partitioned create partition artifacts Partition partition = step.getPartition(); if (partition != null) { //partition.getConcurrencyElements(); } try { invokeBatchlet(step.getBatchlet()); } finally { invokeCollectorIfPresent(); } }
Partition partition = step.getPartition(); if (partition != null) {
if(logger.isLoggable(Level.FINER)) { logger.logp (Level.FINER, CLASSNAME, methodName, "Get StepController for", step.getId());} if (step.getPartition() != null) { if (isTruePartitionOfTopLevelStep(step)) { return new PartitionedStepControllerImpl(jobExecutionImpl, step);
Partition partition = step.getPartition(); if (partition != null) {
protected void setupStepArtifacts() { // set up listeners InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, null); this.stepListeners = jobExecutionImpl.getListenerFactory().getStepListeners(step, injectionRef, stepContext); // set up collectors if we are running a partitioned step if (step.getPartition() != null) { Collector collector = step.getPartition().getCollector(); if (collector != null) { List<Property> propList = (collector.getProperties() == null) ? null : collector.getProperties().getPropertyList(); /** * Inject job flow, split, and step contexts into partition * artifacts like collectors and listeners some of these * contexts may be null */ injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { this.collectorProxy = ProxyFactory.createPartitionCollectorProxy(collector.getRef(), injectionRef, this.stepContext); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the collector [" + collector.getRef() + "]", e); } } } }
protected void setupStepArtifacts() { // set up listeners InjectionReferences injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, null); this.stepListeners = jobExecutionImpl.getListenerFactory().getStepListeners(step, injectionRef, stepContext); // set up collectors if we are running a partitioned step if (step.getPartition() != null) { Collector collector = step.getPartition().getCollector(); if (collector != null) { List<Property> propList = (collector.getProperties() == null) ? null : collector.getProperties().getPropertyList(); /** * Inject job flow, split, and step contexts into partition * artifacts like collectors and listeners some of these * contexts may be null */ injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { this.collectorProxy = ProxyFactory.createPartitionCollectorProxy(collector.getRef(), injectionRef, this.stepContext); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the collector [" + collector.getRef() + "]", e); } } } }
@Override protected void setupStepArtifacts() { InjectionReferences injectionRef = null; injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, null); this.stepListeners = jobExecutionImpl.getListenerFactory().getStepListeners(step, injectionRef, stepContext); Analyzer analyzer = step.getPartition().getAnalyzer(); if (analyzer != null) { final List<Property> propList = analyzer.getProperties() == null ? null : analyzer.getProperties() .getPropertyList(); injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { analyzerProxy = ProxyFactory.createPartitionAnalyzerProxy(analyzer.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + analyzer.getRef() + "]", e); } } PartitionReducer partitionReducer = step.getPartition().getReducer(); if (partitionReducer != null) { final List<Property> propList = partitionReducer.getProperties() == null ? null : partitionReducer.getProperties() .getPropertyList(); injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { this.partitionReducerProxy = ProxyFactory.createPartitionReducerProxy(partitionReducer.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + partitionReducer.getRef() + "]", e); } } }
@Override protected void setupStepArtifacts() { InjectionReferences injectionRef = null; injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, null); this.stepListeners = jobExecutionImpl.getListenerFactory().getStepListeners(step, injectionRef, stepContext); Analyzer analyzer = step.getPartition().getAnalyzer(); if (analyzer != null) { final List<Property> propList = analyzer.getProperties() == null ? null : analyzer.getProperties() .getPropertyList(); injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { analyzerProxy = ProxyFactory.createPartitionAnalyzerProxy(analyzer.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + analyzer.getRef() + "]", e); } } PartitionReducer partitionReducer = step.getPartition().getReducer(); if (partitionReducer != null) { final List<Property> propList = partitionReducer.getProperties() == null ? null : partitionReducer.getProperties() .getPropertyList(); injectionRef = new InjectionReferences(jobExecutionImpl.getJobContext(), stepContext, propList); try { this.partitionReducerProxy = ProxyFactory.createPartitionReducerProxy(partitionReducer.getRef(), injectionRef, stepContext); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + partitionReducer.getRef() + "]", e); } } }
@Override protected void setupStepArtifacts() { InjectionReferences injectionRef = null; injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, null); this.stepListeners = runtimeWorkUnitExecution.getListenerFactory().getStepListeners(getStep(), injectionRef, runtimeStepExecution); Analyzer analyzer = getStep().getPartition().getAnalyzer(); if (analyzer != null) { final List<Property> propList = analyzer.getProperties() == null ? null : analyzer.getProperties().getPropertyList(); injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propList); try { analyzerProxy = ProxyFactory.createPartitionAnalyzerProxy(analyzer.getRef(), injectionRef, runtimeStepExecution); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the analyzer [" + analyzer.getRef() + "]", e); } } PartitionReducer partitionReducer = getStep().getPartition().getReducer(); if (partitionReducer != null) { final List<Property> propList = partitionReducer.getProperties() == null ? null : partitionReducer.getProperties().getPropertyList(); injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propList); try { this.partitionReducerProxy = ProxyFactory.createPartitionReducerProxy(partitionReducer.getRef(), injectionRef, runtimeStepExecution); } catch (final ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the reducer [" + partitionReducer.getRef() + "]", e); } } }
protected void setupStepArtifacts() { // set up listeners InjectionReferences injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, null); this.stepListeners = runtimeWorkUnitExecution.getListenerFactory().getStepListeners(getStep(), injectionRef, runtimeStepExecution); // set up collectors if we are running a partitioned step if ( isPartitionedStep() ) { Collector collector = getStep().getPartition().getCollector(); if (collector != null) { List<Property> propList = (collector.getProperties() == null) ? null : collector.getProperties().getPropertyList(); /** * Inject job flow, split, and step contexts into partition * artifacts like collectors and listeners some of these * contexts may be null */ injectionRef = new InjectionReferences(runtimeWorkUnitExecution.getWorkUnitJobContext(), runtimeStepExecution, propList); try { this.collectorProxy = ProxyFactory.createPartitionCollectorProxy(collector.getRef(), injectionRef, this.runtimeStepExecution); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the collector [" + collector.getRef() + "]", e); } } } }
if (step.getPartition() != null) { PropertyResolverFactory.createPartitionPropertyResolver(this.isPartitionedStep).substituteProperties(step.getPartition(), submittedProps, currentProps);
if (step.getPartition() != null) { PropertyResolverFactory.createPartitionPropertyResolver(this.isPartitionedStep).substituteProperties(step.getPartition(), submittedProps, currentProps);
if (step.getPartition() != null) { PropertyResolverFactory.createPartitionPropertyResolver(this.isPartitionedStep).substituteProperties(step.getPartition(), submittedProps, currentProps);
Partition partition = step.getPartition(); if (partition != null) { if (partition.getCollector() != null) {
Partition partition = step.getPartition(); if (partition != null) { if (partition.getCollector() != null) {
Partition partition = step.getPartition(); if (partition != null) { if (partition.getCollector() != null) {