Search in sources :

Example 1 with DynamicgridSpacePartitioner

use of org.bboxdb.distribution.partitioner.DynamicgridSpacePartitioner in project bboxdb by jnidzwetzki.

the class TestDynamicgridSpacePartitioner method testRootElement.

@Test(timeout = 60000)
public void testRootElement() throws ZookeeperException, ZookeeperNotFoundException, BBoxDBException {
    final DynamicgridSpacePartitioner spacePartitioner = getSpacePartitioner();
    final DistributionRegion rootElement = spacePartitioner.getRootNode();
    Assert.assertEquals(rootElement.getState(), DistributionRegionState.SPLIT);
    final BoundingBox box = rootElement.getConveringBox();
    Assert.assertEquals(new BoundingBox(0.0, 5.0, 0.0, 6.0), box);
}
Also used : DynamicgridSpacePartitioner(org.bboxdb.distribution.partitioner.DynamicgridSpacePartitioner) DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) BoundingBox(org.bboxdb.commons.math.BoundingBox) Test(org.junit.Test)

Example 2 with DynamicgridSpacePartitioner

use of org.bboxdb.distribution.partitioner.DynamicgridSpacePartitioner in project bboxdb by jnidzwetzki.

the class TestDynamicgridSpacePartitioner method createGridCells.

@Test(timeout = 60000)
public void createGridCells() throws ZookeeperException, ZookeeperNotFoundException, BBoxDBException {
    final DynamicgridSpacePartitioner spacePartitioner = getSpacePartitioner();
    final DistributionRegion rootElement = spacePartitioner.getRootNode();
    final long regions = rootElement.getThisAndChildRegions().stream().map(r -> r.getState()).filter(DistributionRegionHelper.PREDICATE_REGIONS_FOR_WRITE).count();
    Assert.assertEquals(12, regions);
}
Also used : DynamicgridSpacePartitioner(org.bboxdb.distribution.partitioner.DynamicgridSpacePartitioner) DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) Test(org.junit.Test)

Aggregations

DynamicgridSpacePartitioner (org.bboxdb.distribution.partitioner.DynamicgridSpacePartitioner)2 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)2 Test (org.junit.Test)2 BoundingBox (org.bboxdb.commons.math.BoundingBox)1