atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Kantor <dkan...@us.ibm.com>
Subject Re: Review Request 45948: Atlas-645: avoid infinite recursion in FieldMapping.output()
Date Mon, 18 Apr 2016 17:17:28 GMT


> On April 13, 2016, 12:21 a.m., Hemanth Yamijala wrote:
> > typesystem/src/main/java/org/apache/atlas/typesystem/types/FieldMapping.java, line
51
> > <https://reviews.apache.org/r/45948/diff/1/?file=1337582#file1337582line51>
> >
> >     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
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message