mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-28 02:46:09 +00:00
MINOR: Governance Workflows fixes (#18744)
* Add annotation to turn delete_recursive test into the last one to be executed * Improve Fetching Entities by only fetching the FQN * Cut back default batchsize to 500
This commit is contained in:
parent
31c2dee533
commit
b3d765dce1
@ -53,6 +53,7 @@ public class PeriodicBatchEntityTrigger implements TriggerInterface {
|
||||
|
||||
StartEvent startEvent =
|
||||
new StartEventBuilder().id(getFlowableElementId(triggerWorkflowId, "startEvent")).build();
|
||||
startEvent.setAsynchronousLeave(true);
|
||||
oTimerDefinition.ifPresent(startEvent::addEventDefinition);
|
||||
process.addFlowElement(startEvent);
|
||||
|
||||
|
@ -64,7 +64,13 @@ public class FetchEntitiesImpl implements JavaDelegate {
|
||||
|
||||
try {
|
||||
return searchRepository.listWithDeepPagination(
|
||||
entityType, null, searchFilter, searchSortFilter, batchSize, searchAfter);
|
||||
entityType,
|
||||
null,
|
||||
searchFilter,
|
||||
new String[] {"fullyQualifiedName"},
|
||||
searchSortFilter,
|
||||
batchSize,
|
||||
searchAfter);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -174,6 +174,7 @@ public interface SearchClient {
|
||||
String index,
|
||||
String query,
|
||||
String filter,
|
||||
String[] fields,
|
||||
SearchSortFilter searchSortFilter,
|
||||
int size,
|
||||
Object[] searchAfter)
|
||||
|
@ -841,13 +841,20 @@ public class SearchRepository {
|
||||
String entityType,
|
||||
String query,
|
||||
String filter,
|
||||
String[] fields,
|
||||
SearchSortFilter searchSortFilter,
|
||||
int size,
|
||||
Object[] searchAfter)
|
||||
throws IOException {
|
||||
IndexMapping index = entityIndexMap.get(entityType);
|
||||
return searchClient.listWithDeepPagination(
|
||||
index.getIndexName(clusterAlias), query, filter, searchSortFilter, size, searchAfter);
|
||||
index.getIndexName(clusterAlias),
|
||||
query,
|
||||
filter,
|
||||
fields,
|
||||
searchSortFilter,
|
||||
size,
|
||||
searchAfter);
|
||||
}
|
||||
|
||||
public Response searchBySourceUrl(String sourceUrl) throws IOException {
|
||||
|
@ -700,6 +700,7 @@ public class ElasticSearchClient implements SearchClient {
|
||||
String index,
|
||||
String query,
|
||||
String filter,
|
||||
String[] fields,
|
||||
SearchSortFilter searchSortFilter,
|
||||
int size,
|
||||
Object[] searchAfter)
|
||||
@ -710,6 +711,10 @@ public class ElasticSearchClient implements SearchClient {
|
||||
if (!nullOrEmpty(query)) {
|
||||
searchSourceBuilder = getSearchSourceBuilder(index, query, 0, size);
|
||||
}
|
||||
if (!nullOrEmpty(fields)) {
|
||||
searchSourceBuilder.fetchSource(fields, null);
|
||||
}
|
||||
|
||||
if (Optional.ofNullable(filter).isPresent()) {
|
||||
getSearchFilter(filter, searchSourceBuilder, !nullOrEmpty(query));
|
||||
}
|
||||
|
@ -691,6 +691,7 @@ public class OpenSearchClient implements SearchClient {
|
||||
String index,
|
||||
String query,
|
||||
String filter,
|
||||
String[] fields,
|
||||
SearchSortFilter searchSortFilter,
|
||||
int size,
|
||||
Object[] searchAfter)
|
||||
@ -699,6 +700,9 @@ public class OpenSearchClient implements SearchClient {
|
||||
if (!nullOrEmpty(query)) {
|
||||
searchSourceBuilder = getSearchSourceBuilder(index, query, 0, size);
|
||||
}
|
||||
if (!nullOrEmpty(fields)) {
|
||||
searchSourceBuilder.fetchSource(fields, null);
|
||||
}
|
||||
|
||||
List<Map<String, Object>> results = new ArrayList<>();
|
||||
|
||||
|
@ -731,6 +731,7 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(Integer.MAX_VALUE)
|
||||
void delete_recursive(TestInfo test) throws IOException {
|
||||
Glossary g1 = createGlossary(test, null, emptyList());
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
"batchSize": {
|
||||
"description": "Number of Entities to process at once.",
|
||||
"type": "integer",
|
||||
"default": 1000
|
||||
"default": 500
|
||||
}
|
||||
},
|
||||
"required": ["schedule", "entityType", "filters"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user