T
- the type of object returned as item readpublic class DataStoreItemReader<T>
extends java.lang.Object
implements org.springframework.batch.item.ItemStreamReader<T>
ItemReader
able
to read items from HDFS file splits.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
READ_POSITION |
Constructor and Description |
---|
DataStoreItemReader()
Instantiates a new data store item reader.
|
DataStoreItemReader(DataStoreReader<T> dataStoreReader)
Instantiates a new data store item reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isSaveState()
The flag that determines whether to save internal state for restarts.
|
void |
open(org.springframework.batch.item.ExecutionContext executionContext) |
T |
read() |
void |
setDataStoreReader(DataStoreReader<T> dataStoreReader)
Sets the data store reader.
|
void |
setLineDataMapper(LineDataMapper<T> lineDataMapper)
Sets the line data mapper.
|
void |
setSaveState(boolean saveState)
Set the flag that determines whether to save internal data for
ExecutionContext . |
void |
update(org.springframework.batch.item.ExecutionContext executionContext) |
public static final java.lang.String READ_POSITION
public DataStoreItemReader()
public DataStoreItemReader(DataStoreReader<T> dataStoreReader)
dataStoreReader
- the data store readerpublic void open(org.springframework.batch.item.ExecutionContext executionContext) throws org.springframework.batch.item.ItemStreamException
open
in interface org.springframework.batch.item.ItemStream
org.springframework.batch.item.ItemStreamException
public void update(org.springframework.batch.item.ExecutionContext executionContext) throws org.springframework.batch.item.ItemStreamException
update
in interface org.springframework.batch.item.ItemStream
org.springframework.batch.item.ItemStreamException
public void close() throws org.springframework.batch.item.ItemStreamException
close
in interface org.springframework.batch.item.ItemStream
org.springframework.batch.item.ItemStreamException
public T read() throws java.lang.Exception, org.springframework.batch.item.UnexpectedInputException, org.springframework.batch.item.ParseException, org.springframework.batch.item.NonTransientResourceException
read
in interface org.springframework.batch.item.ItemReader<T>
java.lang.Exception
org.springframework.batch.item.UnexpectedInputException
org.springframework.batch.item.ParseException
org.springframework.batch.item.NonTransientResourceException
public void setLineDataMapper(LineDataMapper<T> lineDataMapper)
lineDataMapper
- the new line data mapperpublic void setDataStoreReader(DataStoreReader<T> dataStoreReader)
dataStoreReader
- the new data store readerpublic void setSaveState(boolean saveState)
ExecutionContext
. Only switch this to false if you don't want to
save any state from this stream, and you don't need it to be restartable.
Always set it to false if the reader is being used in a concurrent
environment.saveState
- flag value (default true).public boolean isSaveState()