Search in sources :

Example 26 with DistributionGroupConfiguration

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);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) BeforeClass(org.junit.BeforeClass)

Example 27 with DistributionGroupConfiguration

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;
}
Also used : DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration)

Example 28 with DistributionGroupConfiguration

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());
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Test(org.junit.Test)

Example 29 with DistributionGroupConfiguration

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());
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Test(org.junit.Test)

Example 30 with DistributionGroupConfiguration

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);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Before(org.junit.Before)

Aggregations

DistributionGroupConfiguration (org.bboxdb.storage.entity.DistributionGroupConfiguration)43 Test (org.junit.Test)12 EmptyResultFuture (org.bboxdb.network.client.future.EmptyResultFuture)9 Before (org.junit.Before)7 ZookeeperNotFoundException (org.bboxdb.distribution.zookeeper.ZookeeperNotFoundException)4 BeforeClass (org.junit.BeforeClass)4 BoundingBox (org.bboxdb.commons.math.BoundingBox)3 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)3 ZookeeperException (org.bboxdb.distribution.zookeeper.ZookeeperException)3 BBoxDBException (org.bboxdb.misc.BBoxDBException)3 Tuple (org.bboxdb.storage.entity.Tuple)3 DistributionGroupAdapter (org.bboxdb.distribution.zookeeper.DistributionGroupAdapter)2 ZookeeperClient (org.bboxdb.distribution.zookeeper.ZookeeperClient)2 TupleStoreConfiguration (org.bboxdb.storage.entity.TupleStoreConfiguration)2 Cursor (java.awt.Cursor)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 HashSet (java.util.HashSet)1 Random (java.util.Random)1 InputParseException (org.bboxdb.commons.InputParseException)1