Search in sources :

Example 1 with RegionMerger

use of org.bboxdb.distribution.partitioner.regionsplit.RegionMerger in project bboxdb by jnidzwetzki.

the class SSTableServiceRunnable method testForUnderflow.

/**
 * Test for region underflow
 *
 * @param spacePartitioner
 * @param regionToMerge
 * @throws BBoxDBException
 */
private void testForUnderflow(final SpacePartitioner spacePartitioner, final DistributionRegion oneSourceNode) throws BBoxDBException {
    final List<List<DistributionRegion>> candidates = spacePartitioner.getMergeCandidates(oneSourceNode);
    for (final List<DistributionRegion> sources : candidates) {
        if (RegionMergeHelper.isRegionUnderflow(sources)) {
            final TupleStoreManagerRegistry tupleStoreManagerRegistry = storage.getTupleStoreManagerRegistry();
            final RegionMerger regionMerger = new RegionMerger(tupleStoreManagerRegistry);
            regionMerger.mergeRegion(sources, spacePartitioner, tupleStoreManagerRegistry);
            return;
        }
    }
}
Also used : DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) TupleStoreManagerRegistry(org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry) RegionMerger(org.bboxdb.distribution.partitioner.regionsplit.RegionMerger) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 RegionMerger (org.bboxdb.distribution.partitioner.regionsplit.RegionMerger)1 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)1 TupleStoreManagerRegistry (org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry)1