use of com.bakdata.conquery.models.jobs.CalculateCBlocksJob in project conquery by bakdata.
the class BucketManager method addConcept.
public void addConcept(Concept<?> concept) {
storage.updateConcept(concept);
if (!(concept instanceof TreeConcept)) {
return;
}
CalculateCBlocksJob job = new CalculateCBlocksJob(storage, this, worker.getJobsExecutorService());
for (ConceptTreeConnector connector : ((TreeConcept) concept).getConnectors()) {
for (Bucket bucket : storage.getAllBuckets()) {
if (!bucket.getTable().equals(connector.getTable())) {
continue;
}
final CBlockId cBlockId = new CBlockId(bucket.getId(), connector.getId());
if (hasCBlock(cBlockId)) {
continue;
}
job.addCBlock(bucket, connector);
}
}
jobManager.addSlowJob(job);
}
use of com.bakdata.conquery.models.jobs.CalculateCBlocksJob in project conquery by bakdata.
the class BucketManager method addBucket.
public void addBucket(Bucket bucket) {
storage.addBucket(bucket);
registerBucket(bucket, entities, tableToBuckets);
CalculateCBlocksJob job = new CalculateCBlocksJob(storage, this, worker.getJobsExecutorService());
for (Concept<?> concept : storage.getAllConcepts()) {
if (!(concept instanceof TreeConcept)) {
continue;
}
for (ConceptTreeConnector connector : ((TreeConcept) concept).getConnectors()) {
if (!connector.getTable().equals(bucket.getTable())) {
continue;
}
CBlockId cBlockId = new CBlockId(bucket.getId(), connector.getId());
if (hasCBlock(cBlockId)) {
continue;
}
job.addCBlock(bucket, connector);
}
}
jobManager.addSlowJob(job);
}
use of com.bakdata.conquery.models.jobs.CalculateCBlocksJob in project conquery by bakdata.
the class BucketManager method fullUpdate.
@SneakyThrows
public void fullUpdate() {
CalculateCBlocksJob job = new CalculateCBlocksJob(storage, this, worker.getJobsExecutorService());
for (Concept<?> c : storage.getAllConcepts()) {
if (!(c instanceof TreeConcept)) {
continue;
}
for (ConceptTreeConnector con : ((TreeConcept) c).getConnectors()) {
for (Bucket bucket : storage.getAllBuckets()) {
CBlockId cBlockId = new CBlockId(bucket.getId(), con.getId());
if (!con.getTable().equals(bucket.getTable())) {
continue;
}
if (hasCBlock(cBlockId)) {
log.trace("Skip calculation of CBlock[{}], because it was loaded from the storage.", cBlockId);
continue;
}
log.warn("CBlock[{}] missing in Storage. Queuing recalculation", cBlockId);
job.addCBlock(bucket, con);
}
}
}
if (!job.isEmpty()) {
jobManager.addSlowJob(job);
}
}
Aggregations