public class SimpleStepExecutionSplitter extends java.lang.Object implements StepExecutionSplitter, org.springframework.beans.factory.InitializingBean
Partitioner
に委譲して ExecutionContext
インスタンスを生成する StepExecutionSplitter
の一般的な実装。再始動性を処理し、同じジョブの以前の実行からのステップ実行を識別します。生成された StepExecution
インスタンスには、パーティション内で一意に識別する名前があります。名前は、ベース(ターゲットステップの名前)と、Partitioner
識別子から取得したサフィックスから構成され、コロンで区切られます。{step1:partition0, step1:partition1,...}
。コンストラクターと説明 |
---|
SimpleStepExecutionSplitter() 設定に便利なデフォルトのコンストラクター。 |
SimpleStepExecutionSplitter(JobRepository jobRepository, boolean allowStartIfComplete, java.lang.String stepName, Partitioner partitioner) 必須プロパティから SimpleStepExecutionSplitter を構築します。 |
SimpleStepExecutionSplitter(JobRepository jobRepository, Step step, Partitioner partitioner) 使用すべきではありません。 |
修飾子と型 | メソッドと説明 |
---|---|
void | afterPropertiesSet() 必須プロパティ(ステップ名、ジョブリポジトリ、パーティショナー)を確認します。 |
protected boolean | getStartable(StepExecution stepExecution, ExecutionContext context) 使用すべきではありません。 このメソッドは isStartable(org.springframework.batch.core.StepExecution, org.springframework.batch.item.ExecutionContext) のために非推奨になり、将来のバージョンで削除される予定です。 |
java.lang.String | getStepName() リモートで実行されるステップ構成の名前。 |
protected boolean | isStartable(StepExecution stepExecution, ExecutionContext context) ステップ実行が開始可能かどうかを確認します。 |
void | setAllowStartIfComplete(boolean allowStartIfComplete) 実行が完了した場合にパーティションターゲットステップを開始できることを示すフラグ。 |
void | setJobRepository(JobRepository jobRepository) デリゲートステップ実行の永続性を管理するために使用されるジョブリポジトリ。 |
void | setPartitioner(Partitioner partitioner) ターゲットステップのステップ実行メタデータを生成するために使用される Partitioner 。 |
void | setStepName(java.lang.String stepName) パーティション全体で実行されるターゲットステップの名前。 |
java.util.Set<StepExecution> | split(StepExecution stepExecution, int gridSize) 提供された StepExecution を、同じ親 JobExecution を持つ並列実行可能インスタンスのセットに分割します。 |
public SimpleStepExecutionSplitter()
public SimpleStepExecutionSplitter(JobRepository jobRepository, boolean allowStartIfComplete, java.lang.String stepName, Partitioner partitioner)
SimpleStepExecutionSplitter
を構築します。jobRepository
- JobRepository
allowStartIfComplete
- 再起動時の設定を指定するフラグ stepName
- ターゲットステップ名 partitioner
- 入力パラメーターの生成に使用する Partitioner
@Deprecated public SimpleStepExecutionSplitter(JobRepository jobRepository, Step step, Partitioner partitioner)
SimpleStepExecutionSplitter(JobRepository, boolean, String, Partitioner)
を使用してください SimpleStepExecutionSplitter
を構築します。jobRepository
- JobRepository
step
- ターゲットステップ(そのローカルバージョン)。名前と allowStartIfComplete フラグを抽出するために使用されます partitioner
- 入力パラメーターの生成に使用する Partitioner
public void afterPropertiesSet() throws java.lang.Exception
org.springframework.beans.factory.InitializingBean
の afterPropertiesSet
java.lang.Exception
InitializingBean.afterPropertiesSet()
public void setAllowStartIfComplete(boolean allowStartIfComplete)
allowStartIfComplete
- 設定する値 Step.isAllowStartIfComplete()
public void setJobRepository(JobRepository jobRepository)
jobRepository
- 設定する JobRepositorypublic void setPartitioner(Partitioner partitioner)
Partitioner
。partitioner
- 設定するパーティショナー public void setStepName(java.lang.String stepName)
stepName
- 設定するステップ名 public java.lang.String getStepName()
StepExecutionSplitter
StepExecutionSplitter
の getStepName
StepExecutionSplitter.getStepName()
public java.util.Set<StepExecution> split(StepExecution stepExecution, int gridSize) throws JobExecutionException
StepExecutionSplitter
StepExecution
を、同じ親 JobExecution
を持つ並列実行可能インスタンスのセットに分割します。グリッドサイズは、返されるコレクションのサイズのヒントとして扱われます。実行グリッドの物理サイズに対応する場合と対応しない場合があります。StepExecutionSplitter
のクライアントは、最後に失敗した実行の状態を再構成し、再起動が必要な実行のみを返すことを期待する必要があります。グリッドサイズのヒントは再起動時に無視されます。StepExecutionSplitter
の split
stepExecution
- パーティション化される StepExecution
。gridSize
- グリッドのサイズがわかっている場合のスプリッターのヒント StepExecution
インスタンスのセット JobExecutionException
- 分割できない場合 StepExecutionSplitter.split(StepExecution, int)
protected boolean isStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException
stepExecution
- チェックするステップ実行 context
- ステップの実行コンテキスト JobExecutionException
- ステップの実行が開始可能かどうかを確認できない場合 @Deprecated protected boolean getStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException
isStartable(org.springframework.batch.core.StepExecution, org.springframework.batch.item.ExecutionContext)
のために非推奨になり、将来のバージョンで削除される予定です。stepExecution
- チェックするステップ実行 context
- ステップの実行コンテキスト JobExecutionException
- ステップの実行が開始可能かどうかを確認できない場合