T - the type of object returned as item readpublic class DataStoreItemReader<T> extends java.lang.Object implements 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(org.springframework.data.hadoop.store.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(ExecutionContext executionContext) |
T |
read() |
void |
setDataStoreReader(org.springframework.data.hadoop.store.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(ExecutionContext executionContext) |
public static final java.lang.String READ_POSITION
public DataStoreItemReader()
public DataStoreItemReader(org.springframework.data.hadoop.store.DataStoreReader<T> dataStoreReader)
dataStoreReader - the data store readerpublic void open(ExecutionContext executionContext) throws ItemStreamException
open in interface ItemStreamItemStreamExceptionpublic void update(ExecutionContext executionContext) throws ItemStreamException
update in interface ItemStreamItemStreamExceptionpublic void close()
throws ItemStreamException
close in interface ItemStreamItemStreamExceptionpublic T read() throws java.lang.Exception, UnexpectedInputException, ParseException, NonTransientResourceException
read in interface ItemReader<T>java.lang.ExceptionUnexpectedInputExceptionParseExceptionNonTransientResourceExceptionpublic void setLineDataMapper(LineDataMapper<T> lineDataMapper)
lineDataMapper - the new line data mapperpublic void setDataStoreReader(org.springframework.data.hadoop.store.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()