クラス MultiResourceItemWriter<T>
java.lang.ObjectSE
org.springframework.batch.item.ItemStreamSupport
org.springframework.batch.item.support.AbstractItemStreamItemWriter<T>
org.springframework.batch.item.file.MultiResourceItemWriter<T>
- 型パラメーター:
T
- 項目のタイプ
- 実装されたすべてのインターフェース:
ItemStream
、ItemStreamWriter<T>
、ItemWriter<T>
現在のリソースに書き込まれた項目の数が
setItemCountLimitPerResource(int)
を超えると、ResourceAwareItemWriterItemStream
をラップし、新しい出力リソースを作成します。サフィックスの作成は setResourceSuffixCreator(ResourceSuffixCreator)
を使用してカスタマイズできます。 新しいリソースはチャンク境界でのみ作成されることに注意してください。つまり、1 つのリソースに書き込まれるアイテムの数は、setItemCountLimitPerResource(int)
によって設定された制限と (制限 + チャンクサイズ) の間にあります。
- 作成者:
- Robert Kasanicky, Mahmoud Ben Hassine
コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明void
close()
ノーオペレーション。void
open
(ExecutionContext executionContext) ノーオペレーション。void
setDelegate
(ResourceAwareItemWriterItemStream<? super T> delegate) 出力の実際の書き込みに使用されるデリゲート。void
setItemCountLimitPerResource
(int itemCountLimitPerResource) この制限を超えると、次のチャンクが新しく作成されたリソースに書き込まれます。void
setResource
(org.springframework.core.io.Resource resource) 出力リソースのプロトタイプ。void
setResourceSuffixCreator
(ResourceSuffixCreator suffixCreator) インデックスに基づいて、作成されたリソースのサフィックスをカスタマイズできます。void
setSaveState
(boolean saveState) 各コミット後にリーダーの状態が保存されることを示します。void
update
(ExecutionContext executionContext) 空のExecutionContext
を返します。void
指定されたデータ要素を処理します。クラス org.springframework.batch.item.ItemStreamSupport から継承されたメソッド
getExecutionContextKey, getName, setExecutionContextName, setName
コンストラクターの詳細
MultiResourceItemWriter
public MultiResourceItemWriter()
メソッドの詳細
write
インターフェースからコピーされた説明:ItemWriter
指定されたデータ要素を処理します。通常の操作では null アイテムで呼び出されません。- パラメーター:
items
- 書きこまれる項目。null
であってはなりません。- 例外:
ExceptionSE
- エラーがある場合。フレームワークは例外をキャッチし、必要に応じて変換または再スローします。
setResourceSuffixCreator
インデックスに基づいて、作成されたリソースのサフィックスをカスタマイズできます。- パラメーター:
suffixCreator
- ライターが使用するResourceSuffixCreator
。
setItemCountLimitPerResource
public void setItemCountLimitPerResource(int itemCountLimitPerResource) この制限を超えると、次のチャンクが新しく作成されたリソースに書き込まれます。- パラメーター:
itemCountLimitPerResource
- 新しいリソースを作成するタイミングを決定するために使用される int アイテムのしきい値。
setDelegate
出力の実際の書き込みに使用されるデリゲート。- パラメーター:
delegate
- 出力の書き込みに使用されるResourceAwareItemWriterItemStream
。
setResource
public void setResource(org.springframework.core.io.Resource resource) 出力リソースのプロトタイプ。実際の出力ファイルは同じディレクトリに作成され、このプロトタイプと同じ名前にサフィックスが追加されます(setResourceSuffixCreator(ResourceSuffixCreator)
による)。- パラメーター:
resource
- プロトタイプリソース。
setSaveState
public void setSaveState(boolean saveState) 各コミット後にリーダーの状態が保存されることを示します。- パラメーター:
saveState
- true 状態が保存されます。
close
クラスからコピーされた説明:ItemStreamSupport
ノーオペレーション。- 次で指定:
- インターフェース
ItemStream
のclose
- オーバーライド:
- クラス
ItemStreamSupport
のclose
- 例外:
ItemStreamException
- 関連事項:
open
クラスからコピーされた説明:ItemStreamSupport
ノーオペレーション。- 次で指定:
- インターフェース
ItemStream
のopen
- オーバーライド:
- クラス
ItemStreamSupport
のopen
- パラメーター:
executionContext
- 現在のステップのExecutionContext
。再起動時のステップの最後の実行からの executionContext になります。- 例外:
ItemStreamException
- 関連事項:
update
クラスからコピーされた説明:ItemStreamSupport
空のExecutionContext
を返します。- 次で指定:
- インターフェース
ItemStream
のupdate
- オーバーライド:
- クラス
ItemStreamSupport
のupdate
- パラメーター:
executionContext
- 更新される- 例外:
ItemStreamException
- 関連事項: