Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanHolstien committed Mar 23, 2024
1 parent 5669ff8 commit daca6a7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ private static UrnArrayMap mapIgnoreAsHops(List<EntityTypeToPlatforms> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,19 @@ private Stream<Urn> processOneHopLineage(
lineageRelationship -> additionalCurrentLevel.add(lineageRelationship.getEntity()));
if (!additionalCurrentLevel.isEmpty()) {
Stream<Urn> 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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit daca6a7

Please sign in to comment.