Search in sources :

Example 11 with StorageFactory

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

the class DistributedTransactionServiceWithConsensusCommitWithExtraReadIntegrationTest method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws ExecutionException, IOException {
    ServerConfig serverConfig = ServerEnv.getServerConfig(Isolation.SERIALIZABLE, SerializableStrategy.EXTRA_READ);
    if (serverConfig != null) {
        server = new ScalarDbServer(serverConfig);
        server.start();
    }
    GrpcConfig grpcConfig = ServerEnv.getGrpcConfig();
    StorageFactory factory = new StorageFactory(grpcConfig);
    admin = factory.getAdmin();
    consensusCommitAdmin = new ConsensusCommitAdmin(admin, new ConsensusCommitConfig(grpcConfig.getProperties()));
    createTables(admin, consensusCommitAdmin);
    manager = new GrpcTransactionManager(grpcConfig);
}
Also used : ConsensusCommitConfig(com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig) StorageFactory(com.scalar.db.service.StorageFactory) GrpcTransactionManager(com.scalar.db.transaction.rpc.GrpcTransactionManager) GrpcConfig(com.scalar.db.storage.rpc.GrpcConfig) ConsensusCommitAdmin(com.scalar.db.transaction.consensuscommit.ConsensusCommitAdmin) BeforeClass(org.junit.BeforeClass)

Example 12 with StorageFactory

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

the class DistributedStorageIntegrationTestBase method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    initialize();
    StorageFactory factory = StorageFactory.create(getProperties());
    admin = factory.getAdmin();
    namespace = getNamespace();
    createTable();
    storage = factory.getStorage();
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 13 with StorageFactory

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

the class DistributedStorageMultiplePartitionKeyIntegrationTestBase method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    initialize();
    StorageFactory factory = StorageFactory.create(TestUtils.addSuffix(getProperties(), TEST_NAME));
    admin = factory.getAdmin();
    namespaceBaseName = getNamespaceBaseName();
    partitionKeyTypes = getPartitionKeyTypes();
    executorService = Executors.newFixedThreadPool(getThreadNum());
    createTables();
    storage = factory.getStorage();
    seed = System.currentTimeMillis();
    System.out.println("The seed used in the multiple partition key integration test is " + seed);
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 14 with StorageFactory

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

the class DistributedStorageSingleClusteringKeyScanIntegrationTestBase method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    initialize();
    StorageFactory factory = StorageFactory.create(TestUtils.addSuffix(getProperties(), TEST_NAME));
    admin = factory.getAdmin();
    namespace = getNamespace();
    clusteringKeyTypes = getClusteringKeyTypes();
    createTables();
    storage = factory.getStorage();
    seed = System.currentTimeMillis();
    System.out.println("The seed used in the single clustering key scan integration test is " + seed);
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 15 with StorageFactory

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

the class DistributedStorageColumnValueIntegrationTestBase method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    initialize();
    StorageFactory factory = StorageFactory.create(TestUtils.addSuffix(getProperties(), 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);
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) BeforeAll(org.junit.jupiter.api.BeforeAll)

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