Over a million developers have joined DZone.

Imcache : Stable version 0.1.0 released


Imcache  0.1.0 is released with bunch of new features like CacheIndexes, QueryExecution with criterias and filters, CachePopulator and so on.

Here is a sample query execution code snippet . 

SearchableCache<Integer, Customer> cache = CacheBuilder
   .heapCache().addIndex("age", IndexType.RANGE_INDEX).build();
cache.put(0, createCustomer());
cache.put(1, createCustomer());
cache.put(2, createCustomer());
List<SimpleObject> objects = cache.execute(CacheQuery.newQuery()
   .setCriteria(new BetweenCriteria("age",20,30)
   .or(new ETCriteria("age", 33)))
   .setFilter(new LTFilter("highestPurchase", 3000)));

Before going into detail, here is a quick explanation of the concept used in the snippet.

Criterias are for meeting certain condition for the indexed values.

Filters are for eliminating objects from the result set of the query. 

In this code snippet, we create a searchable cache with a range index on age attribute. We then create random customers and populate the cache. We then create a new query with between criteria and equals to criteria. We also filter the result set with less than filter for highestPurchase attribute.

Maven dependency for imcache is as follows.


We also announce open positions for imcache. If you are interested in, please let us know.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}