use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class TestTupleSink method before.
@BeforeClass
public static void before() throws ZookeeperException, BBoxDBException {
distributionGroupZookeeperAdapter = ZookeeperClientFactory.getZookeeperClient().getDistributionGroupAdapter();
tupleStoreAdapter = ZookeeperClientFactory.getZookeeperClient().getTupleStoreAdapter();
final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).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 TestDistributionGroup method createDistributionGroup.
/**
* @param dimensions
* @return
*/
private DistributionRegion createDistributionGroup(final int dimensions) {
final String name = "foo";
DistributionGroupConfigurationCache.getInstance().clear();
final DistributionGroupConfiguration config = new DistributionGroupConfiguration();
config.setDimensions(dimensions);
DistributionGroupConfigurationCache.getInstance().addNewConfiguration(name, config);
final DistributionRegion level0 = new DistributionRegion(name, BoundingBox.createFullCoveringDimensionBoundingBox(dimensions));
return level0;
}
use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class TestDistributionGroup method testDistributionGroupConfiguration1.
/**
* Test the distribution group config
*/
@Test(timeout = 60000)
public void testDistributionGroupConfiguration1() {
final DistributionGroupConfiguration config = DistributionGroupConfigurationBuilder.create(45).withMaximumRegionSize(342).withMinimumRegionSize(53454).withPlacementStrategy("place1", "place2").withSpacePartitioner("abc", "456").withReplicationFactor((short) 99).build();
Assert.assertEquals(45, config.getDimensions());
Assert.assertEquals(342, config.getMaximumRegionSize());
Assert.assertEquals(53454, config.getMinimumRegionSize());
Assert.assertEquals("place1", config.getPlacementStrategy());
Assert.assertEquals("place2", config.getPlacementStrategyConfig());
Assert.assertEquals("abc", config.getSpacePartitioner());
Assert.assertEquals("456", config.getSpacePartitionerConfig());
Assert.assertEquals((short) 99, config.getReplicationFactor());
}
use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class TestDistributionGroup method testDistributionGroupConfiguration2.
/**
* Test the distribution group config
*/
@Test(timeout = 60000)
public void testDistributionGroupConfiguration2() {
final DistributionGroupConfiguration config1 = DistributionGroupConfigurationBuilder.create(45).build();
final DistributionGroupConfiguration config2 = DistributionGroupConfigurationBuilder.create(45).build();
Assert.assertTrue(config1.toString().length() > 10);
Assert.assertEquals(config1, config2);
Assert.assertEquals(config1.hashCode(), config2.hashCode());
}
use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class TestZookeeperIntegration method before.
@Before
public void before() throws ZookeeperException, BBoxDBException {
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);
Assert.assertTrue(zookeeperClient.getClustername().length() > 5);
}
Aggregations