クラス 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
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明voidclose()ノーオペレーション。voidopen(ExecutionContext executionContext) ノーオペレーション。voidsetDelegate(ResourceAwareItemWriterItemStream<? super T> delegate) 出力の実際の書き込みに使用されるデリゲート。voidsetItemCountLimitPerResource(int itemCountLimitPerResource) この制限を超えると、次のチャンクが新しく作成されたリソースに書き込まれます。voidsetResource(org.springframework.core.io.Resource resource) 出力リソースのプロトタイプ。voidsetResourceSuffixCreator(ResourceSuffixCreator suffixCreator) インデックスに基づいて、作成されたリソースのサフィックスをカスタマイズできます。voidsetSaveState(boolean saveState) 各コミット後にリーダーの状態が保存されることを示します。voidupdate(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- 関連事項: