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
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • 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