FrankYang0529 commented on code in PR #22294:
URL: https://github.com/apache/kafka/pull/22294#discussion_r3254419180


##########
storage/src/test/java/org/apache/kafka/tiered/storage/HarnessBackedClusterInstance.java:
##########
@@ -0,0 +1,175 @@
+/*
+ * 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.tiered.storage;
+
+import kafka.server.ControllerServer;
+import kafka.server.KafkaBroker;
+
+import org.apache.kafka.common.network.ListenerName;
+import org.apache.kafka.common.test.ClusterInstance;
+import org.apache.kafka.common.test.api.ClusterConfig;
+import org.apache.kafka.common.test.api.Type;
+import org.apache.kafka.server.fault.FaultHandlerException;
+import org.apache.kafka.test.TestUtils;
+
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+
+import scala.jdk.javaapi.CollectionConverters;
+
+/**
+ * A {@link ClusterInstance} implementation backed by a {@link 
TieredStorageTestHarness}.
+ * This allows {@link TieredStorageTestContext} to depend only on {@link 
ClusterInstance}
+ * rather than on the concrete harness class.
+ */
+public class HarnessBackedClusterInstance implements ClusterInstance {
+
+    private final TieredStorageTestHarness harness;
+
+    public HarnessBackedClusterInstance(TieredStorageTestHarness harness) {
+        this.harness = harness;
+    }
+
+    @Override
+    public Type type() {
+        return Type.KRAFT;
+    }
+
+    @Override
+    public ClusterConfig config() {
+        return ClusterConfig.defaultBuilder().build();

Review Comment:
   We cannot throw error here. The function is used by 
ClusterInstance#setClientSaslConfig. We need to use ClusterInstance to build 
consumer/producer/admin which uses `setClientSaslConfig`. I change to build 
ClusterConfig from harness data.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to