atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltf <ltf...@163.com>
Subject Re:Re: Some code questions
Date Tue, 01 Sep 2015 06:44:43 GMT
OK, I'll file a bug and submit the patch.





Best, liutongfeng



At 2015-09-01 14:24:59, "Shwetha Shivalingamurthy" <sshivalingamurthy@hortonworks.com>
wrote:
>1, 2 and 4 look like valid issues. Can you file a bug and submit the
>patches. Thanks
>
>AttributeStores is used in some tests. Memory based repository is not
>used. But can be fixed
>
>
>
>Regards,
>Shwetha
>
>
>
>
>
>
>On 01/09/15 11:43 am, "ltf" <ltfxyz@163.com> wrote:
>
>>Hello,
>>I'm very new to Atlas, and I still in the status of learning.
>>When I browsed the source code of Atlas, I have the following 4
>>questions, maybe or maybe not issues, thanks.
>>
>>
>>1.
>>file : 
>>incubator-atlas\typesystem\src\main\java\org\apache\atlas\typesystem\types
>>\ObjectGraphTraversal.java
>>line : 56
>>    void processValue(IDataType dT, Object val) throws AtlasException {
>>        if (val != null) {
>>            if (dT.getTypeCategory() == DataTypes.TypeCategory.ARRAY) {
>>                IDataType elemType = ((DataTypes.ArrayType)
>>dT).getElemType();
>>                processCollection(elemType, val);
>>            } else if (dT.getTypeCategory() ==
>>DataTypes.TypeCategory.MAP) {
>>                IDataType keyType = ((DataTypes.MapType) dT).getKeyType();
>>                IDataType valueType = ((DataTypes.MapType)
>>dT).getKeyType();    //   should be getValueType();     ???
>>                processMap(keyType, valueType, val);
>>            } else if (dT.getTypeCategory() ==
>>DataTypes.TypeCategory.STRUCT
>>                    || dT.getTypeCategory() ==
>>DataTypes.TypeCategory.TRAIT) {
>>                processStruct(val);
>>            } else if (dT.getTypeCategory() ==
>>DataTypes.TypeCategory.CLASS) {
>>                processReferenceableInstance(val);
>>            }
>>        }
>>    }
>>
>>
>>2. 
>>file : 
>>incubator-atlas\typesystem\src\main\java\org\apache\atlas\typesystem\types
>>\ObjectGraphWalker.java
>>line : 94
>>    void traverseValue(IDataType dT, Object val) throws AtlasException {
>>        if (val != null) {
>>            if (dT.getTypeCategory() == DataTypes.TypeCategory.ARRAY) {
>>                IDataType elemType = ((DataTypes.ArrayType)
>>dT).getElemType();
>>                visitCollection(elemType, val);
>>            } else if (dT.getTypeCategory() ==
>>DataTypes.TypeCategory.MAP) {
>>                IDataType keyType = ((DataTypes.MapType) dT).getKeyType();
>>                IDataType valueType = ((DataTypes.MapType)
>>dT).getKeyType();    //   should be getValueType();     ???
>>                visitMap(keyType, valueType, val);
>>            } else if (dT.getTypeCategory() ==
>>DataTypes.TypeCategory.STRUCT
>>                    || dT.getTypeCategory() ==
>>DataTypes.TypeCategory.TRAIT) {
>>                visitStruct(val);
>>            } else if (dT.getTypeCategory() ==
>>DataTypes.TypeCategory.CLASS) {
>>                visitReferenceableInstance(val);
>>            }
>>        }
>>    }
>>
>>
>>3.
>>file : 
>>incubator-atlas\repository\src\main\java\org\apache\atlas\repository\memor
>>y\AttributeStores.java
>>line : 58
>>    static IAttributeStore createStore(AttributeInfo i) throws
>>RepositoryException {
>>        switch (i.dataType().getTypeCategory()) {
>>        case PRIMITIVE:
>>            if (i.dataType() == DataTypes.BOOLEAN_TYPE) {
>>                return new BooleanAttributeStore(i);
>>            } else if (i.dataType() == DataTypes.BYTE_TYPE) {
>>                return new ByteAttributeStore(i);
>>            } else if (i.dataType() == DataTypes.SHORT_TYPE) {
>>                new ShortAttributeStore(i);
>>                   //   should be return     ???
>>            } else if (i.dataType() == DataTypes.INT_TYPE) {
>>                return new IntAttributeStore(i);
>>
>>
>>4.
>>file : incubator-atlas\src\test\python\scripts\TestMetadata.py
>>line : 52
>>    self.assertTrue(java_mock.called)
>>    if IS_WINDOWS:
>>      java_mock.assert_called_with(
>>        'org.apache.atlas.Main',
>>        ['-app', 'metadata_home/server/webapp/atlas'],
>>           //  when os is WINDOWS, '/' should be '\\', otherwise the test
>>fails, build will stop!!!
>>        
>>'metadata_home/conf:metadata_home/server/webapp/atlas/WEB-INF/classes:meta
>>data_home/server/webapp/atlas/WEB-INF/lib\\*:metadata_home/libext\\*',
>>        ['-Datlas.log.dir=metadata_home/logs',
>>'-Datlas.log.file=application.log', '-Datlas.home=metadata_home',
>>'-Datlas.conf=metadata_home/conf', '-Xmx1024m',
>>'-Dlog4j.configuration=atlas-log4j.xml'], 'metadata_home/logs')
>>    else:
>>
>>
>>Best, liutongfeng
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message