use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class TestDynamicgridSpacePartitioner method before.
@Before
public void before() throws ZookeeperException, BBoxDBException {
final String config = "[[0.0,5.0]:[0.0,6.0]];0.5";
final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.DynamicgridSpacePartitioner", config).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 TestKDtreeSpacePartitioner method createNewDistributionGroup.
/**
* Create a new distribution group
*
* @param dimension
* @throws ZookeeperException
* @throws BBoxDBException
*/
private void createNewDistributionGroup(int dimension) throws ZookeeperException, BBoxDBException {
final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(dimension).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 testRestrictedSpace.
/**
* Test the restricted space
* @throws ZookeeperException
* @throws BBoxDBException
* @throws ZookeeperNotFoundException
*/
@Test(timeout = 60000)
public void testRestrictedSpace() throws ZookeeperException, BBoxDBException, ZookeeperNotFoundException {
final BoundingBox completeSpace = new BoundingBox(0d, 10d, 0d, 10d);
final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.QuadtreeSpacePartitioner", completeSpace.toCompactString()).withPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy", "").build();
distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
final QuadtreeSpacePartitioner spacepartitionier = getSpacePartitioner();
final DistributionRegion rootNode = spacepartitionier.getRootNode();
Assert.assertEquals(completeSpace, rootNode.getConveringBox());
spacepartitionier.splitRegion(rootNode, new HashSet<>());
Assert.assertEquals("[[0.0,5.0):[0.0,5.0)]", rootNode.getChildNumber(0).getConveringBox().toCompactString());
Assert.assertEquals("[[5.0,10.0]:[0.0,5.0)]", rootNode.getChildNumber(1).getConveringBox().toCompactString());
Assert.assertEquals("[[0.0,5.0):[5.0,10.0]]", rootNode.getChildNumber(2).getConveringBox().toCompactString());
Assert.assertEquals("[[5.0,10.0]:[5.0,10.0]]", rootNode.getChildNumber(3).getConveringBox().toCompactString());
}
use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class TestSpacePartitionerCache method testRootNodeRefresh.
@Test(timeout = 60000)
public void testRootNodeRefresh() throws Exception {
final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy", "").build();
distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
final KDtreeSpacePartitioner oldSpacepartitionier = (KDtreeSpacePartitioner) SpacePartitionerCache.getInstance().getSpacePartitionerForGroupName(TEST_GROUP);
final DistributionRegion oldRootNode = oldSpacepartitionier.getRootNode();
final DistributionRegionIdMapper mapper = oldSpacepartitionier.getDistributionRegionIdMapper();
Assert.assertEquals(0, mapper.getAllRegionIds().size());
mapper.addMapping(3, BoundingBox.FULL_SPACE);
Assert.assertEquals(1, mapper.getAllRegionIds().size());
distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
final KDtreeSpacePartitioner newSpacepartitionier1 = (KDtreeSpacePartitioner) SpacePartitionerCache.getInstance().getSpacePartitionerForGroupName(TEST_GROUP);
final DistributionRegion newRootNode = newSpacepartitionier1.getRootNode();
Assert.assertFalse(oldRootNode == newRootNode);
Assert.assertEquals(0, mapper.getAllRegionIds().size());
distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
Thread.sleep(1000);
final KDtreeSpacePartitioner newSpacepartitionier2 = (KDtreeSpacePartitioner) SpacePartitionerCache.getInstance().getSpacePartitionerForGroupName(TEST_GROUP);
final DistributionRegion newRootNode2 = newSpacepartitionier2.getRootNode();
Assert.assertFalse(newRootNode2 == newRootNode);
}
use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class TestStaticgridSpacePartitioner method before.
@Before
public void before() throws ZookeeperException, BBoxDBException {
final String config = "[[0.0,5.0]:[0.0,6.0]];0.5;0.5";
final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withSpacePartitioner("org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner", config).withPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy", "").build();
distributionGroupZookeeperAdapter.deleteDistributionGroup(TEST_GROUP);
distributionGroupZookeeperAdapter.createDistributionGroup(TEST_GROUP, configuration);
}
Aggregations