public class JsrPartitionHandler extends java.lang.Object implements PartitionHandler, org.springframework.beans.factory.InitializingBean
ThreadPoolTaskExecutor
を使用して、スレッドごとにステップインスタンスを実行します。各ステップの結果は、累積結果に集約されます。修飾子と型 | クラスと説明 |
---|---|
static class | JsrPartitionHandler.PartitionPlanState PartitionPlan は動的データ(実行ごとに異なる結果)を提供する可能性があるため、バッチランタイムは再起動のために結果を保存する必要があります。 |
コンストラクターと説明 |
---|
JsrPartitionHandler() |
修飾子と型 | メソッドと説明 |
---|---|
void | afterPropertiesSet() |
protected java.util.concurrent.FutureTask<StepExecution> | createTask(Step step, StepExecution stepExecution) 指定された実行のコンテキストで指定されたステップを実行するタスクを作成します。 |
java.util.Collection<java.lang.String> | getPartitionStepNames() |
Step | getStep() |
java.util.Collection<StepExecution> | handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution) PartitionHandler インターフェースのメインエントリポイント。 |
void | setAllowStartIfComplete(boolean allowStartIfComplete) |
void | setJobRepository(JobRepository jobRepository) |
void | setPartitionAnalyzer(javax.batch.api.partition.PartitionAnalyzer analyzer) |
void | setPartitionDataQueue(java.util.Queue<java.io.Serializable> queue) |
void | setPartitionLock(java.util.concurrent.locks.ReentrantLock lock) |
void | setPartitionMapper(javax.batch.api.partition.PartitionMapper mapper) |
void | setPartitions(int partitions) |
void | setPollingInterval(int pollingInterval) |
void | setPropertyContext(BatchPropertyContext context) |
void | setStep(Step step) |
void | setThreads(int threads) |
public Step getStep()
public java.util.Collection<java.lang.String> getPartitionStepNames()
public void setAllowStartIfComplete(boolean allowStartIfComplete)
allowStartIfComplete
- 前の実行で完了した場合にステップを再開する必要があるかどうかを示すフラグ public void setPartitionDataQueue(java.util.Queue<java.io.Serializable> queue)
queue
- PartitionCollector
の出力を受信する Queue
public void setPartitionLock(java.util.concurrent.locks.ReentrantLock lock)
public void setPropertyContext(BatchPropertyContext context)
context
- パーティションレベルのステッププロパティを解決する BatchPropertyContext
public void setPartitionMapper(javax.batch.api.partition.PartitionMapper mapper)
mapper
- パーティショニングの構成に使用される PartitionMapper
public void setStep(Step step)
step
- 分割されたステップとして実行されるステップ public void setPartitionAnalyzer(javax.batch.api.partition.PartitionAnalyzer analyzer)
analyzer
- PartitionAnalyzer
public void setThreads(int threads)
threads
- 実行するパーティションを実行するスレッドの数。デフォルトはパーティションの数です。public void setPartitions(int partitions)
partitions
- 実行するパーティションの数 public void setJobRepository(JobRepository jobRepository)
jobRepository
- JobRepository
public void setPollingInterval(int pollingInterval)
pollingInterval
- パーティション完了のポーリング間隔の期間(ミリ秒単位)。デフォルト値は 500ms です。public java.util.Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution) throws java.lang.Exception
PartitionHandler
PartitionHandler
インターフェースのメインエントリポイント。スプリッターは、ファームアウトする必要のあるすべての実行を、入力パラメーター(ExecutionContext
の形式)とともに作成します。マスターステップの実行は、パーティションを識別し、結果を論理的にグループ化するために使用されます。PartitionHandler
の handle
stepSplitter
- StepExecution
インスタンスのコレクションを生成するための戦略 stepExecution
- パーティション全体のマスターステップの実行 StepExecution
インスタンスのコレクション java.lang.Exception
- 何かがうまくいかない場合。これにより、実装は自由になり、必要に応じて呼び出し元が例外をステップ障害に変換することに依存することができます。protected java.util.concurrent.FutureTask<StepExecution> createTask(Step step, StepExecution stepExecution)
step
- 実行するステップ stepExecution
- 与えられた実行 public void afterPropertiesSet() throws java.lang.Exception
org.springframework.beans.factory.InitializingBean
の afterPropertiesSet
java.lang.Exception