クラス TaskExecutorPartitionHandler

java.lang.ObjectSE
org.springframework.batch.core.partition.support.AbstractPartitionHandler
org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler
実装されたすべてのインターフェース:
PartitionHandlerStepHolderorg.springframework.beans.factory.InitializingBean

public class TaskExecutorPartitionHandler extends AbstractPartitionHandler implements StepHolder, org.springframework.beans.factory.InitializingBean
TaskExecutor を使用して、パーティション化された Step を複数のスレッドでローカルに実行する PartitionHandler。これは、ディレクトリやファイルシステムのスキャンやコピーなど、IO を集中的に使用するバッチステップをスケーリングするための効果的なアプローチです。
デフォルトでは、スレッドプールは同期しています。
導入:
2.0
作成者:
Sebastien Gerard, Dave Syer, Mahmoud Ben Hassine
  • コンストラクターの詳細

    • TaskExecutorPartitionHandler

      public TaskExecutorPartitionHandler()
  • メソッドの詳細

    • afterPropertiesSet

      public void afterPropertiesSet() throws ExceptionSE
      次で指定:
      インターフェース org.springframework.beans.factory.InitializingBeanafterPropertiesSet 
      例外:
      ExceptionSE
    • setTaskExecutor

      public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
      ステップ実行を複数のスレッドにファームアウトするために使用される TaskExecutor の Setter。
      パラメーター:
      taskExecutor - TaskExecutor
    • setStep

      public void setStep(Step step)
      パーティション化された StepExecution の実行に使用される Step の Setter。これは通常の Spring Batch ステップであり、StepExecution コンテキストの入力パラメーターに基づいて実行を完了するために必要なすべてのビジネスロジックが含まれています。
      パラメーター:
      step - ビジネスロジックの実行に使用する Step インスタンス
    • getStep

      public Step getStep()
      このハンドラーによって並行して実行されるステップインスタンス。
      次で指定:
      インターフェース StepHoldergetStep 
      戻り値:
      使用されるステップインスタンス
      関連事項:
    • doHandle

      protected SetSE<StepExecution> doHandle(StepExecution managerStepExecution, SetSE<StepExecution> partitionStepExecutions) throws ExceptionSE
      クラスからコピーされた説明: AbstractPartitionHandler
      指定された StepExecution インスタンスを実行し、それらの更新されたビューを返します。何か問題が発生した場合、ExceptionSE をスローします。
      次で指定:
      クラス AbstractPartitionHandlerdoHandle 
      パラメーター:
      managerStepExecution - パーティション全体の実行
      partitionStepExecutions - 実行する StepExecution インスタンス
      戻り値:
      これらの完成した StepExecution インスタンスの更新されたビュー
      例外:
      ExceptionSE - 何かがうまくいかない場合。これにより、実装は自由になり、必要に応じて呼び出し元が例外をステップ障害に変換することに依存することができます。
    • createTask

      protected FutureTaskSE<StepExecution> createTask(Step step, StepExecution stepExecution)
      指定された実行のコンテキストで指定されたステップを実行するタスクを作成します。
      パラメーター:
      step - 実行するステップ
      stepExecution - 与えられた実行
      戻り値:
      指定されたステップを実行するタスク