> On April 19, 2016, 11 a.m., Shwetha GS wrote: > > typesystem/src/main/java/org/apache/atlas/typesystem/types/FieldMapping.java, > > line 99 > > <https://reviews.apache.org/r/45948/diff/3/?file=1348566#file1348566line99> > > > > Can we maintain this as Set<String> and check on just typeName? > > David Kantor wrote: > I don't understand how checking typeName would avoid the infinite > recursion. The problem use case is when structs reference each other. So > let's say there is a bi-directional reference between A and B. When A is > output, its attribute values are output. So then B is output, and when its > attributes are output, FieldMapping.output() is called recursively on A. We > need to detect that A is already in the process of being output to avoid the > infinite recursion. How does checking typeName help with this? Please > advise.
In FieldMappingTest.testOutputReferenceableInstance(), even ownerType.toString() throws stack overflow. So, thought you were addressing type.tostring() For type.toString(), we can use typename. For instance.tostring(), can we use id string, instead of full instance in the set - Shwetha ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45948/#review129505 ----------------------------------------------------------- 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 > >
