Repository: atlas Updated Branches: refs/heads/master 2fbea9f2b -> fdab2efd7
ATLAS-2924: Use encoded property name in getEncodedProperty() and setEncodedProperty() methods Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/fdab2efd Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/fdab2efd Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/fdab2efd Branch: refs/heads/master Commit: fdab2efd718573a014f445cd54f7d8c477407958 Parents: 2fbea9f Author: Sarath Subramanian <[email protected]> Authored: Tue Oct 16 12:59:13 2018 -0700 Committer: Sarath Subramanian <[email protected]> Committed: Tue Oct 16 12:59:13 2018 -0700 ---------------------------------------------------------------------- .../repository/store/graph/v2/AtlasStructDefStoreV2.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/fdab2efd/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java index f043e0d..1b67f11 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java @@ -49,6 +49,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey; + /** * StructDef store in v1 format. */ @@ -377,7 +379,9 @@ public class AtlasStructDefStoreV2 extends AtlasAbstractDefStoreV2<AtlasStructDe } } - List<String> currAttrNames = vertex.getProperty(AtlasGraphUtilsV2.getTypeDefPropertyKey(structDef), List.class); + String structDefPropertyKey = AtlasGraphUtilsV2.getTypeDefPropertyKey(structDef); + String encodedStructDefPropertyKey = encodePropertyKey(structDefPropertyKey); + List<String> currAttrNames = vertex.getProperty(encodedStructDefPropertyKey, List.class); // delete attributes that are not present in updated structDef if (CollectionUtils.isNotEmpty(currAttrNames)) { @@ -423,7 +427,7 @@ public class AtlasStructDefStoreV2 extends AtlasAbstractDefStoreV2<AtlasStructDe } } - AtlasGraphUtilsV2.setProperty(vertex, AtlasGraphUtilsV2.getTypeDefPropertyKey(structDef), attrNames); + AtlasGraphUtilsV2.setEncodedProperty(vertex, encodedStructDefPropertyKey, attrNames); } public static void updateVertexAddReferences(AtlasStructDef structDef, AtlasVertex vertex,
