public class HdfsItemWriter<T>
extends java.lang.Object
implements org.springframework.batch.item.ItemStreamWriter<T>
ItemWriter
実装。ファイルを削除または変更できないという HDFS の制限により、ファイルを以前の状態にロールバックすることはできません。これにより、この ItemWriter
を使用して再起動できなくなります。ItemWriter
はスレッドセーフではありません。コンストラクターと説明 |
---|
HdfsItemWriter(org.apache.hadoop.fs.FileSystem fileSystem, org.springframework.core.serializer.Serializer<T> itemSerializer, java.lang.String fileName) コンストラクター |
修飾子と型 | メソッドと説明 |
---|---|
void | close() |
protected void | doWrite(java.util.List<? extends T> items) テンプレートを介してストアへの実際の書き込みを実行します。 |
void | open(org.springframework.batch.item.ExecutionContext executionContext) |
void | update(org.springframework.batch.item.ExecutionContext executionContext) |
void | write(java.util.List<? extends T> items) |
public HdfsItemWriter(org.apache.hadoop.fs.FileSystem fileSystem, org.springframework.core.serializer.Serializer<T> itemSerializer, java.lang.String fileName)
fileSystem
- - HDFS FileSystem
リファレンス itemSerializer
- - アイテムを直列化するための戦略 fileName
- - 書き込むファイルの名前 protected void doWrite(java.util.List<? extends T> items)
items
- 永続化するアイテムのリスト。public void open(org.springframework.batch.item.ExecutionContext executionContext) throws org.springframework.batch.item.ItemStreamException
org.springframework.batch.item.ItemStream
の open
org.springframework.batch.item.ItemStreamException
public void update(org.springframework.batch.item.ExecutionContext executionContext) throws org.springframework.batch.item.ItemStreamException
org.springframework.batch.item.ItemStream
の update
org.springframework.batch.item.ItemStreamException
public void write(java.util.List<? extends T> items) throws java.lang.Exception
org.springframework.batch.item.ItemWriter<T>
の write
java.lang.Exception
public void close()
org.springframework.batch.item.ItemStream
の close