I'm just trying to understand the current state of things and risks. May be we need to do some adjustments here before 2.0 to be on the safe side.
Actually looks like this not really important, we just have to clearly document that DML builds keys this way and require from user to do the same to be able to use cache API. Sergi 2017-04-11 21:47 GMT+03:00 Dmitriy Setrakyan <dsetrak...@apache.org>: > Sergi, why do you not like the alphabetical order? Seems like it would be a > much easier to understand requirement from the user standpoint. Do you see > some issues here? > > On Mon, Apr 10, 2017 at 10:43 AM, Sergi Vladykin <sergi.vlady...@gmail.com > > > wrote: > > > I'm sorry, looks like I do not really well understand this stuff, but it > is > > still not clear to me why wouldn't we just take the order of key fields > > given in QueryEntity and use it for both cases irrespectively to the > order > > of fields in regular Class or in Binarylizable? > > > > I mean lets say we have a Class (with unpredictable order of fields > > according to reflection): > > > > Person implements Serializable > > {int age, double salary} > > > > Or we have a Binarylizable (with some unknown user defined order of > > fields): > > > > Person implements Binarylizable { > > writeBinary(w) {w.writeDouble("salary", salary), w.writeInt(''age", > > age)} > > > > Also we have a QueryEntity (age, salary) > > > > Why we can not take key fields names from QueryEntity in the given order > > (age, salary) and get values from either "regular" Class or from > > Binarylizable and calculate hash code? > > > > Sergi > > > > 2017-04-10 19:56 GMT+03:00 Vladimir Ozerov <voze...@gridgain.com>: > > > > > Guys, > > > > > > The problem is that order of fields serialization is unknown for > regular > > > objects, where "regular" stands for non-Binarilyzable class. Reflection > > > returns fields in unpredictable order. For this reason you cannot match > > > fields order between class and QueryEntity. This is why we introduced > > > sorting, and this is why idea to rely on QueryEntity doesn't work. > > > > > > On Mon, Apr 10, 2017 at 7:01 PM, Sergi Vladykin < > > sergi.vlady...@gmail.com> > > > wrote: > > > > > > > Why "regular" are different here? > > > > > > > > Sergi > > > > > > > > 2017-04-10 18:59 GMT+03:00 Pavel Tupitsyn <ptupit...@gridgain.com>: > > > > > > > > > QueryEntity sorting is not an option for "regular" classes with > > > > reflective > > > > > serialization. > > > > > We have to use alphabetical. > > > > > Also, same class can participate in multiple query entities. > > > > > > > > > > 10 апр. 2017 г. 18:52 пользователь "Dmitriy Setrakyan" < > > > > > dsetrak...@apache.org> написал: > > > > > > > > > > On Mon, Apr 10, 2017 at 8:28 AM, Sergi Vladykin < > > > > sergi.vlady...@gmail.com> > > > > > wrote: > > > > > > > > > > > The decision to use alphabetic order looks strange here. Using > > order > > > > > > provided in QueryEntity and require from user to have the same > > order > > > > > > in Binarylizable > > > > > > looks more reasonable. > > > > > > > > > > > > > > > > I think this would be much harder to verify. Alphabetical order is > > more > > > > > intuitive, no? > > > > > > > > > > > > > > >