m1a2st commented on code in PR #17666:
URL: https://github.com/apache/kafka/pull/17666#discussion_r1827120089
##########
test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/RaftClusterInvocationContext.java:
##########
@@ -175,8 +175,10 @@ public KafkaClusterTestKit getUnderlying() {
}
@Override
- public Admin createAdminClient(Properties configOverrides) {
- Admin admin =
Admin.create(clusterTestKit.newClientPropertiesBuilder(configOverrides).build());
+ public Admin admin(Map<String, Object> overrides) {
+ Properties props = new Properties();
+ props.putAll(overrides);
+ Admin admin =
Admin.create(clusterTestKit.newClientPropertiesBuilder(props).build());
admins.add(admin);
Review Comment:
t seems that this collection is used in the close method. Would we lose the
benefit of auto-closing the admin resource in the close method?
```
@Override
public void stop() {
if (stopped.compareAndSet(false, true)) {
admins.forEach(admin -> Utils.closeQuietly(admin, "admin"));
admins.clear();
Utils.closeQuietly(clusterTestKit, "cluster");
}
}
```
##########
test-common/test-common-api/src/main/java/org/apache/kafka/common/test/api/RaftClusterInvocationContext.java:
##########
@@ -175,8 +175,10 @@ public KafkaClusterTestKit getUnderlying() {
}
@Override
- public Admin createAdminClient(Properties configOverrides) {
- Admin admin =
Admin.create(clusterTestKit.newClientPropertiesBuilder(configOverrides).build());
+ public Admin admin(Map<String, Object> overrides) {
+ Properties props = new Properties();
+ props.putAll(overrides);
+ Admin admin =
Admin.create(clusterTestKit.newClientPropertiesBuilder(props).build());
admins.add(admin);
Review Comment:
It seems that this collection is used in the close method. Would we lose the
benefit of auto-closing the admin resource in the close method?
```
@Override
public void stop() {
if (stopped.compareAndSet(false, true)) {
admins.forEach(admin -> Utils.closeQuietly(admin, "admin"));
admins.clear();
Utils.closeQuietly(clusterTestKit, "cluster");
}
}
```
--
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]