Search in sources :

Example 1 with ConsensusCommitConfig

use of com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig in project scalardb by scalar-labs.

the class SchemaLoaderIntegrationTestBase method setUp.

@Before
public void setUp() throws Exception {
    if (!initialized) {
        initialize();
        DatabaseConfig config = getDatabaseConfig();
        namespace1 = getNamespace1();
        namespace2 = getNamespace2();
        writeConfigFile(config.getProperties());
        Map<String, Object> schemaJsonMap = getSchemaJsonMap();
        writeSchemaFile(schemaJsonMap);
        StorageFactory factory = new StorageFactory(config);
        admin = factory.getAdmin();
        consensusCommitAdmin = new ConsensusCommitAdmin(admin, new ConsensusCommitConfig(config.getProperties()));
        initialized = true;
    }
    dropTablesIfExist();
}
Also used : ConsensusCommitConfig(com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig) StorageFactory(com.scalar.db.service.StorageFactory) ConsensusCommitAdmin(com.scalar.db.transaction.consensuscommit.ConsensusCommitAdmin) DatabaseConfig(com.scalar.db.config.DatabaseConfig) Before(org.junit.Before)

Example 2 with ConsensusCommitConfig

use of com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig in project scalardb by scalar-labs.

the class TwoPhaseCommitTransactionServiceWithTwoPhaseConsensusCommitWithExtraReadIntegrationTest 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 GrpcTwoPhaseCommitTransactionManager(grpcConfig);
}
Also used : ConsensusCommitConfig(com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig) StorageFactory(com.scalar.db.service.StorageFactory) GrpcConfig(com.scalar.db.storage.rpc.GrpcConfig) GrpcTwoPhaseCommitTransactionManager(com.scalar.db.transaction.rpc.GrpcTwoPhaseCommitTransactionManager) ConsensusCommitAdmin(com.scalar.db.transaction.consensuscommit.ConsensusCommitAdmin) BeforeClass(org.junit.BeforeClass)

Example 3 with ConsensusCommitConfig

use of com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig in project scalardb by scalar-labs.

the class TwoPhaseCommitTransactionServiceWithTwoPhaseConsensusCommitWithExtraWriteIntegrationTest method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws ExecutionException, IOException {
    ServerConfig serverConfig = ServerEnv.getServerConfig(Isolation.SERIALIZABLE, SerializableStrategy.EXTRA_WRITE);
    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 GrpcTwoPhaseCommitTransactionManager(grpcConfig);
}
Also used : ConsensusCommitConfig(com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig) StorageFactory(com.scalar.db.service.StorageFactory) GrpcConfig(com.scalar.db.storage.rpc.GrpcConfig) GrpcTwoPhaseCommitTransactionManager(com.scalar.db.transaction.rpc.GrpcTwoPhaseCommitTransactionManager) ConsensusCommitAdmin(com.scalar.db.transaction.consensuscommit.ConsensusCommitAdmin) BeforeClass(org.junit.BeforeClass)

Example 4 with ConsensusCommitConfig

use of com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig in project scalardb by scalar-labs.

the class DistributedTransactionServiceWithConsensusCommitIntegrationTest method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws ExecutionException, IOException {
    ServerConfig serverConfig = ServerEnv.getServerConfig();
    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 5 with ConsensusCommitConfig

use of com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig 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)

Aggregations

StorageFactory (com.scalar.db.service.StorageFactory)7 ConsensusCommitAdmin (com.scalar.db.transaction.consensuscommit.ConsensusCommitAdmin)7 ConsensusCommitConfig (com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig)7 GrpcConfig (com.scalar.db.storage.rpc.GrpcConfig)6 BeforeClass (org.junit.BeforeClass)6 GrpcTransactionManager (com.scalar.db.transaction.rpc.GrpcTransactionManager)3 GrpcTwoPhaseCommitTransactionManager (com.scalar.db.transaction.rpc.GrpcTwoPhaseCommitTransactionManager)3 DatabaseConfig (com.scalar.db.config.DatabaseConfig)1 Before (org.junit.Before)1