Search in sources :

Example 1 with PlanCheckContext

use of com.hazelcast.sql.impl.optimizer.PlanCheckContext in project hazelcast by hazelcast.

the class PlanCacheChecker method check.

public void check() {
    if (planCache.size() == 0) {
        return;
    }
    // Collect object IDs
    SqlCatalog catalog = new SqlCatalog(tableResolvers);
    Set<PlanObjectKey> objectKeys = new HashSet<>();
    for (Map<String, Table> tableMap : catalog.getSchemas().values()) {
        for (Table table : tableMap.values()) {
            PlanObjectKey objectKey = table.getObjectKey();
            if (objectKey != null) {
                objectKeys.add(objectKey);
            }
        }
    }
    // Prepare partition distribution
    Map<UUID, PartitionIdSet> partitions = QueryUtils.createPartitionMap(nodeEngine, null, false);
    // Do check
    planCache.check(new PlanCheckContext(objectKeys, partitions));
}
Also used : SqlCatalog(com.hazelcast.sql.impl.schema.SqlCatalog) PlanCheckContext(com.hazelcast.sql.impl.optimizer.PlanCheckContext) Table(com.hazelcast.sql.impl.schema.Table) PlanObjectKey(com.hazelcast.sql.impl.optimizer.PlanObjectKey) PartitionIdSet(com.hazelcast.internal.util.collection.PartitionIdSet) UUID(java.util.UUID) HashSet(java.util.HashSet)

Aggregations

PartitionIdSet (com.hazelcast.internal.util.collection.PartitionIdSet)1 PlanCheckContext (com.hazelcast.sql.impl.optimizer.PlanCheckContext)1 PlanObjectKey (com.hazelcast.sql.impl.optimizer.PlanObjectKey)1 SqlCatalog (com.hazelcast.sql.impl.schema.SqlCatalog)1 Table (com.hazelcast.sql.impl.schema.Table)1 HashSet (java.util.HashSet)1 UUID (java.util.UUID)1