use of io.cdap.cdap.common.guice.LocalLocationModule in project cdap by cdapio.
the class DatasetMetadataStorageTest method doSetup.
public static Injector doSetup(Module... additionalModules) throws IOException {
List<Module> modules = ImmutableList.<Module>builder().add(new ConfigModule(), new LocalLocationModule(), new TransactionInMemoryModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new NamespaceAdminTestModule(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
}).add(additionalModules).build();
Injector injector = Guice.createInjector(modules);
txManager = injector.getInstance(TransactionManager.class);
txManager.startAndWait();
storage = injector.getInstance(DatasetMetadataStorage.class);
storage.createIndex();
return injector;
}
use of io.cdap.cdap.common.guice.LocalLocationModule in project cdap by cdapio.
the class DefaultOwnerStoreTest method setup.
@BeforeClass
public static void setup() throws IOException, TableAlreadyExistsException {
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new DataSetsModules().getInMemoryModules(), new LocalLocationModule(), new TransactionInMemoryModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new NamespaceAdminTestModule(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
});
injector.getInstance(TransactionManager.class).startAndWait();
txRunner = injector.getInstance(TransactionRunner.class);
StoreDefinition.OwnerStore.create(injector.getInstance(StructuredTableAdmin.class));
ownerStore = new DefaultOwnerStore(txRunner);
}
use of io.cdap.cdap.common.guice.LocalLocationModule in project cdap by cdapio.
the class SqlOwnerStoreTest method setup.
@BeforeClass
public static void setup() throws Exception {
CConfiguration cConf = CConfiguration.create();
pg = PostgresInstantiator.createAndStart(cConf, TEMP_FOLDER.newFolder());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new LocalLocationModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
});
txRunner = injector.getInstance(TransactionRunner.class);
StoreDefinition.OwnerStore.create(injector.getInstance(StructuredTableAdmin.class));
ownerStore = new DefaultOwnerStore(txRunner);
}
use of io.cdap.cdap.common.guice.LocalLocationModule in project cdap by cdapio.
the class SqlFieldLineageTableTest method beforeClass.
@BeforeClass
public static void beforeClass() throws IOException, TableAlreadyExistsException {
CConfiguration cConf = CConfiguration.create();
pg = PostgresInstantiator.createAndStart(cConf, TEMP_FOLDER.newFolder());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new LocalLocationModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
});
transactionRunner = injector.getInstance(TransactionRunner.class);
StoreDefinition.createAllTables(injector.getInstance(StructuredTableAdmin.class));
}
use of io.cdap.cdap.common.guice.LocalLocationModule in project cdap by cdapio.
the class SqlUsageTableTest method beforeClass.
@BeforeClass
public static void beforeClass() throws IOException, TableAlreadyExistsException {
CConfiguration cConf = CConfiguration.create();
pg = PostgresInstantiator.createAndStart(cConf, TEMP_FOLDER.newFolder());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new LocalLocationModule(), new SystemDatasetRuntimeModule().getInMemoryModules(), new StorageModule(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
}
});
transactionRunner = injector.getInstance(TransactionRunner.class);
StoreDefinition.createAllTables(injector.getInstance(StructuredTableAdmin.class));
}
Aggregations