Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ public class DefaultConfigPropertyFilter implements ConfigPropertyFilter {

private static final String CONFIG_PROPERTIES_EXCLUDE_DOC = "List of topic configuration properties and/or regexes "
+ "that should not be replicated.";
public static final String CONFIG_PROPERTIES_EXCLUDE_DEFAULT = "follower\\.replication\\.throttled\\.replicas, "
+ "leader\\.replication\\.throttled\\.replicas, "
+ "message\\.timestamp\\.difference\\.max\\.ms, "
+ "message\\.timestamp\\.type, "
+ "unclean\\.leader\\.election\\.enable, "
+ "min\\.insync\\.replicas";
public static final String CONFIG_PROPERTIES_EXCLUDE_DEFAULT = "follower.replication.throttled.replicas, "
+ "leader.replication.throttled.replicas, "
+ "message.timestamp.difference.max.ms, "
+ "log.message.timestamp.before.max.ms, "
+ "log.message.timestamp.after.max.ms, "
+ "message.timestamp.type, "
+ "unclean.leader.election.enable, "
+ "min.insync.replicas";
Comment on lines -38 to +45
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing double backslash before full stops is fine in practice. An unescaped full stop would only cause a false match if there were a config property name identical except with a different character where a dot is (e.g. minXinsync.replicas), which doesn't exist in Kafka's config space. The readability improvement outweighs the theoretical imprecision.

private Pattern excludePattern = MirrorUtils.compilePatternList(CONFIG_PROPERTIES_EXCLUDE_DEFAULT);
private String useDefaultsFrom = USE_DEFAULTS_FROM_DEFAULT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,14 @@ public void testConfigPropertyFilteringWithAlterConfigsAndSourceDefault() {
@Test
public void testNewTopicConfigs() throws Exception {
Map<String, Object> filterConfig = new HashMap<>();
filterConfig.put(DefaultConfigPropertyFilter.CONFIG_PROPERTIES_EXCLUDE_CONFIG, "follower\\.replication\\.throttled\\.replicas, "
+ "leader\\.replication\\.throttled\\.replicas, "
+ "message\\.timestamp\\.difference\\.max\\.ms, "
+ "message\\.timestamp\\.type, "
+ "unclean\\.leader\\.election\\.enable, "
+ "min\\.insync\\.replicas,"
filterConfig.put(DefaultConfigPropertyFilter.CONFIG_PROPERTIES_EXCLUDE_CONFIG, "follower.replication.throttled.replicas, "
+ "leader.replication.throttled.replicas, "
+ "message.timestamp.difference.max.ms, "
+ "log.message.timestamp.before.max.ms, "
+ "log.message.timestamp.after.max.ms, "
+ "message.timestamp.type, "
+ "unclean.leader.election.enable, "
+ "min.insync.replicas,"
+ "exclude_param.*");
DefaultConfigPropertyFilter filter = new DefaultConfigPropertyFilter();
filter.configure(filterConfig);
Expand Down Expand Up @@ -377,7 +379,6 @@ public void testNewTopicConfigs() throws Exception {
verify(connector).createNewTopics(any(), any());
}


@Test
public void testMirrorSourceConnectorTaskConfig() {
List<TopicPartition> knownSourceTopicPartitions = new ArrayList<>();
Expand Down