use of com.bakdata.conquery.models.datasets.concepts.tree.ConceptTreeConnector in project conquery by bakdata.
the class SerializationTests method cqConcept.
@Test
public void cqConcept() throws JSONException, IOException {
final Dataset dataset = new Dataset();
dataset.setName("dataset");
final TreeConcept concept = new TreeConcept();
concept.setName("concept");
concept.setDataset(dataset);
final ConceptTreeConnector connector = new ConceptTreeConnector();
connector.setConcept(concept);
concept.setConnectors(List.of(connector));
final CQConcept cqConcept = new CQConcept();
cqConcept.setElements(List.of(concept));
cqConcept.setLabel("Label");
final CQTable cqTable = new CQTable();
cqTable.setConnector(connector);
cqTable.setFilters(List.of());
cqTable.setConcept(cqConcept);
cqConcept.setTables(List.of(cqTable));
final CentralRegistry registry = new CentralRegistry();
registry.register(dataset);
registry.register(concept);
registry.register(connector);
SerializationTestUtil.forType(CQConcept.class).registry(registry).test(cqConcept);
}
use of com.bakdata.conquery.models.datasets.concepts.tree.ConceptTreeConnector in project conquery by bakdata.
the class FEValueTest method sortedValidityDates.
@Test
public void sortedValidityDates() {
Dataset dataset = new Dataset();
dataset.setName("testDataset");
Table table = new Table();
table.setDataset(dataset);
table.setName("testTable");
Column column = new Column();
column.setName("testColumn");
column.setTable(table);
ConceptTreeConnector connector = new ConceptTreeConnector();
connector.setName("testConnector");
TreeConcept concept = new TreeConcept();
concept.setDataset(dataset);
concept.setName("testConcept");
ValidityDate val0 = new ValidityDate();
val0.setName("val0");
val0.setConnector(connector);
ValidityDate val1 = new ValidityDate();
val1.setName("val1");
val1.setConnector(connector);
ValidityDate val2 = new ValidityDate();
val2.setName("val2");
val2.setConnector(connector);
List<ValidityDate> validityDates = List.of(val0, val1, val2);
connector.setColumn(column);
connector.setConcept(concept);
connector.setValidityDates(validityDates);
FETable feTable = FrontEndConceptBuilder.createTable(connector);
assertThat(feTable.getDateColumn().getOptions()).containsExactly(new FEValue("val0", val0.getId().toString()), new FEValue("val1", val1.getId().toString()), new FEValue("val2", val2.getId().toString()));
}
use of com.bakdata.conquery.models.datasets.concepts.tree.ConceptTreeConnector in project conquery by bakdata.
the class CBlockTest method serialize.
@SneakyThrows
@Test
public void serialize() throws IOException, JSONException {
final CentralRegistry registry = new CentralRegistry();
final Dataset dataset = new Dataset();
dataset.setName("dataset");
final TreeConcept concept = new TreeConcept();
concept.setDataset(dataset);
concept.setName("concept");
final ConceptTreeConnector connector = new ConceptTreeConnector();
connector.setName("connector");
connector.setConcept(concept);
concept.setConnectors(List.of(connector));
final Table table = new Table();
table.setName("table");
table.setDataset(dataset);
final Import imp = new Import(table);
imp.setName("import");
final Bucket bucket = new Bucket(0, 0, 0, new ColumnStore[0], Collections.emptySet(), new int[10], new int[10], imp);
final CBlock cBlock = CBlock.createCBlock(connector, bucket, 10);
registry.register(dataset).register(table).register(concept).register(connector).register(bucket).register(imp);
SerializationTestUtil.forType(CBlock.class).registry(registry).test(cBlock);
}
use of com.bakdata.conquery.models.datasets.concepts.tree.ConceptTreeConnector 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