Return-Path: X-Original-To: apmail-atlas-dev-archive@minotaur.apache.org Delivered-To: apmail-atlas-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F256D19454 for ; Mon, 18 Apr 2016 17:17:35 +0000 (UTC) Received: (qmail 82550 invoked by uid 500); 18 Apr 2016 17:17:35 -0000 Delivered-To: apmail-atlas-dev-archive@atlas.apache.org Received: (qmail 82500 invoked by uid 500); 18 Apr 2016 17:17:35 -0000 Mailing-List: contact dev-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list dev@atlas.incubator.apache.org Received: (qmail 82489 invoked by uid 99); 18 Apr 2016 17:17:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Apr 2016 17:17:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 65C661A0274 for ; Mon, 18 Apr 2016 17:17:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.77 X-Spam-Level: X-Spam-Status: No, score=-1.77 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 6PmpMy9G8T3p for ; Mon, 18 Apr 2016 17:17:33 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 0F30A5FB39 for ; Mon, 18 Apr 2016 17:17:32 +0000 (UTC) Received: (qmail 82464 invoked by uid 99); 18 Apr 2016 17:17:32 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Apr 2016 17:17:32 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 352A12B076D; Mon, 18 Apr 2016 17:17:28 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7658381556350909394==" MIME-Version: 1.0 Subject: Re: Review Request 45948: Atlas-645: avoid infinite recursion in FieldMapping.output() From: David Kantor To: Neeru Gupta , Hemanth Yamijala , David Kantor , atlas , Shwetha GS Date: Mon, 18 Apr 2016 17:17:28 -0000 Message-ID: <20160418171728.8135.2466@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: David Kantor X-ReviewGroup: atlas X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/45948/ X-Sender: David Kantor References: <20160413002116.29093.39712@reviews.apache.org> In-Reply-To: <20160413002116.29093.39712@reviews.apache.org> X-ReviewBoard-Diff-For: typesystem/src/test/java/org/apache/atlas/typesystem/types/FieldMappingTest.java Reply-To: David Kantor X-ReviewRequest-Repository: atlas --===============7658381556350909394== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On April 13, 2016, 12:21 a.m., Hemanth Yamijala wrote: > > typesystem/src/main/java/org/apache/atlas/typesystem/types/FieldMapping.java, line 51 > > > > > > This may not be a valid case - maybe Shwetha would know better... but if a FieldMapping instance's output is called from different threads, wouldn't this mutable state cause issues? Can't think of an easy way to fix that very quickly though. So please take a call based on whether it is a valid use case or not. > > Shwetha GS wrote: > Yes, this will not work as there is single instance of type in the system. Can you create the list and pass it in the output() method instead? > > David Kantor wrote: > Rather than passing a list around, I moved the output status tracking to the structs themselves, which are not singletons like FieldMapping. > > Shwetha GS wrote: > outputInProgress shouldn't be a class level field and it has no significance outside of output(). I think it makes more sense to maintain it as argument to output() Agreed, I have changed the implementation to pass an "in process" Set as an argument to FieldMapping.output() and IDataType.output(). Thanks very much for reviewing the code. - David ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45948/#review128589 ----------------------------------------------------------- On April 18, 2016, 5:13 p.m., David Kantor wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45948/ > ----------------------------------------------------------- > > (Updated April 18, 2016, 5:13 p.m.) > > > Review request for atlas. > > > Bugs: ATLAS-645 > https://issues.apache.org/jira/browse/ATLAS-645 > > > Repository: atlas > > > Description > ------- > > ATLAS-645: In FieldMapping.output(), avoid infinite recursion when IReferenceableInstance and IStruct instances reference each other. > > > Diffs > ----- > > typesystem/src/main/java/org/apache/atlas/typesystem/persistence/ReferenceableInstance.java 31ef49d5e6accd8b4621385cce1e3a6b7a6936ff > typesystem/src/main/java/org/apache/atlas/typesystem/persistence/StructInstance.java af62442bfe5daa221079207acf361e1316cab3ad > typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java 92be3c794077bd3e437aa6f3426ed8b7892b945e > typesystem/src/main/java/org/apache/atlas/typesystem/types/ClassType.java 90cf3ccfe8e9d0e20901452c0b83796ba3994998 > typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java 55ec91f5c3cba65f1bf7c524c84c075cc1c96dff > typesystem/src/main/java/org/apache/atlas/typesystem/types/FieldMapping.java 36149bafff80b68ce176e82dcacac87035459362 > typesystem/src/main/java/org/apache/atlas/typesystem/types/IDataType.java 373ad2c93efdecc292b68fab1ea2403afce84dac > typesystem/src/main/java/org/apache/atlas/typesystem/types/StructType.java 54e344f5d6322a00ac7825ee8964f43a1552dcbe > typesystem/src/main/java/org/apache/atlas/typesystem/types/TraitType.java 84c22bf96a059a78b065a73a8feefae87deb9975 > typesystem/src/main/java/org/apache/atlas/typesystem/types/TypedStructHandler.java da246d66d94bcd3e221b70b859de2850fa6cf7a8 > typesystem/src/test/java/org/apache/atlas/typesystem/types/FieldMappingTest.java PRE-CREATION > > Diff: https://reviews.apache.org/r/45948/diff/ > > > Testing > ------- > > Ran all unit and integration tests with no regressions. Added test cases > > > Thanks, > > David Kantor > > --===============7658381556350909394==--