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 D0162200C54 for ; Wed, 12 Apr 2017 10:07:49 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CE7E8160B95; Wed, 12 Apr 2017 08:07:49 +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 EEECB160B8A for ; Wed, 12 Apr 2017 10:07:48 +0200 (CEST) Received: (qmail 32751 invoked by uid 500); 12 Apr 2017 08:07:48 -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 32733 invoked by uid 99); 12 Apr 2017 08:07:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2017 08:07:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A94591AFB5F for ; Wed, 12 Apr 2017 08:07:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.297 X-Spam-Level: X-Spam-Status: No, score=-0.297 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Dt_x1nWjPaBS for ; Wed, 12 Apr 2017 08:07:44 +0000 (UTC) Received: from mail-ua0-f175.google.com (mail-ua0-f175.google.com [209.85.217.175]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id E71A25FCBA for ; Wed, 12 Apr 2017 08:07:43 +0000 (UTC) Received: by mail-ua0-f175.google.com with SMTP id 49so11847541uau.2 for ; Wed, 12 Apr 2017 01:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gridgain-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=jS+BX6we4KKjfEcQpAldja1GuIxeDnYKxYJxZn8HSoY=; b=VyVN4QSBfrQOfdmJDni/j6KxQSy/42tGuLl2x7m9p6bvjSN8Ajjg351F3JkDCtnye0 nkVvB4ZdFKozTKSQq5eUU9LC1HqhrwNe7KmqcmP4cGhpsyLMnFBq87A8Vw7qZfv//8g2 Jq+oAdGxHygrIdQuXIRUBRnF59+AmQdrdnqhw8CXEa97JpV0J1KrMuZGzONsXzdGWcQK 6Cl5ml4OxtxPtapXl5lCwHf6VvNVVhmqyiqBCmjz0jOMbco6VLdmPUq9CVF1qmeisIYd fgOal2RPBGVQoECwwumRbrvGS3c51DtN+XJU76I5x/gUSA3MPt5yx0tklDpJYRHQOugR QnwQ== 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=jS+BX6we4KKjfEcQpAldja1GuIxeDnYKxYJxZn8HSoY=; b=YbPCbLrTew/jl+CMF4MGJMafIMKaFdvl8YANiuKkd5kieffDEqgHbUnoNDvRiGRkOT IYP8FjMnY5zUSrcRLiFmP8f2un+Zx9jb0yRZBxSKsDOO5ItvyZDGG5pnWTqnZoT/zv+K 24rsub1RbHA6b/xS6afgowV2oZJkkNdUdKbu/clz8WQIRvOdwa8TZQAtU/LEs7NZY8I9 vIDhbh6BPCPL/Oe0crJqFYxDR86oLJr6OY7EfCw7+1Nh5lCFemWGzt7doMwoLNCPlEK+ LDBr0Swb+KW1ULQ8Ogs2NIPHbODCDc5db6uXEXJlZVDW1021Hv1pI7AFkk5Cih04sLAk ehsQ== X-Gm-Message-State: AN3rC/5F9KyxBh23yQqwczrW6jcAeSw3+kz8gNCqx2FQoWfdBBl4r62y8cAqWX5oHGstKOfohuK5zRS0negf1HWj X-Received: by 10.176.16.3 with SMTP id f3mr786433uab.77.1491984462752; Wed, 12 Apr 2017 01:07:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.35.53 with HTTP; Wed, 12 Apr 2017 01:07:42 -0700 (PDT) In-Reply-To: References: From: Vladimir Ozerov Date: Wed, 12 Apr 2017 11:07:42 +0300 Message-ID: Subject: Re: Sorting fields of Binarilyzable objects on write To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=f403045e3774e9cdaa054cf3b37f archived-at: Wed, 12 Apr 2017 08:07:50 -0000 --f403045e3774e9cdaa054cf3b37f Content-Type: text/plain; charset=UTF-8 Consider the following code: void writeBinary(BinaryWriter w) { w.writeBoolean("C", c); if (c) w.writeInt("A", a) else w.writeInt("B", b) } How are we going to force user to follow the contract in this case? On Wed, Apr 12, 2017 at 9:16 AM, Dmitriy Setrakyan wrote: > I think it is OK for users to do their own sorting, but we should > definitely validate the correct order and throw an exception if it is not. > > D. > > On Tue, Apr 11, 2017 at 11:02 PM, Pavel Tupitsyn > wrote: > > > QueryEntity order is not only harder for the users, it will be nightmare > to > > implement. > > What if there is no QueryEntity defined? What if the same class is used > in > > multiple QueryEntity? > > I don't think serialization code has to be tied to QueryEntity in any > way, > > this violates separation of concerns. > > > > So I guess we can agree on sorting fields alphabetically. > > > > Let's get to the initial question: > > * Should we do the sorting for the user (performance hit)? > > * Should we at least validate user-defined order? > > > > On Wed, Apr 12, 2017 at 2:12 AM, Dmitriy Setrakyan < > dsetrakyan@apache.org> > > wrote: > > > > > On Tue, Apr 11, 2017 at 1:28 PM, Sergi Vladykin < > > sergi.vladykin@gmail.com> > > > wrote: > > > > > > > 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. > > > > > > > > > > > > > I think it is important from the usability stand point. A user can > always > > > sort fields alphabetically in his or her mind. However, trying to > > remember > > > the field order from some QueryEntity is a lot harder. > > > > > > --f403045e3774e9cdaa054cf3b37f--