Package org.springframework.batch.core.partition

Examples of org.springframework.batch.core.partition.StepExecutionSplitter.split()


    MessagingTemplate operations = mock(MessagingTemplate.class);
    Message message = mock(Message.class);
    //when
    HashSet<StepExecution> stepExecutions = new HashSet<StepExecution>();
    stepExecutions.add(new StepExecution("step1", new JobExecution(5l)));
    when(stepExecutionSplitter.split((StepExecution) anyObject(), eq(1))).thenReturn(stepExecutions);
    when(message.getPayload()).thenReturn(Collections.emptyList());
    when(operations.receive((PollableChannel) anyObject())).thenReturn(message);
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);
View Full Code Here


    Message message = mock(Message.class);
    PollableChannel replyChannel = mock(PollableChannel.class);
    //when
    HashSet<StepExecution> stepExecutions = new HashSet<StepExecution>();
    stepExecutions.add(new StepExecution("step1", new JobExecution(5l)));
    when(stepExecutionSplitter.split((StepExecution) anyObject(), eq(1))).thenReturn(stepExecutions);
    when(message.getPayload()).thenReturn(Collections.emptyList());
    when(operations.receive(replyChannel)).thenReturn(message);
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);
    messageChannelPartitionHandler.setReplyChannel(replyChannel);
View Full Code Here

    MessagingTemplate operations = mock(MessagingTemplate.class);
    Message message = mock(Message.class);
    //when
    HashSet<StepExecution> stepExecutions = new HashSet<StepExecution>();
    stepExecutions.add(new StepExecution("step1", new JobExecution(5l)));
    when(stepExecutionSplitter.split((StepExecution) anyObject(), eq(1))).thenReturn(stepExecutions);
    when(message.getPayload()).thenReturn(Collections.emptyList());
    //set
    messageChannelPartitionHandler.setMessagingOperations(operations);

    //execute
View Full Code Here

          partitionStepExecutions = applyPartitionPlan(stepExecution, plan, true);
        }

      } else {
        StepExecutionSplitter stepSplitter = new JsrStepExecutionSplitter(jobRepository, allowStartIfComplete, stepExecution.getStepName(), true);
        partitionStepExecutions = stepSplitter.split(stepExecution, partitions);
      }
    } else {
      if(mapper != null) {
        PartitionPlan plan = mapper.mapPartitions();
        partitionStepExecutions = applyPartitionPlan(stepExecution, plan, true);
View Full Code Here

      if(mapper != null) {
        PartitionPlan plan = mapper.mapPartitions();
        partitionStepExecutions = applyPartitionPlan(stepExecution, plan, true);
      } else {
        StepExecutionSplitter stepSplitter = new JsrStepExecutionSplitter(jobRepository, allowStartIfComplete, stepExecution.getStepName(), true);
        partitionStepExecutions = stepSplitter.split(stepExecution, partitions);
      }
    }
    return partitionStepExecutions;
  }
View Full Code Here

    }

    stepExecution.getExecutionContext().put("partitionPlanState", new PartitionPlanState(plan));

    stepSplitter = new JsrStepExecutionSplitter(jobRepository, allowStartIfComplete, stepExecution.getStepName(), restoreState);
    partitionStepExecutions = stepSplitter.split(stepExecution, plan.getPartitions());
    registerPartitionProperties(partitionStepExecutions, plan);
    return partitionStepExecutions;
  }

  private void processFinishedPartitions(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.