@@ -284,26 +284,23 @@ private AtlasLineageOnDemandInfo getLineageInfoOnDemand(String guid, AtlasLineag
284
284
LineageOnDemandConstraints lineageConstraintsByGuid = getAndValidateLineageConstraintsByGuid (guid , atlasLineageOnDemandContext );
285
285
AtlasLineageOnDemandInfo .LineageDirection direction = lineageConstraintsByGuid .getDirection ();
286
286
int depth = lineageConstraintsByGuid .getDepth ();
287
-
288
287
AtlasLineageOnDemandInfo ret = initializeLineageOnDemandInfo (guid );
289
288
290
- if (depth == 0 ) {
289
+ if (depth == 0 )
291
290
depth = -1 ;
292
- }
293
-
294
- if (!ret .getRelationsOnDemand ().containsKey (guid )) {
291
+ if (!ret .getRelationsOnDemand ().containsKey (guid ))
295
292
ret .getRelationsOnDemand ().put (guid , new LineageInfoOnDemand (lineageConstraintsByGuid ));
296
- }
293
+
297
294
AtomicInteger inputEntitiesTraversed = new AtomicInteger (0 );
298
295
AtomicInteger outputEntitiesTraversed = new AtomicInteger (0 );
299
296
if (isDataSet ) {
300
297
AtlasVertex datasetVertex = AtlasGraphUtilsV2 .findByGuid (this .graph , guid );
301
- if (direction == AtlasLineageOnDemandInfo .LineageDirection .INPUT || direction == AtlasLineageOnDemandInfo .LineageDirection .BOTH ) {
298
+ if (direction == AtlasLineageOnDemandInfo .LineageDirection .INPUT || direction == AtlasLineageOnDemandInfo .LineageDirection .BOTH )
302
299
traverseEdgesOnDemand (datasetVertex , true , depth , new HashSet <>(), atlasLineageOnDemandContext , ret , guid , inputEntitiesTraversed );
303
- }
304
- if (direction == AtlasLineageOnDemandInfo .LineageDirection .OUTPUT || direction == AtlasLineageOnDemandInfo .LineageDirection .BOTH ) {
300
+ if (direction == AtlasLineageOnDemandInfo .LineageDirection .OUTPUT || direction == AtlasLineageOnDemandInfo .LineageDirection .BOTH )
305
301
traverseEdgesOnDemand (datasetVertex , false , depth , new HashSet <>(), atlasLineageOnDemandContext , ret , guid , outputEntitiesTraversed );
306
- }
302
+ AtlasEntityHeader baseEntityHeader = entityRetriever .toAtlasEntityHeader (datasetVertex , atlasLineageOnDemandContext .getAttributes ());
303
+ ret .getGuidEntityMap ().put (guid , baseEntityHeader );
307
304
} else {
308
305
AtlasVertex processVertex = AtlasGraphUtilsV2 .findByGuid (this .graph , guid );
309
306
// make one hop to the next dataset vertices from process vertex and traverse with 'depth = depth - 1'
@@ -317,7 +314,6 @@ private AtlasLineageOnDemandInfo getLineageInfoOnDemand(String guid, AtlasLineag
317
314
}
318
315
}
319
316
RequestContext .get ().endMetricRecord (metricRecorder );
320
-
321
317
return ret ;
322
318
}
323
319
0 commit comments