Search in sources :

Example 6 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestZookeeperIntegration method testDistributionGroupConfiguration.

/**
 * Test the reading and the writing of the distribution group configuration
 * @throws ZookeeperException
 * @throws InputParseException
 * @throws ZookeeperNotFoundException
 * @throws BBoxDBException
 */
@Test(timeout = 60000)
public void testDistributionGroupConfiguration() throws ZookeeperException, ZookeeperNotFoundException, InputParseException, BBoxDBException {
    final DistributionGroupConfiguration configuration = new DistributionGroupConfiguration(45);
    configuration.setMaximumRegionSize(342);
    configuration.setMinimumRegionSize(53454);
    configuration.setPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy");
    configuration.setPlacementStrategyConfig("def");
    configuration.setReplicationFactor((short) 99);
    configuration.setSpacePartitioner(Const.DEFAULT_SPACE_PARTITIONER);
    configuration.setSpacePartitionerConfig("xyz");
    distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
    distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
    final DistributionGroupConfiguration readConfiguration = distributionGroupZookeeperAdapter.getDistributionGroupConfiguration(TEST_GROUP);
    Assert.assertEquals(configuration, readConfiguration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Test(org.junit.Test)

Example 7 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestKDtreeSpacePartitioner method before.

@Before
public void before() throws ZookeeperException, BBoxDBException {
    distributionGroupZookeeperAdapter = ZookeeperClientFactory.getZookeeperClient().getDistributionGroupAdapter();
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withReplicationFactor((short) 1).withPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy", "").build();
    distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
    distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Before(org.junit.Before)

Example 8 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestQuadtreeSpacePartitioner method before.

@Before
public void before() throws ZookeeperException, BBoxDBException {
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.QuadtreeSpacePartitioner", "").withPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy", "").build();
    distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
    distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Before(org.junit.Before)

Example 9 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestStaticgridSpacePartitioner2 method testInvalidConfiguration1.

@Test(expected = BBoxDBException.class)
public void testInvalidConfiguration1() throws ZookeeperException, BBoxDBException {
    final String config = "abc";
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner", config).build();
    distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
    distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Test(org.junit.Test)

Example 10 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestHelper method recreateDistributionGroup.

/**
 * Recreate the given distribution group
 * @param client
 * @param DISTRIBUTION_GROUP
 * @throws InterruptedException
 * @throws BBoxDBException
 */
public static void recreateDistributionGroup(final BBoxDB client, final String DISTRIBUTION_GROUP) throws InterruptedException, BBoxDBException {
    // Delete distribution group
    final EmptyResultFuture resultDelete = client.deleteDistributionGroup(DISTRIBUTION_GROUP);
    resultDelete.waitForAll();
    Assert.assertFalse(resultDelete.isFailed());
    // Create distribution group
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withReplicationFactor((short) 1).build();
    final EmptyResultFuture resultCreate = client.createDistributionGroup(DISTRIBUTION_GROUP, configuration);
    resultCreate.waitForAll();
    Assert.assertFalse(resultCreate.isFailed());
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) EmptyResultFuture(org.bboxdb.network.client.future.EmptyResultFuture)

Aggregations

DistributionGroupConfiguration (org.bboxdb.storage.entity.DistributionGroupConfiguration)43 Test (org.junit.Test)12 EmptyResultFuture (org.bboxdb.network.client.future.EmptyResultFuture)9 Before (org.junit.Before)7 ZookeeperNotFoundException (org.bboxdb.distribution.zookeeper.ZookeeperNotFoundException)4 BeforeClass (org.junit.BeforeClass)4 BoundingBox (org.bboxdb.commons.math.BoundingBox)3 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)3 ZookeeperException (org.bboxdb.distribution.zookeeper.ZookeeperException)3 BBoxDBException (org.bboxdb.misc.BBoxDBException)3 Tuple (org.bboxdb.storage.entity.Tuple)3 DistributionGroupAdapter (org.bboxdb.distribution.zookeeper.DistributionGroupAdapter)2 ZookeeperClient (org.bboxdb.distribution.zookeeper.ZookeeperClient)2 TupleStoreConfiguration (org.bboxdb.storage.entity.TupleStoreConfiguration)2 Cursor (java.awt.Cursor)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 HashSet (java.util.HashSet)1 Random (java.util.Random)1 InputParseException (org.bboxdb.commons.InputParseException)1