congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Start an intent from android
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Path (java.nio.file)
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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