Search in sources :

Example 1 with GrpcTwoPhaseCommitTransactionManager

use of com.scalar.db.transaction.rpc.GrpcTwoPhaseCommitTransactionManager 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 2 with GrpcTwoPhaseCommitTransactionManager

use of com.scalar.db.transaction.rpc.GrpcTwoPhaseCommitTransactionManager 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 3 with GrpcTwoPhaseCommitTransactionManager

use of com.scalar.db.transaction.rpc.GrpcTwoPhaseCommitTransactionManager in project scalardb by scalar-labs.

the class TwoPhaseCommitTransactionServiceWithTwoPhaseConsensusCommitIntegrationTest 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 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)

Aggregations

StorageFactory (com.scalar.db.service.StorageFactory)3 GrpcConfig (com.scalar.db.storage.rpc.GrpcConfig)3 ConsensusCommitAdmin (com.scalar.db.transaction.consensuscommit.ConsensusCommitAdmin)3 ConsensusCommitConfig (com.scalar.db.transaction.consensuscommit.ConsensusCommitConfig)3 GrpcTwoPhaseCommitTransactionManager (com.scalar.db.transaction.rpc.GrpcTwoPhaseCommitTransactionManager)3 BeforeClass (org.junit.BeforeClass)3