Search in sources :

Example 1 with DbServiceImpl

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();
}
Also used : DataObjectScanner(com.emc.storageos.db.common.DataObjectScanner) DbServiceImpl(com.emc.storageos.db.server.impl.DbServiceImpl) ServiceImpl(com.emc.storageos.coordinator.common.impl.ServiceImpl) DbServiceImpl(com.emc.storageos.db.server.impl.DbServiceImpl) SchemaUtil(com.emc.storageos.db.server.impl.SchemaUtil)

Example 2 with DbServiceImpl

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();
}
Also used : DataObjectScanner(com.emc.storageos.db.common.DataObjectScanner) DbServiceImpl(com.emc.storageos.db.server.impl.DbServiceImpl) ServiceImpl(com.emc.storageos.coordinator.common.impl.ServiceImpl) DbServiceImpl(com.emc.storageos.db.server.impl.DbServiceImpl) SchemaUtil(com.emc.storageos.db.server.impl.SchemaUtil)

Aggregations

ServiceImpl (com.emc.storageos.coordinator.common.impl.ServiceImpl)2 DataObjectScanner (com.emc.storageos.db.common.DataObjectScanner)2 DbServiceImpl (com.emc.storageos.db.server.impl.DbServiceImpl)2 SchemaUtil (com.emc.storageos.db.server.impl.SchemaUtil)2