org.springframework.data.hadoop.store.dataset
Interface DatasetOperations

All Known Implementing Classes:
DatasetTemplate

public interface DatasetOperations

Interface specifying a basic set of Dataset operations against a specific DatasetRepository. Implemented by DatasetTemplate.

Since:
2.0
Author:
Thomas Risberg

Method Summary
 void execute(DatasetRepositoryCallback callback)
          Execute a callback for the DatasetRepository
<T> org.kitesdk.data.DatasetDescriptor
getDatasetDescriptor(Class<T> targetClass)
          Get the DatasetDescriptor for the given class
<T> String
getDatasetName(Class<T> targetClass)
          Get the dataset name to be used for the given class
<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 PartitionKey and 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 PartitionKey and call the provided callback for each record.
<T> void
write(Collection<T> records)
          Write all records provided in the record collection
 

Method Detail

read

<T> void read(Class<T> targetClass,
              RecordCallback<T> callback)
Read all records in the dataset and call the provided callback for each record.

Parameters:
targetClass - the class that is stored in the dataset
callback - the callback to be called for each record

read

<T> Collection<T> read(Class<T> targetClass)
Read all records in the dataset and return as a collection.

Parameters:
targetClass - the class that is stored in the dataset
Returns:
collection containing the records as the specified target class

read

<T> void read(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.

Parameters:
targetClass - the class that is stored in the dataset
callback - the callback to be called for each record
partitionKey - the partition key to use for the read

read

<T> Collection<T> read(Class<T> targetClass,
                       org.kitesdk.data.PartitionKey partitionKey)
Read records in the dataset partition based on the PartitionKey and return as a collection.

Parameters:
targetClass - the class that is stored in the dataset
partitionKey - the partition key to use for the read
Returns:
collection containing the records as the specified target class

write

<T> void write(Collection<T> records)
Write all records provided in the record collection

Parameters:
records - the records to write

execute

void execute(DatasetRepositoryCallback callback)
Execute a callback for the DatasetRepository

Parameters:
callback -

getDatasetDescriptor

<T> org.kitesdk.data.DatasetDescriptor getDatasetDescriptor(Class<T> targetClass)
Get the DatasetDescriptor for the given class

Parameters:
targetClass - the class stored in the dataset
Returns:
the DatasetDescriptor

getDatasetName

<T> String getDatasetName(Class<T> targetClass)
Get the dataset name to be used for the given class

Parameters:
targetClass - the class stored in the dataset
Returns:
the dataset name