You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by David Radley <da...@uk.ibm.com> on 2017/01/16 17:36:13 UTC
Entity API V2 question
Hi,
I am looking at Jira ATLAS-1458 . If we define a type that points to a
second type that has references back and uses constraints, we get an
infinite loop in toString. I can circumvent this by caching the guids we
have seen already in toString() processing, so we do not put out the same
guid twice, thus ending that loop. After this patch, it then loops in the
GSON serialization in the toJSON method. It looks like we could amend this
to use a GSON exclusion strategy.
I then remembered at V1, we had hrefs for references. This seems to have
been removed from the V2 POJO API, which leaves us open to these infinite
loops. It seems to me that the v1 hrefs would be preferable to the
circumventions I am contemplating above,
all the best, David.
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Re: Entity API V2 question
Posted by David Radley <da...@uk.ibm.com>.
Hi Madhan,
I have added json files to the Jira,
Thanks, David.
From: Madhan Neethiraj <ma...@apache.org>
To: "dev@atlas.incubator.apache.org" <de...@atlas.incubator.apache.org>
Date: 16/01/2017 22:06
Subject: Re: Entity API V2 question
Sent by: Madhan Neethiraj <mn...@hortonworks.com>
David,
It will make it easier to understand and discuss if entity-def json is
available (similar to the ones under directory addons/models); can you
please attach to the JIRA?
Thanks,
Madhan
On 1/16/17, 9:36 AM, "David Radley" <da...@uk.ibm.com> wrote:
Hi,
I am looking at Jira ATLAS-1458 . If we define a type that points to a
second type that has references back and uses constraints, we get an
infinite loop in toString. I can circumvent this by caching the guids
we
have seen already in toString() processing, so we do not put out the
same
guid twice, thus ending that loop. After this patch, it then loops in
the
GSON serialization in the toJSON method. It looks like we could amend
this
to use a GSON exclusion strategy.
I then remembered at V1, we had hrefs for references. This seems to
have
been removed from the V2 POJO API, which leaves us open to these
infinite
loops. It seems to me that the v1 hrefs would be preferable to the
circumventions I am contemplating above,
all the best, David.
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with
number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Re: Entity API V2 question
Posted by Madhan Neethiraj <ma...@apache.org>.
David,
It will make it easier to understand and discuss if entity-def json is available (similar to the ones under directory addons/models); can you please attach to the JIRA?
Thanks,
Madhan
On 1/16/17, 9:36 AM, "David Radley" <da...@uk.ibm.com> wrote:
Hi,
I am looking at Jira ATLAS-1458 . If we define a type that points to a
second type that has references back and uses constraints, we get an
infinite loop in toString. I can circumvent this by caching the guids we
have seen already in toString() processing, so we do not put out the same
guid twice, thus ending that loop. After this patch, it then loops in the
GSON serialization in the toJSON method. It looks like we could amend this
to use a GSON exclusion strategy.
I then remembered at V1, we had hrefs for references. This seems to have
been removed from the V2 POJO API, which leaves us open to these infinite
loops. It seems to me that the v1 hrefs would be preferable to the
circumventions I am contemplating above,
all the best, David.
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU