diff --git a/flink-connector-db2-cdc/pom.xml b/flink-connector-db2-cdc/pom.xml index 0d82bb1f0d5..2d8748e206f 100644 --- a/flink-connector-db2-cdc/pom.xml +++ b/flink-connector-db2-cdc/pom.xml @@ -29,13 +29,6 @@ under the License. - - - com.ververica - flink-cdc-base - ${project.version} - - com.ververica diff --git a/flink-connector-db2-cdc/src/main/java/com/ververica/cdc/connectors/db2/table/Db2TableSourceFactory.java b/flink-connector-db2-cdc/src/main/java/com/ververica/cdc/connectors/db2/table/Db2TableSourceFactory.java index a466bbcfc06..124f0ed5736 100644 --- a/flink-connector-db2-cdc/src/main/java/com/ververica/cdc/connectors/db2/table/Db2TableSourceFactory.java +++ b/flink-connector-db2-cdc/src/main/java/com/ververica/cdc/connectors/db2/table/Db2TableSourceFactory.java @@ -25,7 +25,7 @@ import org.apache.flink.table.factories.DynamicTableSourceFactory; import org.apache.flink.table.factories.FactoryUtil; -import com.ververica.cdc.connectors.base.utils.OptionUtils; +import com.ververica.cdc.connectors.db2.utils.OptionUtils; import java.time.ZoneId; import java.util.HashSet; diff --git a/flink-connector-db2-cdc/src/main/java/com/ververica/cdc/connectors/db2/utils/OptionUtils.java b/flink-connector-db2-cdc/src/main/java/com/ververica/cdc/connectors/db2/utils/OptionUtils.java new file mode 100644 index 00000000000..cbc81a92d2c --- /dev/null +++ b/flink-connector-db2-cdc/src/main/java/com/ververica/cdc/connectors/db2/utils/OptionUtils.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Ververica Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.ververica.cdc.connectors.db2.utils; + +import org.apache.flink.configuration.ConfigOption; +import org.apache.flink.configuration.ReadableConfig; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; +import java.util.List; + +/** A utility class to print configuration of connectors. */ +public class OptionUtils { + + private static final Logger LOG = LoggerFactory.getLogger(OptionUtils.class); + + private static final List SENSITIVE_OPTIONS = Arrays.asList("password"); + + private static final String SHADE = "**********"; + + /** Utility class can not be instantiated. */ + private OptionUtils() {} + + public static void printOptions(ReadableConfig config, ConfigOption... options) { + for (ConfigOption option : options) { + if (SENSITIVE_OPTIONS.contains(option.key())) { + LOG.info("{} = {}", option.key(), SHADE); + } else { + LOG.info("{} = {}", option.key(), config.get(option)); + } + } + } +}