use of org.bboxdb.storage.entity.TupleStoreConfiguration in project bboxdb by jnidzwetzki.
the class TestQueryProcessing method init.
@Before
public void init() throws StorageManagerException {
storageRegistry.deleteTable(TABLE_1, true);
storageRegistry.createTable(TABLE_1, new TupleStoreConfiguration());
storageRegistry.deleteTable(TABLE_2, true);
storageRegistry.createTable(TABLE_2, new TupleStoreConfiguration());
storageRegistry.deleteTable(TABLE_3, true);
storageRegistry.createTable(TABLE_3, new TupleStoreConfiguration());
}
use of org.bboxdb.storage.entity.TupleStoreConfiguration in project bboxdb by jnidzwetzki.
the class TestStorageManager method init.
@Before
public void init() throws StorageManagerException {
// Delete the old table
storageRegistry.deleteTable(TEST_RELATION, true);
// Create a new table
final TupleStoreConfiguration tupleStoreConfiguration = TupleStoreConfigurationBuilder.create().build();
storageRegistry.createTable(TEST_RELATION, tupleStoreConfiguration);
// Assure table is created successfully
storageManager = storageRegistry.getTupleStoreManager(TEST_RELATION);
Assert.assertTrue(storageManager.getServiceState().isInRunningState());
}
use of org.bboxdb.storage.entity.TupleStoreConfiguration in project bboxdb by jnidzwetzki.
the class TestStorageManager method testWithDuplicates.
/**
* Test the storage manager with duplicates
* @throws StorageManagerException
* @throws RejectedException
*/
@Test(timeout = 60000)
public void testWithDuplicates() throws StorageManagerException, RejectedException {
// Delete the old table
storageRegistry.deleteTable(TEST_RELATION, true);
// Create a new table
final TupleStoreConfiguration tupleStoreConfiguration = TupleStoreConfigurationBuilder.create().allowDuplicates(true).build();
storageRegistry.createTable(TEST_RELATION, tupleStoreConfiguration);
// Assure table is created successfully
storageManager = storageRegistry.getTupleStoreManager(TEST_RELATION);
Assert.assertTrue(storageManager.getServiceState().isInRunningState());
final Tuple tuple1 = new Tuple("abc", BoundingBox.FULL_SPACE, "abc1".getBytes());
storageManager.put(tuple1);
final Tuple tuple2 = new Tuple("abc", BoundingBox.FULL_SPACE, "abc2".getBytes());
storageManager.put(tuple2);
final Tuple tuple3 = new Tuple("abc", BoundingBox.FULL_SPACE, "abc3".getBytes());
storageManager.put(tuple3);
final Tuple tuple4 = new Tuple("abc", BoundingBox.FULL_SPACE, "abc4".getBytes());
storageManager.put(tuple4);
final Tuple tuple5 = new Tuple("abc", BoundingBox.FULL_SPACE, "abc5".getBytes());
storageManager.put(tuple5);
final List<Tuple> readTuples = storageManager.get("abc");
Assert.assertEquals(5, readTuples.size());
Assert.assertTrue(readTuples.contains(tuple1));
Assert.assertTrue(readTuples.contains(tuple2));
Assert.assertTrue(readTuples.contains(tuple3));
Assert.assertTrue(readTuples.contains(tuple4));
Assert.assertTrue(readTuples.contains(tuple5));
}
use of org.bboxdb.storage.entity.TupleStoreConfiguration in project bboxdb by jnidzwetzki.
the class TestStorageRegistry method testCalculateSize.
/**
* Calculate the size of a distribution group
* @throws StorageManagerException
* @throws InterruptedException
* @throws RejectedException
*/
@Test(timeout = 60000)
public void testCalculateSize() throws StorageManagerException, InterruptedException, RejectedException {
storageRegistry.deleteTable(RELATION_NAME, true);
Assert.assertFalse(storageRegistry.isStorageManagerActive(RELATION_NAME));
storageRegistry.createTable(RELATION_NAME, new TupleStoreConfiguration());
final TupleStoreManager storageManager = storageRegistry.getTupleStoreManager(RELATION_NAME);
for (int i = 0; i < 50000; i++) {
final Tuple createdTuple = new Tuple(Integer.toString(i), BoundingBox.FULL_SPACE, Integer.toString(i).getBytes());
storageManager.put(createdTuple);
}
// Wait for requests to settle
storageManager.flush();
final List<TupleStoreName> tablesBeforeDelete = storageRegistry.getAllTables();
System.out.println(tablesBeforeDelete);
Assert.assertTrue(tablesBeforeDelete.contains(RELATION_NAME));
final long size1 = TupleStoreUtil.getSizeOfDistributionGroupAndRegionId(storageRegistry, RELATION_NAME.getDistributionGroup(), 2);
Assert.assertTrue(size1 > 0);
storageRegistry.deleteTable(RELATION_NAME, true);
final List<TupleStoreName> tablesAfterDelete = storageRegistry.getAllTables();
System.out.println(tablesAfterDelete);
Assert.assertFalse(tablesAfterDelete.contains(RELATION_NAME));
final long size2 = TupleStoreUtil.getSizeOfDistributionGroupAndRegionId(storageRegistry, RELATION_NAME.getDistributionGroup(), 2);
Assert.assertTrue(size2 == 0);
}
use of org.bboxdb.storage.entity.TupleStoreConfiguration in project bboxdb by jnidzwetzki.
the class TestStorageRegistry method testRegisterAndUnregister.
/**
* Test registering and unregistering the storage manager
* @throws StorageManagerException
*
* @throws Exception
*/
@Test(timeout = 60000)
public void testRegisterAndUnregister() throws StorageManagerException {
storageRegistry.deleteTable(RELATION_NAME, true);
Assert.assertFalse(storageRegistry.isStorageManagerActive(RELATION_NAME));
storageRegistry.createTable(RELATION_NAME, new TupleStoreConfiguration());
storageRegistry.getTupleStoreManager(RELATION_NAME);
Assert.assertTrue(storageRegistry.isStorageManagerActive(RELATION_NAME));
storageRegistry.shutdownSStable(RELATION_NAME);
Assert.assertFalse(storageRegistry.isStorageManagerActive(RELATION_NAME));
}
Aggregations