mimaison commented on code in PR #22815:
URL: https://github.com/apache/kafka/pull/22815#discussion_r3655893293
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/KafkaClusterTestKit.java:
##########
@@ -645,6 +646,50 @@ public void
restartBrokersWithSwappedClientListenerPorts(int nodeId1, int nodeId
broker2.startup();
}
+ /**
+ * Shuts down the given broker (if it isn't already) and starts it back up
with a possibly
+ * modified static configuration. This allows tests to change read-only
configs, such as
+ * {@code log.dirs}, which can only be applied when the broker process
(re)starts.
+ * <p>
+ * The broker keeps its identity (node ID, cluster metadata, bound ports):
a new
+ * {@link SharedServer}/{@link BrokerServer} pair is created from the
previous broker's
+ * {@link MetaPropertiesEnsemble} and socket factory, but with a {@link
KafkaConfig} derived
+ * from the previous one with {@code propOverrides} applied on top.
+ *
+ * @param nodeId The ID of the broker to restart.
+ * @param propOverrides Configs to override in the broker's static
configuration.
+ */
+ public void restartBroker(int nodeId, Properties propOverrides) {
+ BrokerServer broker = brokers.get(nodeId);
+ if (broker == null) {
+ throw new IllegalArgumentException("Unknown broker ID " + nodeId);
+ }
+ if (!broker.isShutdown()) {
+ broker.shutdown();
+ }
Review Comment:
This comment has not been addressed
--
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]