public boolean shouldRestartConnector(ConnectorStatus status) {
        return !onlyFailed || status.state() == AbstractStatus.State.FAILED;
    }
Determine whether the connector with the given status is to be restarted.

@param status the connector status; may not be null
@return true if the connector is to be restarted, or false otherwise
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/RestartRequest.java