atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltf <ltf...@163.com>
Subject [Atlas] A source code question
Date Wed, 16 Sep 2015 07:50:41 GMT
Hello,
In the following code, for ENUM, the key for fieldPos is i.name, but others are attrName.
Is it a issue??? Thanks.




file : org/apache/atlas/typesystem/types/HierarchicalType.java
protected Pair<FieldMapping, ImmutableMap<String, String>> constructFieldMapping(ImmutableList<String>
superTypes, AttributeInfo... fields) throws AtlasException { ... String attrName = i.name;
if (fieldsMap.containsKey(attrName)) { attrName = currentPath.addOverrideAttr(attrName); }
attributeNameToType.put(attrName, superType.getName()); fieldsMap.put(attrName, i); fieldNullPos.put(attrName,
fieldNullPos.size()); if (i.dataType() == DataTypes.BOOLEAN_TYPE) { fieldPos.put(attrName,
numBools); numBools++; } else if (i.dataType() == DataTypes.BYTE_TYPE) { fieldPos.put(attrName,
numBytes); numBytes++; } else if (i.dataType() == DataTypes.SHORT_TYPE) { fieldPos.put(attrName,
numShorts); numShorts++; } else if (i.dataType() == DataTypes.INT_TYPE) { fieldPos.put(attrName,
numInts); numInts++; } else if (i.dataType() == DataTypes.LONG_TYPE) { fieldPos.put(attrName,
numLongs); numLongs++; } else if (i.dataType() == DataTypes.FLOAT_TYPE) { fieldPos.put(attrName,
numFloats); numFloats++; } else if (i.dataType() == DataTypes.DOUBLE_TYPE) { fieldPos.put(attrName,
numDoubles); numDoubles++; } else if (i.dataType() == DataTypes.BIGINTEGER_TYPE) { fieldPos.put(attrName,
numBigInts); numBigInts++; } else if (i.dataType() == DataTypes.BIGDECIMAL_TYPE) { fieldPos.put(attrName,
numBigDecimals); numBigDecimals++; } else if (i.dataType() == DataTypes.DATE_TYPE) { fieldPos.put(attrName,
numDates); numDates++; } else if (i.dataType() == DataTypes.STRING_TYPE) { fieldPos.put(attrName,
numStrings); numStrings++; } else if (i.dataType().getTypeCategory() == DataTypes.TypeCategory.ENUM)
{ fieldPos.put(i.name, numInts); numInts++; } else if (i.dataType().getTypeCategory() == DataTypes.TypeCategory.ARRAY)
{ fieldPos.put(attrName, numArrays); numArrays++;








Best, liutongfeng




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