use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class TestSampling method beforeClass.
@BeforeClass
public static void beforeClass() throws InterruptedException, BBoxDBException {
distributionGroupZookeeperAdapter = ZookeeperClientFactory.getZookeeperClient().getDistributionGroupAdapter();
storageRegistry = new TupleStoreManagerRegistry();
storageRegistry.init();
}
use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class TestTupleSink method createTupleRedistributor.
/**
* Get the tuple redistributor
* @return
* @throws BBoxDBException
* @throws InterruptedException
*/
protected TupleRedistributor createTupleRedistributor() throws InterruptedException, BBoxDBException {
final TupleStoreName tupleStoreName = new TupleStoreName(TABLENAME.getFullname());
final TupleStoreManagerRegistry tupleStoreManagerRegistry = new TupleStoreManagerRegistry();
tupleStoreManagerRegistry.init();
return new TupleRedistributor(tupleStoreManagerRegistry, tupleStoreName);
}
use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class TestZookeeperIntegration method testTableCreateDelete.
/**
* Test the table deletion and creation
* @throws ZookeeperException
* @throws BBoxDBException
* @throws InterruptedException
*/
@Test(timeout = 60000)
public void testTableCreateDelete() throws Exception {
final TupleStoreAdapter tupleStoreAdapter = zookeeperClient.getTupleStoreAdapter();
final SpacePartitioner spacePartitioner = getSpacePartitioner();
final DistributionRegion rootNode = spacePartitioner.getRootNode();
final String rootPath = distributionRegionAdapter.getZookeeperPathForDistributionRegion(rootNode);
distributionRegionAdapter.addSystemToDistributionRegion(rootPath, ZookeeperClientFactory.getLocalInstanceName());
final TupleStoreName tupleStoreName = new TupleStoreName(TEST_GROUP + "_tabletest");
final TupleStoreName tupleStoreName0 = new TupleStoreName(TEST_GROUP + "_tabletest_0");
final TupleStoreConfiguration configuration = TupleStoreConfigurationBuilder.create().build();
tupleStoreAdapter.writeTuplestoreConfiguration(tupleStoreName, configuration);
final TupleStoreManagerRegistry storageRegistry = new TupleStoreManagerRegistry();
storageRegistry.init();
storageRegistry.deleteTable(tupleStoreName0, true);
storageRegistry.createTable(tupleStoreName0, configuration);
storageRegistry.getTupleStoreManager(tupleStoreName0);
Assert.assertTrue(storageRegistry.isStorageManagerKnown(tupleStoreName0));
System.out.println("=== Executing deletion");
tupleStoreAdapter.deleteTable(tupleStoreName0);
Thread.sleep(5000);
Assert.assertFalse(storageRegistry.isStorageManagerKnown(tupleStoreName0));
storageRegistry.shutdown();
}
use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class LocalSelftest method main.
public static void main(final String[] args) throws InterruptedException, ExecutionException, BBoxDBException, StorageManagerException, RejectedException {
if (args.length != 1) {
logger.error("Usage: LocalSelftest <Iterations>");
System.exit(-1);
}
try {
final int iterations = Integer.parseInt(args[0]);
logger.info("Running selftest......");
final TupleStoreManagerRegistry storageRegistry = new TupleStoreManagerRegistry();
storageRegistry.init();
final TupleStoreName sstable = new TupleStoreName(TABLENAME);
final TupleStoreManager storageManager = storageRegistry.getTupleStoreManager(sstable);
for (int iteration = 0; iteration < iterations; iteration++) {
logger.info("Running iteration {}", iteration);
storageRegistry.deleteTable(sstable, true);
testInsertDelete(storageManager);
}
storageRegistry.shutdown();
logger.info("Selftest done");
} catch (NumberFormatException e) {
logger.error("Unable to parse {} as a number, exiting", args[0]);
System.exit(-1);
}
}
use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class BBoxDBMain method init.
public void init() throws Exception {
logger.info("Init the BBoxDB");
services.clear();
// The storage registry
final TupleStoreManagerRegistry storageRegistry = new TupleStoreManagerRegistry();
services.add(storageRegistry);
// The zookeeper registerer
final ZookeeperInstanceRegisterer zookeeperClient = new ZookeeperInstanceRegisterer();
services.add(zookeeperClient);
// The membership connection service
final MembershipConnectionService membershipService = createMembershipService(storageRegistry);
services.add(membershipService);
// The network connection handler
final NetworkConnectionService connectionHandler = createConnectionHandler(storageRegistry);
services.add(connectionHandler);
// The recovery service
final DistributedRecoveryService recoveryService = new DistributedRecoveryService(storageRegistry);
services.add(recoveryService);
// The statistics update service
final StatisticsUpdateService statisticsService = new StatisticsUpdateService(storageRegistry);
services.add(statisticsService);
// The JMX service
final JMXService jmxService = new JMXService(this);
services.add(jmxService);
// The performance counter service
final PerformanceCounterService performanceCounterService = new PerformanceCounterService();
services.add(performanceCounterService);
// Send flush events to zookeeper
storageRegistry.registerSSTableFlushCallback(new TupleStoreFlushZookeeperAdapter());
}
Aggregations