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

View File

@ -134,6 +134,6 @@ public class OpenSearchDataInsightsClient implements DataInsightsSearchInterface
@Override @Override
public void deleteDataAssetDataStream(String name) throws IOException { 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()) { if (!costAnalysisConfig.getEnabled()) {
return; return;
} }
LOG.info("[Data Insights] Processing Cost Analysis.");
initialize(); initialize();
Map<String, Object> contextData = new HashMap<>(); Map<String, Object> contextData = new HashMap<>();

View File

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

View File

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

View File

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