Skip to content

Commit 1be216c

Browse files
mohityadav766OpenMetadata Release Bot
authored andcommitted
Remove * callsites (#28151)
(cherry picked from commit 71893d5)
1 parent de1825c commit 1be216c

9 files changed

Lines changed: 20 additions & 11 deletions

File tree

openmetadata-service/src/main/java/org/openmetadata/service/apps/ApplicationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void initialize() {
4545
appRepo
4646
.listAfter(
4747
null,
48-
appRepo.getFields("*"),
48+
appRepo.getFields("pipelines"),
4949
listFilter,
5050
appRepo.getDao().listCount(listFilter),
5151
"")

openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/insights/workflows/costAnalysis/CostAnalysisWorkflow.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public CostAnalysisWorkflow(
102102

103103
private void initialize() throws SearchIndexException {
104104
PaginatedEntitiesSource databaseServices =
105-
new PaginatedEntitiesSource(Entity.DATABASE_SERVICE, batchSize, List.of("*"));
105+
new PaginatedEntitiesSource(Entity.DATABASE_SERVICE, batchSize, List.of());
106106
int total = 0;
107107

108108
String keysetCursor = null;
@@ -117,7 +117,8 @@ private void initialize() throws SearchIndexException {
117117
filter.addQueryParam("database", databaseService.getFullyQualifiedName());
118118

119119
sources.add(
120-
new PaginatedEntitiesSource(Entity.TABLE, batchSize, List.of("*"), filter)
120+
new PaginatedEntitiesSource(
121+
Entity.TABLE, batchSize, List.of(Entity.FIELD_LIFE_CYCLE), filter)
121122
.withName(
122123
String.format(
123124
"[CostAnalysisWorkflow] %s", databaseService.getFullyQualifiedName())));

openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/insights/workflows/dataAssets/DataAssetsWorkflow.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import static org.openmetadata.service.apps.bundles.insights.utils.TimestampUtils.START_TIMESTAMP_KEY;
66
import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.ENTITY_TYPE_KEY;
77
import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getInitialStatsForEntities;
8+
import static org.openmetadata.service.workflows.searchIndex.ReindexingUtil.getSearchIndexFields;
89

910
import java.util.ArrayList;
1011
import java.util.Collections;
@@ -139,7 +140,7 @@ private void initialize() {
139140
|| entityTypesToProcess.contains(entityType))
140141
.forEach(
141142
entityType -> {
142-
List<String> fields = List.of("*");
143+
List<String> fields = getSearchIndexFields(entityType);
143144
ListFilter filter = getListFilter(entityType);
144145
PaginatedEntitiesSource source =
145146
new PaginatedEntitiesSource(entityType, batchSize, fields, filter)

openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/impl/CheckChangeDescriptionTaskImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void execute(DelegateExecution execution) {
5555
private boolean checkChangeDescription(DelegateExecution execution, String entityLinkStr) {
5656
// Parse entity
5757
MessageParser.EntityLink entityLink = MessageParser.EntityLink.parse(entityLinkStr);
58-
EntityInterface entity = Entity.getEntity(entityLink, "*", Include.ALL);
58+
EntityInterface entity = Entity.getEntity(entityLink, "", Include.ALL);
5959

6060
// No changeDescription means it's a create event - return true
6161
ChangeDescription changeDescription = entity.getChangeDescription();

openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/impl/RollbackEntityImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void execute(DelegateExecution execution) {
6161
updatedBy = "governance-bot";
6262
}
6363

64-
EntityInterface currentEntity = Entity.getEntity(entityLink, "*", Include.ALL);
64+
EntityInterface currentEntity = Entity.getEntity(entityLink, "", Include.ALL);
6565

6666
String entityType = currentEntity.getEntityReference().getType();
6767
UUID entityId = currentEntity.getId();

openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/impl/SetEntityCertificationImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void execute(DelegateExecution execution) {
4343
varHandler.getNamespacedVariable(
4444
inputNamespaceMap.get(RELATED_ENTITY_VARIABLE), RELATED_ENTITY_VARIABLE));
4545
String entityType = entityLink.getEntityType();
46-
EntityInterface entity = Entity.getEntity(entityLink, "*", Include.ALL);
46+
EntityInterface entity = Entity.getEntity(entityLink, "certification", Include.ALL);
4747

4848
String certification =
4949
Optional.ofNullable(certificationExpr)

openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/impl/SetGlossaryTermStatusImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void execute(DelegateExecution execution) {
4141
(String)
4242
varHandler.getNamespacedVariable(
4343
inputNamespaceMap.get(RELATED_ENTITY_VARIABLE), RELATED_ENTITY_VARIABLE));
44-
GlossaryTerm glossaryTerm = Entity.getEntity(entityLink, "*", Include.ALL);
44+
GlossaryTerm glossaryTerm = Entity.getEntity(entityLink, "", Include.ALL);
4545

4646
String status = (String) statusExpr.getValue(execution);
4747
String user =

openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/sink/SinkTaskDelegate.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.openmetadata.service.Entity;
3737
import org.openmetadata.service.governance.workflows.WorkflowVariableHandler;
3838
import org.openmetadata.service.resources.feeds.MessageParser;
39+
import org.openmetadata.service.workflows.searchIndex.ReindexingUtil;
3940

4041
/**
4142
* Flowable delegate that executes sink operations within a workflow.
@@ -239,7 +240,10 @@ BatchAccumulator merge(SinkResult result, List<SinkResult.SinkError> fetchErrors
239240
for (String entityLinkStr : subBatch) {
240241
try {
241242
var entityLink = MessageParser.EntityLink.parse(entityLinkStr);
242-
entities.add(Entity.getEntity(entityLink, "*", Include.ALL));
243+
String fields =
244+
String.join(
245+
",", ReindexingUtil.getSearchIndexFields(entityLink.getEntityType()));
246+
entities.add(Entity.getEntity(entityLink, fields, Include.ALL));
243247
} catch (Exception e) {
244248
LOG.error("Failed to fetch entity: {}", entityLinkStr, e);
245249
fetchErrors.add(
@@ -288,7 +292,9 @@ private SinkResult executeSingleEntityMode(
288292
(String) varHandler.getNamespacedVariable(relatedEntityNamespace, RELATED_ENTITY_VARIABLE);
289293

290294
MessageParser.EntityLink entityLink = MessageParser.EntityLink.parse(relatedEntityValue);
291-
EntityInterface entity = Entity.getEntity(entityLink, "*", Include.ALL);
295+
String fields =
296+
String.join(",", ReindexingUtil.getSearchIndexFields(entityLink.getEntityType()));
297+
EntityInterface entity = Entity.getEntity(entityLink, fields, Include.ALL);
292298

293299
LOG.info(
294300
"[{}] Executing single entity sink for: {}",

openmetadata-service/src/main/java/org/openmetadata/service/search/SearchIndexRetryWorker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ private void reindexEntityCascade(EntityReference root) throws Exception {
384384

385385
EntityInterface entity;
386386
try {
387-
entity = Entity.getEntity(current, "*", Include.ALL);
387+
String fields = String.join(",", ReindexingUtil.getSearchIndexFields(current.getType()));
388+
entity = Entity.getEntity(current, fields, Include.ALL);
388389
} catch (Exception ex) {
389390
continue;
390391
}

0 commit comments

Comments
 (0)