use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class IgniteSqlSegmentedIndexSelfTest method testSizeOnSegmentedIndexWithEvictionPolicy.
/**
* Verifies that <code>select count(*)</code> return valid result on a single-node grid.
*
* @throws Exception If failed.
*/
public void testSizeOnSegmentedIndexWithEvictionPolicy() throws Exception {
final IgniteCache<Object, Object> cache = ignite(0).createCache(cacheConfig(ORG_CACHE_NAME, true, Integer.class, Organization.class).setEvictionPolicy(new FifoEvictionPolicy(10)).setOnheapCacheEnabled(true));
final long SIZE = 20;
for (int i = 0; i < SIZE; i++) cache.put(i, new Organization("org-" + i));
String select0 = "select count(*) from \"org\".Organization";
List<List<?>> res = cache.query(new SqlFieldsQuery(select0)).getAll();
assertEquals(SIZE, res.get(0).get(0));
}
Aggregations