Hi Denis,
we have ignite cache that has key value pair as the following;
IgniteCache<Long, ArrayList<MyPOJO>>
and cache cofiguration for this cache is as the following;
CacheConfiguration<Long, ArrayList<MyPOJO>> cacheCfg = new
CacheConfiguration<>(cacheName);
cacheCfg.setStartSize(startSize);
cacheCfg.setCacheMode(CacheMode.LOCAL);
I wrote query as the following;
String sql = "_key >= ? && _key < ? ";
IgniteCache<Long, ArrayList<MyPOJO>> igniteCache =
Ignition.ignite().cache(this.getCacheName());
SqlQuery<Long, ArrayList<MyPOJO>> sqlQuery = new SqlQuery<Long,
ArrayList<MyPOJO>>("ArrayList<MyPOJO>.class", sql);
sqlQuery.setArgs(min, max);
igniteCache.query(sqlQuery).getAll();
above method call returns the following exception;
Caused by: javax.cache.CacheException: Indexing is disabled for cache:
MY_CACHE. Use setIndexedTypes or setTypeMetadata methods on
CacheConfiguration to enable.
at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.validate(IgniteCacheProxy.java:852)
I think I need to add indexing by calling
cacheConfig.setIndexedTypes(Long.class, Value.class)
But my value class is ArrayList<MyPOJO> not sure how to specify *.class file
for this generic collection type. Can you please advise. Thanks,
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/Ignite-cache-range-query-using-cache-keys-tp10717p10785.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.