Skip to content

Commit

Permalink
Fix for test logging exception for metadata service + updated Insight…
Browse files Browse the repository at this point in the history
… Template URl (open-metadata#11485)
  • Loading branch information
mohityadav766 authored May 8, 2023
1 parent 65fc94a commit 9820172
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,49 +125,52 @@ public void initialize(OpenMetadataApplicationConfig config) {
this.pipelineServiceClient =
PipelineServiceClientFactory.createPipelineServiceClient(config.getPipelineServiceClientConfiguration());
dao.setPipelineServiceClient(pipelineServiceClient);
createIndexAndInsightPipeline();
createIndexAndInsightPipeline(config);
}

private void createIndexAndInsightPipeline() {
try {
EntityReference metadataService =
this.metadataServiceRepository
.getByName(null, OPENMETADATA_SERVICE, dao.getFields("id"))
.getEntityReference();
// Create Data Insights Pipeline
CreateIngestionPipeline createPipelineRequest =
new CreateIngestionPipeline()
.withName(DEFAULT_INSIGHT_PIPELINE)
.withDisplayName(DEFAULT_INSIGHT_PIPELINE)
.withDescription("Data Insights Pipeline")
.withPipelineType(PipelineType.DATA_INSIGHT)
.withSourceConfig(
new SourceConfig()
.withConfig(
new MetadataToElasticSearchPipeline()
.withType(
MetadataToElasticSearchPipeline.MetadataToESConfigType.METADATA_TO_ELASTIC_SEARCH)))
.withAirflowConfig(IngestionPipelineUtils.getDefaultAirflowConfig())
.withService(metadataService);
// Get Pipeline
IngestionPipeline dataInsightPipeline =
getIngestionPipeline(createPipelineRequest, "system").withProvider(ProviderType.SYSTEM);
dao.setFullyQualifiedName(dataInsightPipeline);
dao.initializeEntity(dataInsightPipeline);

// Create Reindex Pipeline
createPipelineRequest
.withName(DEFAULT_REINDEX_PIPELINE)
.withDisplayName(DEFAULT_REINDEX_PIPELINE)
.withDescription("Elastic Search Reindexing Pipeline")
.withPipelineType(PipelineType.ELASTIC_SEARCH_REINDEX);
// Get Pipeline
IngestionPipeline elasticSearchPipeline =
getIngestionPipeline(createPipelineRequest, "system").withProvider(ProviderType.SYSTEM);
dao.setFullyQualifiedName(elasticSearchPipeline);
dao.initializeEntity(elasticSearchPipeline);
} catch (Exception ex) {
LOG.error("[IngestionPipelineResource] Failed in Creating Reindex and Insight Pipeline", ex);
private void createIndexAndInsightPipeline(OpenMetadataApplicationConfig config) {
// Metadata Service is created only when ES config is present
if (config.getElasticSearchConfiguration() != null) {
try {
EntityReference metadataService =
this.metadataServiceRepository
.getByName(null, OPENMETADATA_SERVICE, dao.getFields("id"))
.getEntityReference();
// Create Data Insights Pipeline
CreateIngestionPipeline createPipelineRequest =
new CreateIngestionPipeline()
.withName(DEFAULT_INSIGHT_PIPELINE)
.withDisplayName(DEFAULT_INSIGHT_PIPELINE)
.withDescription("Data Insights Pipeline")
.withPipelineType(PipelineType.DATA_INSIGHT)
.withSourceConfig(
new SourceConfig()
.withConfig(
new MetadataToElasticSearchPipeline()
.withType(
MetadataToElasticSearchPipeline.MetadataToESConfigType.METADATA_TO_ELASTIC_SEARCH)))
.withAirflowConfig(IngestionPipelineUtils.getDefaultAirflowConfig())
.withService(metadataService);
// Get Pipeline
IngestionPipeline dataInsightPipeline =
getIngestionPipeline(createPipelineRequest, "system").withProvider(ProviderType.SYSTEM);
dao.setFullyQualifiedName(dataInsightPipeline);
dao.initializeEntity(dataInsightPipeline);

// Create Reindex Pipeline
createPipelineRequest
.withName(DEFAULT_REINDEX_PIPELINE)
.withDisplayName(DEFAULT_REINDEX_PIPELINE)
.withDescription("Elastic Search Reindexing Pipeline")
.withPipelineType(PipelineType.ELASTIC_SEARCH_REINDEX);
// Get Pipeline
IngestionPipeline elasticSearchPipeline =
getIngestionPipeline(createPipelineRequest, "system").withProvider(ProviderType.SYSTEM);
dao.setFullyQualifiedName(elasticSearchPipeline);
dao.initializeEntity(elasticSearchPipeline);
} catch (Exception ex) {
LOG.error("[IngestionPipelineResource] Failed in Creating Reindex and Insight Pipeline", ex);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<td align="center" valign="top" height="759" bgcolor="#ffffff" style="padding: 10px; height: 759px;">
<table border="0" cellspacing="0" cellpadding="0" width="590" style="width: 590px;">
<div>
<img src="img/i-1839955869.png" width="1000" alt="" border="0" style="display: block; max-width: 1000px; width: 100%;" class="w1000px">
<img src="https://i.imgur.com/ARPP9s5.png" width="1000" alt="" border="0" style="display: block; max-width: 1000px; width: 100%;" class="w1000px">
</div>
</table>
<div>
Expand Down

0 comments on commit 9820172

Please sign in to comment.