|
Spring for Apache Hadoop | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.data.hadoop.store.dataset.DatasetTemplate
public class DatasetTemplate
This is the central class in the store.dataset package. It simplifies the use of Datasets,
DatasetReaders and DatasetWriters
| Constructor Summary | |
|---|---|
DatasetTemplate()
|
|
| Method Summary | ||
|---|---|---|
void |
afterPropertiesSet()
|
|
void |
execute(DatasetRepositoryCallback callback)
Execute a callback for the DatasetRepository |
|
java.util.Collection<DatasetDefinition> |
getDatasetDefinitions()
The DatasetDefinitions used for this template. |
|
|
getDatasetDescriptor(java.lang.Class<T> targetClass)
Get the DatasetDescriptor for the given class |
|
|
getDatasetName(java.lang.Class<T> clazz)
Get the dataset name to be used for the given class |
|
DatasetDefinition |
getDefaultDatasetDefinition()
The default DatasetDefinition used for this template. |
|
|
read(java.lang.Class<T> targetClass)
Read all records in the dataset and return as a collection. |
|
|
read(java.lang.Class<T> targetClass,
org.kitesdk.data.PartitionKey partitionKey)
Read records in the dataset partition based on the PartitionKey and return as a collection. |
|
|
read(java.lang.Class<T> targetClass,
RecordCallback<T> callback)
Read all records in the dataset and call the provided callback for each record. |
|
|
read(java.lang.Class<T> targetClass,
RecordCallback<T> callback,
org.kitesdk.data.PartitionKey partitionKey)
Read records in the dataset partition based on the PartitionKey and call the provided callback for each record. |
|
void |
setDatasetDefinitions(java.util.Collection<DatasetDefinition> datasetDefinitions)
The list of DatasetDefinitions to use for this template. |
|
void |
setDatasetRepositoryFactory(DatasetRepositoryFactory datasetRepositoryFactory)
The DatasetRepositoryFactory to use for this template. |
|
void |
setDefaultDatasetDefinition(DatasetDefinition defaultDatasetDefinition)
The default DatasetDefinition to use for this template. |
|
|
write(java.util.Collection<T> records)
Write all records provided in the record collection |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatasetTemplate()
| Method Detail |
|---|
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 java.util.Collection<DatasetDefinition> getDatasetDefinitions()
DatasetDefinitions used for this template.
public void setDatasetDefinitions(java.util.Collection<DatasetDefinition> datasetDefinitions)
DatasetDefinitions to use for this template.
datasetDefinitions - the DatasetDefinitions to use
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exception
public <T> void read(java.lang.Class<T> targetClass,
RecordCallback<T> callback)
DatasetOperations
read in interface DatasetOperationstargetClass - the class that is stored in the datasetcallback - the callback to be called for each recordpublic <T> java.util.Collection<T> read(java.lang.Class<T> targetClass)
DatasetOperations
read in interface DatasetOperationstargetClass - the class that is stored in the dataset
public <T> void read(java.lang.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 read
public <T> java.util.Collection<T> read(java.lang.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 read
public <T> void write(java.util.Collection<T> records)
DatasetOperations
write in interface DatasetOperationsrecords - the records to writepublic void execute(DatasetRepositoryCallback callback)
DatasetOperationsDatasetRepository
execute in interface DatasetOperationspublic <T> org.kitesdk.data.DatasetDescriptor getDatasetDescriptor(java.lang.Class<T> targetClass)
DatasetOperationsDatasetDescriptor for the given class
getDatasetDescriptor in interface DatasetOperationstargetClass - the class stored in the dataset
public <T> java.lang.String getDatasetName(java.lang.Class<T> clazz)
DatasetOperations
getDatasetName in interface DatasetOperationsclazz - the class stored in the dataset
|
Spring for Apache Hadoop | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||