use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class ZKRouteStoreTest method init.
@BeforeClass
public static void init() throws IOException {
zkServer = InMemoryZKServer.builder().setDataDir(TMP_FOLDER.newFolder()).build();
zkServer.startAndWait();
CConfiguration cConf = CConfiguration.create();
cConf.set(Constants.Zookeeper.QUORUM, zkServer.getConnectionStr());
Injector injector = Guice.createInjector(new ConfigModule(cConf), new ZKClientModule());
zkClientService = injector.getInstance(ZKClientService.class);
zkClientService.startAndWait();
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class MetadataAdminAuthorizationTest method createCConf.
private static CConfiguration createCConf() throws IOException {
CConfiguration cConf = CConfiguration.create();
cConf.setBoolean(Constants.Security.ENABLED, true);
cConf.setBoolean(Constants.Security.Authorization.ENABLED, true);
// we only want to test authorization, but we don't specify principal/keytab, so disable kerberos
cConf.setBoolean(Constants.Security.KERBEROS_ENABLED, false);
cConf.setInt(Constants.Security.Authorization.CACHE_MAX_ENTRIES, 0);
LocationFactory locationFactory = new LocalLocationFactory(new File(TEMPORARY_FOLDER.newFolder().toURI()));
Location authorizerJar = AppJarHelper.createDeploymentJar(locationFactory, InMemoryAuthorizer.class);
cConf.set(Constants.Security.Authorization.EXTENSION_JAR_PATH, authorizerJar.toURI().getPath());
return cConf;
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class SecureStoreTest method beforeClass.
@BeforeClass
public static void beforeClass() throws Exception {
CConfiguration cConf = createBasicCConf();
cConf.set(Constants.Security.Store.PROVIDER, "file");
SConfiguration sConf = SConfiguration.create();
sConf.set(Constants.Security.Store.FILE_PASSWORD, "secret");
initializeAndStartServices(cConf, sConf);
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class DefaultTransactionStateCache method getSnapshotConfiguration.
@Override
protected Configuration getSnapshotConfiguration() throws IOException {
CConfiguration cConf = configTable.read(ConfigurationTable.Type.DEFAULT, sysConfigTablePrefix);
Configuration txConf = HBaseConfiguration.create(getConf());
CConfigurationUtil.copyTxProperties(cConf, txConf);
return txConf;
}
use of co.cask.cdap.common.conf.CConfiguration in project cdap by caskdata.
the class InMemoryExploreServiceTest method start.
@BeforeClass
public static void start() throws Exception {
CConfiguration configuration = CConfiguration.create();
Configuration hConf = new Configuration();
configuration.set(Constants.CFG_DATA_INMEMORY_PERSISTENCE, Constants.InMemoryPersistenceType.MEMORY.name());
configuration.set(Constants.Explore.LOCAL_DATA_DIR, tmpFolder.newFolder().getAbsolutePath());
Injector injector = Guice.createInjector(new ConfigModule(configuration, hConf), new IOModule(), new DiscoveryRuntimeModule().getInMemoryModules(), new NonCustomLocationUnitTestModule().getModule(), new DataFabricModules().getInMemoryModules(), new DataSetsModules().getStandaloneModules(), new DataSetServiceModules().getInMemoryModules(), new MetricsClientRuntimeModule().getInMemoryModules(), new ExploreRuntimeModule().getInMemoryModules(), new ExploreClientModule(), new ViewAdminModules().getInMemoryModules(), new StreamAdminModules().getInMemoryModules(), new NamespaceClientRuntimeModule().getInMemoryModules(), new NamespaceStoreModule().getStandaloneModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new AbstractModule() {
@Override
protected void configure() {
bind(NotificationFeedManager.class).to(NoOpNotificationFeedManager.class);
bind(UGIProvider.class).to(UnsupportedUGIProvider.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
}
});
transactionManager = injector.getInstance(TransactionManager.class);
transactionManager.startAndWait();
dsOpService = injector.getInstance(DatasetOpExecutor.class);
dsOpService.startAndWait();
datasetService = injector.getInstance(DatasetService.class);
datasetService.startAndWait();
exploreService = injector.getInstance(ExploreService.class);
exploreService.startAndWait();
namespaceAdmin = injector.getInstance(NamespaceAdmin.class);
}
Aggregations