-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Fix db2 connector compile error
- Loading branch information
1 parent
5f3e7e7
commit 2cf8b83
Showing
3 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...k-connector-db2-cdc/src/main/java/com/ververica/cdc/connectors/db2/utils/OptionUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<String> 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)); | ||
} | ||
} | ||
} | ||
} |