Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MESH-184 Validations for domainGUIDs de-norm attribute #3508

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ protected List<AtlasEntityHeader> getPolicies(Set<String> resources) throws Atla

protected Boolean hasLinkedAssets(String domainGuid) throws AtlasBaseException {
AtlasPerfMetrics.MetricRecorder metricRecorder = RequestContext.get().startMetricRecord("isAssetLinked");
boolean exists = false;
try {
List<Map<String, Object>> mustClauseList = new ArrayList<>();
mustClauseList.add(mapOf("term", mapOf(DOMAIN_GUIDS, domainGuid)));
Expand All @@ -300,19 +299,14 @@ protected Boolean hasLinkedAssets(String domainGuid) throws AtlasBaseException {

Map<String, Object> dsl = mapOf("query", mapOf("bool", bool));

boolean hasLinkedAsset = fetchLinkedAssets(dsl, DOMAIN_GUID_ATTR, this.discovery);
if (hasLinkedAsset) {
exists = true;
}

return exists;
return hasLinkedAssets(dsl, DOMAIN_GUID_ATTR, this.discovery);

} finally {
RequestContext.get().endMetricRecord(metricRecorder);
}
}

protected static Boolean fetchLinkedAssets(Map<String, Object> dsl, Set<String> attributes, EntityDiscoveryService discovery) throws AtlasBaseException {
protected static Boolean hasLinkedAssets(Map<String, Object> dsl, Set<String> attributes, EntityDiscoveryService discovery) throws AtlasBaseException {
IndexSearchParams searchParams = new IndexSearchParams();
boolean exists = false;

Expand Down
Loading