use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class SSTableServiceRunnable method executeSplit.
/**
* Execute a region split
*
* @param sstableManager
* @param spacePartitioner
* @param regionToSplit
* @throws StorageManagerException
* @throws BBoxDBException
* @throws InterruptedException
*/
private void executeSplit(final TupleStoreManager sstableManager, final SpacePartitioner spacePartitioner, final DistributionRegion regionToSplit) throws Exception {
final TupleStoreManagerRegistry tupleStoreManagerRegistry = storage.getTupleStoreManagerRegistry();
final RegionSplitter regionSplitter = new RegionSplitter(tupleStoreManagerRegistry);
forceMajorCompact(sstableManager);
regionSplitter.splitRegion(regionToSplit, spacePartitioner, tupleStoreManagerRegistry);
}
use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class SSTableServiceRunnable method execute.
/**
* Execute a new compaction
* @throws InterruptedException
*/
public synchronized void execute() throws InterruptedException {
final TupleStoreManagerRegistry storageRegistry = storage.getTupleStoreManagerRegistry();
final String location = storage.getBasedir().getAbsolutePath();
final List<TupleStoreName> tupleStores = storageRegistry.getTupleStoresForLocation(location);
processTupleStores(storageRegistry, tupleStores);
processRegionMerges();
processScheduldedDeletions();
}
use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class SSTableServiceRunnable method openFacades.
/**
* Open the facades
*
* @param newTableWriter
* @param newFacades
* @throws StorageManagerException
*/
private void openFacades(final List<SSTableWriter> newTableWriter, final List<SSTableFacade> newFacades) throws StorageManagerException {
for (final SSTableWriter writer : newTableWriter) {
final TupleStoreManagerRegistry tupleStoreManagerRegistry = storage.getTupleStoreManagerRegistry();
final BBoxDBConfiguration configuration = tupleStoreManagerRegistry.getConfiguration();
final int sstableKeyCacheEntries = configuration.getSstableKeyCacheEntries();
final SSTableFacade newFacade = new SSTableFacade(writer.getDirectory(), writer.getName(), writer.getTablenumber(), sstableKeyCacheEntries);
newFacades.add(newFacade);
}
}
use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class SSTableCheckpointRunnable method runThread.
/**
* Execute the checkpoint thread
*/
protected void runThread() {
final TupleStoreManagerRegistry storageRegistry = storage.getTupleStoreManagerRegistry();
try {
while (!Thread.currentThread().isInterrupted()) {
if (Const.LOG_MEMORY_STATISTICS) {
logger.info(SystemInfo.getMemoryStatisticsString());
}
final List<TupleStoreName> allTables = storageRegistry.getTupleStoresForLocation(storage.getBasedir().getAbsolutePath());
for (final TupleStoreName ssTableName : allTables) {
logger.info("Executing checkpoint check for: {}", ssTableName);
if (Thread.currentThread().isInterrupted()) {
return;
}
createCheckpointIfNeeded(storageRegistry, ssTableName);
}
waitForNextRun();
}
} catch (Exception e) {
if (!Thread.interrupted()) {
logger.error("Got exception while executing thread", e);
}
}
}
use of org.bboxdb.storage.tuplestore.manager.TupleStoreManagerRegistry in project bboxdb by jnidzwetzki.
the class ContinuousBoundingBoxClientQuery method init.
/**
* Init the query
* @param tupleStoreManagerRegistry
* @throws BBoxDBException
*/
protected void init() throws BBoxDBException {
try {
final TupleStoreManagerRegistry storageRegistry = clientConnectionHandler.getStorageRegistry();
final String fullname = requestTable.getDistributionGroup();
final SpacePartitioner spacePartitioner = SpacePartitionerCache.getInstance().getSpacePartitionerForGroupName(fullname);
final DistributionRegionIdMapper regionIdMapper = spacePartitioner.getDistributionRegionIdMapper();
final List<TupleStoreName> localTables = regionIdMapper.getLocalTablesForRegion(boundingBox, requestTable);
if (localTables.size() != 1) {
logger.error("Got more than one table for the continuous query {}", localTables);
close();
return;
}
final TupleStoreName tupleStoreName = localTables.get(0);
storageManager = QueryHelper.getTupleStoreManager(storageRegistry, tupleStoreName);
storageManager.registerInsertCallback(tupleInsertCallback);
// Remove tuple store insert listener on connection close
clientConnectionHandler.addConnectionClosedHandler((c) -> close());
} catch (StorageManagerException | ZookeeperException e) {
logger.error("Got an exception during query init", e);
close();
}
}
Aggregations