Repository: atlas Updated Branches: refs/heads/master 945de013f -> 8129bade5
ATLAS-2967: set and read homeId in relationship Signed-off-by: grahamwallis <graham_wal...@uk.ibm.com> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/8129bade Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/8129bade Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/8129bade Branch: refs/heads/master Commit: 8129bade53d1f2ad7a5de07c8254612b5c7a1f1f Parents: 945de01 Author: Graham Wallis <grahamwallis@Grahams-MacBook-Pro.local> Authored: Mon Nov 19 11:34:21 2018 +0000 Committer: grahamwallis <graham_wal...@uk.ibm.com> Committed: Mon Nov 19 11:41:10 2018 +0000 ---------------------------------------------------------------------- .../repository/store/graph/v2/AtlasRelationshipStoreV2.java | 4 +++- .../atlas/repository/store/graph/v2/EntityGraphRetriever.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/8129bade/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java index 6bc36b3..86cc98c 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java @@ -71,10 +71,11 @@ import static org.apache.atlas.model.instance.AtlasEntity.Status.DELETED; import static org.apache.atlas.model.typedef.AtlasRelationshipDef.PropagateTags.ONE_TO_TWO; import static org.apache.atlas.model.typedef.AtlasRelationshipDef.PropagateTags.TWO_TO_ONE; import static org.apache.atlas.repository.Constants.ENTITY_TYPE_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.HOME_ID_KEY; +import static org.apache.atlas.repository.Constants.PROVENANCE_TYPE_KEY; import static org.apache.atlas.repository.Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY; import static org.apache.atlas.repository.Constants.RELATIONSHIP_GUID_PROPERTY_KEY; import static org.apache.atlas.repository.Constants.VERSION_PROPERTY_KEY; -import static org.apache.atlas.repository.Constants.PROVENANCE_TYPE_KEY; import static org.apache.atlas.repository.graph.GraphHelper.getBlockedClassificationIds; @@ -750,6 +751,7 @@ public class AtlasRelationshipStoreV2 implements AtlasRelationshipStore { AtlasGraphUtilsV2.setEncodedProperty(ret, ENTITY_TYPE_PROPERTY_KEY, relationship.getTypeName()); AtlasGraphUtilsV2.setEncodedProperty(ret, RELATIONSHIP_GUID_PROPERTY_KEY, guid); + AtlasGraphUtilsV2.setEncodedProperty(ret, HOME_ID_KEY, relationship.getHomeId()); AtlasGraphUtilsV2.setEncodedProperty(ret, VERSION_PROPERTY_KEY, getRelationshipVersion(relationship)); AtlasGraphUtilsV2.setEncodedProperty(ret, PROVENANCE_TYPE_KEY, relationship.getProvenanceType()); AtlasGraphUtilsV2.setEncodedProperty(ret, RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, tagPropagation.name()); http://git-wip-us.apache.org/repos/asf/atlas/blob/8129bade/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java index 912bc3e..066abc1 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java @@ -1199,6 +1199,7 @@ public final class EntityGraphRetriever { provenanceType = Integer.valueOf(0); } relationship.setProvenanceType(provenanceType); + relationship.setHomeId(GraphHelper.getHomeId(edge)); relationship.setStatus(GraphHelper.getEdgeStatus(edge));