Search in sources :

Example 11 with ReadOnlyTupleStore

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

the class SamplingHelper method getSamples.

/**
 * Get the samples
 *
 * @param boundingBox
 * @param splitDimension
 * @param tables
 * @return
 * @throws StorageManagerException
 */
private static List<BoundingBox> getSamples(final BoundingBox boundingBox, final TupleStoreManagerRegistry tupleStoreManagerRegistry, final List<TupleStoreName> tables) throws StorageManagerException {
    final List<BoundingBox> allPointSamples = new ArrayList<>();
    for (final TupleStoreName ssTableName : tables) {
        logger.info("Create split samples for table: {} ", ssTableName.getFullname());
        final TupleStoreManager sstableManager = tupleStoreManagerRegistry.getTupleStoreManager(ssTableName);
        final List<ReadOnlyTupleStore> tupleStores = sstableManager.getAllTupleStorages();
        final List<BoundingBox> pointSamples = processTupleStores(tupleStores);
        allPointSamples.addAll(pointSamples);
        logger.info("Create split samples for table: {} DONE. Got {} samples.", ssTableName.getFullname(), pointSamples.size());
    }
    return allPointSamples;
}
Also used : BoundingBox(org.bboxdb.commons.math.BoundingBox) ArrayList(java.util.ArrayList) TupleStoreName(org.bboxdb.storage.entity.TupleStoreName) ReadOnlyTupleStore(org.bboxdb.storage.tuplestore.ReadOnlyTupleStore) TupleStoreManager(org.bboxdb.storage.tuplestore.manager.TupleStoreManager)

Aggregations

ReadOnlyTupleStore (org.bboxdb.storage.tuplestore.ReadOnlyTupleStore)11 ArrayList (java.util.ArrayList)9 StorageManagerException (org.bboxdb.storage.StorageManagerException)7 BBoxDBException (org.bboxdb.misc.BBoxDBException)6 Tuple (org.bboxdb.storage.entity.Tuple)6 TupleStoreName (org.bboxdb.storage.entity.TupleStoreName)5 TupleStoreManager (org.bboxdb.storage.tuplestore.manager.TupleStoreManager)5 RejectedException (org.bboxdb.commons.RejectedException)3 BoundingBox (org.bboxdb.commons.math.BoundingBox)3 TupleStoreManagerRegistry (org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry)3 File (java.io.File)2 IOException (java.io.IOException)2 List (java.util.List)2 ZookeeperException (org.bboxdb.distribution.zookeeper.ZookeeperException)2 ZookeeperNotFoundException (org.bboxdb.distribution.zookeeper.ZookeeperNotFoundException)2 DeletedTuple (org.bboxdb.storage.entity.DeletedTuple)2 SSTableWriter (org.bboxdb.storage.sstable.SSTableWriter)2 SSTableFacade (org.bboxdb.storage.sstable.reader.SSTableFacade)2 DiskStorage (org.bboxdb.storage.tuplestore.DiskStorage)2 Test (org.junit.Test)2