use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class DataRedistributionLoader method initBBoxDB.
/**
* Re-Create the distribution group and the table
*/
private void initBBoxDB() {
try {
// Delete old distribution group
System.out.println("Delete old distribution group");
final EmptyResultFuture dgroupDeleteResult = bboxDBCluster.deleteDistributionGroup(DGROUP);
dgroupDeleteResult.waitForAll();
if (dgroupDeleteResult.isFailed()) {
System.err.println(dgroupDeleteResult.getAllMessages());
System.exit(-1);
}
// Create new distribution group
System.out.println("Create new distribution group");
final DistributionGroupConfiguration dgroupConfig = DistributionGroupConfigurationBuilder.create(2).withReplicationFactor((short) 1).withMaximumRegionSize(16).withMinimumRegionSize(4).build();
final EmptyResultFuture dgroupCreateResult = bboxDBCluster.createDistributionGroup(DGROUP, dgroupConfig);
dgroupCreateResult.waitForAll();
if (dgroupCreateResult.isFailed()) {
System.err.println(dgroupCreateResult.getAllMessages());
System.exit(-1);
}
// Create new table
System.out.println("Create new table");
final TupleStoreConfiguration storeConfiguration = TupleStoreConfigurationBuilder.create().allowDuplicates(false).build();
final EmptyResultFuture tableCreateResult = bboxDBCluster.createTable(TABLE, storeConfiguration);
tableCreateResult.waitForAll();
if (tableCreateResult.isFailed()) {
System.err.println(tableCreateResult.getAllMessages());
System.exit(-1);
}
} catch (Exception e) {
System.err.println("Got an exception while prepating BBoxDB");
e.printStackTrace();
System.exit(-1);
}
}
use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class RegionSplitHelper method getConfiguredRegionMaxSize.
/**
* Get maximal size of a region
* @return
* @throws ZookeeperNotFoundException
* @throws ZookeeperException
*/
private static long getConfiguredRegionMaxSize(final DistributionRegion region) throws ZookeeperException, ZookeeperNotFoundException {
final String fullname = region.getDistributionGroupName();
final DistributionGroupConfiguration config = DistributionGroupConfigurationCache.getInstance().getDistributionGroupConfiguration(fullname);
return config.getMaximumRegionSize();
}
use of org.bboxdb.storage.entity.DistributionGroupConfiguration in project bboxdb by jnidzwetzki.
the class KDtreeSpacePartitioner method getDimension.
/**
* Get the dimension of the distribution region
* @return
*/
private int getDimension() {
try {
final DistributionGroupConfigurationCache instance = DistributionGroupConfigurationCache.getInstance();
final DistributionGroupConfiguration config = instance.getDistributionGroupConfiguration(distributionGroupName);
return config.getDimensions();
} catch (ZookeeperNotFoundException e) {
throw new RuntimeException(e);
}
}
Aggregations