ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@apache.org>
Subject Key-value access to caches created with DDL
Date Sat, 02 Sep 2017 07:12:06 GMT

Consider a table and cache created this way:

  `ID` INT(11),
  `Name` CHAR(35),
  `CountryCode` CHAR(3),
  `District` CHAR(20),
  `Population` INT(11),
  PRIMARY KEY (`ID`, `CountryCode`)
) WITH "template=partitioned, backups=1, affinityKey=CountryCode";
Now in addition to SQL I want to process the data from this cache using *key-value* and *compute
affinity* APIs. To do that I need to build a valid key first (like CityKey(cityId, countryCode)
where countryCode is an affinityKey).

Seems it’s not achievable (or at least usable) because the key type name is defined by DDL/DML
and a bit scary - SQL_PUBLIC_CITY_3f4e9fbf_3464_4598_8394_1307b86dc4e7_KEY.

Will my case be addressed if we do the following?

- Let a user pass a key type’s name into WITH clause. Assume CityKey was chosen for this

- DML operations keep using the same BinaryObjectBuilders for the key generation internally
but passing CityKey as a type name instead of the auto-generated one.

- The end user now can construct a valid key using the same BinaryObjectBuilders or CityKey
object (making sure hashCode and equals are implemented properly) and, for instance, execute
a compute.affinityRun over the City cache.

Please suggest another alternatives if I overlook something.  


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message