From 22fa6f786ec60625106d2478889eb1cedd7448d3 Mon Sep 17 00:00:00 2001 From: mahaotian's debian Date: Tue, 10 Dec 2024 21:00:50 +0800 Subject: [PATCH] [INLONG-11349][Sort] Added enable.log.report configuration for connectors --- .../java/org/apache/inlong/sort/base/Constants.java | 6 ++++++ .../apache/inlong/sort/mysql/MysqlTableFactory.java | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/inlong-sort/sort-flink/base/src/main/java/org/apache/inlong/sort/base/Constants.java b/inlong-sort/sort-flink/base/src/main/java/org/apache/inlong/sort/base/Constants.java index 7e02b0ca96..d2480be58f 100644 --- a/inlong-sort/sort-flink/base/src/main/java/org/apache/inlong/sort/base/Constants.java +++ b/inlong-sort/sort-flink/base/src/main/java/org/apache/inlong/sort/base/Constants.java @@ -469,4 +469,10 @@ public final class Constants { .withDescription( "pulsar client auth params"); + public static final ConfigOption ENABLE_LOG_REPORT = + ConfigOptions.key("enable.log.report") + .booleanType() + .defaultValue(false) + .withDescription("Whether enable openTelemetry log report or not."); + } diff --git a/inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/mysql/MysqlTableFactory.java b/inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/mysql/MysqlTableFactory.java index 81d1278348..0dc854dfa2 100644 --- a/inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/mysql/MysqlTableFactory.java +++ b/inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/mysql/MysqlTableFactory.java @@ -17,6 +17,7 @@ package org.apache.inlong.sort.mysql; +import org.apache.inlong.sort.base.Constants; import org.apache.inlong.sort.base.metric.MetricOption; import com.ververica.cdc.connectors.mysql.source.config.MySqlSourceOptions; @@ -69,7 +70,7 @@ public DynamicTableSource createDynamicTableSource(Context context) { final String username = config.get(USERNAME); final String password = config.get(PASSWORD); final String databaseName = config.get(DATABASE_NAME); - final Boolean enableLogReport = context.getConfiguration().get(ENABLE_LOG_REPORT); + final Boolean enableLogReport = context.getConfiguration().get(Constants.ENABLE_LOG_REPORT); validateRegex(DATABASE_NAME.key(), databaseName); final String tableName = config.get(TABLE_NAME); validateRegex(TABLE_NAME.key(), tableName); @@ -339,13 +340,6 @@ public Set> optionalOptions() { + "\"-U\" represents UPDATE_BEFORE.\n" + "\"+U\" represents UPDATE_AFTER.\n" + "\"-D\" represents DELETE."); - - public static final ConfigOption ENABLE_LOG_REPORT = - ConfigOptions.key("enable.log.report") - .booleanType() - .defaultValue(false) - .withDescription("Whether enable openTelemetry log report or not."); - // ---------------------------------------------------------------------------- // experimental options, won't add them to documentation // ----------------------------------------------------------------------------