use of io.cdap.cdap.data2.dataset2.lib.partitioned.PartitionedFileSetModule in project cdap by caskdata.
the class AbstractDatasetFrameworkTest method testMultipleTransitiveDependencies.
@Test
public void testMultipleTransitiveDependencies() throws DatasetManagementException, IOException, UnauthorizedException {
// Adding modules
DatasetFramework framework = getFramework();
try {
framework.addModule(IN_MEMORY, new InMemoryTableModule());
framework.addModule(CORE, new CoreDatasetsModule());
framework.addModule(FILE, new FileSetModule());
framework.addModule(PFS, new PartitionedFileSetModule());
framework.addModule(TWICE, new SingleTypeModule(EmbedsTableTwiceDataset.class));
// Creating an instances
framework.addInstance(EmbedsTableTwiceDataset.class.getName(), MY_DS, PartitionedFileSetProperties.builder().setPartitioning(Partitioning.builder().addStringField("x").build()).build());
Assert.assertTrue(framework.hasInstance(MY_DS));
framework.getDataset(MY_DS, DatasetProperties.EMPTY.getProperties(), null);
} finally {
framework.deleteAllInstances(NAMESPACE_ID);
framework.deleteAllModules(NAMESPACE_ID);
}
}
use of io.cdap.cdap.data2.dataset2.lib.partitioned.PartitionedFileSetModule in project cdap by caskdata.
the class SystemDatasetRuntimeModule method bindDefaultModules.
/**
* Add bindings for Dataset modules that are available by default
*/
private void bindDefaultModules(MapBinder<String, DatasetModule> mapBinder) {
mapBinder.addBinding("core").toInstance(new CoreDatasetsModule());
mapBinder.addBinding(FileSetDataset.TYPE).toInstance(new FileSetModule());
mapBinder.addBinding(TimePartitionedFileSet.TYPE).toInstance(new TimePartitionedFileSetModule());
mapBinder.addBinding(PartitionedFileSet.TYPE).toInstance(new PartitionedFileSetModule());
mapBinder.addBinding(ObjectMappedTable.TYPE).toInstance(new ObjectMappedTableModule());
mapBinder.addBinding(Cube.TYPE).toInstance(new CubeModule());
mapBinder.addBinding(ExternalDataset.TYPE).toInstance(new ExternalDatasetModule());
}
use of io.cdap.cdap.data2.dataset2.lib.partitioned.PartitionedFileSetModule in project cdap by caskdata.
the class SystemDatasetRuntimeModule method bindDefaultModules.
/**
* Add bindings for Dataset modules that are available by default
*/
private void bindDefaultModules(MapBinder<String, DatasetModule> mapBinder) {
mapBinder.addBinding("core").toInstance(new CoreDatasetsModule());
mapBinder.addBinding("fileSet").toInstance(new FileSetModule());
mapBinder.addBinding("timePartitionedFileSet").toInstance(new TimePartitionedFileSetModule());
mapBinder.addBinding("partitionedFileSet").toInstance(new PartitionedFileSetModule());
mapBinder.addBinding("objectMappedTable").toInstance(new ObjectMappedTableModule());
mapBinder.addBinding("cube").toInstance(new CubeModule());
mapBinder.addBinding("usage").toInstance(new UsageDatasetModule());
mapBinder.addBinding("metadata").toInstance(new MetadataDatasetModule());
mapBinder.addBinding("lineage").toInstance(new LineageDatasetModule());
mapBinder.addBinding("externalDataset").toInstance(new ExternalDatasetModule());
}
use of io.cdap.cdap.data2.dataset2.lib.partitioned.PartitionedFileSetModule in project cdap by caskdata.
the class AbstractDatasetFrameworkTest method testMultipleTransitiveDependencies.
@Test
public void testMultipleTransitiveDependencies() throws DatasetManagementException, IOException {
// Adding modules
DatasetFramework framework = getFramework();
try {
framework.addModule(IN_MEMORY, new InMemoryTableModule());
framework.addModule(CORE, new CoreDatasetsModule());
framework.addModule(FILE, new FileSetModule());
framework.addModule(PFS, new PartitionedFileSetModule());
framework.addModule(TWICE, new SingleTypeModule(EmbedsTableTwiceDataset.class));
// Creating an instances
framework.addInstance(EmbedsTableTwiceDataset.class.getName(), MY_DS, PartitionedFileSetProperties.builder().setPartitioning(Partitioning.builder().addStringField("x").build()).build());
Assert.assertTrue(framework.hasInstance(MY_DS));
framework.getDataset(MY_DS, DatasetProperties.EMPTY.getProperties(), null);
} finally {
framework.deleteAllInstances(NAMESPACE_ID);
framework.deleteAllModules(NAMESPACE_ID);
}
}
Aggregations