mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-29 03:16:05 +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 =
|
StartEvent startEvent =
|
||||||
new StartEventBuilder().id(getFlowableElementId(triggerWorkflowId, "startEvent")).build();
|
new StartEventBuilder().id(getFlowableElementId(triggerWorkflowId, "startEvent")).build();
|
||||||
|
startEvent.setAsynchronousLeave(true);
|
||||||
oTimerDefinition.ifPresent(startEvent::addEventDefinition);
|
oTimerDefinition.ifPresent(startEvent::addEventDefinition);
|
||||||
process.addFlowElement(startEvent);
|
process.addFlowElement(startEvent);
|
||||||
|
|
||||||
|
@ -64,7 +64,13 @@ public class FetchEntitiesImpl implements JavaDelegate {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return searchRepository.listWithDeepPagination(
|
return searchRepository.listWithDeepPagination(
|
||||||
entityType, null, searchFilter, searchSortFilter, batchSize, searchAfter);
|
entityType,
|
||||||
|
null,
|
||||||
|
searchFilter,
|
||||||
|
new String[] {"fullyQualifiedName"},
|
||||||
|
searchSortFilter,
|
||||||
|
batchSize,
|
||||||
|
searchAfter);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
@ -174,6 +174,7 @@ public interface SearchClient {
|
|||||||
String index,
|
String index,
|
||||||
String query,
|
String query,
|
||||||
String filter,
|
String filter,
|
||||||
|
String[] fields,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
int size,
|
int size,
|
||||||
Object[] searchAfter)
|
Object[] searchAfter)
|
||||||
|
@ -841,13 +841,20 @@ public class SearchRepository {
|
|||||||
String entityType,
|
String entityType,
|
||||||
String query,
|
String query,
|
||||||
String filter,
|
String filter,
|
||||||
|
String[] fields,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
int size,
|
int size,
|
||||||
Object[] searchAfter)
|
Object[] searchAfter)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
IndexMapping index = entityIndexMap.get(entityType);
|
IndexMapping index = entityIndexMap.get(entityType);
|
||||||
return searchClient.listWithDeepPagination(
|
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 {
|
public Response searchBySourceUrl(String sourceUrl) throws IOException {
|
||||||
|
@ -700,6 +700,7 @@ public class ElasticSearchClient implements SearchClient {
|
|||||||
String index,
|
String index,
|
||||||
String query,
|
String query,
|
||||||
String filter,
|
String filter,
|
||||||
|
String[] fields,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
int size,
|
int size,
|
||||||
Object[] searchAfter)
|
Object[] searchAfter)
|
||||||
@ -710,6 +711,10 @@ public class ElasticSearchClient implements SearchClient {
|
|||||||
if (!nullOrEmpty(query)) {
|
if (!nullOrEmpty(query)) {
|
||||||
searchSourceBuilder = getSearchSourceBuilder(index, query, 0, size);
|
searchSourceBuilder = getSearchSourceBuilder(index, query, 0, size);
|
||||||
}
|
}
|
||||||
|
if (!nullOrEmpty(fields)) {
|
||||||
|
searchSourceBuilder.fetchSource(fields, null);
|
||||||
|
}
|
||||||
|
|
||||||
if (Optional.ofNullable(filter).isPresent()) {
|
if (Optional.ofNullable(filter).isPresent()) {
|
||||||
getSearchFilter(filter, searchSourceBuilder, !nullOrEmpty(query));
|
getSearchFilter(filter, searchSourceBuilder, !nullOrEmpty(query));
|
||||||
}
|
}
|
||||||
|
@ -691,6 +691,7 @@ public class OpenSearchClient implements SearchClient {
|
|||||||
String index,
|
String index,
|
||||||
String query,
|
String query,
|
||||||
String filter,
|
String filter,
|
||||||
|
String[] fields,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
int size,
|
int size,
|
||||||
Object[] searchAfter)
|
Object[] searchAfter)
|
||||||
@ -699,6 +700,9 @@ public class OpenSearchClient implements SearchClient {
|
|||||||
if (!nullOrEmpty(query)) {
|
if (!nullOrEmpty(query)) {
|
||||||
searchSourceBuilder = getSearchSourceBuilder(index, query, 0, size);
|
searchSourceBuilder = getSearchSourceBuilder(index, query, 0, size);
|
||||||
}
|
}
|
||||||
|
if (!nullOrEmpty(fields)) {
|
||||||
|
searchSourceBuilder.fetchSource(fields, null);
|
||||||
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> results = new ArrayList<>();
|
List<Map<String, Object>> results = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -731,6 +731,7 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Order(Integer.MAX_VALUE)
|
||||||
void delete_recursive(TestInfo test) throws IOException {
|
void delete_recursive(TestInfo test) throws IOException {
|
||||||
Glossary g1 = createGlossary(test, null, emptyList());
|
Glossary g1 = createGlossary(test, null, emptyList());
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
"batchSize": {
|
"batchSize": {
|
||||||
"description": "Number of Entities to process at once.",
|
"description": "Number of Entities to process at once.",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1000
|
"default": 500
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["schedule", "entityType", "filters"],
|
"required": ["schedule", "entityType", "filters"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user