Igniters,

Consider a table and cache created this way:

CREATE TABLE `city` (
  `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 example.

- 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.  

—
Denis


Reply via email to