org.kitesdk.data
Interface RandomAccessDatasetRepository

All Superinterfaces:
DatasetRepository

@Immutable
public interface RandomAccessDatasetRepository
extends DatasetRepository

A logical repository (storage system) of RandomAccessDatasets.

RandomAccessDatasetRepositorys are DatasetRepositorys that return the Dataset sub-interface RandomAccessDataset from the load, create, and update methods. See DatasetRepository for more details.

Implementations of DatasetRepository are immutable.

Since:
0.9.0
See Also:
RandomAccessDataset, DatasetRepository, DatasetDescriptor

Method Summary
<E> RandomAccessDataset<E>
create(String name, DatasetDescriptor descriptor)
          Create a Dataset with the supplied descriptor.
<E> RandomAccessDataset<E>
create(String name, DatasetDescriptor descriptor, Class<E> type)
          Create a Dataset with the supplied descriptor.
<E> RandomAccessDataset<E>
load(String name)
          Get the latest version of a named Dataset.
<E> RandomAccessDataset<E>
load(String name, Class<E> type)
          Get the latest version of a named Dataset.
<E> RandomAccessDataset<E>
update(String name, DatasetDescriptor descriptor)
          Update an existing Dataset to reflect the supplied descriptor.
<E> RandomAccessDataset<E>
update(String name, DatasetDescriptor descriptor, Class<E> type)
          Update an existing Dataset to reflect the supplied descriptor.
 
Methods inherited from interface org.kitesdk.data.DatasetRepository
delete, exists, getUri, list
 

Method Detail

load

<E> RandomAccessDataset<E> load(String name)
Description copied from interface: DatasetRepository
Get the latest version of a named Dataset. If no dataset with the provided name exists, a DatasetNotFoundException is thrown.

Specified by:
load in interface DatasetRepository
Parameters:
name - The name of the dataset.

load

<E> RandomAccessDataset<E> load(String name,
                                Class<E> type)
Description copied from interface: DatasetRepository
Get the latest version of a named Dataset. If no dataset with the provided name exists, a DatasetNotFoundException is thrown.

Specified by:
load in interface DatasetRepository
Parameters:
name - The name of the dataset.
type - the Java type of entities in the dataset

create

<E> RandomAccessDataset<E> create(String name,
                                  DatasetDescriptor descriptor)
Description copied from interface: DatasetRepository
Create a Dataset with the supplied descriptor. Depending on the underlying dataset storage, some schema types or configurations might not be supported. If you supply an illegal schema, the implementing class throws an exception. It is illegal to create more than one dataset with the same name. If you provide a duplicate name, the implementing class throws an exception.

Specified by:
create in interface DatasetRepository
Parameters:
name - The fully qualified dataset name
descriptor - A descriptor that describes the schema and other properties of the dataset
Returns:
The newly created dataset

create

<E> RandomAccessDataset<E> create(String name,
                                  DatasetDescriptor descriptor,
                                  Class<E> type)
Description copied from interface: DatasetRepository
Create a Dataset with the supplied descriptor. Depending on the underlying dataset storage, some schema types or configurations might not be supported. If you supply an illegal schema, the implementing class throws an exception. It is illegal to create more than one dataset with the same name. If you provide a duplicate name, the implementing class throws an exception.

Specified by:
create in interface DatasetRepository
Parameters:
name - The fully qualified dataset name
descriptor - A descriptor that describes the schema and other properties of the dataset
type - the Java type of entities in the dataset
Returns:
The newly created dataset

update

<E> RandomAccessDataset<E> update(String name,
                                  DatasetDescriptor descriptor)
Description copied from interface: DatasetRepository
Update an existing Dataset to reflect the supplied descriptor. The common case is updating a dataset schema. Depending on the underlying dataset storage, some updates might not be supported, such as a change in format or partition strategy. Any attempt to make an unsupported or incompatible update results in an exception being thrown and no changes made to the dataset.

Specified by:
update in interface DatasetRepository
Parameters:
name - The fully qualified dataset name
descriptor - A descriptor that describes the schema and other properties of the dataset
Returns:
The updated dataset

update

<E> RandomAccessDataset<E> update(String name,
                                  DatasetDescriptor descriptor,
                                  Class<E> type)
Description copied from interface: DatasetRepository
Update an existing Dataset to reflect the supplied descriptor. The common case is updating a dataset schema. Depending on the underlying dataset storage, some updates might not be supported, such as a change in format or partition strategy. Any attempt to make an unsupported or incompatible update results in an exception being thrown and no changes made to the dataset.

Specified by:
update in interface DatasetRepository
Parameters:
name - The fully qualified dataset name
descriptor - A descriptor that describes the schema and other properties of the dataset
type - the Java type of entities in the dataset
Returns:
The updated dataset


Copyright © 2013–2014. All rights reserved.