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 A5695200AE4 for ; Fri, 24 Jun 2016 15:17:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A3501160A49; Fri, 24 Jun 2016 13:17:20 +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 C7BBA160A38 for ; Fri, 24 Jun 2016 15:17:19 +0200 (CEST) Received: (qmail 41418 invoked by uid 500); 24 Jun 2016 13:17:18 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 41408 invoked by uid 99); 24 Jun 2016 13:17:18 -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; Fri, 24 Jun 2016 13:17:18 +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 72186C9370 for ; Fri, 24 Jun 2016 13:17:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.299 X-Spam-Level: * X-Spam-Status: No, score=1.299 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, HTML_OBFUSCATE_05_10=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 9lujzhubOrhF for ; Fri, 24 Jun 2016 13:17:16 +0000 (UTC) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id E16CA5FE0D for ; Fri, 24 Jun 2016 13:17:15 +0000 (UTC) Received: by mail-oi0-f44.google.com with SMTP id f189so114635018oig.3 for ; Fri, 24 Jun 2016 06:17:15 -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=GW2kLqmFSKoEh9/E6bzuPUd+wiQuhOBzo+dtxfPp9+g=; b=gjT93Yqex4VX2kMk/RGgMQFfCD2urGr+4Vw4pEFmFf+IGMYr4MzVLg46o3n5u7bT+f pKoUu86jrdDd+/U+rUqydfyQ/pNQK3NdOiVBpDsQjSEyfDSs4JVOIt/d+TcKB0DkPB3C 1WeOQOWx+zXUhV0yWA6gM38zHzEkuu1VNoFyme+xHDuGneUSzlfE1wazWooCHrLM/pRv aD21Z6aEl76t3afG4H+TfKVele3gn/c0iGknzh/QOCz1xU1zkgex5RuQ/QzBuk+uOkCF AFXQu2efE8NuYps12bGd29hVCi/mZ9ZSLK++x6K7w1Kwm8pFxtzpLO3cg7dQwIEHY33E BBbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=GW2kLqmFSKoEh9/E6bzuPUd+wiQuhOBzo+dtxfPp9+g=; b=jbKE2jsF0bt38GEnwdqfnKfhdyapm4KGkvXRyXm2YKTULdWWXcK0hYVV5nX096irQu zoAaAf85orXV2L95PzHlbnff8/vNR6tN8FNHHZU4RCVCvgxHWgILGwIVGeq6ADXumFsN 5TPHczi1tZPS9T2/QMJtjIVHGHG4VpNZ/3L2QVnqExaHX982lxDOzhPwEsNrVjLjEwjJ 3gfmXTpT+8W4q2g9qtm1pf4wJnCdrkOpCrJDtqJLODosKVMy7bkN0SPGUHGUbyAbjg5v Gv4EorQPuHmxbCSO79EWTjs28o8ROA0xD6OMHR3B4elNuQ0nKq6BIFSb7HwTR3DE5gd5 nqKA== X-Gm-Message-State: ALyK8tIyi5rJWTLfHt7Vhj4KiSOWSYq5CxxN997R6x5xsF+gqnVOqayKy+6HAxxrgQEXqVJ42Ahezvrlr2NhjtJ6 X-Received: by 10.202.175.138 with SMTP id y132mr2671674oie.131.1466774234506; Fri, 24 Jun 2016 06:17:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.37.69 with HTTP; Fri, 24 Jun 2016 06:16:45 -0700 (PDT) In-Reply-To: References: <1466669175937-5819.post@n6.nabble.com> <1466688290018-5838.post@n6.nabble.com> <1466766958856-5872.post@n6.nabble.com> From: Pavel Tupitsyn Date: Fri, 24 Jun 2016 16:16:45 +0300 Message-ID: Subject: Re: Enable Binary Reflective Serializer in the app.config To: user@ignite.apache.org Content-Type: multipart/alternative; boundary=001a113cdf6036dbe0053605fda6 archived-at: Fri, 24 Jun 2016 13:17:20 -0000 --001a113cdf6036dbe0053605fda6 Content-Type: text/plain; charset=UTF-8 ... and another fix would be to remove [QuerySqlField] attribute, since queries won't work with raw mode anyway. On Fri, Jun 24, 2016 at 3:26 PM, Pavel Tupitsyn wrote: > The workaround is to implement raw mode manually via IBinarizable > interface. > It will look like this for the OrderEntity class (field order should be > the same in read and write methods): > > public void WriteBinary(IBinaryWriter writer) > { > var w = writer.GetRawWriter(); > > w.WriteInt(OrderId); > w.WriteString(OrderName); > w.WriteObject(OrderDateTime); > w.WriteDouble(OrderValue); > w.WriteString(OrderAddress); > } > public void ReadBinary(IBinaryReader reader) > { > var r = reader.GetRawReader(); > > OrderId = r.ReadInt(); > OrderName = r.ReadString(); > OrderDateTime = r.ReadObject(); > OrderValue = r.ReadDouble(); > OrderAddress = r.ReadString(); > } > > > On Fri, Jun 24, 2016 at 3:22 PM, Pavel Tupitsyn > wrote: > >> I've reproduced it. >> There is a bug with DateTime in raw mode. It works when I remove >> OrderEntity.OrderDateTime property. >> >> Bug is filed and will be fixed shortly: >> https://issues.apache.org/jira/browse/IGNITE-3364 >> >> On Fri, Jun 24, 2016 at 2:15 PM, mrinalkamboj < >> mrinal.technology@gmail.com> wrote: >> >>> On enabling the rawMode="true", as suggested in the configuration file, >>> following piece of code leads to the exception: >>> >>> using (var ldr = ignite.GetDataStreamer("OrderCache")) >>> { >>> ldr.PerNodeBufferSize = 1024; >>> >>> //ldr.AllowOverwrite = true; >>> >>> var parallelOptions = new ParallelOptions { >>> MaxDegreeOfParallelism = Environment.ProcessorCount }; >>> >>> // ReSharper disable once AccessToDisposedClosure >>> Parallel.Invoke(parallelOptions, orders.Select(order => >>> (Action)(() => ldr.AddData(order.OrderId, order))).ToArray()); >>> } >>> >>> On the AddData call of the Data Streamer and the Exception is: >>> >>> {Apache.Ignite.Core.Binary.BinaryObjectException} - Cannot write named >>> fields after raw data is written. >>> >>> Logically this looks correct, but what shall I do now, can't use Data >>> Streamer with this setting, if I remove the rawMode setting then it works >>> fine >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://apache-ignite-users.70518.x6.nabble.com/Enable-Binary-Reflective-Serializer-in-the-app-config-tp5819p5872.html >>> Sent from the Apache Ignite Users mailing list archive at Nabble.com. >>> >> >> > --001a113cdf6036dbe0053605fda6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
... and another fix would be to remove [QuerySqlField] att= ribute, since queries won't work with raw mode anyway.

On Fri, Jun 24, 2016 at 3:2= 6 PM, Pavel Tupitsyn <ptupitsyn@gridgain.com> wrote:
The workaround is to imple= ment raw mode manually via=C2=A0IBinarizable interface.
It will look li= ke this for the OrderEntity class (field order should be the same in read a= nd write methods):
public=C2=A0void=C2=A0WriteBi=
nary(IBinaryWriter=C2=A0writer=
)
{
=C2=A0=C2=A0=C2=A0=C2=A0var=C2=A0w=C2=A0=
=3D=C2=A0writer.GetRawWriter();
=20
=C2=A0=C2=A0=C2=A0=C2=A0w.WriteInt(OrderId);
=C2=A0=C2=A0=C2=A0=C2=A0w.WriteString(OrderName);
=C2=A0=C2=A0=C2=A0=C2=A0w.WriteObject(OrderDateTime);
=C2=A0=C2=A0=C2=A0=C2=A0w.WriteDouble(OrderValue);
=C2=A0=C2=A0=C2=A0=C2=A0w.WriteString(OrderAddress);
}
=20
public=C2=A0vo=
id=C2=A0ReadBinary(IBinaryRead=
er=C2=A0reader)
{
=C2=A0=C2=A0=C2=A0=C2=A0var=C2=A0r=C2=A0=
=3D=C2=A0reader.GetRawReader();
=20
=C2=A0=C2=A0=C2=A0=C2=A0OrderId=C2=A0=3D=C2=A0r.ReadInt();
=C2=A0=C2=A0=C2=A0=C2=A0OrderName=C2=A0=3D=C2=A0r.ReadString();
=C2=A0=C2=A0=C2=A0=C2=A0OrderDateTime=C2=A0=3D=C2=A0r.ReadObject<DateTime>();
=C2=A0=C2=A0=C2=A0=C2=A0OrderValue=C2=A0=3D=C2=A0r.ReadDouble();
=C2=A0=C2=A0=C2=A0=C2=A0OrderAddress=C2=A0=3D=C2=A0r.ReadString();
}

On Fri, Jun 24, 2016 at 3:22 PM, P= avel Tupitsyn <ptupitsyn@gridgain.com> wrote:
I've reproduced it.=C2= =A0
There is a bug with DateTime in raw mode. It works when I rem= ove OrderEntity.OrderDateTime property.

Bug is fil= ed and will be fixed shortly:=C2=A0https://issues.apache.org/jira/brow= se/IGNITE-3364

On Fri, Jun 24, 2016 at 2:15 PM, mrinalkamboj <mrinal.technology@gmail.com> wrote:
On enabling the rawMode=3D"true", as suggested in = the configuration file,
following piece of code leads to the exception:

=C2=A0using (var ldr =3D ignite.GetDataStreamer<int, OrderEntity>(&qu= ot;OrderCache"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ldr.PerNodeBufferSi= ze =3D 1024;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 //ldr.AllowOverwrit= e =3D true;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 var parallelOptions= =3D new ParallelOptions {
MaxDegreeOfParallelism =3D Environment.ProcessorCount };

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // ReSharper disabl= e once AccessToDisposedClosure
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Parallel.Invoke(par= allelOptions, orders.Select(order =3D>
(Action)(() =3D> ldr.AddData(order.OrderId, order))).ToArray());
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }

On the AddData call of the Data Streamer and the Exception is:

{Apache.Ignite.Core.Binary.BinaryObjectException} - Cannot write named
fields after raw data is written.

Logically this looks correct, but what shall I do now, can't use Data Streamer with this setting, if I remove the rawMode setting then it works fine




--
View this message in context: http://apache-ignite-users.7= 0518.x6.nabble.com/Enable-Binary-Reflective-Serializer-in-the-app-config-tp= 5819p5872.html
Sent from the Apache Ignite Users mailing list archive at Nabble.= com.



--001a113cdf6036dbe0053605fda6--