Search in sources :

Example 1 with StaticgridSpacePartitioner

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

the class TestStaticgridSpacePartitioner method testRootElement.

@Test(timeout = 60000)
public void testRootElement() throws ZookeeperException, ZookeeperNotFoundException, BBoxDBException {
    final StaticgridSpacePartitioner 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 : StaticgridSpacePartitioner(org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner) DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) BoundingBox(org.bboxdb.commons.math.BoundingBox) Test(org.junit.Test)

Example 2 with StaticgridSpacePartitioner

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

the class TestStaticgridSpacePartitioner method createGridCells.

@Test(timeout = 60000)
public void createGridCells() throws ZookeeperException, ZookeeperNotFoundException, BBoxDBException {
    final StaticgridSpacePartitioner 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(120, regions);
}
Also used : StaticgridSpacePartitioner(org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner) DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) Test(org.junit.Test)

Example 3 with StaticgridSpacePartitioner

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

the class TestStaticgridSpacePartitioner2 method testMergeFailed.

/**
 * Test the merge failed call
 * @throws BBoxDBException
 * @throws ZookeeperNotFoundException
 * @throws ZookeeperException
 */
@Test(expected = BBoxDBException.class)
public void testMergeFailed() throws BBoxDBException, ZookeeperException, ZookeeperNotFoundException {
    final StaticgridSpacePartitioner spacePartitioner = getSpacePartitioner();
    spacePartitioner.mergeFailed(null, null);
}
Also used : StaticgridSpacePartitioner(org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner) Test(org.junit.Test)

Example 4 with StaticgridSpacePartitioner

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

the class TestStaticgridSpacePartitioner2 method testIsSplittable.

/**
 * Test the is splittable call
 * @throws ZookeeperNotFoundException
 * @throws ZookeeperException
 */
@Test(timeout = 60000)
public void testIsSplittable() throws ZookeeperException, ZookeeperNotFoundException {
    final StaticgridSpacePartitioner spacePartitioner = getSpacePartitioner();
    Assert.assertFalse(spacePartitioner.isSplitable(null));
}
Also used : StaticgridSpacePartitioner(org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner) Test(org.junit.Test)

Example 5 with StaticgridSpacePartitioner

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

the class TestStaticgridSpacePartitioner2 method testGetMergeCandidates.

/**
 * Get the merge candidates
 */
@Test(timeout = 60000)
public void testGetMergeCandidates() throws ZookeeperException, ZookeeperNotFoundException {
    final StaticgridSpacePartitioner spacePartitioner = getSpacePartitioner();
    Assert.assertTrue(spacePartitioner.getMergeCandidates(null).isEmpty());
}
Also used : StaticgridSpacePartitioner(org.bboxdb.distribution.partitioner.StaticgridSpacePartitioner) Test(org.junit.Test)

Aggregations

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