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

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • startActivity (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • 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