Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 11555f7e1 -> ee7411082


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/ee741108
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/ee741108
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/ee741108

Branch: refs/heads/branch-0.8
Commit: ee7411082e1b192ef7b67c1188bb271ff9358abf
Parents: 11555f7
Author: Sarath Subramanian <ssubraman...@hortonworks.com>
Authored: Tue Oct 16 12:03:03 2018 -0700
Committer: Sarath Subramanian <ssubraman...@hortonworks.com>
Committed: Tue Oct 16 12:03:03 2018 -0700

----------------------------------------------------------------------
 .../atlas/repository/graph/TypedInstanceToGraphMapper.java     | 3 ++-
 .../atlas/repository/store/graph/v1/EntityGraphRetriever.java  | 6 ++++--
 .../atlas/repository/typestore/GraphBackedTypeStore.java       | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/ee741108/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
index 7075b53..d43e09e 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
@@ -58,6 +58,7 @@ import java.util.Map;
 import java.util.Set;
 
 import static org.apache.atlas.repository.graph.GraphHelper.string;
+import static 
org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey;
 
 @Component
 @Deprecated
@@ -77,7 +78,7 @@ public final class TypedInstanceToGraphMapper {
         this.deleteHandler = deleteHandler;
     }
 
-    private final String SIGNATURE_HASH_PROPERTY_KEY = 
Constants.INTERNAL_PROPERTY_KEY_PREFIX + "signature";
+    private final String SIGNATURE_HASH_PROPERTY_KEY = 
encodePropertyKey(Constants.INTERNAL_PROPERTY_KEY_PREFIX + "signature");
 
     public enum Operation {
         CREATE,

http://git-wip-us.apache.org/repos/asf/atlas/blob/ee741108/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
index 5395b7a..0445e27 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
@@ -60,6 +60,7 @@ import java.util.Set;
 
 import static org.apache.atlas.model.typedef.AtlasBaseTypeDef.*;
 import static org.apache.atlas.repository.graph.GraphHelper.EDGE_LABEL_PREFIX;
+import static 
org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey;
 
 @Component
 public final class EntityGraphRetriever {
@@ -491,9 +492,10 @@ public final class EntityGraphRetriever {
         Map<String, AtlasObjectId> ret          = new 
HashMap<>(mapKeys.size());
 
         for (Object mapKey : mapKeys) {
-            final String keyPropertyName = String.format(MAP_VALUE_FORMAT, 
propertyName, mapKey);
+            String        keyPropertyName        = 
String.format(MAP_VALUE_FORMAT, propertyName, mapKey);
+            String        encodedKeyPropertyName = 
encodePropertyKey(keyPropertyName);
+            AtlasObjectId mapValue               = 
mapVertexToObjectIdForSoftRef(entityVertex, encodedKeyPropertyName);
 
-            AtlasObjectId mapValue = 
mapVertexToObjectIdForSoftRef(entityVertex, keyPropertyName);
             if (mapValue != null) {
                 ret.put((String) mapKey, mapValue);
             }

http://git-wip-us.apache.org/repos/asf/atlas/blob/ee741108/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
 
b/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
index 9e6ad18..ba71c1e 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
@@ -295,7 +295,7 @@ public class GraphBackedTypeStore implements ITypeStore {
         List<String> values = GraphHelper.getListProperty(vertex, 
getPropertyKey(typeName));
         for (String value : values) {
             String valueProperty = getPropertyKey(typeName, value);
-            enumValues.add(new EnumValue(value, 
AtlasGraphUtilsV1.getEncodedProperty(vertex, valueProperty, Integer.class)));
+            enumValues.add(new EnumValue(value, 
AtlasGraphUtilsV1.getProperty(vertex, valueProperty, Integer.class)));
         }
         return new EnumTypeDefinition(typeName, typeDescription, 
enumValues.toArray(new EnumValue[enumValues.size()]));
     }

Reply via email to