クラス TaskExecutorPartitionHandler
java.lang.ObjectSE
org.springframework.batch.core.partition.support.AbstractPartitionHandler
org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler
- 実装されたすべてのインターフェース:
PartitionHandler
、StepHolder
、org.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
フィールドサマリー
クラス org.springframework.batch.core.partition.support.AbstractPartitionHandler から継承されたフィールド
gridSize
コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明void
protected FutureTaskSE<StepExecution>
createTask
(Step step, StepExecution stepExecution) 指定された実行のコンテキストで指定されたステップを実行するタスクを作成します。protected SetSE<StepExecution>
doHandle
(StepExecution managerStepExecution, SetSE<StepExecution> partitionStepExecutions) 指定されたStepExecution
インスタンスを実行し、それらの更新されたビューを返します。getStep()
このハンドラーによって並行して実行されるステップインスタンス。void
パーティション化されたStepExecution
の実行に使用されるStep
の Setter。void
setTaskExecutor
(org.springframework.core.task.TaskExecutor taskExecutor) ステップ実行を複数のスレッドにファームアウトするために使用されるTaskExecutor
の Setter。クラス org.springframework.batch.core.partition.support.AbstractPartitionHandler から継承されたメソッド
getGridSize, handle, setGridSize
コンストラクターの詳細
TaskExecutorPartitionHandler
public TaskExecutorPartitionHandler()
メソッドの詳細
afterPropertiesSet
- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBean
のafterPropertiesSet
- 例外:
ExceptionSE
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor) ステップ実行を複数のスレッドにファームアウトするために使用されるTaskExecutor
の Setter。- パラメーター:
taskExecutor
-TaskExecutor
setStep
パーティション化されたStepExecution
の実行に使用されるStep
の Setter。これは通常の Spring Batch ステップであり、StepExecution
コンテキストの入力パラメーターに基づいて実行を完了するために必要なすべてのビジネスロジックが含まれています。- パラメーター:
step
- ビジネスロジックの実行に使用するStep
インスタンス
getStep
このハンドラーによって並行して実行されるステップインスタンス。- 次で指定:
- インターフェース
StepHolder
のgetStep
- 戻り値:
- 使用されるステップインスタンス
- 関連事項:
doHandle
protected SetSE<StepExecution> doHandle(StepExecution managerStepExecution, SetSE<StepExecution> partitionStepExecutions) throws ExceptionSE クラスからコピーされた説明:AbstractPartitionHandler
指定されたStepExecution
インスタンスを実行し、それらの更新されたビューを返します。何か問題が発生した場合、Exception
SE をスローします。- 次で指定:
- クラス
AbstractPartitionHandler
のdoHandle
- パラメーター:
managerStepExecution
- パーティション全体の実行partitionStepExecutions
- 実行するStepExecution
インスタンス- 戻り値:
- これらの完成した
StepExecution
インスタンスの更新されたビュー - 例外:
ExceptionSE
- 何かがうまくいかない場合。これにより、実装は自由になり、必要に応じて呼び出し元が例外をステップ障害に変換することに依存することができます。
createTask
指定された実行のコンテキストで指定されたステップを実行するタスクを作成します。- パラメーター:
step
- 実行するステップstepExecution
- 与えられた実行- 戻り値:
- 指定されたステップを実行するタスク