Search in sources :

Example 6 with DiskStorage

use of org.bboxdb.storage.tuplestore.DiskStorage in project bboxdb by jnidzwetzki.

the class DistributedRecoveryService method runRecoveryForDistributionGroup.

/**
 * Run recovery for distribution group
 * @param distributionGroupName
 * @throws ZookeeperException
 */
protected void runRecoveryForDistributionGroup(final String distributionGroupName) {
    try {
        final ZookeeperClient zookeeperClient = ZookeeperClientFactory.getZookeeperClient();
        final BBoxDBInstance localInstance = ZookeeperClientFactory.getLocalInstanceName();
        for (final DiskStorage storage : storageRegistry.getAllStorages()) {
            checkGroupVersion(storage, distributionGroupName, zookeeperClient);
        }
        final SpacePartitioner spacePartitioner = SpacePartitionerCache.getInstance().getSpacePartitionerForGroupName(distributionGroupName);
        final DistributionRegion distributionGroup = spacePartitioner.getRootNode();
        final List<OutdatedDistributionRegion> outdatedRegions = DistributionRegionHelper.getOutdatedRegions(distributionGroup, localInstance);
        handleOutdatedRegions(distributionGroupName, outdatedRegions);
    } catch (Throwable e) {
        logger.error("Got exception while running recovery for distribution group: " + distributionGroupName, e);
    }
}
Also used : ZookeeperClient(org.bboxdb.distribution.zookeeper.ZookeeperClient) DistributionRegion(org.bboxdb.distribution.region.DistributionRegion) BBoxDBInstance(org.bboxdb.distribution.membership.BBoxDBInstance) DiskStorage(org.bboxdb.storage.tuplestore.DiskStorage) SpacePartitioner(org.bboxdb.distribution.partitioner.SpacePartitioner)

Aggregations

DiskStorage (org.bboxdb.storage.tuplestore.DiskStorage)6 StorageManagerException (org.bboxdb.storage.StorageManagerException)4 File (java.io.File)2 BBoxDBException (org.bboxdb.misc.BBoxDBException)2 Lists (com.google.common.collect.Lists)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 RejectedException (org.bboxdb.commons.RejectedException)1 BoundingBox (org.bboxdb.commons.math.BoundingBox)1 BBoxDBInstance (org.bboxdb.distribution.membership.BBoxDBInstance)1 SpacePartitioner (org.bboxdb.distribution.partitioner.SpacePartitioner)1 DistributionRegion (org.bboxdb.distribution.region.DistributionRegion)1 ZookeeperClient (org.bboxdb.distribution.zookeeper.ZookeeperClient)1 BBoxDBConfigurationManager (org.bboxdb.misc.BBoxDBConfigurationManager)1 DeletedTuple (org.bboxdb.storage.entity.DeletedTuple)1 Tuple (org.bboxdb.storage.entity.Tuple)1