Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2FDF0200C52 for ; Mon, 10 Apr 2017 19:44:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2E48D160B99; Mon, 10 Apr 2017 17:44:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4D36B160B7F for ; Mon, 10 Apr 2017 19:44:07 +0200 (CEST) Received: (qmail 21039 invoked by uid 500); 10 Apr 2017 17:44:06 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 21027 invoked by uid 99); 10 Apr 2017 17:44:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2017 17:44:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BBEF5CD35E for ; Mon, 10 Apr 2017 17:44:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 7YORItYCaiHo for ; Mon, 10 Apr 2017 17:44:03 +0000 (UTC) Received: from mail-yb0-f182.google.com (mail-yb0-f182.google.com [209.85.213.182]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 3D56C5F30C for ; Mon, 10 Apr 2017 17:44:03 +0000 (UTC) Received: by mail-yb0-f182.google.com with SMTP id m133so36018328ybb.1 for ; Mon, 10 Apr 2017 10:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=KgKdAsyIPl6lEkvTB0tdilTYWIa9Y20dRPTLrKrjQHs=; b=mp3ytCZGijzuiZ7WcgH5TL9jpphwcN9xm64YNIau7U71jXCv+IS6jY+fJ7KR+Bcf40 nstrvYis6QOBYaiyE29JxTbIqUjvYKx4fDTQkonXuzLSVUgcrHNRCGXilLcSjWcavjVH ScOgOWuRbJUMZ5jJn9Kt8CnxPI+guoZRuyiNZp5hEAvXmGVDxeENVEGPaYNYtw7Fh7/z CU89oIFn69Be7IwGwfTe9h3ZgXmj3PV/Dg/9JNhwj6KnXn8AOlKviTv+YXL8You4Wuo0 DfVvKP+J3mSs5XLzwQr5BchqDAnJHPXD3vmef+/xUJdQ9e9WImCs+spAkrp24frmQbHb AlJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=KgKdAsyIPl6lEkvTB0tdilTYWIa9Y20dRPTLrKrjQHs=; b=WSr+WXEoQ+oBx0keL1KK4m0TInVEILmllD6JorKoaZhi0zhOa8o1pXD8ojEm2pTbJu uDYImOKbIylQF/mlPRBtfTj2olM8KkDHyl9376rtcavRF5RMzB3IrUaWjb/nhm3UBI7f cHS4P7JfTNmB4S8ibAZwF6T4USEdKdRVWUO+y5e1anZkzkSjwSWeze1ZrqsV3IL5CV8s 7MxvvF9RNQ10vCB2SM1No44q+VKbPMYmGedEsUX909wfXUeFBCtYgkg/0Lbngu0DAKVk tb5SRanQUJi4Kz4MJlI6HjhLLJB+9Bs8Z2lxzsM5I2XGnxIZzIAk43vQLb9eSyH9XLiy 1a8A== X-Gm-Message-State: AFeK/H3FRmbXCIghVZVW96OhJMkcs2VGTlpQ4MAK01KPVNOAXytAS+851EcvXUpSqbQQRj5DSBWaIZcUENkwPA== X-Received: by 10.129.74.130 with SMTP id x124mr39540273ywa.298.1491846236860; Mon, 10 Apr 2017 10:43:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.220.131 with HTTP; Mon, 10 Apr 2017 10:43:16 -0700 (PDT) In-Reply-To: References: From: Sergi Vladykin Date: Mon, 10 Apr 2017 20:43:16 +0300 Message-ID: Subject: Re: Sorting fields of Binarilyzable objects on write To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=001a114d82f801f813054cd385f0 archived-at: Mon, 10 Apr 2017 17:44:08 -0000 --001a114d82f801f813054cd385f0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 : > 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 > wrote: > > > Why "regular" are different here? > > > > Sergi > > > > 2017-04-10 18:59 GMT+03:00 Pavel Tupitsyn : > > > > > 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 =D0=B0=D0=BF=D1=80. 2017 =D0=B3. 18:52 =D0=BF=D0=BE=D0=BB=D1=8C=D0= =B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Dmitriy Setrakyan" < > > > dsetrakyan@apache.org> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > > > > > > On Mon, Apr 10, 2017 at 8:28 AM, Sergi Vladykin < > > sergi.vladykin@gmail.com> > > > wrote: > > > > > > > The decision to use alphabetic order looks strange here. Using orde= r > > > > provided in QueryEntity and require from user to have the same orde= r > > > > in Binarylizable > > > > looks more reasonable. > > > > > > > > > > I think this would be much harder to verify. Alphabetical order is mo= re > > > intuitive, no? > > > > > > --001a114d82f801f813054cd385f0--