diff --git a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/common/mappers/LineageFlagsInputMapper.java b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/common/mappers/LineageFlagsInputMapper.java index 4d1cc10684c1d6..53f68fe3ca50ff 100644 --- a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/common/mappers/LineageFlagsInputMapper.java +++ b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/common/mappers/LineageFlagsInputMapper.java @@ -58,7 +58,10 @@ private static UrnArrayMap mapIgnoreAsHops(List ignoreAsH ignoreAsHop -> result.put( EntityTypeMapper.getName(ignoreAsHop.getEntityType()), - new UrnArray(Optional.ofNullable(ignoreAsHop.getPlatforms()).orElse(Collections.emptyList()).stream() + new UrnArray( + Optional.ofNullable(ignoreAsHop.getPlatforms()) + .orElse(Collections.emptyList()) + .stream() .map(UrnUtils::getUrn) .collect(Collectors.toList())))); return result; diff --git a/metadata-io/src/main/java/com/linkedin/metadata/graph/elastic/ESGraphQueryDAO.java b/metadata-io/src/main/java/com/linkedin/metadata/graph/elastic/ESGraphQueryDAO.java index 5b906fe88183ef..0b4a81fd2efb31 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/graph/elastic/ESGraphQueryDAO.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/graph/elastic/ESGraphQueryDAO.java @@ -391,8 +391,19 @@ private Stream processOneHopLineage( lineageRelationship -> additionalCurrentLevel.add(lineageRelationship.getEntity())); if (!additionalCurrentLevel.isEmpty()) { Stream ignoreAsHopUrns = - processOneHopLineage(additionalCurrentLevel, remainingTime, direction, maxHops, graphFilters, - visitedEntities, viaEntities, existingPaths, exploreMultiplePaths, result, lineageFlags, i); + processOneHopLineage( + additionalCurrentLevel, + remainingTime, + direction, + maxHops, + graphFilters, + visitedEntities, + viaEntities, + existingPaths, + exploreMultiplePaths, + result, + lineageFlags, + i); intermediateStream = Stream.concat(intermediateStream, ignoreAsHopUrns); } } diff --git a/metadata-io/src/main/java/com/linkedin/metadata/search/EntityLineageResultCacheKey.java b/metadata-io/src/main/java/com/linkedin/metadata/search/EntityLineageResultCacheKey.java index 95c015c726ee52..e5e3d4f10f5378 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/search/EntityLineageResultCacheKey.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/search/EntityLineageResultCacheKey.java @@ -14,7 +14,10 @@ public class EntityLineageResultCacheKey { private final Integer entitiesExploredPerHopLimit; public EntityLineageResultCacheKey( - @Nonnull String contextId, Urn sourceUrn, LineageDirection direction, Integer maxHops, + @Nonnull String contextId, + Urn sourceUrn, + LineageDirection direction, + Integer maxHops, Integer entitiesExploredPerHopLimit) { this.contextId = contextId; this.sourceUrn = sourceUrn; diff --git a/metadata-io/src/main/java/com/linkedin/metadata/search/LineageSearchService.java b/metadata-io/src/main/java/com/linkedin/metadata/search/LineageSearchService.java index c342555966ab1d..ce267046efbdbf 100644 --- a/metadata-io/src/main/java/com/linkedin/metadata/search/LineageSearchService.java +++ b/metadata-io/src/main/java/com/linkedin/metadata/search/LineageSearchService.java @@ -153,7 +153,10 @@ public LineageSearchResult searchAcrossLineage( // Cache multihop result for faster performance final EntityLineageResultCacheKey cacheKey = new EntityLineageResultCacheKey( - finalOpContext.getSearchContextId(), sourceUrn, direction, maxHops, + finalOpContext.getSearchContextId(), + sourceUrn, + direction, + maxHops, opContext.getSearchContext().getLineageFlags().getEntitiesExploredPerHopLimit()); CachedEntityLineageResult cachedLineageResult = null; @@ -746,7 +749,10 @@ public LineageScrollResult scrollAcrossLineage( // Cache multihop result for faster performance final EntityLineageResultCacheKey cacheKey = new EntityLineageResultCacheKey( - opContext.getSearchContextId(), sourceUrn, direction, maxHops, + opContext.getSearchContextId(), + sourceUrn, + direction, + maxHops, opContext.getSearchContext().getLineageFlags().getEntitiesExploredPerHopLimit()); CachedEntityLineageResult cachedLineageResult = cacheEnabled ? cache.get(cacheKey, CachedEntityLineageResult.class) : null; diff --git a/metadata-service/factories/src/test/java/com/linkedin/gms/factory/search/CacheTest.java b/metadata-service/factories/src/test/java/com/linkedin/gms/factory/search/CacheTest.java index 65c1042122c6d4..153348e7ec1198 100644 --- a/metadata-service/factories/src/test/java/com/linkedin/gms/factory/search/CacheTest.java +++ b/metadata-service/factories/src/test/java/com/linkedin/gms/factory/search/CacheTest.java @@ -33,7 +33,6 @@ import com.linkedin.metadata.search.cache.CachedEntityLineageResult; import io.datahubproject.metadata.context.OperationContext; import io.datahubproject.test.metadata.context.TestOperationContexts; -import java.time.temporal.ChronoUnit; import java.util.List; import org.javatuples.Quintet; import org.javatuples.Sextet; @@ -185,8 +184,7 @@ public void testLineageCaching() { Cache cache2 = cacheManager2.getCache("relationshipSearchService"); EntityLineageResultCacheKey key = - new EntityLineageResultCacheKey( - "", corpuserUrn, LineageDirection.DOWNSTREAM, 1, null); + new EntityLineageResultCacheKey("", corpuserUrn, LineageDirection.DOWNSTREAM, 1, null); cache1.put(key, cachedEntityLineageResult);