Spring for Apache Hadoop

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(java.lang.Class<T> targetClass)
          Get the DatasetDescriptor for the given class
<T> java.lang.String
getDatasetName(java.lang.Class<T> targetClass)
          Get the dataset name to be used for the given class
<T> java.util.Collection<T>
read(java.lang.Class<T> targetClass)
          Read all records in the dataset and return as a collection.
<T> java.util.Collection<T>
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.
<T> void
read(java.lang.Class<T> targetClass, RecordCallback<T> callback)
          Read all records in the dataset and call the provided callback for each record.
<T> void
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.
<T> void
write(java.util.Collection<T> records)
          Write all records provided in the record collection
 

Method Detail

read

<T> void read(java.lang.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> java.util.Collection<T> read(java.lang.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(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.

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> java.util.Collection<T> 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.

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(java.util.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(java.lang.Class<T> targetClass)
Get the DatasetDescriptor for the given class

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

getDatasetName

<T> java.lang.String getDatasetName(java.lang.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

Spring for Apache Hadoop