public class DatasetTemplate extends Object implements InitializingBean, DatasetOperations
Datasets,
 DatasetReaders and DatasetWriters| Constructor and Description | 
|---|
| DatasetTemplate() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | afterPropertiesSet() | 
| void | execute(DatasetRepositoryCallback callback)Execute a callback for the  DatasetRepository | 
| Collection<DatasetDefinition> | getDatasetDefinitions()The  DatasetDefinitions used for this template. | 
| <T> org.kitesdk.data.DatasetDescriptor | getDatasetDescriptor(Class<T> targetClass)Get the  DatasetDescriptorfor the given class | 
| <T> String | getDatasetName(Class<T> clazz)Get the dataset name to be used for the given class | 
| DatasetDefinition | getDefaultDatasetDefinition()The default  DatasetDefinitionused for this template. | 
| <T> Collection<T> | read(Class<T> targetClass)Read all records in the dataset and return as a collection. | 
| <T> Collection<T> | read(Class<T> targetClass,
    org.kitesdk.data.PartitionKey partitionKey)Read records in the dataset  partition based on the  PartitionKeyand return as a collection. | 
| <T> void | read(Class<T> targetClass,
    RecordCallback<T> callback)Read all records in the dataset and call the provided callback for each record. | 
| <T> void | read(Class<T> targetClass,
    RecordCallback<T> callback,
    org.kitesdk.data.PartitionKey partitionKey)Read records in the dataset partition based on the  PartitionKeyand call the provided callback for each record. | 
| void | setDatasetDefinitions(Collection<DatasetDefinition> datasetDefinitions)The list of  DatasetDefinitions to use for this template. | 
| void | setDatasetRepositoryFactory(DatasetRepositoryFactory datasetRepositoryFactory)The  DatasetRepositoryFactoryto use for this template. | 
| void | setDefaultDatasetDefinition(DatasetDefinition defaultDatasetDefinition)The default  DatasetDefinitionto use for this template. | 
| <T> void | write(Collection<T> records)Write all records provided in the record collection | 
public void setDatasetRepositoryFactory(DatasetRepositoryFactory datasetRepositoryFactory)
DatasetRepositoryFactory to use for this template.datasetRepositoryFactory - the DatasetRepositoryFactory to usepublic DatasetDefinition getDefaultDatasetDefinition()
DatasetDefinition used for this template.public void setDefaultDatasetDefinition(DatasetDefinition defaultDatasetDefinition)
DatasetDefinition to use for this template.defaultDatasetDefinition - the DatasetDefinition to usepublic Collection<DatasetDefinition> getDatasetDefinitions()
DatasetDefinitions used for this template.public void setDatasetDefinitions(Collection<DatasetDefinition> datasetDefinitions)
DatasetDefinitions to use for this template.datasetDefinitions - the DatasetDefinitions to usepublic void afterPropertiesSet()
                        throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic <T> void read(Class<T> targetClass, RecordCallback<T> callback)
DatasetOperationsread in interface DatasetOperationstargetClass - the class that is stored in the datasetcallback - the callback to be called for each recordpublic <T> Collection<T> read(Class<T> targetClass)
DatasetOperationsread in interface DatasetOperationstargetClass - the class that is stored in the datasetpublic <T> void read(Class<T> targetClass, RecordCallback<T> callback, org.kitesdk.data.PartitionKey partitionKey)
DatasetOperationsPartitionKey and call the provided callback for each record.read in interface DatasetOperationstargetClass - the class that is stored in the datasetcallback - the callback to be called for each recordpartitionKey - the partition key to use for the readpublic <T> Collection<T> read(Class<T> targetClass, org.kitesdk.data.PartitionKey partitionKey)
DatasetOperationsPartitionKey and return as a collection.read in interface DatasetOperationstargetClass - the class that is stored in the datasetpartitionKey - the partition key to use for the readpublic <T> void write(Collection<T> records)
DatasetOperationswrite in interface DatasetOperationsrecords - the records to writepublic void execute(DatasetRepositoryCallback callback)
DatasetOperationsDatasetRepositoryexecute in interface DatasetOperationspublic <T> org.kitesdk.data.DatasetDescriptor getDatasetDescriptor(Class<T> targetClass)
DatasetOperationsDatasetDescriptor for the given classgetDatasetDescriptor in interface DatasetOperationstargetClass - the class stored in the datasetpublic <T> String getDatasetName(Class<T> clazz)
DatasetOperationsgetDatasetName in interface DatasetOperationsclazz - the class stored in the dataset