@@ -1383,7 +1383,7 @@ private Object mapToVertexByTypeCategory(AttributeMutationContext ctx, EntityMut
13831383 objectId .put ("typeName" , getTypeName (inverseVertex ));
13841384 objectId .put ("guid" , GraphHelper .getGuid (inverseVertex ));
13851385
1386- AtlasEntity diffEntity = getOrInitializeDiffEntity (ctx .getReferringVertex ());
1386+ AtlasEntity diffEntity = entityRetriever . getOrInitializeDiffEntity (ctx .getReferringVertex ());
13871387 diffEntity .setAddedRelationshipAttribute (ctx .getAttribute ().getName (), objectId );
13881388 }
13891389 }
@@ -2279,7 +2279,7 @@ public List appendArrayValue(AttributeMutationContext ctx, EntityMutationContext
22792279 }
22802280 }
22812281
2282- AtlasEntity diffEntity = getOrInitializeDiffEntity (ctx .getReferringVertex ());
2282+ AtlasEntity diffEntity = entityRetriever . getOrInitializeDiffEntity (ctx .getReferringVertex ());
22832283 diffEntity .setAddedRelationshipAttribute (attribute .getName (), attrValues );
22842284 }
22852285
@@ -2372,7 +2372,7 @@ public List removeArrayValue(AttributeMutationContext ctx, EntityMutationContext
23722372 attrValues .add (objectId );
23732373 }
23742374
2375- AtlasEntity diffEntity = getOrInitializeDiffEntity (ctx .getReferringVertex ());
2375+ AtlasEntity diffEntity = entityRetriever . getOrInitializeDiffEntity (ctx .getReferringVertex ());
23762376 diffEntity .setRemovedRelationshipAttribute (attribute .getName (), attrValues );
23772377 }
23782378
@@ -2519,18 +2519,6 @@ public static void validateCustomRelationship(AtlasVertex end1Vertex, AtlasVerte
25192519 validateCustomRelationshipCount (currentSize , end2Vertex );
25202520 }
25212521
2522- private AtlasEntity getOrInitializeDiffEntity (AtlasVertex vertex ) {
2523- AtlasEntity diffEntity = RequestContext .get ().getDifferentialEntity (GraphHelper .getGuid (vertex ));
2524- if (diffEntity == null ) {
2525- diffEntity = new AtlasEntity ();
2526- diffEntity .setTypeName (GraphHelper .getTypeName (vertex ));
2527- diffEntity .setGuid (GraphHelper .getGuid (vertex ));
2528- diffEntity .setUpdateTime (new Date (RequestContext .get ().getRequestTime ()));
2529- RequestContext .get ().cacheDifferentialEntity (diffEntity );
2530- }
2531- return diffEntity ;
2532- }
2533-
25342522 private static void validateCustomRelationshipCount (long size , AtlasVertex vertex ) throws AtlasBaseException {
25352523 if (UD_REL_THRESHOLD < size ) {
25362524 throw new AtlasBaseException (AtlasErrorCode .OPERATION_NOT_SUPPORTED ,
@@ -6208,7 +6196,7 @@ public void addHasLineage(Set<AtlasEdge> inputOutputEdges, boolean isRestoreEnti
62086196
62096197 if (getEntityHasLineage (processVertex )) {
62106198 AtlasGraphUtilsV2 .setEncodedProperty (assetVertex , HAS_LINEAGE , true );
6211- AtlasEntity diffEntity = getOrInitializeDiffEntity (assetVertex );
6199+ AtlasEntity diffEntity = entityRetriever . getOrInitializeDiffEntity (assetVertex );
62126200 diffEntity .setAttribute (HAS_LINEAGE , true );
62136201 continue ;
62146202 }
@@ -6226,17 +6214,17 @@ public void addHasLineage(Set<AtlasEdge> inputOutputEdges, boolean isRestoreEnti
62266214 AtlasGraphUtilsV2 .setEncodedProperty (assetVertex , HAS_LINEAGE , true );
62276215 AtlasGraphUtilsV2 .setEncodedProperty (processVertex , HAS_LINEAGE , true );
62286216
6229- AtlasEntity diffEntity = getOrInitializeDiffEntity (assetVertex );
6217+ AtlasEntity diffEntity = entityRetriever . getOrInitializeDiffEntity (assetVertex );
62306218 diffEntity .setAttribute (HAS_LINEAGE , true );
62316219
6232- diffEntity = getOrInitializeDiffEntity (processVertex );
6220+ diffEntity = entityRetriever . getOrInitializeDiffEntity (processVertex );
62336221 diffEntity .setAttribute (HAS_LINEAGE , true );
62346222 isHasLineageSet = true ;
62356223 }
62366224
62376225 if (isRestoreEntity ) {
62386226 AtlasGraphUtilsV2 .setEncodedProperty (oppositeEdgeAssetVertex , HAS_LINEAGE , true );
6239- AtlasEntity diffEntity = getOrInitializeDiffEntity (oppositeEdgeAssetVertex );
6227+ AtlasEntity diffEntity = entityRetriever . getOrInitializeDiffEntity (oppositeEdgeAssetVertex );
62406228 diffEntity .setAttribute (HAS_LINEAGE , true );
62416229 } else {
62426230 break ;
0 commit comments