From 0692047d82f3b3733c32c7930e9667be6758684d Mon Sep 17 00:00:00 2001 From: David Leifker Date: Wed, 17 Jul 2024 11:02:54 -0500 Subject: [PATCH] Add missing config --- .../SchemaFieldsFromSchemaMetadataConfig.java | 34 +++++++++++++++++++ .../src/main/resources/application.yaml | 5 +++ 2 files changed, 39 insertions(+) create mode 100644 datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/SchemaFieldsFromSchemaMetadataConfig.java diff --git a/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/SchemaFieldsFromSchemaMetadataConfig.java b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/SchemaFieldsFromSchemaMetadataConfig.java new file mode 100644 index 00000000000000..175bab9b27add3 --- /dev/null +++ b/datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/SchemaFieldsFromSchemaMetadataConfig.java @@ -0,0 +1,34 @@ +package com.linkedin.datahub.upgrade.config; + +import com.linkedin.datahub.upgrade.system.NonBlockingSystemUpgrade; +import com.linkedin.datahub.upgrade.system.schemafield.GenerateSchemaFieldsFromSchemaMetadata; +import com.linkedin.metadata.entity.AspectDao; +import com.linkedin.metadata.entity.EntityService; +import io.datahubproject.metadata.context.OperationContext; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; + +@Configuration +@Conditional(SystemUpdateCondition.NonBlockingSystemUpdateCondition.class) +public class SchemaFieldsFromSchemaMetadataConfig { + + @Bean + public NonBlockingSystemUpgrade schemaFieldsFromSchemaMetadata( + @Qualifier("systemOperationContext") final OperationContext opContext, + final EntityService entityService, + final AspectDao aspectDao, + // SYSTEM_UPDATE_SCHEMA_FIELDS_FROM_SCHEMA_METADATA_ENABLED + @Value("${systemUpdate.schemaFieldsFromSchemaMetadata.enabled}") final boolean enabled, + // SYSTEM_UPDATE_SCHEMA_FIELDS_FROM_SCHEMA_METADATA_BATCH_SIZE + @Value("${systemUpdate.schemaFieldsFromSchemaMetadata.batchSize}") final Integer batchSize, + // SYSTEM_UPDATE_SCHEMA_FIELDS_FROM_SCHEMA_METADATA_DELAY_MS + @Value("${systemUpdate.schemaFieldsFromSchemaMetadata.delayMs}") final Integer delayMs, + // SYSTEM_UPDATE_SCHEMA_FIELDS_FROM_SCHEMA_METADATA_LIMIT + @Value("${systemUpdate.schemaFieldsFromSchemaMetadata.limit}") final Integer limit) { + return new GenerateSchemaFieldsFromSchemaMetadata( + opContext, entityService, aspectDao, enabled, batchSize, delayMs, limit); + } +} diff --git a/metadata-service/configuration/src/main/resources/application.yaml b/metadata-service/configuration/src/main/resources/application.yaml index 1d5b7c7904f978..6419f25b8d0840 100644 --- a/metadata-service/configuration/src/main/resources/application.yaml +++ b/metadata-service/configuration/src/main/resources/application.yaml @@ -341,6 +341,11 @@ systemUpdate: batchSize: ${BOOTSTRAP_SYSTEM_UPDATE_OWNERSHIP_TYPES_BATCH_SIZE:1000} reprocess: enabled: ${BOOTSTRAP_SYSTEM_UPDATE_OWNERSHIP_TYPES_REPROCESS:false} + schemaFieldsFromSchemaMetadata: + enabled: ${SYSTEM_UPDATE_SCHEMA_FIELDS_FROM_SCHEMA_METADATA_ENABLED:true} + batchSize: ${SYSTEM_UPDATE_SCHEMA_FIELDS_FROM_SCHEMA_METADATA_BATCH_SIZE:100} + delayMs: ${SYSTEM_UPDATE_SCHEMA_FIELDS_FROM_SCHEMA_METADATA_DELAY_MS:1000} + limit: ${SYSTEM_UPDATE_SCHEMA_FIELDS_FROM_SCHEMA_METADATA_LIMIT:0} structuredProperties: enabled: ${ENABLE_STRUCTURED_PROPERTIES_HOOK:true} # applies structured properties mappings