mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-28 19:05:53 +00:00
Refactor code to improve di pipeline performance (#17820)
This commit is contained in:
parent
dbbd932cf7
commit
4ae318f11b
@ -7,7 +7,6 @@ import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.ENTI
|
|||||||
import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.TIMESTAMP_KEY;
|
import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.TIMESTAMP_KEY;
|
||||||
import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getUpdatedStats;
|
import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getUpdatedStats;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -52,11 +51,14 @@ public class DataInsightsEntityEnricherProcessor
|
|||||||
try {
|
try {
|
||||||
enrichedMaps =
|
enrichedMaps =
|
||||||
input.getData().stream()
|
input.getData().stream()
|
||||||
.map(entity -> getEntityVersions(entity, contextData))
|
.flatMap(
|
||||||
.flatMap(Collection::stream)
|
entity ->
|
||||||
.map(entityVersionMap -> enrichEntity(entityVersionMap, contextData))
|
getEntityVersions(entity, contextData).stream()
|
||||||
.map(this::generateDailyEntitySnapshots)
|
.flatMap(
|
||||||
.flatMap(Collection::stream)
|
entityVersionMap ->
|
||||||
|
generateDailyEntitySnapshots(
|
||||||
|
enrichEntity(entityVersionMap, contextData))
|
||||||
|
.stream()))
|
||||||
.toList();
|
.toList();
|
||||||
updateStats(input.getData().size(), 0);
|
updateStats(input.getData().size(), 0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user