Search in sources :

Example 21 with Table

use of com.bakdata.conquery.models.datasets.Table in project conquery by bakdata.

the class BucketManager method create.

public static BucketManager create(Worker worker, WorkerStorage storage, int entityBucketSize) {
    Int2ObjectMap<Entity> entities = new Int2ObjectAVLTreeMap<>();
    Map<Connector, Int2ObjectMap<Map<Bucket, CBlock>>> connectorCBlocks = new HashMap<>();
    Map<Table, Int2ObjectMap<List<Bucket>>> tableBuckets = new HashMap<>();
    IntArraySet assignedBucketNumbers = worker.getInfo().getIncludedBuckets();
    log.trace("Trying to load these buckets that map to: {}", assignedBucketNumbers);
    for (Bucket bucket : storage.getAllBuckets()) {
        if (!assignedBucketNumbers.contains(bucket.getBucket())) {
            log.warn("Found Bucket[{}] in Storage that does not belong to this Worker according to the Worker information.", bucket.getId());
        }
        registerBucket(bucket, entities, tableBuckets);
    }
    for (CBlock cBlock : storage.getAllCBlocks()) {
        registerCBlock(cBlock, connectorCBlocks);
    }
    return new BucketManager(worker.getJobManager(), storage, worker, entities, connectorCBlocks, tableBuckets, entityBucketSize);
}
Also used : Entity(com.bakdata.conquery.models.query.entity.Entity) ConceptTreeConnector(com.bakdata.conquery.models.datasets.concepts.tree.ConceptTreeConnector) Connector(com.bakdata.conquery.models.datasets.concepts.Connector) Table(com.bakdata.conquery.models.datasets.Table) HashMap(java.util.HashMap) Int2ObjectAVLTreeMap(it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap) Int2ObjectMap(it.unimi.dsi.fastutil.ints.Int2ObjectMap) IntArraySet(it.unimi.dsi.fastutil.ints.IntArraySet)

Example 22 with Table

use of com.bakdata.conquery.models.datasets.Table in project conquery by bakdata.

the class RequiredTable method toTable.

public Table toTable(Dataset dataset, CentralRegistry centralRegistry) {
    Table table = new Table();
    table.setDataset(dataset);
    table.setName(name);
    table.setColumns(Arrays.stream(columns).map(col -> col.toColumn(table, centralRegistry)).toArray(Column[]::new));
    return table;
}
Also used : Table(com.bakdata.conquery.models.datasets.Table) Column(com.bakdata.conquery.models.datasets.Column)

Aggregations

Table (com.bakdata.conquery.models.datasets.Table)22 Column (com.bakdata.conquery.models.datasets.Column)12 Dataset (com.bakdata.conquery.models.datasets.Dataset)11 CentralRegistry (com.bakdata.conquery.models.identifiable.CentralRegistry)8 Test (org.junit.jupiter.api.Test)8 Validator (javax.validation.Validator)7 Import (com.bakdata.conquery.models.datasets.Import)6 TreeConcept (com.bakdata.conquery.models.datasets.concepts.tree.TreeConcept)6 CQTable (com.bakdata.conquery.apiv1.query.concept.filter.CQTable)5 ConceptTreeConnector (com.bakdata.conquery.models.datasets.concepts.tree.ConceptTreeConnector)5 Getter (lombok.Getter)5 Injectable (com.bakdata.conquery.io.jackson.Injectable)4 MutableInjectableValues (com.bakdata.conquery.io.jackson.MutableInjectableValues)4 MetaStorage (com.bakdata.conquery.io.storage.MetaStorage)4 Concept (com.bakdata.conquery.models.datasets.concepts.Concept)4 Connector (com.bakdata.conquery.models.datasets.concepts.Connector)4 Bucket (com.bakdata.conquery.models.events.Bucket)4 SneakyThrows (lombok.SneakyThrows)4 NamespaceStorage (com.bakdata.conquery.io.storage.NamespaceStorage)3 SecondaryIdDescription (com.bakdata.conquery.models.datasets.SecondaryIdDescription)3