mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-01 01:56:04 +00:00
This commit is contained in:
parent
f5a7c193e3
commit
456f10ab63
@ -27,23 +27,25 @@ public final class AirflowUtils {
|
||||
|
||||
private AirflowUtils() {}
|
||||
|
||||
public static OpenMetadataIngestionComponent makeDatasourceComponent(Ingestion ingestion) {
|
||||
public static OpenMetadataIngestionComponent makeOpenMetadataDatasourceComponent(Ingestion ingestion) {
|
||||
Map<String, Object> dbConfig = new HashMap<>();
|
||||
dbConfig.put("host_port", ingestion.getConnectorConfig().getHost());
|
||||
dbConfig.put("username", ingestion.getConnectorConfig().getUsername());
|
||||
dbConfig.put("password", ingestion.getConnectorConfig().getPassword());
|
||||
dbConfig.put("database", ingestion.getConnectorConfig().getDatabase());
|
||||
dbConfig.put("service_name", ingestion.getService().getName());
|
||||
dbConfig.put("filter_pattern", ingestion.getConnectorConfig().getIncludeFilterPattern());
|
||||
if (ingestion.getConnectorConfig().getIncludeFilterPattern() != null) {
|
||||
dbConfig.put("filter_pattern", ingestion.getConnectorConfig().getIncludeFilterPattern());
|
||||
}
|
||||
return OpenMetadataIngestionComponent.builder()
|
||||
.type(ingestion.getService().getType())
|
||||
.type(ingestion.getIngestionType().value())
|
||||
.config(dbConfig).build();
|
||||
}
|
||||
|
||||
public static OpenMetadataIngestionComponent makeMetadataSourceComponent(Ingestion ingestion) {
|
||||
public static OpenMetadataIngestionComponent makeOpenMetadataSourceComponent(Ingestion ingestion) {
|
||||
Map<String, Object> dbConfig = new HashMap<>();
|
||||
return OpenMetadataIngestionComponent.builder()
|
||||
.type("metadata")
|
||||
.type(ingestion.getIngestionType().value())
|
||||
.config(dbConfig)
|
||||
.build();
|
||||
}
|
||||
@ -76,7 +78,7 @@ public final class AirflowUtils {
|
||||
public static OpenMetadataIngestionConfig buildDatabaseIngestion(Ingestion ingestion,
|
||||
AirflowConfiguration airflowConfiguration) {
|
||||
return OpenMetadataIngestionConfig.builder()
|
||||
.source(makeDatasourceComponent(ingestion))
|
||||
.source(makeOpenMetadataDatasourceComponent(ingestion))
|
||||
.sink(makeOpenMetadataSinkComponent(ingestion))
|
||||
.metadataServer(makeOpenMetadataConfigComponent(ingestion, airflowConfiguration)).build();
|
||||
|
||||
|
||||
@ -365,6 +365,7 @@ public class IngestionResource {
|
||||
return new Ingestion().withId(UUID.randomUUID()).withName(create.getName())
|
||||
.withDisplayName(create.getDisplayName())
|
||||
.withDescription(create.getDescription())
|
||||
.withIngestionType(create.getIngestionType())
|
||||
.withForceDeploy(create.getForceDeploy())
|
||||
.withConcurrency(create.getConcurrency())
|
||||
.withPauseWorkflow(create.getPauseWorkflow())
|
||||
|
||||
@ -19,6 +19,9 @@
|
||||
"description": "Description of the workflow.",
|
||||
"type": "string"
|
||||
},
|
||||
"ingestionType": {
|
||||
"$ref": "../../../operations/workflows/ingestion.json#/definitions/ingestionType"
|
||||
},
|
||||
"owner": {
|
||||
"description": "Owner of this Ingestion.",
|
||||
"$ref": "../../../type/entityReference.json",
|
||||
|
||||
@ -27,19 +27,19 @@
|
||||
"name": "bigquery"
|
||||
},
|
||||
{
|
||||
"name": "bigquery-usage"
|
||||
"name": "bigquery_usage"
|
||||
},
|
||||
{
|
||||
"name": "redshift"
|
||||
},
|
||||
{
|
||||
"name": "redshift-usage"
|
||||
"name": "redshift_usage"
|
||||
},
|
||||
{
|
||||
"name": "snowflake"
|
||||
},
|
||||
{
|
||||
"name": "snowflake-usage"
|
||||
"name": "snowflake_usage"
|
||||
},
|
||||
{
|
||||
"name": "hive"
|
||||
@ -171,6 +171,9 @@
|
||||
"minLength": 1,
|
||||
"maxLength": 128
|
||||
},
|
||||
"ingestionType": {
|
||||
"$ref": "#/definitions/ingestionType"
|
||||
},
|
||||
"tags": {
|
||||
"description": "Tags associated with the Ingestion.",
|
||||
"type": "array",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user