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 CE054200AE4 for ; Fri, 24 Jun 2016 14:27:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CCA3A160A5A; Fri, 24 Jun 2016 12:27:17 +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 F10B7160A38 for ; Fri, 24 Jun 2016 14:27:16 +0200 (CEST) Received: (qmail 21084 invoked by uid 500); 24 Jun 2016 12:27:16 -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 21073 invoked by uid 99); 24 Jun 2016 12:27:16 -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 12:27:16 +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 9BF44C0449 for ; Fri, 24 Jun 2016 12:27:15 +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 mx1-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 PWe8vOVWRcGZ for ; Fri, 24 Jun 2016 12:27:12 +0000 (UTC) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 3A2805F245 for ; Fri, 24 Jun 2016 12:27:11 +0000 (UTC) Received: by mail-oi0-f43.google.com with SMTP id r2so112899557oih.2 for ; Fri, 24 Jun 2016 05:27:11 -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=XQmtGPiaApU16lvDWmbKlpF8EO4wGPXIpvYhFbIkxkY=; b=SQiPamPDaBEAdiBQQAN1PZVqqYak5MHmMV+fzYZwrK6b2O6tYUcyAaG1yIFLQO7uEC eAsMJVCXhi8KzP/+dqmyRLeIKzmG3GwZ75NquHhmL13u424ILFLj8ddcbvdk8QVmhX3Q tYS6AOLkBhcmCWCMRkYF3n0b3RgUBeROApsnKDeTsaXPqMX5K17APghGiQytu5hIQQGS Qbe2Gb45MFNS4W2GtNcg5x055EHuJ57G/3FQgJmnq2AmmTK9rMUoioDcHIe8LRGxQdJQ BJjCt9n3IadZeTgfeVZdB6Kw65UU5Wh3Lw3V77FxOOUt0kkpVldNQkkx5zN8ce+JYZSJ ggGw== 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=XQmtGPiaApU16lvDWmbKlpF8EO4wGPXIpvYhFbIkxkY=; b=QicBVcaHlc6dT23soZniPvZ2nnquzJ8ZrtICCj3n7q2Kvv3KxVuslxpJdDYU8YnWwS 4G8h3kwAOH7ghknKOpbvn863yT+qSB94jJxt2DyhZiDnmqBFqDuIilz4Q/q8JDWnOUv+ AYDSXmZwqiFWvR2Ts+Tp1lJHSPEYR9XGA8aueH3LUurIFthZaDZpr76LqVAUOZAwAbiV v+Df1SybPwQ97ERstdwiUaGcFj9PY8yoVxGlZf1uaQj0hkdOuPH2LrtF6U26Wmp1ZYrT LZqsObhRv8f0qIyUiyGK83V8j1R0Hm/qdMk2CHWubdLDqsobioCCE1nT5R90pIHgkZ6v 2/Og== X-Gm-Message-State: ALyK8tJVfMpGROXqSLUBTXq5gO96wPmEYVNPy5c5eF0NlvHd0RRsLO9dSjZhWbhSbC+L54y6/cI15xsynop0wg2m X-Received: by 10.157.32.166 with SMTP id x35mr2511609ota.32.1466771223980; Fri, 24 Jun 2016 05:27:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.37.69 with HTTP; Fri, 24 Jun 2016 05:26:34 -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 15:26:34 +0300 Message-ID: Subject: Re: Enable Binary Reflective Serializer in the app.config To: user@ignite.apache.org Content-Type: multipart/alternative; boundary=94eb2c0340a8c5e716053605495d archived-at: Fri, 24 Jun 2016 12:27:18 -0000 --94eb2c0340a8c5e716053605495d Content-Type: text/plain; charset=UTF-8 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 > 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. >> > > --94eb2c0340a8c5e716053605495d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The workaround is to implement raw mode manually via=C2=A0= IBinarizable interface.
It will look like this for the OrderEntity clas= s (field order should be the same in read and write methods):
public=C2=A0void=C2=A0WriteBinary(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, Pavel Tupitsyn <ptupitsyn@gridgain.= com> wrote:
I've reproduced it.=C2=A0
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:=C2=A0ht= tps://issues.apache.org/jira/browse/IGNITE-3364

On Fri, Jun 24, 2016 at 2:15 PM, mrinalkamboj <mrin= al.technology@gmail.com> wrote:
On enabling the rawMode=3D"true", as suggested in the config= uration 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.


--94eb2c0340a8c5e716053605495d--