ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ambha <ambha.ungrapa...@wipro.com>
Subject Querying HashMap stored as value in IgniteCache
Date Tue, 15 Mar 2016 06:54:02 GMT
For my application, I need to store <String, HashMap> as key-value pair in
IgniteCache and later query the cache on HashMap keys as shown in example
below. Is that possible in Ignite? If it is not possible, do let me know the
way to extend query/indexing functionality to enable this feature or is
there any other way of achieving the same result but the IgniteCache's value
must be HashMap because the keys are dynamic


Ignite ignite = Ignition.start("ignite-config.xml")
IgniteCache cache = ignite.getOrCreateCache("mycache");

Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("id", 111);
valueMap.put("name", "cache name");
valueMap.put("isActive", Boolean.TRUE);

cache.put("111", valueMap);

valueMap = new HashMap<String,Object>();
valueMap.put("id", 222);
valueMap.put("name", "cache name");
valueMap.put("isActive", Boolean.FALSE);

cache.put("222", valueMap);

valueMap = new HashMap<String,Object>();
valueMap.put("id", 333);
valueMap.put("name", "cache name");
valueMap.put("isActive", Boolean.TRUE);

cache.put("333", valueMap);

My query looks like "get all HashMaps which are active (i.e. having the
isActive = Boolean.TRUE)"
the expected output is "111" and "333"

View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Querying-HashMap-stored-as-value-in-IgniteCache-tp3507.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message