public class DatasetInstanceService extends Object
| Constructor and Description |
|---|
DatasetInstanceService(DatasetTypeManager implManager,
DatasetInstanceManager instanceManager,
DatasetOpExecutor opExecutorClient,
ExploreFacade exploreFacade,
CConfiguration conf,
co.cask.tephra.TransactionExecutorFactory txFactory,
DatasetDefinitionRegistryFactory registryFactory,
NamespaceStore nsStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
create(String namespaceId,
String name,
DatasetInstanceConfiguration props)
Creates a dataset instance.
|
void |
drop(Id.DatasetInstance instance)
Drops the specified dataset instance.
|
DatasetAdminOpResponse |
executeAdmin(Id.DatasetInstance instance,
String method)
Executes an admin operation on a dataset instance.
|
DatasetMeta |
get(Id.DatasetInstance instance,
List<? extends Id> owners)
Gets a dataset instance.
|
Collection<co.cask.cdap.api.dataset.DatasetSpecification> |
list(Id.Namespace namespace)
Lists all dataset instances in a namespace.
|
void |
update(Id.DatasetInstance instance,
Map<String,String> properties)
Updates an existing Dataset specification properties.
|
@Inject public DatasetInstanceService(DatasetTypeManager implManager, DatasetInstanceManager instanceManager, DatasetOpExecutor opExecutorClient, ExploreFacade exploreFacade, CConfiguration conf, co.cask.tephra.TransactionExecutorFactory txFactory, DatasetDefinitionRegistryFactory registryFactory, NamespaceStore nsStore)
public Collection<co.cask.cdap.api.dataset.DatasetSpecification> list(Id.Namespace namespace) throws Exception
namespace - the namespace to list datasets forNotFoundException - if the namespace was not foundIOException - if there is a problem in making an HTTP request to check if the namespace exists.Exceptionpublic DatasetMeta get(Id.DatasetInstance instance, List<? extends Id> owners) throws Exception
instance - instance to getowners - the Ids that will be using the dataset instanceDatasetMetaNotFoundException - if either the namespace or dataset instance is not found,IOException - if there is a problem in making an HTTP request to check if the namespace exists.Exceptionpublic void create(String namespaceId, String name, DatasetInstanceConfiguration props) throws Exception
namespaceId - the namespace to create the dataset instance inname - the name of the new dataset instanceprops - the properties for the new dataset instanceNamespaceNotFoundException - if the specified namespace was not foundDatasetAlreadyExistsException - if a dataset with the same name already existsDatasetTypeNotFoundException - if the dataset type was not foundException - if something went wrongpublic void update(Id.DatasetInstance instance, Map<String,String> properties) throws Exception
DatasetInstanceConfiguration is constructed based on request and the Dataset instance is updated.instance - the dataset instanceproperties - the dataset properties to be usedNamespaceNotFoundException - if the specified namespace was not foundDatasetNotFoundException - if the dataset was not foundDatasetTypeNotFoundException - if the type of the existing dataset was not foundExceptionpublic void drop(Id.DatasetInstance instance) throws Exception
instance - the Id.DatasetInstance to dropNamespaceNotFoundException - if the namespace was not foundDatasetNotFoundException - if the dataset instance was not foundIOException - if there was a problem in checking if the namespace exists over HTTPExceptionpublic DatasetAdminOpResponse executeAdmin(Id.DatasetInstance instance, String method) throws Exception
instance - the instance to execute the admin operation onmethod - the type of admin operation to executeDatasetAdminOpResponse from the HTTP handlerNamespaceNotFoundException - if the requested namespace was not foundIOException - if there was a problem in checking if the namespace exists over HTTPExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.