use of com.hazelcast.sql.impl.optimizer.PlanObjectKey in project hazelcast by hazelcast.
the class PlanCacheTestSupport method createPlan.
public static SqlPlan createPlan(PlanKey key, Map<UUID, PartitionIdSet> partitions, int... objectKeys) {
Set<PlanObjectKey> objectKeys0 = new HashSet<>();
if (objectKeys != null) {
for (int objectId : objectKeys) {
objectKeys0.add(createObjectId(objectId));
}
}
SqlPlan plan = new TestPlan(key, objectKeys0, partitions);
assertEquals(key, plan.getPlanKey());
assertEquals(0L, plan.getPlanLastUsed());
return plan;
}
use of com.hazelcast.sql.impl.optimizer.PlanObjectKey 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));
}
Aggregations