Fix DI Data Stream delete on OpenSearch (#20447)

This commit is contained in:
IceS2 2025-03-26 16:09:03 +01:00 committed by GitHub
parent b4ec3f29a5
commit 690f862177
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 1 deletions

View File

@ -126,11 +126,13 @@ public class DataInsightsApp extends AbstractNativeApplication {
private void createIndexInternal(String entityType) throws IOException {
IndexMapping resultIndexType = searchRepository.getIndexMapping(entityType);
if (!searchRepository.indexExists(resultIndexType)) {
LOG.info(String.format("[Data Insights] Creating Index for Entity Type: '%s'", entityType));
searchRepository.createIndex(resultIndexType);
}
DataInsightsSearchInterface searchInterface = getSearchInterface();
if (!searchInterface.dataAssetDataStreamExists(
getDataStreamName(searchRepository.getClusterAlias(), entityType))) {
LOG.info(String.format("[Data Insights] Creating Index for Entity Type: '%s'", entityType));
searchRepository
.getSearchClient()
.addIndexAlias(
@ -141,6 +143,7 @@ public class DataInsightsApp extends AbstractNativeApplication {
private void deleteIndexInternal(String entityType) {
IndexMapping resultIndexType = searchRepository.getIndexMapping(entityType);
if (searchRepository.indexExists(resultIndexType)) {
LOG.info(String.format("[Data Insights] Deleting Index for Entity Type: '%s'", entityType));
searchRepository.deleteIndex(resultIndexType);
}
}

View File

@ -134,6 +134,6 @@ public class OpenSearchDataInsightsClient implements DataInsightsSearchInterface
@Override
public void deleteDataAssetDataStream(String name) throws IOException {
performRequest("DELETE", String.format("_data_stream/%s", name));
performRequest("DELETE", String.format("/_data_stream/%s", name));
}
}

View File

@ -138,6 +138,7 @@ public class CostAnalysisWorkflow {
if (!costAnalysisConfig.getEnabled()) {
return;
}
LOG.info("[Data Insights] Processing Cost Analysis.");
initialize();
Map<String, Object> contextData = new HashMap<>();

View File

@ -183,6 +183,7 @@ public class DataAssetsWorkflow {
if (!dataAssetsConfig.getEnabled()) {
return;
}
LOG.info("[Data Insights] Processing Data Assets Insights.");
initialize();
Map<String, Object> contextData = new HashMap<>();

View File

@ -148,6 +148,7 @@ public class DataQualityWorkflow {
if (!dataQualityConfig.getEnabled()) {
return;
}
LOG.info("[Data Insights] Processing Data Quality Insights.");
initialize();
Map<String, Object> contextData = new HashMap<>();

View File

@ -121,6 +121,7 @@ public class WebAnalyticsWorkflow {
if (!webAnalyticsConfig.getEnabled()) {
return;
}
LOG.info("[Data Insights] Processing App Analytics.");
initialize();
Map<String, Object> contextData = new HashMap<>();