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

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 -

getDatasetName

<T> java.lang.String getDatasetName(java.lang.Class<T> clazz)
Get the dataset name to be used for the given class

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

Spring for Apache Hadoop