You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by woo charles <ig...@gmail.com> on 2017/06/06 13:57:31 UTC

Affinity Collocation and missing data

hi,
I have tried to implement the cache with Affinity Collocation

Object personKey1 = new AffinityKey("myPersonId1",
"myCompanyId");Object personKey2 = new AffinityKey("myPersonId2",
"myCompanyId");
 Person p1 = new Person(personKey1, ...);Person p2 = new
Person(personKey2, ...);
 // Both, the company and the person objects will be cached on the
same node.cache.put("myCompanyId", new
Company(..));cache.put(personKey1, p1);cache.put(personKey2, p2);


I have successfully put the company and its relevant Person into the same
node.
But, I cannot get the expected numbers of records from the cache.


I have 3 server nodes, 2 company (Company A, Company B), each company has 4
persons.
Server1 : CompanyA, P1, P2, P3, P4
Server2 : NULL
Server3 : CompanyB , P11, P12, P13, P14

I did the query task in the web console.

select * from Campany as c left join Person as p on c.comp_id = p.comp_id

Actual Result: 2,  Expected: 8

The interesting part is that the result return of contains data from
Company only but not the data  from Person.

I have tried to repeat the query node by node. it returns 4 records in
server1 and 0 records  in server 2 and 4 records in server3, which are the
expected.

I am not sure what is going wrong.

Re: Affinity Collocation and missing data

Posted by afedotov <al...@gmail.com>.
Hi.

Could you please share your Ignite configuration?
As well, does running the query from code via SqlFieldsQuery give you the
same results?

Kind regards,
Alex.

On Tue, Jun 6, 2017 at 4:57 PM, woo charles [via Apache Ignite Users] <
ml+s70518n13417h61@n6.nabble.com> wrote:

> hi,
> I have tried to implement the cache with Affinity Collocation
>
> Object personKey1 = new AffinityKey("myPersonId1", "myCompanyId");Object personKey2 = new AffinityKey("myPersonId2", "myCompanyId");
>  Person p1 = new Person(personKey1, ...);Person p2 = new Person(personKey2, ...);
>  // Both, the company and the person objects will be cached on the same node.cache.put("myCompanyId", new Company(..));cache.put(personKey1, p1);cache.put(personKey2, p2);
>
>
> I have successfully put the company and its relevant Person into the same
> node.
> But, I cannot get the expected numbers of records from the cache.
>
>
> I have 3 server nodes, 2 company (Company A, Company B), each company has
> 4 persons.
> Server1 : CompanyA, P1, P2, P3, P4
> Server2 : NULL
> Server3 : CompanyB , P11, P12, P13, P14
>
> I did the query task in the web console.
>
> select * from Campany as c left join Person as p on c.comp_id = p.comp_id
>
> Actual Result: 2,  Expected: 8
>
> The interesting part is that the result return of contains data from
> Company only but not the data  from Person.
>
> I have tried to repeat the query node by node. it returns 4 records in
> server1 and 0 records  in server 2 and 4 records in server3, which are the
> expected.
>
> I am not sure what is going wrong.
>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Affinity-
> Collocation-and-missing-data-tp13417.html
> To start a new topic under Apache Ignite Users, email
> ml+s70518n1h65@n6.nabble.com
> To unsubscribe from Apache Ignite Users, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-Collocation-and-missing-data-tp13417p13418.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.