Search in sources :

Example 11 with TupleStoreManagerRegistry

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();
}
Also used : TupleStoreManagerRegistry(org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry) BeforeClass(org.junit.BeforeClass)

Example 12 with TupleStoreManagerRegistry

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);
}
Also used : TupleRedistributor(org.bboxdb.distribution.partitioner.regionsplit.tuplesink.TupleRedistributor) TupleStoreManagerRegistry(org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry) TupleStoreName(org.bboxdb.storage.entity.TupleStoreName)

Example 13 with TupleStoreManagerRegistry

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();
}
Also used : DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) TupleStoreConfiguration(org.bboxdb.storage.entity.TupleStoreConfiguration) TupleStoreManagerRegistry(org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry) TupleStoreAdapter(org.bboxdb.distribution.zookeeper.TupleStoreAdapter) TupleStoreName(org.bboxdb.storage.entity.TupleStoreName) SpacePartitioner(org.bboxdb.distribution.partitioner.SpacePartitioner) KDtreeSpacePartitioner(org.bboxdb.distribution.partitioner.KDtreeSpacePartitioner) Test(org.junit.Test)

Example 14 with TupleStoreManagerRegistry

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);
    }
}
Also used : TupleStoreManagerRegistry(org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry) TupleStoreName(org.bboxdb.storage.entity.TupleStoreName) TupleStoreManager(org.bboxdb.storage.tuplestore.manager.TupleStoreManager)

Example 15 with TupleStoreManagerRegistry

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());
}
Also used : NetworkConnectionService(org.bboxdb.network.server.NetworkConnectionService) DistributedRecoveryService(org.bboxdb.distribution.DistributedRecoveryService) PerformanceCounterService(org.bboxdb.performance.PerformanceCounterService) JMXService(org.bboxdb.jmx.JMXService) ZookeeperInstanceRegisterer(org.bboxdb.distribution.zookeeper.ZookeeperInstanceRegisterer) TupleStoreManagerRegistry(org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry) MembershipConnectionService(org.bboxdb.distribution.membership.MembershipConnectionService) StatisticsUpdateService(org.bboxdb.distribution.statistics.StatisticsUpdateService) TupleStoreFlushZookeeperAdapter(org.bboxdb.distribution.TupleStoreFlushZookeeperAdapter)

Aggregations

TupleStoreManagerRegistry (org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry)21 TupleStoreName (org.bboxdb.storage.entity.TupleStoreName)10 BeforeClass (org.junit.BeforeClass)5 StorageManagerException (org.bboxdb.storage.StorageManagerException)4 ArrayList (java.util.ArrayList)3 ZookeeperException (org.bboxdb.distribution.zookeeper.ZookeeperException)3 TupleStoreManager (org.bboxdb.storage.tuplestore.manager.TupleStoreManager)3 SpacePartitioner (org.bboxdb.distribution.partitioner.SpacePartitioner)2 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)2 TupleStoreAdapter (org.bboxdb.distribution.zookeeper.TupleStoreAdapter)2 BBoxDBException (org.bboxdb.misc.BBoxDBException)2 Tuple (org.bboxdb.storage.entity.Tuple)2 File (java.io.File)1 List (java.util.List)1 DistributedRecoveryService (org.bboxdb.distribution.DistributedRecoveryService)1 TupleStoreFlushZookeeperAdapter (org.bboxdb.distribution.TupleStoreFlushZookeeperAdapter)1 MembershipConnectionService (org.bboxdb.distribution.membership.MembershipConnectionService)1 KDtreeSpacePartitioner (org.bboxdb.distribution.partitioner.KDtreeSpacePartitioner)1 RegionMerger (org.bboxdb.distribution.partitioner.regionsplit.RegionMerger)1 RegionSplitter (org.bboxdb.distribution.partitioner.regionsplit.RegionSplitter)1