Search in sources :

Example 1 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestStorageRegistry method beforeClass.

@BeforeClass
public static void beforeClass() throws InterruptedException, BBoxDBException, ZookeeperException {
    storageRegistry = new TupleStoreManagerRegistry();
    storageRegistry.init();
    final ZookeeperClient zookeeperClient = ZookeeperClientFactory.getZookeeperClient();
    final DistributionGroupAdapter adapter = new DistributionGroupAdapter(zookeeperClient);
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy", "").build();
    adapter.createDistributionGroup(RELATION_NAME.getDistributionGroup(), configuration);
}
Also used : ZookeeperClient(org.bboxdb.distribution.zookeeper.ZookeeperClient) DistributionGroupAdapter(org.bboxdb.distribution.zookeeper.DistributionGroupAdapter) TupleStoreManagerRegistry(org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry) DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) BeforeClass(org.junit.BeforeClass)

Example 2 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestRegionIdMapper method before.

@BeforeClass
public static void before() {
    DistributionGroupConfigurationCache.getInstance().clear();
    DistributionGroupConfigurationCache.getInstance().addNewConfiguration(DISTRIBUTION_REGION_NAME, new DistributionGroupConfiguration(2));
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) BeforeClass(org.junit.BeforeClass)

Example 3 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestRegionSyncer method before.

@Before
public void before() throws ZookeeperException, BBoxDBException {
    final DistributionGroupConfiguration configuration = DistributionGroupConfigurationBuilder.create(2).withPlacementStrategy("org.bboxdb.distribution.placement.DummyResourcePlacementStrategy", "").build();
    distributionGroupAdapter.deleteDistributionGroup(GROUP);
    distributionGroupAdapter.createDistributionGroup(GROUP, configuration);
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Before(org.junit.Before)

Example 4 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestNetworkClasses method encodeAndDecodeCreateDistributionGroup.

/**
 * The the encoding and decoding of an create distribution group package
 * @throws IOException
 * @throws PackageEncodeException
 */
@Test(timeout = 60000)
public void encodeAndDecodeCreateDistributionGroup() throws IOException, PackageEncodeException {
    final short sequenceNumber = sequenceNumberGenerator.getNextSequenceNummber();
    final DistributionGroupConfiguration distributionGroupConfiguration = DistributionGroupConfigurationBuilder.create(4).withPlacementStrategy("abc", "def").withSpacePartitioner("efg", "ijh").withMaximumRegionSize(33333).withMinimumRegionSize(1111).withReplicationFactor((short) 11).build();
    final CreateDistributionGroupRequest groupPackage = new CreateDistributionGroupRequest(sequenceNumber, "test", distributionGroupConfiguration);
    byte[] encodedVersion = networkPackageToByte(groupPackage);
    Assert.assertNotNull(encodedVersion);
    final ByteBuffer bb = NetworkPackageDecoder.encapsulateBytes(encodedVersion);
    final CreateDistributionGroupRequest decodedPackage = CreateDistributionGroupRequest.decodeTuple(bb);
    Assert.assertEquals(groupPackage.getDistributionGroup(), decodedPackage.getDistributionGroup());
    Assert.assertEquals(groupPackage.getDistributionGroupConfiguration(), distributionGroupConfiguration);
    Assert.assertEquals(groupPackage.hashCode(), decodedPackage.hashCode());
    Assert.assertEquals(groupPackage.toString(), decodedPackage.toString());
}
Also used : CreateDistributionGroupRequest(org.bboxdb.network.packages.request.CreateDistributionGroupRequest) DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) ByteBuffer(java.nio.ByteBuffer) Test(org.junit.Test)

Example 5 with DistributionGroupConfiguration

use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.

the class TestZookeeperIntegration method testDistributionGroupReplicationFactor.

/**
 * Test the replication factor of a distribution group
 * @throws ZookeeperException
 * @throws ZookeeperNotFoundException
 * @throws BBoxDBException
 */
@Test(timeout = 60000)
public void testDistributionGroupReplicationFactor() throws ZookeeperException, ZookeeperNotFoundException, BBoxDBException {
    final DistributionGroupConfiguration config = DistributionGroupConfigurationCache.getInstance().getDistributionGroupConfiguration(TEST_GROUP);
    Assert.assertEquals(1, config.getReplicationFactor());
}
Also used : DistributionGroupConfiguration(org.bboxdb.storage.entity.DistributionGroupConfiguration) Test(org.junit.Test)

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