use of org.bboxdb.distribution.zookeeper.ZookeeperException in project bboxdb by jnidzwetzki.
the class AbstractSpacePartitioner method prepareMerge.
@Override
public void prepareMerge(final List<DistributionRegion> source, final DistributionRegion destination) throws BBoxDBException {
try {
logger.debug("Merging region: {}", destination.getIdentifier());
distributionRegionZookeeperAdapter.setStateForDistributionRegion(destination, DistributionRegionState.REDISTRIBUTION_ACTIVE);
for (final DistributionRegion childRegion : source) {
final String zookeeperPathChild = distributionRegionZookeeperAdapter.getZookeeperPathForDistributionRegion(childRegion);
distributionRegionZookeeperAdapter.setStateForDistributionGroup(zookeeperPathChild, DistributionRegionState.MERGING);
}
} catch (ZookeeperException e) {
throw new BBoxDBException(e);
}
}
use of org.bboxdb.distribution.zookeeper.ZookeeperException in project bboxdb by jnidzwetzki.
the class AbstractTreeSpacePartitoner method mergeComplete.
@Override
public void mergeComplete(final List<DistributionRegion> source, final DistributionRegion destination) throws BBoxDBException {
try {
for (final DistributionRegion childRegion : source) {
logger.info("Merge done deleting: {}", childRegion.getIdentifier());
distributionRegionZookeeperAdapter.deleteChild(childRegion);
}
distributionRegionZookeeperAdapter.setStateForDistributionRegion(destination, DistributionRegionState.ACTIVE);
} catch (ZookeeperException e) {
throw new BBoxDBException(e);
}
}
use of org.bboxdb.distribution.zookeeper.ZookeeperException in project bboxdb by jnidzwetzki.
the class AbstractTreeSpacePartitoner method splitFailed.
@Override
public void splitFailed(final DistributionRegion sourceRegion, final List<DistributionRegion> destination) throws BBoxDBException {
try {
distributionRegionZookeeperAdapter.setStateForDistributionRegion(sourceRegion, DistributionRegionState.ACTIVE);
for (final DistributionRegion childRegion : destination) {
logger.info("Deleting child after failed split: {}", childRegion.getIdentifier());
distributionRegionZookeeperAdapter.deleteChild(childRegion);
}
} catch (ZookeeperException e) {
throw new BBoxDBException(e);
}
}
use of org.bboxdb.distribution.zookeeper.ZookeeperException in project bboxdb by jnidzwetzki.
the class DynamicgridSpacePartitioner method mergeComplete.
@Override
public void mergeComplete(final List<DistributionRegion> source, final DistributionRegion destination) throws BBoxDBException {
try {
for (final DistributionRegion childRegion : source) {
logger.info("Merge done deleting: {}", childRegion.getIdentifier());
distributionRegionZookeeperAdapter.deleteChild(childRegion);
}
distributionRegionZookeeperAdapter.setStateForDistributionRegion(destination, DistributionRegionState.ACTIVE);
} catch (ZookeeperException e) {
throw new BBoxDBException(e);
}
}
use of org.bboxdb.distribution.zookeeper.ZookeeperException in project bboxdb by jnidzwetzki.
the class KDtreeSpacePartitioner method splitRegion.
/**
* Split the node at the given position
* @param regionToSplit
* @param splitPosition
* @throws ZookeeperException
* @throws ResourceAllocationException
* @throws ZookeeperNotFoundException
*/
@Override
public List<DistributionRegion> splitRegion(final DistributionRegion regionToSplit, final Collection<BoundingBox> samples) throws BBoxDBException {
try {
final SplitpointStrategy splitpointStrategy = new SamplingBasedSplitStrategy(samples);
final int splitDimension = getSplitDimension(regionToSplit);
final BoundingBox regionBox = regionToSplit.getConveringBox();
final double splitPosition = splitpointStrategy.getSplitPoint(splitDimension, regionBox);
splitNode(regionToSplit, splitPosition);
return regionToSplit.getDirectChildren();
} catch (Exception e) {
throw new BBoxDBException(e);
}
}
Aggregations