Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 b085c2cf5 -> 902bd153e


ATLAS-2924: Use encoded property name in getEncodedProperty() and 
setEncodedProperty() methods

(cherry picked from commit fdab2efd718573a014f445cd54f7d8c477407958)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/902bd153
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/902bd153
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/902bd153

Branch: refs/heads/branch-1.0
Commit: 902bd153e44adc5432225071ff7409b056a13ff4
Parents: b085c2c
Author: Sarath Subramanian <[email protected]>
Authored: Tue Oct 16 12:59:13 2018 -0700
Committer: Sarath Subramanian <[email protected]>
Committed: Tue Oct 16 13:47:58 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/902bd153/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 bcd805e..841556e 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,

Reply via email to