use of org.bboxdb.distribution.partitioner.SpacePartitionerContext in project bboxdb by jnidzwetzki.
the class TestRegionSyncer method buildSyncer.
/**
* Build a new syncer
*/
private DistributionRegionSyncer buildSyncer() {
final Set<DistributionRegionCallback> callbacks = new CopyOnWriteArraySet<>();
final DistributionRegionIdMapper distributionRegionIdMapper = new DistributionRegionIdMapper(GROUP);
final SpacePartitionerContext spacePartitionerContext = new SpacePartitionerContext("", GROUP, ZookeeperClientFactory.getZookeeperClient(), callbacks, distributionRegionIdMapper);
return new DistributionRegionSyncer(spacePartitionerContext);
}
use of org.bboxdb.distribution.partitioner.SpacePartitionerContext in project bboxdb by jnidzwetzki.
the class DistributionGroupAdapter method getSpaceparitioner.
/**
* Get the space partitioner of a distribution group
* @param mapper
* @param callback
* @return
* @throws ZookeeperException
* @throws ZookeeperNotFoundException
*/
public SpacePartitioner getSpaceparitioner(final String distributionGroup, final Set<DistributionRegionCallback> callback, final DistributionRegionIdMapper mapper) throws ZookeeperException, ZookeeperNotFoundException {
final String path = getDistributionGroupPath(distributionGroup);
if (!zookeeperClient.exists(path)) {
final String exceptionMessage = MessageFormat.format("Unable to read {0}. Path {1} does not exist", distributionGroup, path);
throw new ZookeeperException(exceptionMessage);
}
final DistributionGroupConfiguration config = DistributionGroupConfigurationCache.getInstance().getDistributionGroupConfiguration(distributionGroup);
final SpacePartitionerContext spacePartitionerContext = new SpacePartitionerContext(config.getSpacePartitionerConfig(), distributionGroup, zookeeperClient, callback, mapper);
return SpacePartitionerFactory.getSpacePartitionerForDistributionGroup(spacePartitionerContext);
}
Aggregations