use of org.bboxdb.storage.entity.TupleStoreName 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;
}
use of org.bboxdb.storage.entity.TupleStoreName in project bboxdb by jnidzwetzki.
the class TupleStoreConfigurationCache method getDuplicateResolverForTupleStore.
public synchronized DuplicateResolver<Tuple> getDuplicateResolverForTupleStore(final String tupleStorename) {
if (!cache.containsKey(tupleStorename)) {
try {
final TupleStoreAdapter tupleStoreAdapter = ZookeeperClientFactory.getZookeeperClient().getTupleStoreAdapter();
final TupleStoreName tupleStoreNameObject = new TupleStoreName(tupleStorename);
if (!tupleStoreAdapter.isTableKnown(tupleStoreNameObject)) {
logger.error("Table {} is not known, using do nothing duplicate resolver", tupleStorename);
return new DoNothingDuplicateResolver();
}
final TupleStoreConfiguration tupleStoreConfiguration = tupleStoreAdapter.readTuplestoreConfiguration(tupleStoreNameObject);
final DuplicateResolver<Tuple> resolver = TupleDuplicateResolverFactory.build(tupleStoreConfiguration);
cache.put(tupleStorename, resolver);
} catch (ZookeeperException e) {
logger.error("Exception while reading zookeeper data", e);
return new DoNothingDuplicateResolver();
}
}
final DuplicateResolver<Tuple> duplicateResolver = cache.get(tupleStorename);
return duplicateResolver;
}
Aggregations