DBZ-5811 Use validate method
This commit is contained in:
parent
66fb51b55a
commit
574c1b0015
@ -393,6 +393,7 @@ Stathis Souris
|
||||
Stefan Miklosovic
|
||||
Stephen Powis
|
||||
Steven Siahetiong
|
||||
Subodh Kant Chaturvedi
|
||||
Sungho Hwang
|
||||
Syed Muhammad Sufyian
|
||||
Tapani Moilanen
|
||||
|
@ -851,13 +851,7 @@ public static AutoCreateMode parse(String value, String defaultValue) {
|
||||
.withDescription(
|
||||
"Boolean to determine if Debezium should flush LSN in the source postgres database. If set to false, user will have to flush the LSN manually outside Debezium.")
|
||||
.withDefault(Boolean.TRUE)
|
||||
.withValidation(Field::isBoolean, (config, field, problems) -> {
|
||||
if (config.getString(PostgresConnectorConfig.SHOULD_FLUSH_LSN_IN_SOURCE_DB.name(), "true").equalsIgnoreCase("false")) {
|
||||
LOGGER.warn(
|
||||
"Property flush.lsn.source is set to false, the LSN will not be flushed to the database source and WAL logs will not be cleared. User is expected to handle this outside Debezium.");
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
.withValidation(Field::isBoolean, PostgresConnectorConfig::validateFlushLsnSource);
|
||||
|
||||
private final LogicalDecodingMessageFilter logicalDecodingMessageFilter;
|
||||
private final HStoreHandlingMode hStoreHandlingMode;
|
||||
@ -1071,6 +1065,14 @@ private static int validateLogicalDecodingMessageExcludeList(Configuration confi
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static int validateFlushLsnSource(Configuration config, Field field, Field.ValidationOutput problems) {
|
||||
if (config.getString(PostgresConnectorConfig.SHOULD_FLUSH_LSN_IN_SOURCE_DB, "true").equalsIgnoreCase("false")) {
|
||||
LOGGER.warn("Property '" + PostgresConnectorConfig.SHOULD_FLUSH_LSN_IN_SOURCE_DB.name()
|
||||
+ "' is set to 'false', the LSN will not be flushed to the database source and WAL logs will not be cleared. User is expected to handle this outside Debezium.");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContextName() {
|
||||
return Module.contextName();
|
||||
|
@ -172,3 +172,4 @@ dude0001,Mark Lambert
|
||||
adasari,Anil Dasari
|
||||
mkobayas,Masazumi Kobayashi
|
||||
Skezzowski,Balázs Sipos
|
||||
subodh,Subodh Kant Chaturvedi
|
||||
|
Loading…
Reference in New Issue
Block a user