use of it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap 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);
}
Aggregations