Search in sources :

Example 26 with StorageFactory

use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.

the class SchemaLoaderIntegrationTestBase method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    initialize();
    Properties properties = getProperties();
    namespace1 = getNamespace1();
    namespace2 = getNamespace2();
    writeConfigFile(properties);
    Map<String, Object> schemaJsonMap = getSchemaJsonMap();
    writeSchemaFile(schemaJsonMap);
    StorageFactory factory = StorageFactory.create(properties);
    admin = factory.getAdmin();
    consensusCommitAdmin = new ConsensusCommitAdmin(admin, new DatabaseConfig(properties));
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) ConsensusCommitAdmin(com.scalar.db.transaction.consensuscommit.ConsensusCommitAdmin) Properties(java.util.Properties) DatabaseConfig(com.scalar.db.config.DatabaseConfig) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 27 with StorageFactory

use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.

the class ConsensusCommitSpecificIntegrationTestBase method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    initialize();
    Properties properties = TestUtils.addSuffix(getProperties(), TEST_NAME);
    StorageFactory factory = StorageFactory.create(properties);
    admin = factory.getAdmin();
    databaseConfig = new DatabaseConfig(properties);
    consensusCommitConfig = new ConsensusCommitConfig(databaseConfig);
    consensusCommitAdmin = new ConsensusCommitAdmin(admin, consensusCommitConfig);
    namespace1 = getNamespace1();
    namespace2 = getNamespace2();
    createTables();
    originalStorage = factory.getStorage();
    parallelExecutor = new ParallelExecutor(consensusCommitConfig);
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) Properties(java.util.Properties) DatabaseConfig(com.scalar.db.config.DatabaseConfig) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 28 with StorageFactory

use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.

the class TwoPhaseConsensusCommitSpecificIntegrationTestBase method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    initialize();
    Properties properties = TestUtils.addSuffix(getProperties(), TEST_NAME);
    namespace = getNamespace();
    StorageFactory factory = StorageFactory.create(properties);
    admin = factory.getAdmin();
    DatabaseConfig databaseConfig = new DatabaseConfig(properties);
    ConsensusCommitConfig consensusCommitConfig = new ConsensusCommitConfig(databaseConfig);
    consensusCommitAdmin = new ConsensusCommitAdmin(admin, consensusCommitConfig);
    createTables();
    storage = factory.getStorage();
    initManagerAndCoordinator(databaseConfig, consensusCommitConfig);
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) Properties(java.util.Properties) DatabaseConfig(com.scalar.db.config.DatabaseConfig) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 29 with StorageFactory

use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.

the class AdminIntegrationTestBase method setUp.

@Before
public void setUp() throws Exception {
    if (!initialized) {
        initialize();
        StorageFactory factory = new StorageFactory(TestUtils.addSuffix(getDatabaseConfig(), TEST_NAME));
        admin = factory.getAdmin();
        namespace1 = getNamespace1();
        namespace2 = getNamespace2();
        namespace3 = getNamespace3();
        createTables();
        storage = factory.getStorage();
        initialized = true;
    }
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) Before(org.junit.Before)

Example 30 with StorageFactory

use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.

the class StorageColumnValueIntegrationTestBase method setUp.

@Before
public void setUp() throws Exception {
    if (!initialized) {
        StorageFactory factory = new StorageFactory(TestUtils.addSuffix(getDatabaseConfig(), TEST_NAME));
        admin = factory.getAdmin();
        namespace = getNamespace();
        createTable();
        storage = factory.getStorage();
        seed = System.currentTimeMillis();
        System.out.println("The seed used in the column value integration test is " + seed);
        initialized = true;
    }
    admin.truncateTable(namespace, TABLE);
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) Before(org.junit.Before)

Aggregations

StorageFactory (com.scalar.db.service.StorageFactory)37 BeforeAll (org.junit.jupiter.api.BeforeAll)13 Before (org.junit.Before)11 ConsensusCommitAdmin (com.scalar.db.transaction.consensuscommit.ConsensusCommitAdmin)8 BeforeClass (org.junit.BeforeClass)8 GrpcConfig (com.scalar.db.storage.rpc.GrpcConfig)7 ConsensusCommitConfig (com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig)7 DatabaseConfig (com.scalar.db.config.DatabaseConfig)6 GrpcTransactionManager (com.scalar.db.transaction.rpc.GrpcTransactionManager)4 GrpcTwoPhaseCommitTransactionManager (com.scalar.db.transaction.rpc.GrpcTwoPhaseCommitTransactionManager)3 Properties (java.util.Properties)3 TableMetadata (com.scalar.db.api.TableMetadata)2 JdbcConfig (com.scalar.db.storage.jdbc.JdbcConfig)1