use of com.hazelcast.sql.impl.plan.cache.PlanCache in project hazelcast by hazelcast.
the class PlanCacheTest method testOverflow.
@Test
public void testOverflow() {
// Fill till full
int size = 5;
PlanCache cache = new PlanCache(size);
for (int i = 0; i < size; i++) {
PlanKey key = createKey(Integer.toString(i));
cache.put(key, createPlan(key, PART_MAP_1));
advanceTime();
}
assertEquals(size, cache.size());
// Overflow happens here
PlanKey overflowKey = createKey(Integer.toString(size));
cache.put(overflowKey, createPlan(overflowKey, PART_MAP_1));
assertEquals(size, cache.size());
for (int i = 0; i < size; i++) {
PlanKey key = createKey(Integer.toString(i + 1));
assertNotNull(cache.get(key));
}
}
Aggregations