T
- the type of entity to readR
- the type of entity in readerpublic abstract class AbstractDatasetStoreReader<T,R> extends java.lang.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(java.lang.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 java.lang.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(java.lang.Class<T> entityClass, DatasetRepositoryFactory datasetRepositoryFactory, DatasetDefinition datasetDefinition)
entityClass
- the entity classdatasetRepositoryFactory
- the dataset repository factorydatasetDefinition
- the dataset definitionpublic T read() throws java.io.IOException
DataReader
read
in interface DataReader<T>
null
java.io.IOException
- if an I/O error occurspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
protected java.lang.Class<T> getEntityClass()
protected DatasetRepositoryFactory getDatasetRepositoryFactory()
protected DatasetDefinition getDatasetDefinition()
protected abstract T convertEntity(R entity)
entity
- the entityprotected abstract org.kitesdk.data.DatasetReader<R> createReader()
DatasetReader
.