use of com.emc.storageos.db.server.impl.DbServiceImpl in project coprhd-controller by CoprHD.
the class LocalCassandraService method startDb.
private void startDb() throws IOException {
ServiceImpl service = new ServiceImpl();
service.setName("dbsvc");
service.setEndpoint(URI.create("thrift://localhost:9160"));
service.setId("foobar");
DataObjectScanner scanner = new DataObjectScanner();
scanner.setPackages("com.emc.sa.model");
scanner.init();
SchemaUtil util = new SchemaUtil();
util.setKeyspaceName(DEFAULT_KEYSPACE_NAME);
util.setClusterName(DEFAULT_CLUSTER_NAME);
util.setDataObjectScanner(scanner);
util.setService(service);
dbService = new DbServiceImpl();
dbService.setConfig(createConfig(configResource, rootDir.getAbsolutePath()));
dbService.setSchemaUtil(util);
dbService.setCoordinator(coordinator);
dbService.setService(service);
dbService.start();
}
use of com.emc.storageos.db.server.impl.DbServiceImpl in project coprhd-controller by CoprHD.
the class TestDbService method start.
/**
* Starts the Cassandra DB, using any Persisted data files
*/
public void start() throws Exception {
if (dbsvc != null) {
return;
}
DataObjectScanner dataObjectScanner = new DataObjectScanner();
dataObjectScanner.setPackages(modelPackages.toArray(new String[0]));
dataObjectScanner.init();
ServiceImpl dummyDBService = new ServiceImpl();
dummyDBService.setName("dbsvc");
dummyDBService.setVersion("1");
dummyDBService.setEndpoint(URI.create("thrift://localhost:9170"));
dummyDBService.setId("foobar");
SchemaUtil schemaUtil = new SchemaUtil();
schemaUtil.setKeyspaceName("Testing");
schemaUtil.setService(dummyDBService);
schemaUtil.setCoordinator(coordinatorClient);
schemaUtil.setDataObjectScanner(dataObjectScanner);
String config = createConfig(dataDir.getAbsolutePath());
dbsvc = new DbServiceImpl();
dbsvc.setConfig(config);
dbsvc.setSchemaUtil(schemaUtil);
dbsvc.setCoordinator(coordinatorClient);
dbsvc.setService(dummyDBService);
dbsvc.start();
}
Aggregations