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);
}
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));
}
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);
}
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());
}
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());
}
Aggregations