mimaison commented on code in PR #12577: URL: https://github.com/apache/kafka/pull/12577#discussion_r994551128
########## clients/src/main/java/org/apache/kafka/clients/admin/ForwardingAdmin.java: ########## @@ -0,0 +1,284 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 org.apache.kafka.clients.admin; + +import org.apache.kafka.clients.consumer.OffsetAndMetadata; +import org.apache.kafka.common.ElectionType; +import org.apache.kafka.common.Metric; +import org.apache.kafka.common.MetricName; +import org.apache.kafka.common.TopicCollection; +import org.apache.kafka.common.TopicPartition; +import org.apache.kafka.common.TopicPartitionReplica; +import org.apache.kafka.common.acl.AclBinding; +import org.apache.kafka.common.acl.AclBindingFilter; +import org.apache.kafka.common.config.ConfigResource; +import org.apache.kafka.common.quota.ClientQuotaAlteration; +import org.apache.kafka.common.quota.ClientQuotaFilter; + +import java.time.Duration; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +/** + * {@code ForwardingAdmin} is the default value of {@code forwarding.admin.class} in MM2. + * Users who wish to customize the MM2 behaviour for the creation of topics and access control lists can extend this + * class without needing to provide a whole implementation of {@code Admin}. + * The class must have a constructor with signature {@code (Map<String, Object> config)} for configuring + * a decorated {@link KafkaAdminClient} and any other clients needed for external resource management. + */ +public class ForwardingAdmin implements Admin { + private final Admin delegate; + + public ForwardingAdmin(Map<String, Object> configs) { + this.delegate = Admin.create(configs); + } + + @Override + public void close(Duration timeout) { + delegate.close(); Review Comment: Should we pass the timeout to the delegate? ########## connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorConnectorConfig.java: ########## @@ -92,6 +94,9 @@ public class MirrorConnectorConfig extends AbstractConfig { private static final String REPLICATION_POLICY_SEPARATOR_DOC = "Separator used in remote topic naming convention."; public static final String REPLICATION_POLICY_SEPARATOR_DEFAULT = MirrorClientConfig.REPLICATION_POLICY_SEPARATOR_DEFAULT; + public static final String FORWARDING_ADMIN_CLASS = MirrorClientConfig.FORWARDING_ADMIN_CLASS; Review Comment: A bit of a meta question but should we follow up with a similar change for Connect itself? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org