Tabnine Logo
TaskExecutorPartitionHandler.getGridSize
Code IndexAdd Tabnine to your IDE (free)

How to use
getGridSize
method
in
org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler

Best Java code snippets using org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler.getGridSize (Showing top 4 results out of 315)

origin: spring-projects/spring-batch

@Override
protected Set<StepExecution> doHandle(StepExecution masterStepExecution,
                   Set<StepExecution> partitionStepExecutions) throws Exception {
  Assert.notNull(step, "A Step must be provided.");
  final Set<Future<StepExecution>> tasks = new HashSet<>(getGridSize());
  final Set<StepExecution> result = new HashSet<>();
  for (final StepExecution stepExecution : partitionStepExecutions) {
    final FutureTask<StepExecution> task = createTask(step, stepExecution);
    try {
      taskExecutor.execute(task);
      tasks.add(task);
    } catch (TaskRejectedException e) {
      // couldn't execute one of the tasks
      ExitStatus exitStatus = ExitStatus.FAILED
          .addExitDescription("TaskExecutor rejected the task for this step.");
      /*
       * Set the status in case the caller is tracking it through the
       * JobExecution.
       */
      stepExecution.setStatus(BatchStatus.FAILED);
      stepExecution.setExitStatus(exitStatus);
      result.add(stepExecution);
    }
  }
  for (Future<StepExecution> task : tasks) {
    result.add(task.get());
  }
  return result;
}
origin: org.springframework.batch/spring-batch-core

@Override
protected Set<StepExecution> doHandle(StepExecution masterStepExecution,
                   Set<StepExecution> partitionStepExecutions) throws Exception {
  Assert.notNull(step, "A Step must be provided.");
  final Set<Future<StepExecution>> tasks = new HashSet<Future<StepExecution>>(getGridSize());
  final Set<StepExecution> result = new HashSet<StepExecution>();
  for (final StepExecution stepExecution : partitionStepExecutions) {
    final FutureTask<StepExecution> task = createTask(step, stepExecution);
    try {
      taskExecutor.execute(task);
      tasks.add(task);
    } catch (TaskRejectedException e) {
      // couldn't execute one of the tasks
      ExitStatus exitStatus = ExitStatus.FAILED
          .addExitDescription("TaskExecutor rejected the task for this step.");
      /*
       * Set the status in case the caller is tracking it through the
       * JobExecution.
       */
      stepExecution.setStatus(BatchStatus.FAILED);
      stepExecution.setExitStatus(exitStatus);
      result.add(stepExecution);
    }
  }
  for (Future<StepExecution> task : tasks) {
    result.add(task.get());
  }
  return result;
}
origin: apache/servicemix-bundles

@Override
protected Set<StepExecution> doHandle(StepExecution masterStepExecution,
                   Set<StepExecution> partitionStepExecutions) throws Exception {
  Assert.notNull(step, "A Step must be provided.");
  final Set<Future<StepExecution>> tasks = new HashSet<Future<StepExecution>>(getGridSize());
  final Set<StepExecution> result = new HashSet<StepExecution>();
  for (final StepExecution stepExecution : partitionStepExecutions) {
    final FutureTask<StepExecution> task = createTask(step, stepExecution);
    try {
      taskExecutor.execute(task);
      tasks.add(task);
    } catch (TaskRejectedException e) {
      // couldn't execute one of the tasks
      ExitStatus exitStatus = ExitStatus.FAILED
          .addExitDescription("TaskExecutor rejected the task for this step.");
      /*
       * Set the status in case the caller is tracking it through the
       * JobExecution.
       */
      stepExecution.setStatus(BatchStatus.FAILED);
      stepExecution.setExitStatus(exitStatus);
      result.add(stepExecution);
    }
  }
  for (Future<StepExecution> task : tasks) {
    result.add(task.get());
  }
  return result;
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
protected Set<StepExecution> doHandle(StepExecution masterStepExecution,
                   Set<StepExecution> partitionStepExecutions) throws Exception {
  Assert.notNull(step, "A Step must be provided.");
  final Set<Future<StepExecution>> tasks = new HashSet<Future<StepExecution>>(getGridSize());
  final Set<StepExecution> result = new HashSet<StepExecution>();
  for (final StepExecution stepExecution : partitionStepExecutions) {
    final FutureTask<StepExecution> task = createTask(step, stepExecution);
    try {
      taskExecutor.execute(task);
      tasks.add(task);
    } catch (TaskRejectedException e) {
      // couldn't execute one of the tasks
      ExitStatus exitStatus = ExitStatus.FAILED
          .addExitDescription("TaskExecutor rejected the task for this step.");
      /*
       * Set the status in case the caller is tracking it through the
       * JobExecution.
       */
      stepExecution.setStatus(BatchStatus.FAILED);
      stepExecution.setExitStatus(exitStatus);
      result.add(stepExecution);
    }
  }
  for (Future<StepExecution> task : tasks) {
    result.add(task.get());
  }
  return result;
}
org.springframework.batch.core.partition.supportTaskExecutorPartitionHandlergetGridSize

Popular methods of TaskExecutorPartitionHandler

  • <init>
  • setGridSize
    Passed to the StepExecutionSplitter in the #handle(StepExecutionSplitter,StepExecution) method, inst
  • setStep
    Setter for the Step that will be used to execute the partitioned StepExecution. This is a regular Sp
  • setTaskExecutor
    Setter for the TaskExecutor that is used to farm out step executions to multiple threads.
  • createTask
    Creates the task executing the given step in the context of the given execution.
  • afterPropertiesSet
  • handle

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • setContentView (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 21 Best IntelliJ Plugins
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