Search in sources :

Example 16 with StorageFactory

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

the class MultiStorageIntegrationTest method initStorage1AndAdmin1.

private void initStorage1AndAdmin1() throws ExecutionException {
    StorageFactory factory = StorageFactory.create(MultiStorageEnv.getPropertiesForStorage1());
    admin1 = factory.getAdmin();
    createTables(admin1);
    storage1 = factory.getStorage();
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory)

Example 17 with StorageFactory

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

the class MultiStorageIntegrationTest method initStorage2AndAdmin2.

private void initStorage2AndAdmin2() throws ExecutionException {
    StorageFactory factory = StorageFactory.create(MultiStorageEnv.getPropertiesForStorage2());
    admin2 = factory.getAdmin();
    createTables(admin2);
    storage2 = factory.getStorage();
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory)

Example 18 with StorageFactory

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

the class MultiStorageAdminIntegrationTest method initAdmin1.

private void initAdmin1() throws ExecutionException {
    StorageFactory factory = StorageFactory.create(MultiStorageEnv.getPropertiesForStorage1());
    admin1 = factory.getAdmin();
    // create tables
    admin1.createNamespace(NAMESPACE1, true);
    TableMetadata tableMetadata = TableMetadata.newBuilder().addPartitionKey(COL_NAME1).addClusteringKey(COL_NAME4).addColumn(COL_NAME1, DataType.INT).addColumn(COL_NAME2, DataType.TEXT).addColumn(COL_NAME3, DataType.INT).addColumn(COL_NAME4, DataType.INT).addColumn(COL_NAME5, DataType.BOOLEAN).build();
    for (String table : Arrays.asList(TABLE1, TABLE2, TABLE3)) {
        admin1.createTable(NAMESPACE1, table, tableMetadata, true);
    }
    admin1.createNamespace(NAMESPACE2, true);
    admin1.createTable(NAMESPACE2, TABLE1, tableMetadata, true);
}
Also used : TableMetadata(com.scalar.db.api.TableMetadata) StorageFactory(com.scalar.db.service.StorageFactory)

Example 19 with StorageFactory

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

the class MultiStorageAdminIntegrationTest method initAdmin2.

private void initAdmin2() throws ExecutionException {
    StorageFactory factory = StorageFactory.create(MultiStorageEnv.getPropertiesForStorage2());
    admin2 = factory.getAdmin();
    // create tables
    admin2.createNamespace(NAMESPACE1, true);
    TableMetadata tableMetadata = TableMetadata.newBuilder().addColumn(COL_NAME1, DataType.TEXT).addColumn(COL_NAME2, DataType.INT).addColumn(COL_NAME3, DataType.BOOLEAN).addPartitionKey(COL_NAME1).build();
    for (String table : Arrays.asList(TABLE1, TABLE2, TABLE3)) {
        admin2.createTable(NAMESPACE1, table, tableMetadata, true);
    }
    admin2.createNamespace(NAMESPACE2, true);
    admin2.createTable(NAMESPACE2, TABLE1, tableMetadata, true);
}
Also used : TableMetadata(com.scalar.db.api.TableMetadata) StorageFactory(com.scalar.db.service.StorageFactory)

Example 20 with StorageFactory

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

the class DistributedStorageMultipleClusteringKeyScanIntegrationTestBase method beforeAll.

@BeforeAll
public void beforeAll() throws Exception {
    initialize();
    StorageFactory factory = StorageFactory.create(TestUtils.addSuffix(getProperties(), TEST_NAME));
    admin = factory.getAdmin();
    namespaceBaseName = getNamespaceBaseName();
    clusteringKeyTypes = getClusteringKeyTypes();
    executorService = Executors.newFixedThreadPool(getThreadNum());
    createTables();
    storage = factory.getStorage();
    seed = System.currentTimeMillis();
    System.out.println("The seed used in the multiple clustering key scan 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