public class LineageWriterDatasetFramework extends Object implements DatasetFramework, ProgramContextAware
DatasetFramework that also records lineage (program-dataset access) records.| Modifier and Type | Method and Description |
|---|---|
void |
addInstance(String datasetTypeName,
Id.DatasetInstance datasetInstanceId,
co.cask.cdap.api.dataset.DatasetProperties props)
Adds information about dataset instance to the system.
|
void |
addModule(Id.DatasetModule moduleId,
co.cask.cdap.api.dataset.module.DatasetModule module)
Adds dataset types by adding dataset module to the system.
|
void |
addModule(Id.DatasetModule moduleId,
co.cask.cdap.api.dataset.module.DatasetModule module,
Location jarLocation)
Adds dataset types by adding dataset module to the system with a jar location containing all dataset classes
needed by the module.
|
void |
createNamespace(Id.Namespace namespaceId)
Creates a namespace in the Storage Providers - HBase/LevelDB, Hive and HDFS/Local File System.
|
void |
deleteAllInstances(Id.Namespace namespaceId)
Deletes all dataset instances in the specified namespace.
|
void |
deleteAllModules(Id.Namespace namespaceId)
Deletes dataset modules and its types in the specified namespace.
|
void |
deleteInstance(Id.DatasetInstance datasetInstanceId)
Deletes dataset instance from the system.
|
void |
deleteModule(Id.DatasetModule moduleId)
Deletes dataset module and its types from the system.
|
void |
deleteNamespace(Id.Namespace namespaceId)
Deletes a namespace in the Storage Providers - HBase/LevelDB, Hive and HDFS/Local File System.
|
<T extends co.cask.cdap.api.dataset.DatasetAdmin> |
getAdmin(Id.DatasetInstance datasetInstanceId,
ClassLoader classLoader)
Gets dataset instance admin to be used to perform administrative operations.
|
<T extends co.cask.cdap.api.dataset.DatasetAdmin> |
getAdmin(Id.DatasetInstance datasetInstanceId,
ClassLoader classLoader,
DatasetClassLoaderProvider classLoaderProvider)
Gets dataset instance admin to be used to perform administrative operations.
|
<T extends co.cask.cdap.api.dataset.Dataset> |
getDataset(Id.DatasetInstance datasetInstanceId,
Map<String,String> arguments,
ClassLoader classLoader)
Gets dataset to be used to perform data operations.
|
<T extends co.cask.cdap.api.dataset.Dataset> |
getDataset(Id.DatasetInstance datasetInstanceId,
Map<String,String> arguments,
ClassLoader classLoader,
DatasetClassLoaderProvider classLoaderProvider,
Iterable<? extends Id> owners)
Gets dataset to be used to perform data operations.
|
<T extends co.cask.cdap.api.dataset.Dataset> |
getDataset(Id.DatasetInstance datasetInstanceId,
Map<String,String> arguments,
ClassLoader classLoader,
Iterable<? extends Id> owners)
Gets dataset to be used to perform data operations.
|
co.cask.cdap.api.dataset.DatasetSpecification |
getDatasetSpec(Id.DatasetInstance datasetInstanceId)
Gets the
DatasetSpecification for the specified dataset instance id |
Collection<DatasetSpecificationSummary> |
getInstances(Id.Namespace namespaceId)
Get all dataset instances in the specified namespace
|
boolean |
hasInstance(Id.DatasetInstance datasetInstanceId) |
boolean |
hasSystemType(String typeName)
Checks if the specified type exists in the 'system' namespace
|
boolean |
hasType(Id.DatasetType datasetTypeId)
Checks if the specified type exists in the specified namespace
|
void |
initContext(Id.Run run)
Initalize with program run information.
|
void |
initContext(Id.Run run,
Id.NamespacedId componentId)
Intialize with program run and program component (i.e, flowet Id, etc.) information.
|
void |
updateInstance(Id.DatasetInstance datasetInstanceId,
co.cask.cdap.api.dataset.DatasetProperties props)
Updates the existing dataset instance in the system.
|
public void initContext(Id.Run run)
ProgramContextAwareinitContext in interface ProgramContextAwarerun - program runpublic void initContext(Id.Run run, Id.NamespacedId componentId)
ProgramContextAwareinitContext in interface ProgramContextAwarerun - program runcomponentId - program componentpublic void addModule(Id.DatasetModule moduleId, co.cask.cdap.api.dataset.module.DatasetModule module) throws DatasetManagementException
DatasetFrameworkDatasetModule may
result in tracing class dependencies if the DatasetModule is not a system dataset, which can takes
couple seconds for the tracing. If the jar Location containing the DatasetModule is known, it's
better to call DatasetFramework.addModule(Id.DatasetModule, DatasetModule, Location) instead.addModule in interface DatasetFrameworkmoduleId - dataset module idmodule - dataset moduleModuleConflictException - when module with same name is already registered or this module registers a type
with a same name as one of the already registered by another module typesDatasetManagementException - in case of problemspublic void addModule(Id.DatasetModule moduleId, co.cask.cdap.api.dataset.module.DatasetModule module, Location jarLocation) throws DatasetManagementException
DatasetFrameworkaddModule in interface DatasetFrameworkmoduleId - dataset module idmodule - dataset modulejarLocation - location of the jar file that contains the dataset classes needed by the moduleModuleConflictException - when module with same name is already registered or this module registers a type
with a same name as one of the already registered by another module typesDatasetManagementException - in case of problemspublic void deleteModule(Id.DatasetModule moduleId) throws DatasetManagementException
DatasetFrameworkdeleteModule in interface DatasetFrameworkmoduleId - dataset module idModuleConflictException - when module cannot be deleted because of its dependant modules or instancesDatasetManagementExceptionpublic void deleteAllModules(Id.Namespace namespaceId) throws DatasetManagementException
DatasetFrameworkdeleteAllModules in interface DatasetFrameworknamespaceId - the Id.Namespace to delete all modules from.ModuleConflictException - when some of modules can't be deleted because of its dependant modules or instancesDatasetManagementExceptionpublic void addInstance(String datasetTypeName, Id.DatasetInstance datasetInstanceId, co.cask.cdap.api.dataset.DatasetProperties props) throws DatasetManagementException, IOException
DatasetFrameworkDatasetDefinition.configure(String, DatasetProperties)
method to build DatasetSpecification which describes dataset instance
and later used to initialize DatasetAdmin and Dataset for the dataset instance.addInstance in interface DatasetFrameworkdatasetTypeName - dataset instance type namedatasetInstanceId - dataset instance nameprops - dataset instance propertiesInstanceConflictException - if dataset instance with this name already existsDatasetManagementExceptionIOException - when creation of dataset instance using its admin failspublic void updateInstance(Id.DatasetInstance datasetInstanceId, co.cask.cdap.api.dataset.DatasetProperties props) throws DatasetManagementException, IOException
DatasetFrameworkDatasetDefinition.configure(String, DatasetProperties)
method to build DatasetSpecification with new properties,
which describes dataset instance and DatasetAdmin is used to upgrade
Dataset for the dataset instance.updateInstance in interface DatasetFrameworkdatasetInstanceId - dataset instance nameprops - dataset instance propertiesDatasetManagementExceptionIOException - when creation of dataset instance using its admin failspublic Collection<DatasetSpecificationSummary> getInstances(Id.Namespace namespaceId) throws DatasetManagementException
DatasetFrameworkgetInstances in interface DatasetFrameworknamespaceId - the specified namespace idDatasetSpecifications for all datasets in the specified namespaceDatasetManagementException@Nullable public co.cask.cdap.api.dataset.DatasetSpecification getDatasetSpec(Id.DatasetInstance datasetInstanceId) throws DatasetManagementException
DatasetFrameworkDatasetSpecification for the specified dataset instance idgetDatasetSpec in interface DatasetFrameworkdatasetInstanceId - the Id.DatasetInstance for which the DatasetSpecification is desiredDatasetSpecification of the dataset or null if dataset not not existDatasetManagementExceptionpublic boolean hasInstance(Id.DatasetInstance datasetInstanceId) throws DatasetManagementException
hasInstance in interface DatasetFrameworkdatasetInstanceId - the Id.DatasetInstance to check for existenceDatasetManagementExceptionpublic boolean hasSystemType(String typeName) throws DatasetManagementException
DatasetFrameworkhasSystemType in interface DatasetFrameworkDatasetManagementExceptionpublic boolean hasType(Id.DatasetType datasetTypeId) throws DatasetManagementException
DatasetFrameworkhasType in interface DatasetFrameworkDatasetManagementExceptionpublic void deleteInstance(Id.DatasetInstance datasetInstanceId) throws DatasetManagementException, IOException
DatasetFrameworkdeleteInstance in interface DatasetFrameworkdatasetInstanceId - dataset instance nameInstanceConflictException - if dataset instance cannot be deleted because of its dependenciesDatasetManagementExceptionIOException - when deletion of dataset instance using its admin failspublic void deleteAllInstances(Id.Namespace namespaceId) throws DatasetManagementException, IOException
DatasetFrameworkdeleteAllInstances in interface DatasetFrameworknamespaceId - the specified namespace idDatasetManagementExceptionIOException - when deletion of dataset instance using its admin fails@Nullable public <T extends co.cask.cdap.api.dataset.DatasetAdmin> T getAdmin(Id.DatasetInstance datasetInstanceId, @Nullable ClassLoader classLoader) throws DatasetManagementException, IOException
DatasetFrameworkgetAdmin in interface DatasetFrameworkT - dataset admin typedatasetInstanceId - dataset instance nameclassLoader - classLoader to be used to load classes or null to use system classLoadernull if dataset instance of this name doesn't exist.DatasetManagementException - when there's trouble getting dataset meta infoIOException - when there's trouble to instantiate DatasetAdmin@Nullable public <T extends co.cask.cdap.api.dataset.DatasetAdmin> T getAdmin(Id.DatasetInstance datasetInstanceId, @Nullable ClassLoader classLoader, DatasetClassLoaderProvider classLoaderProvider) throws DatasetManagementException, IOException
DatasetFrameworkgetAdmin in interface DatasetFrameworkT - dataset admin typedatasetInstanceId - dataset instance nameclassLoader - parent classLoader to be used to load classes or null to use system classLoaderclassLoaderProvider - provider to get classloaders for different dataset modulesnull if dataset instance of this name doesn't exist.DatasetManagementException - when there's trouble getting dataset meta infoIOException - when there's trouble to instantiate DatasetAdmin@Nullable public <T extends co.cask.cdap.api.dataset.Dataset> T getDataset(Id.DatasetInstance datasetInstanceId, @Nullable Map<String,String> arguments, @Nullable ClassLoader classLoader, @Nullable Iterable<? extends Id> owners) throws DatasetManagementException, IOException
DatasetFrameworkgetDataset in interface DatasetFrameworkT - dataset type to be returneddatasetInstanceId - dataset instance idarguments - runtime arguments for the dataset instanceclassLoader - classLoader to be used to load classes or null to use system classLoaderowners - owners of the datasetnull if dataset instance of this name doesn't exist.DatasetManagementException - when there's trouble getting dataset meta infoIOException - when there's trouble to instantiate Dataset@Nullable public <T extends co.cask.cdap.api.dataset.Dataset> T getDataset(Id.DatasetInstance datasetInstanceId, @Nullable Map<String,String> arguments, @Nullable ClassLoader classLoader) throws DatasetManagementException, IOException
DatasetFrameworkgetDataset in interface DatasetFrameworkT - dataset type to be returneddatasetInstanceId - dataset instance idarguments - runtime arguments for the dataset instanceclassLoader - classLoader to be used to load classes or null to use system classLoadernull if dataset instance of this name doesn't exist.DatasetManagementException - when there's trouble getting dataset meta infoIOException - when there's trouble to instantiate Dataset@Nullable public <T extends co.cask.cdap.api.dataset.Dataset> T getDataset(Id.DatasetInstance datasetInstanceId, @Nullable Map<String,String> arguments, @Nullable ClassLoader classLoader, DatasetClassLoaderProvider classLoaderProvider, @Nullable Iterable<? extends Id> owners) throws DatasetManagementException, IOException
DatasetFrameworkgetDataset in interface DatasetFrameworkT - dataset type to be returneddatasetInstanceId - dataset instance idarguments - runtime arguments for the dataset instanceclassLoader - parent classLoader to be used to load classes or null to use system classLoaderclassLoaderProvider - provider to get classloaders for different dataset modulesowners - owners of the datasetnull if dataset instance of this name doesn't exist.DatasetManagementException - when there's trouble getting dataset meta infoIOException - when there's trouble to instantiate Datasetpublic void createNamespace(Id.Namespace namespaceId) throws DatasetManagementException
DatasetFrameworkcreateNamespace in interface DatasetFrameworknamespaceId - the Id.Namespace to createDatasetManagementExceptionpublic void deleteNamespace(Id.Namespace namespaceId) throws DatasetManagementException
DatasetFrameworkdeleteNamespace in interface DatasetFrameworknamespaceId - the Id.Namespace to createDatasetManagementExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.