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);
}
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);
}
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);
}
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);
}
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());
}
Aggregations