rhauch commented on a change in pull request #10822: URL: https://github.com/apache/kafka/pull/10822#discussion_r655779197
########## File path: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/RestartRequest.java ########## @@ -0,0 +1,145 @@ +/* + * 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.connect.runtime; + +import java.util.Objects; + +import org.apache.kafka.connect.connector.Connector; +import org.apache.kafka.connect.connector.Task; + +/** + * A request to restart a connector and/or task instances. + * <p>The natural order is based upon the connector name, if two requests have the same connector name, then the requests are ordered based on the probable number of tasks/connector this request is going to restart. Review comment: Nit: ```suggestion * <p>The natural order is based first upon the connector name and then requested restart behaviors. * If two requests have the same connector name, then the requests are ordered based on the * probable number of tasks/connector this request is going to restart. ``` ########## File path: connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/EmbeddedConnectCluster.java ########## @@ -428,6 +429,40 @@ public void restartConnector(String connName) { } } + /** + * Restart an existing connector and its tasks. + * + * @param connName name of the connector to be restarted Review comment: Please add descriptions of the other parameters and the return value. ########## File path: connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/EmbeddedConnectCluster.java ########## @@ -559,6 +560,31 @@ public String endpointForResource(String resource) { return url + resource; } + /** + * Get the full URL of the endpoint that corresponds to the given REST resource using a worker + * that is not running any tasks or connector instance for the connectorName provided in the arguments + * + * @param resource the resource under the worker's admin endpoint + * @param connectorName the name of the connector + * @return the admin endpoint URL + * @throws ConnectException if no REST endpoint is available + */ + public String endpointForWorkerRunningNoResourceForConnector(String resource, String connectorName) { Review comment: It might be good to clean up the method name a bit. Since it's similar to the existing `endpointForResource(...)`, maybe just add a suffix ... maybe something like `endpointForResourceNotRunningConnector()`? -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org