T - the type of entity to readR - the type of entity in readerpublic abstract class AbstractDatasetStoreReader<T,R> extends Object implements DataStoreReader<T>
DataStoreReader to be extended for providing Dataset reading
capabilities for specific use cases.| Modifier and Type | Field and Description |
|---|---|
protected org.kitesdk.data.DatasetReader<R> |
reader |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDatasetStoreReader(Class<T> entityClass,
DatasetRepositoryFactory datasetRepositoryFactory,
DatasetDefinition datasetDefinition)
Instantiates a new abstract dataset store reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract T |
convertEntity(R entity)
Convert entity used by a reading into a entity
returned.
|
protected abstract org.kitesdk.data.DatasetReader<R> |
createReader()
Creates a
DatasetReader. |
protected DatasetDefinition |
getDatasetDefinition()
Gets the dataset definition.
|
protected DatasetRepositoryFactory |
getDatasetRepositoryFactory()
Gets the dataset repository factory.
|
protected Class<T> |
getEntityClass()
Gets the entity class.
|
T |
read()
Read next entity from a reader.
|
protected volatile org.kitesdk.data.DatasetReader<R> reader
protected AbstractDatasetStoreReader(Class<T> entityClass, DatasetRepositoryFactory datasetRepositoryFactory, DatasetDefinition datasetDefinition)
entityClass - the entity classdatasetRepositoryFactory - the dataset repository factorydatasetDefinition - the dataset definitionpublic T read() throws IOException
DataReaderread in interface DataReader<T>nullIOException - if an I/O error occurspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected DatasetRepositoryFactory getDatasetRepositoryFactory()
protected DatasetDefinition getDatasetDefinition()
protected abstract T convertEntity(R entity)
entity - the entityprotected abstract org.kitesdk.data.DatasetReader<R> createReader()
DatasetReader.