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 60A06200C8E for ; Thu, 8 Jun 2017 16:16:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5F2E5160BD5; Thu, 8 Jun 2017 14:16:18 +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 0A823160BCA for ; Thu, 8 Jun 2017 16:16:16 +0200 (CEST) Received: (qmail 37304 invoked by uid 500); 8 Jun 2017 14:16: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 37294 invoked by uid 99); 8 Jun 2017 14:16:16 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jun 2017 14:16:16 +0000 Received: from mail-ot0-f175.google.com (mail-ot0-f175.google.com [74.125.82.175]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id B57141A0048 for ; Thu, 8 Jun 2017 14:16:15 +0000 (UTC) Received: by mail-ot0-f175.google.com with SMTP id a2so23943749oth.2 for ; Thu, 08 Jun 2017 07:16:15 -0700 (PDT) X-Gm-Message-State: AKS2vOwQxguNNRyiIclta4uQ+9NF/Saek8F56DDXnRB+Xv/MRG8UglVx v3fhUDCiqWfVvSgSIfD0+ttcPrZfQ049 X-Received: by 10.157.56.225 with SMTP id k30mr19120040ote.152.1496931374941; Thu, 08 Jun 2017 07:16:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.56.180 with HTTP; Thu, 8 Jun 2017 07:15:44 -0700 (PDT) In-Reply-To: References: From: Pavel Tupitsyn Date: Thu, 8 Jun 2017 17:15:44 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Get by key only working on .net for certain long literal values To: user@ignite.apache.org Content-Type: multipart/alternative; boundary="001a11c02158db658b0551737e34" archived-at: Thu, 08 Jun 2017 14:16:18 -0000 --001a11c02158db658b0551737e34 Content-Type: text/plain; charset="UTF-8" Gordon, I have reproduced the issue. I will investigate it and get back to you later. Pavel On Thu, Jun 8, 2017 at 2:46 PM, Gordon Reid (Nine Mile) < gordon.reid@ninemilefinancial.com> wrote: > Thanks Pavel. > > > > The objects are loaded on the Java side, which is the server node. Reading > from Java client node works fine always. But reading from .net client gives > the problem mentioned. > > > > Yes, BinaryIdMapper and BinaryNameMapper are configured as per the wiki. > > > > Java side > > BinaryConfiguration bcfg = new BinaryConfiguration(); > > bcfg.setCompactFooter(true); > > bcfg.setIdMapper(new BinaryBasicIdMapper(true)); > > bcfg.setNameMapper(new BinaryBasicNameMapper(true)); > > icfg.setBinaryConfiguration(bcfg); > > > > .NET side > > var binaryTypes = new [] > > { > > .... > > typeof(SecurityKey), > > typeof(Security), > > .... > > } > > > > > > cfg.BinaryConfiguration = new BinaryConfiguration(binaryTypes) > > { > > NameMapper = new BinaryBasicNameMapper { IsSimpleName = > true } > > }; > > > > > > > > *From:* Pavel Tupitsyn [mailto:ptupitsyn@apache.org] > *Sent:* Thursday, 8 June 2017 6:55 PM > > *To:* user@ignite.apache.org > *Subject:* Re: Get by key only working on .net for certain long literal > values > > > > I've tried to use your class as a cache key and it seems to work, see > attached program. > > > > * How do you add these objects to cache? Is it from Java or .NET? > > * Have you configured BinaryIdMapper on .NET and Java sides properly so > that classes map to each other? > > > > Pavel > > > > On Thu, Jun 8, 2017 at 12:07 AM, Gordon Reid (Nine Mile) ninemilefinancial.com> wrote: > > Hi. Yes, I am on 2.0. > > Get Outlook for Android > > > ------------------------------ > > *From:* Pavel Tupitsyn > *Sent:* Thursday, June 8, 2017 12:26:41 AM > *To:* user@ignite.apache.org > *Subject:* Re: Get by key only working on .net for certain long literal > values > > > > Hi Gordon, > > > > Seems like all your threads are related: > > http://apache-ignite-users.70518.x6.nabble.com/BinaryIdentityResolver-is- > gone-in-2-0-but-default-seems-to-have-a-problem-td13444.html > > http://apache-ignite-users.70518.x6.nabble.com/UPDATED- > BinaryIdentityResolver-is-gone-in-2-0-but-default-seems- > to-have-a-problem-td13445.html > > > > Let's discuss them here. > > > > First of all, can you confirm that you are on Ignite 2.0? > > > > Pavel > > > > On Wed, Jun 7, 2017 at 11:03 AM, Gordon Reid (Nine Mile) ninemilefinancial.com> wrote: > > Hi There, > > > > This one is very strange. > > > > I have a .NET client, Java client and Java server. All running locally on > windows desktop. > > > > On the server side I have some cache entries, SecurityKey,Security > > > > I have two Security objects, one with id=4 and one with id=953 > > > > On the Java client, this works no problem > > > > SystemContext.getCache().get(new SecurityKey(4)); > > SystemContext.getCache().get(new SecurityKey(953)); > > > > > > On the .NET client > > > > (Security)SystemContext.Cache.Get(new SecurityKey() { Id = 4 }); > > > > Will succeed > > > > (Security)SystemContext.Cache.Get(new SecurityKey() { Id = 953 }); > > > > Will FAIL, with KeyNotFoundException > > > > This is the case 100% of the time, even after full restart of the > environment. The only thing that seems to cause the problem is the literal > value of the id > > > > Also note that if I iterate over the cache on the .NET side, I can > absolutely see the SecurityKey with id=953, but I will see KeyNotFound when > I try to Get > > > > foreach (var e in SystemContext.Cache) > > { > > if (e.Key is SecurityKey) > > { > > Log.Info(((SecurityKey)e.Key).Id); // this will print > both 4 and 953 > > } > > } > > > > My only guess here is that something funny is going on internally with the > hashing of the binary object fields. So the equality test is failing when > the get is done from the .NET client?? > > > > I have attached the key class as it is on the .NET side and the Java side. > > > > Any thoughts are much appreciated. Thanks! > > > > > > This email and any attachments are proprietary & confidential and are > intended solely for the use of the individuals to whom it is addressed. Any > views or opinions expressed are solely for those of the author and do not > necessarily reflect those of Nine Mile Financial Pty. Limited. If you have > received this email in error, please let us know immediately by reply email > and delete from your system. Nine Mile Financial Pty. Limited. ABN: 346 > 1349 0252 > > > > > > > > This email and any attachments are proprietary & confidential and are > intended solely for the use of the individuals to whom it is addressed. Any > views or opinions expressed are solely for those of the author and do not > necessarily reflect those of Nine Mile Financial Pty. Limited. If you have > received this email in error, please let us know immediately by reply email > and delete from your system. Nine Mile Financial Pty. Limited. ABN: 346 > 1349 0252 > > > > > > > > This email and any attachments are proprietary & confidential and are > intended solely for the use of the individuals to whom it is addressed. Any > views or opinions expressed are solely for those of the author and do not > necessarily reflect those of Nine Mile Financial Pty. Limited. If you have > received this email in error, please let us know immediately by reply email > and delete from your system. Nine Mile Financial Pty. Limited. ABN: 346 > 1349 0252 > --001a11c02158db658b0551737e34 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Gordon, I have reproduced the issue.
I will investigat= e it and get back to you later.

Pavel
<= div class=3D"gmail_extra">
On Thu, Jun 8, 201= 7 at 2:46 PM, Gordon Reid (Nine Mile) <gordon.reid@ninemil= efinancial.com> wrote:

Thanks Pavel.

=C2=A0

The objects are loaded on the Java si= de, which is the server node. Reading from Java client node works fine alwa= ys. But reading from .net client gives the problem mentioned.

=C2=A0

Yes, BinaryIdMapper and BinaryNameMap= per are configured as per the wiki.

=C2=A0

Java side

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BinaryConfiguration bcfg =3D new BinaryConfi= guration();

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bcfg.setCompactFooter(true);

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bcfg.setIdMapper(new BinaryBasicIdMapper(tru= e));

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bcfg.setNameMapper(new BinaryBasicNameMapper= (true));

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 icfg.setBinaryConfiguration(bcfg);

=C2=A0

.NET side

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 var binaryTypes =3D new []

=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=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=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 typeof(SecurityKey),=

=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=C2=A0 typeof(Security),=

=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=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=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=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=C2=A0 cfg.BinaryConfiguration =3D new BinaryConfig= uration(binaryTypes)

=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=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NameMapper =3D new B= inaryBasicNameMapper { IsSimpleName =3D true }=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=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=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=C2=A0};

=C2=A0

=C2=A0

=C2=A0

From: = Pavel Tupitsyn [mailto:ptupitsyn@apache.org]
Sent: Thursday, 8 June 2017 6:55 PM


To: user= @ignite.apache.org
Subject: Re: Get by key only working on .net for certain long litera= l values

=C2=A0

I've tried to use your class as a cache key and = it seems to work, see attached program.

=C2=A0

* How do you add these objects to cache? Is it from = Java or .NET?

* Have you configured BinaryIdMapper on .NET and Jav= a sides properly so that classes map to each other?

=C2=A0

Pavel

=C2=A0

On Thu, Jun 8, 2017 at 12:07 AM, Gordon Reid (Nine M= ile) <gordon.reid@ninemilefinancial.com> wrote:

Hi. Yes, I am on 2.0.

=C2=A0<= u>


From: Pavel = Tupitsyn <ptup= itsyn@apache.org>
Sent: Thursday, June 8, 2017 12:26:41 AM
To: user= @ignite.apache.org
Subject: Re: Get by key only working on .net for certain long litera= l values

=C2=A0

=C2=A0

On Wed, Jun 7, 2017 at 11:03 AM, Gordon Reid (Nine M= ile) <gordon.reid@ninemilefinancial.com> wrote:

Hi There,

=C2=A0

This one is very strange.

=C2=A0

I have a .NET client, Java client and Java server. A= ll running locally on windows desktop.

=C2=A0

On the server side I have some cache entries, Securi= tyKey,Security

=C2=A0

I have two Security objects, one with id=3D4 and one= with id=3D953

=C2=A0

On the Java client, this works no problem<= /u>

=C2=A0

SystemContext.getCache().get(new SecurityKey(4));

SystemContext.getCache().get(new S=
ecurityKey(953<=
span style=3D"font-size:9.0pt;color:#a9b7c6">));

=C2=A0

=C2=A0

On the .NET client

=C2=A0

(Security)SystemContext.Cache.Get(new S= ecurityKey() { Id =3D 4 });

=C2=A0

Will succeed

=C2=A0

(Security)SystemContext.Cache.Get(new S= ecurityKey() { Id =3D 953 });

=C2=A0

Will FAIL, with KeyNotFoundException<= u>

=C2=A0

This is the case 100% of the time, even after full r= estart of the environment. The only thing that seems to cause the problem i= s the literal value of the id

=C2=A0

Also note that if I iterate over the cache on the .N= ET side, I can absolutely see the SecurityKey with id=3D953, but I will see= KeyNotFound when I try to Get

=C2=A0

=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 foreach (var e i= n S= ystemContext.Cache)

=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=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 if (e.Key is S= ecurityKey)

=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= =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=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Log.Info(((SecurityKey)e.Key).Id); // this will print both 4 and 953

=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= =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

My only guess here is th= at something funny is going on internally with the hashing of the binary ob= ject fields. So the equality test is failing when the get is done from the .NET client??

=C2=A0<= /u>

I have attached the key = class as it is on the .NET side and the Java side.

=C2=A0<= /u>

Any thoughts are much ap= preciated. Thanks!

=C2=A0

=C2=A0

This email and any attachments are proprietary & c= onfidential and are intended solely for the use of the individuals to whom it is addressed. Any views or opinions expressed are solely for th= ose of the author and do not necessarily reflect those of Nine Mile Financi= al Pty. Limited. If you have received this email in error, please let us kn= ow immediately by reply email and delete from your system. Nine Mile Financial Pty. Limited. ABN: 346 1349 0= 252

=C2=A0

=C2=A0

=C2=A0

This email and any attachments are proprietary & c= onfidential and are intended solely for the use of the individuals to whom it is addressed. Any views or opinions expressed are solely for th= ose of the author and do not necessarily reflect those of Nine Mile Financi= al Pty. Limited. If you have received this email in error, please let us kn= ow immediately by reply email and delete from your system. Nine Mile Financial Pty. Limited. ABN: 346 1349 0= 252

=C2=A0

=C2=A0

=C2=A0

This email and any attachments are proprietary & c= onfidential and are intended solely for the use of the individuals to whom = it is addressed. Any views or opinions expressed are solely for those of the author and do not necessarily reflect those of Nin= e Mile Financial Pty. Limited. If you have received this email in error, pl= ease let us know immediately by reply email and delete from your system. Ni= ne Mile Financial Pty. Limited. ABN: 346 1349 0252


--001a11c02158db658b0551737e34--