use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.
the class StorageWithReservedKeywordIntegrationTestBase method setUp.
@Before
public void setUp() throws Exception {
if (!initialized) {
StorageFactory factory = new StorageFactory(getDatabaseConfig());
admin = factory.getAdmin();
namespace = getNamespace();
tableName = getTableName();
columnName1 = getColumnName1();
columnName2 = getColumnName2();
columnName3 = getColumnName3();
columnName4 = getColumnName4();
columnName5 = getColumnName5();
createTable();
storage = factory.getStorage();
initialized = true;
}
truncateTable();
storage.with(namespace, tableName);
}
use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.
the class StorageMultipleClusteringKeyScanIntegrationTestBase method setUp.
@Before
public void setUp() throws Exception {
if (!initialized) {
StorageFactory factory = new StorageFactory(TestUtils.addSuffix(getDatabaseConfig(), 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);
initialized = true;
}
}
use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.
the class ConsensusCommitIntegrationTestBase method setUp.
@Before
public void setUp() throws Exception {
if (!initialized) {
initialize();
DatabaseConfig config = TestUtils.addSuffix(getDatabaseConfig(), TEST_NAME);
StorageFactory factory = new StorageFactory(config);
admin = factory.getAdmin();
consensusCommitConfig = new ConsensusCommitConfig(config.getProperties());
consensusCommitAdmin = new ConsensusCommitAdmin(admin, consensusCommitConfig);
namespace1 = getNamespace1();
namespace2 = getNamespace2();
createTables();
originalStorage = factory.getStorage();
parallelExecutor = new ParallelExecutor(consensusCommitConfig);
initialized = true;
}
truncateTables();
storage = spy(originalStorage);
coordinator = spy(new Coordinator(storage, consensusCommitConfig));
TransactionalTableMetadataManager tableMetadataManager = new TransactionalTableMetadataManager(admin, -1);
recovery = spy(new RecoveryHandler(storage, coordinator, tableMetadataManager));
commit = spy(new CommitHandler(storage, coordinator, tableMetadataManager, parallelExecutor));
manager = new ConsensusCommitManager(storage, admin, consensusCommitConfig, coordinator, parallelExecutor, recovery, commit);
}
use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.
the class StorageSingleClusteringKeyScanIntegrationTestBase method setUp.
@Before
public void setUp() throws Exception {
if (!initialized) {
StorageFactory factory = new StorageFactory(TestUtils.addSuffix(getDatabaseConfig(), 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);
initialized = true;
}
}
use of com.scalar.db.service.StorageFactory in project scalardb by scalar-labs.
the class JdbcTransactionIntegrationTest method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws ExecutionException {
DatabaseConfig databaseConfig = TestUtils.addSuffix(JdbcEnv.getJdbcConfig(), TEST_NAME);
JdbcConfig config = new JdbcConfig(databaseConfig.getProperties());
StorageFactory factory = new StorageFactory(config);
admin = factory.getAdmin();
admin.createNamespace(NAMESPACE, true);
admin.createTable(NAMESPACE, TABLE, TableMetadata.newBuilder().addColumn(ACCOUNT_ID, DataType.INT).addColumn(ACCOUNT_TYPE, DataType.INT).addColumn(BALANCE, DataType.INT).addPartitionKey(ACCOUNT_ID).addClusteringKey(ACCOUNT_TYPE).build(), true);
manager = new JdbcTransactionManager(config);
}
Aggregations