congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
PartitionStep.setStepExecutionSplitter
Code IndexAdd Tabnine to your IDE (free)

How to use
setStepExecutionSplitter
method
in
org.springframework.batch.core.partition.support.PartitionStep

Best Java code snippets using org.springframework.batch.core.partition.support.PartitionStep.setStepExecutionSplitter (Showing top 10 results out of 315)

origin: spring-projects/spring-batch

step.setStepExecutionSplitter(splitter);
splitter.setStepName(name);
this.splitter = splitter;
step.setStepExecutionSplitter(splitter);
origin: spring-projects/spring-batch

@Test
public void testVanillaStepExecution() throws Exception {
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
    public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution)
        throws Exception {
      Set<StepExecution> executions = stepSplitter.split(stepExecution, 2);
      for (StepExecution execution : executions) {
        execution.setStatus(BatchStatus.COMPLETED);
        execution.setExitStatus(ExitStatus.COMPLETED);
      }
      return executions;
    }
  });
  step.afterPropertiesSet();
  JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
  StepExecution stepExecution = jobExecution.createStepExecution("foo");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  // one master and two workers
  assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
  assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
}
origin: spring-projects/spring-batch

@Test
public void testFailedStepExecution() throws Exception {
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
    public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution)
        throws Exception {
      Set<StepExecution> executions = stepSplitter.split(stepExecution, 2);
      for (StepExecution execution : executions) {
        execution.setStatus(BatchStatus.FAILED);
        execution.setExitStatus(ExitStatus.FAILED);
      }
      return executions;
    }
  });
  step.afterPropertiesSet();
  JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
  StepExecution stepExecution = jobExecution.createStepExecution("foo");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  // one master and two workers
  assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
  assertEquals(BatchStatus.FAILED, stepExecution.getStatus());
}
origin: spring-projects/spring-batch

@Test
public void testStoppedStepExecution() throws Exception {
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
    public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution)
        throws Exception {
      Set<StepExecution> executions = stepSplitter.split(stepExecution, 2);
      for (StepExecution execution : executions) {
        execution.setStatus(BatchStatus.STOPPED);
        execution.setExitStatus(ExitStatus.STOPPED);
      }
      return executions;
    }
  });
  step.afterPropertiesSet();
  JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
  StepExecution stepExecution = jobExecution.createStepExecution("foo");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  // one master and two workers
  assertEquals(3, stepExecution.getJobExecution().getStepExecutions().size());
  assertEquals(BatchStatus.STOPPED, stepExecution.getStatus());
}
origin: spring-projects/spring-batch

@Test
public void testRestartStepExecution() throws Exception {
  final AtomicBoolean started = new AtomicBoolean(false);
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
origin: spring-projects/spring-batch

@Test
public void testStepAggregator() throws Exception {
  step.setStepExecutionAggregator(new DefaultStepExecutionAggregator() {
    @Override
    public void aggregate(StepExecution result, Collection<StepExecution> executions) {
      super.aggregate(result, executions);
      result.getExecutionContext().put("aggregated", true);
    }
  });
  step.setStepExecutionSplitter(new SimpleStepExecutionSplitter(jobRepository, true, step.getName(), new SimplePartitioner()));
  step.setPartitionHandler(new PartitionHandler() {
    @Override
    public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution)
        throws Exception {
      return Arrays.asList(stepExecution);
    }
  });
  step.afterPropertiesSet();
  JobExecution jobExecution = jobRepository.createJobExecution("vanillaJob", new JobParameters());
  StepExecution stepExecution = jobExecution.createStepExecution("foo");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  assertEquals(true, stepExecution.getExecutionContext().get("aggregated"));
}
origin: org.springframework.batch/org.springframework.batch.core

private void configurePartitionStep(PartitionStep ts) {
  Assert.state(partitioner != null, "A Partitioner must be provided for a partition step");
  Assert.state(step != null, "A Step must be provided for a partition step");
  configureAbstractStep(ts);
  if (partitionHandler != null) {
    ts.setPartitionHandler(partitionHandler);
  }
  else {
    TaskExecutorPartitionHandler partitionHandler = new TaskExecutorPartitionHandler();
    partitionHandler.setStep(step);
    if (taskExecutor == null) {
      taskExecutor = new SyncTaskExecutor();
    }
    partitionHandler.setGridSize(gridSize);
    partitionHandler.setTaskExecutor(taskExecutor);
    ts.setPartitionHandler(partitionHandler);
  }
  SimpleStepExecutionSplitter splitter = new SimpleStepExecutionSplitter(jobRepository, step, partitioner);
  ts.setStepExecutionSplitter(splitter);
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

step.setStepExecutionSplitter(splitter);
splitter.setStepName(name);
this.splitter = splitter;
step.setStepExecutionSplitter(splitter);
origin: org.springframework.batch/spring-batch-core

step.setStepExecutionSplitter(splitter);
splitter.setStepName(name);
this.splitter = splitter;
step.setStepExecutionSplitter(splitter);
origin: apache/servicemix-bundles

step.setStepExecutionSplitter(splitter);
splitter.setStepName(name);
this.splitter = splitter;
step.setStepExecutionSplitter(splitter);
org.springframework.batch.core.partition.supportPartitionStepsetStepExecutionSplitter

Javadoc

Public setter for mandatory property StepExecutionSplitter.

Popular methods of PartitionStep

  • setPartitionHandler
    A PartitionHandler which can send out step executions for remote processing and bring back the resul
  • <init>
  • afterPropertiesSet
    Assert that mandatory properties are set (stepExecutionSplitter, partitionHandler) and delegate top
  • setName
  • setStepExecutionAggregator
    A StepExecutionAggregator that can aggregate step executions when they come back from the handler. D
  • execute
  • getName
  • setJobRepository

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • JFrame (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now