diff --git a/deploy/kafkaconnectors.crd.yaml b/deploy/kafkaconnectors.crd.yaml index fa6a2c6..5e15725 100644 --- a/deploy/kafkaconnectors.crd.yaml +++ b/deploy/kafkaconnectors.crd.yaml @@ -41,6 +41,8 @@ spec: connectorConfig: description: Connector configuration. type: object + additionalProperties: + type: string required: - connectorName - clusterBaseUrl diff --git a/deploy/rbac.yaml b/deploy/rbac.yaml index b4c42ba..9e387f0 100644 --- a/deploy/rbac.yaml +++ b/deploy/rbac.yaml @@ -5,7 +5,7 @@ metadata: name: hoptimator-controller rules: - apiGroups: ["hoptimator.linkedin.com"] - resources: ["sqljobs", "kafkatopics", "subscriptions"] + resources: ["sqljobs", "kafkatopics", "kafkaconnectors", "subscriptions"] verbs: ["get", "watch", "list", "update", "create"] - apiGroups: ["flink.apache.org"] resources: ["flinkdeployments"] diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f603998..bd6ebbd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,6 +19,7 @@ flinkConnectorKafka = "org.apache.flink:flink-sql-connector-kafka:1.17.0" flinkConnectorMySqlCdc = "com.ververica:flink-sql-connector-mysql-cdc:2.3.0" gson = "com.google.code.gson:gson:2.9.0" jackson = "com.fasterxml.jackson.core:jackson-core:2.14.1" +jacksonDatabind = "com.fasterxml.jackson.core:jackson-databind:2.14.1" jacksonYaml = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.1" javaxAnnotationApi = "javax.annotation:javax.annotation-api:1.3.2" junit = "junit:junit:4.12" diff --git a/hoptimator-cli/src/main/java/com/linkedin/hoptimator/HoptimatorCliApp.java b/hoptimator-cli/src/main/java/com/linkedin/hoptimator/HoptimatorCliApp.java index ba512a1..9f36a88 100644 --- a/hoptimator-cli/src/main/java/com/linkedin/hoptimator/HoptimatorCliApp.java +++ b/hoptimator-cli/src/main/java/com/linkedin/hoptimator/HoptimatorCliApp.java @@ -267,7 +267,6 @@ public boolean echoToFile() { } } -<<<<<<< HEAD private class TestCommandHandler implements CommandHandler { @Override diff --git a/hoptimator-kafka-adapter/build.gradle b/hoptimator-kafka-adapter/build.gradle index 9401bad..f784748 100644 --- a/hoptimator-kafka-adapter/build.gradle +++ b/hoptimator-kafka-adapter/build.gradle @@ -11,6 +11,7 @@ dependencies { implementation libs.kafkaClients implementation libs.kubernetesClient implementation libs.kubernetesExtendedClient + implementation libs.jacksonDatabind testImplementation libs.junit testImplementation libs.assertj diff --git a/hoptimator-kafka-adapter/src/main/java/com/linkedin/hoptimator/operator/kafka/KafkaConnectorReconciler.java b/hoptimator-kafka-adapter/src/main/java/com/linkedin/hoptimator/operator/kafka/KafkaConnectorReconciler.java index be837e9..48262de 100644 --- a/hoptimator-kafka-adapter/src/main/java/com/linkedin/hoptimator/operator/kafka/KafkaConnectorReconciler.java +++ b/hoptimator-kafka-adapter/src/main/java/com/linkedin/hoptimator/operator/kafka/KafkaConnectorReconciler.java @@ -14,6 +14,8 @@ import okhttp3.RequestBody; import okhttp3.Response; +import com.fasterxml.jackson.databind.ObjectMapper; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,6 +32,8 @@ public class KafkaConnectorReconciler implements Reconciler { private final static Logger log = LoggerFactory.getLogger(KafkaConnectorReconciler.class); private final static String KAFKACONNECTOR = "hoptimator.linkedin.com/v1alpha1/KafkaConnector"; private final static MediaType JSON = MediaType.get("application/json; charset=utf-8"); + private final ObjectMapper objectMapper = new ObjectMapper(); + private final OkHttpClient httpClient = new OkHttpClient.Builder().build(); private final Operator operator; @@ -38,10 +42,10 @@ public KafkaConnectorReconciler(Operator operator) { } private int putConfig(String url, Map config) throws IOException { - String json = operator.objectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(config); + String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(config); RequestBody body = RequestBody.create(json, JSON); okhttp3.Request request = new okhttp3.Request.Builder().url(url).put(body).build(); - try (Response response = operator.httpClient().newCall(request).execute()) { + try (Response response = httpClient.newCall(request).execute()) { log.info("Response: {}.", response.body().string()); return response.code(); } diff --git a/hoptimator-kafka-adapter/src/main/java/com/linkedin/hoptimator/operator/kafka/KafkaControllerProvider.java b/hoptimator-kafka-adapter/src/main/java/com/linkedin/hoptimator/operator/kafka/KafkaControllerProvider.java index 8a72eb2..97decd1 100644 --- a/hoptimator-kafka-adapter/src/main/java/com/linkedin/hoptimator/operator/kafka/KafkaControllerProvider.java +++ b/hoptimator-kafka-adapter/src/main/java/com/linkedin/hoptimator/operator/kafka/KafkaControllerProvider.java @@ -4,11 +4,14 @@ import com.linkedin.hoptimator.operator.Operator; import com.linkedin.hoptimator.models.V1alpha1KafkaTopic; import com.linkedin.hoptimator.models.V1alpha1KafkaTopicList; +import com.linkedin.hoptimator.models.V1alpha1KafkaConnector; +import com.linkedin.hoptimator.models.V1alpha1KafkaConnectorList; import io.kubernetes.client.extended.controller.Controller; import io.kubernetes.client.extended.controller.builder.ControllerBuilder; import io.kubernetes.client.extended.controller.reconciler.Reconciler; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -20,14 +23,25 @@ public Collection controllers(Operator operator) { operator.registerApi("KafkaTopic", "kafkatopic", "kafkatopics", "hoptimator.linkedin.com", "v1alpha1", V1alpha1KafkaTopic.class, V1alpha1KafkaTopicList.class); - Reconciler reconciler = new KafkaTopicReconciler(operator); - Controller controller = ControllerBuilder.defaultBuilder(operator.informerFactory()) - .withReconciler(reconciler) + operator.registerApi("KafkaConnector", "kafkaconnector", "kafkaconnectors", "hoptimator.linkedin.com", + "v1alpha1", V1alpha1KafkaConnector.class, V1alpha1KafkaConnectorList.class); + + Reconciler topicReconciler = new KafkaTopicReconciler(operator); + Controller topicController = ControllerBuilder.defaultBuilder(operator.informerFactory()) + .withReconciler(topicReconciler) .withName("kafka-topic-controller") .withWorkerCount(1) .watch(x -> ControllerBuilder.controllerWatchBuilder(V1alpha1KafkaTopic.class, x).build()) .build(); - return Collections.singleton(controller); + Reconciler connectorReconciler = new KafkaConnectorReconciler(operator); + Controller connectorController = ControllerBuilder.defaultBuilder(operator.informerFactory()) + .withReconciler(connectorReconciler) + .withName("kafka-connector-controller") + .withWorkerCount(1) + .watch(x -> ControllerBuilder.controllerWatchBuilder(V1alpha1KafkaConnector.class, x).build()) + .build(); + + return Arrays.asList(new Controller[]{topicController, connectorController}); } } diff --git a/hoptimator-models/generate-models.sh b/hoptimator-models/generate-models.sh index 0439bf1..c866b38 100755 --- a/hoptimator-models/generate-models.sh +++ b/hoptimator-models/generate-models.sh @@ -11,6 +11,7 @@ docker run \ ghcr.io/kubernetes-client/java/crd-model-gen:v1.0.6 \ /generate.sh -o "$(pwd)/hoptimator-models" -n "" -p "com.linkedin.hoptimator" \ -u "$(pwd)/deploy/kafkatopics.crd.yaml" \ + -u "$(pwd)/deploy/kafkaconnectors.crd.yaml" \ -u "$(pwd)/deploy/subscriptions.crd.yaml" \ -u "$(pwd)/deploy/sqljobs.crd.yaml" \ && echo "done." diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnector.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnector.java new file mode 100644 index 0000000..8cdbc83 --- /dev/null +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnector.java @@ -0,0 +1,219 @@ +/* + * Kubernetes + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1.21.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.linkedin.hoptimator.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.linkedin.hoptimator.models.V1alpha1KafkaConnectorSpec; +import com.linkedin.hoptimator.models.V1alpha1KafkaConnectorStatus; +import io.kubernetes.client.openapi.models.V1ObjectMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Kafka Connect connector + */ +@ApiModel(description = "Kafka Connect connector") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") +public class V1alpha1KafkaConnector implements io.kubernetes.client.common.KubernetesObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ObjectMeta metadata = null; + + public static final String SERIALIZED_NAME_SPEC = "spec"; + @SerializedName(SERIALIZED_NAME_SPEC) + private V1alpha1KafkaConnectorSpec spec; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private V1alpha1KafkaConnectorStatus status; + + + public V1alpha1KafkaConnector apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * @return apiVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + + public String getApiVersion() { + return apiVersion; + } + + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + + public V1alpha1KafkaConnector kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + + public String getKind() { + return kind; + } + + + public void setKind(String kind) { + this.kind = kind; + } + + + public V1alpha1KafkaConnector metadata(V1ObjectMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1ObjectMeta getMetadata() { + return metadata; + } + + + public void setMetadata(V1ObjectMeta metadata) { + this.metadata = metadata; + } + + + public V1alpha1KafkaConnector spec(V1alpha1KafkaConnectorSpec spec) { + + this.spec = spec; + return this; + } + + /** + * Get spec + * @return spec + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1alpha1KafkaConnectorSpec getSpec() { + return spec; + } + + + public void setSpec(V1alpha1KafkaConnectorSpec spec) { + this.spec = spec; + } + + + public V1alpha1KafkaConnector status(V1alpha1KafkaConnectorStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1alpha1KafkaConnectorStatus getStatus() { + return status; + } + + + public void setStatus(V1alpha1KafkaConnectorStatus status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1KafkaConnector v1alpha1KafkaConnector = (V1alpha1KafkaConnector) o; + return Objects.equals(this.apiVersion, v1alpha1KafkaConnector.apiVersion) && + Objects.equals(this.kind, v1alpha1KafkaConnector.kind) && + Objects.equals(this.metadata, v1alpha1KafkaConnector.metadata) && + Objects.equals(this.spec, v1alpha1KafkaConnector.spec) && + Objects.equals(this.status, v1alpha1KafkaConnector.status); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, kind, metadata, spec, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1KafkaConnector {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorList.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorList.java new file mode 100644 index 0000000..88e1283 --- /dev/null +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorList.java @@ -0,0 +1,195 @@ +/* + * Kubernetes + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1.21.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.linkedin.hoptimator.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.linkedin.hoptimator.models.V1alpha1KafkaConnector; +import io.kubernetes.client.openapi.models.V1ListMeta; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * KafkaConnectorList is a list of KafkaConnector + */ +@ApiModel(description = "KafkaConnectorList is a list of KafkaConnector") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") +public class V1alpha1KafkaConnectorList implements io.kubernetes.client.common.KubernetesListObject { + public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; + @SerializedName(SERIALIZED_NAME_API_VERSION) + private String apiVersion; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private String kind; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private V1ListMeta metadata = null; + + + public V1alpha1KafkaConnectorList apiVersion(String apiVersion) { + + this.apiVersion = apiVersion; + return this; + } + + /** + * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * @return apiVersion + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources") + + public String getApiVersion() { + return apiVersion; + } + + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + + public V1alpha1KafkaConnectorList items(List items) { + + this.items = items; + return this; + } + + public V1alpha1KafkaConnectorList addItemsItem(V1alpha1KafkaConnector itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * List of kafkaconnectors. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md + * @return items + **/ + @ApiModelProperty(required = true, value = "List of kafkaconnectors. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md") + + public List getItems() { + return items; + } + + + public void setItems(List items) { + this.items = items; + } + + + public V1alpha1KafkaConnectorList kind(String kind) { + + this.kind = kind; + return this; + } + + /** + * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds") + + public String getKind() { + return kind; + } + + + public void setKind(String kind) { + this.kind = kind; + } + + + public V1alpha1KafkaConnectorList metadata(V1ListMeta metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public V1ListMeta getMetadata() { + return metadata; + } + + + public void setMetadata(V1ListMeta metadata) { + this.metadata = metadata; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1KafkaConnectorList v1alpha1KafkaConnectorList = (V1alpha1KafkaConnectorList) o; + return Objects.equals(this.apiVersion, v1alpha1KafkaConnectorList.apiVersion) && + Objects.equals(this.items, v1alpha1KafkaConnectorList.items) && + Objects.equals(this.kind, v1alpha1KafkaConnectorList.kind) && + Objects.equals(this.metadata, v1alpha1KafkaConnectorList.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(apiVersion, items, kind, metadata); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1KafkaConnectorList {\n"); + sb.append(" apiVersion: ").append(toIndentedString(apiVersion)).append("\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorSpec.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorSpec.java new file mode 100644 index 0000000..06703e7 --- /dev/null +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorSpec.java @@ -0,0 +1,167 @@ +/* + * Kubernetes + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1.21.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.linkedin.hoptimator.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Desired Kafka connector. + */ +@ApiModel(description = "Desired Kafka connector.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") +public class V1alpha1KafkaConnectorSpec { + public static final String SERIALIZED_NAME_CLUSTER_BASE_URL = "clusterBaseUrl"; + @SerializedName(SERIALIZED_NAME_CLUSTER_BASE_URL) + private String clusterBaseUrl; + + public static final String SERIALIZED_NAME_CONNECTOR_CONFIG = "connectorConfig"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_CONFIG) + private Map connectorConfig = null; + + public static final String SERIALIZED_NAME_CONNECTOR_NAME = "connectorName"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_NAME) + private String connectorName; + + + public V1alpha1KafkaConnectorSpec clusterBaseUrl(String clusterBaseUrl) { + + this.clusterBaseUrl = clusterBaseUrl; + return this; + } + + /** + * URL of the Connect cluster. + * @return clusterBaseUrl + **/ + @ApiModelProperty(required = true, value = "URL of the Connect cluster.") + + public String getClusterBaseUrl() { + return clusterBaseUrl; + } + + + public void setClusterBaseUrl(String clusterBaseUrl) { + this.clusterBaseUrl = clusterBaseUrl; + } + + + public V1alpha1KafkaConnectorSpec connectorConfig(Map connectorConfig) { + + this.connectorConfig = connectorConfig; + return this; + } + + public V1alpha1KafkaConnectorSpec putConnectorConfigItem(String key, String connectorConfigItem) { + if (this.connectorConfig == null) { + this.connectorConfig = new HashMap<>(); + } + this.connectorConfig.put(key, connectorConfigItem); + return this; + } + + /** + * Connector configuration. + * @return connectorConfig + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Connector configuration.") + + public Map getConnectorConfig() { + return connectorConfig; + } + + + public void setConnectorConfig(Map connectorConfig) { + this.connectorConfig = connectorConfig; + } + + + public V1alpha1KafkaConnectorSpec connectorName(String connectorName) { + + this.connectorName = connectorName; + return this; + } + + /** + * The connector name. + * @return connectorName + **/ + @ApiModelProperty(required = true, value = "The connector name.") + + public String getConnectorName() { + return connectorName; + } + + + public void setConnectorName(String connectorName) { + this.connectorName = connectorName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1KafkaConnectorSpec v1alpha1KafkaConnectorSpec = (V1alpha1KafkaConnectorSpec) o; + return Objects.equals(this.clusterBaseUrl, v1alpha1KafkaConnectorSpec.clusterBaseUrl) && + Objects.equals(this.connectorConfig, v1alpha1KafkaConnectorSpec.connectorConfig) && + Objects.equals(this.connectorName, v1alpha1KafkaConnectorSpec.connectorName); + } + + @Override + public int hashCode() { + return Objects.hash(clusterBaseUrl, connectorConfig, connectorName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1KafkaConnectorSpec {\n"); + sb.append(" clusterBaseUrl: ").append(toIndentedString(clusterBaseUrl)).append("\n"); + sb.append(" connectorConfig: ").append(toIndentedString(connectorConfig)).append("\n"); + sb.append(" connectorName: ").append(toIndentedString(connectorName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorStatus.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorStatus.java new file mode 100644 index 0000000..b376c23 --- /dev/null +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaConnectorStatus.java @@ -0,0 +1,129 @@ +/* + * Kubernetes + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1.21.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.linkedin.hoptimator.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Current state of the connector. + */ +@ApiModel(description = "Current state of the connector.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") +public class V1alpha1KafkaConnectorStatus { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_READY = "ready"; + @SerializedName(SERIALIZED_NAME_READY) + private Boolean ready; + + + public V1alpha1KafkaConnectorStatus message(String message) { + + this.message = message; + return this; + } + + /** + * Error or success message, for information only. + * @return message + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Error or success message, for information only.") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public V1alpha1KafkaConnectorStatus ready(Boolean ready) { + + this.ready = ready; + return this; + } + + /** + * Whether the requested connector has been created. + * @return ready + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether the requested connector has been created.") + + public Boolean getReady() { + return ready; + } + + + public void setReady(Boolean ready) { + this.ready = ready; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V1alpha1KafkaConnectorStatus v1alpha1KafkaConnectorStatus = (V1alpha1KafkaConnectorStatus) o; + return Objects.equals(this.message, v1alpha1KafkaConnectorStatus.message) && + Objects.equals(this.ready, v1alpha1KafkaConnectorStatus.ready); + } + + @Override + public int hashCode() { + return Objects.hash(message, ready); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class V1alpha1KafkaConnectorStatus {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" ready: ").append(toIndentedString(ready)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopic.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopic.java index b6bdddb..cbcde1f 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopic.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopic.java @@ -31,7 +31,7 @@ * Kafka Topic */ @ApiModel(description = "Kafka Topic") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1KafkaTopic implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; @SerializedName(SERIALIZED_NAME_API_VERSION) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicList.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicList.java index ac89f64..71d4dcf 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicList.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicList.java @@ -32,7 +32,7 @@ * KafkaTopicList is a list of KafkaTopic */ @ApiModel(description = "KafkaTopicList is a list of KafkaTopic") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1KafkaTopicList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; @SerializedName(SERIALIZED_NAME_API_VERSION) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpec.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpec.java index b278f9a..0161d8e 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpec.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpec.java @@ -33,7 +33,7 @@ * Desired Kafka topic configuration. */ @ApiModel(description = "Desired Kafka topic configuration.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1KafkaTopicSpec { public static final String SERIALIZED_NAME_CLIENT_CONFIGS = "clientConfigs"; @SerializedName(SERIALIZED_NAME_CLIENT_CONFIGS) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpecClientConfigs.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpecClientConfigs.java index ff1a707..b900063 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpecClientConfigs.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpecClientConfigs.java @@ -28,7 +28,7 @@ /** * V1alpha1KafkaTopicSpecClientConfigs */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1KafkaTopicSpecClientConfigs { public static final String SERIALIZED_NAME_CONFIG_MAP_REF = "configMapRef"; @SerializedName(SERIALIZED_NAME_CONFIG_MAP_REF) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpecConfigMapRef.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpecConfigMapRef.java index ecf8fab..55aea4d 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpecConfigMapRef.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicSpecConfigMapRef.java @@ -28,7 +28,7 @@ * Reference to a ConfigMap to use for AdminClient configuration. */ @ApiModel(description = "Reference to a ConfigMap to use for AdminClient configuration.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1KafkaTopicSpecConfigMapRef { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicStatus.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicStatus.java index 5b0ab4c..cbdb81c 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicStatus.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1KafkaTopicStatus.java @@ -28,7 +28,7 @@ * Current state of the topic. */ @ApiModel(description = "Current state of the topic.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1KafkaTopicStatus { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJob.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJob.java index 96736d0..abcf588 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJob.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJob.java @@ -31,7 +31,7 @@ * SQL job */ @ApiModel(description = "SQL job") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1SqlJob implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; @SerializedName(SERIALIZED_NAME_API_VERSION) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobList.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobList.java index 131e7c0..3f3b455 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobList.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobList.java @@ -32,7 +32,7 @@ * SqlJobList is a list of SqlJob */ @ApiModel(description = "SqlJobList is a list of SqlJob") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1SqlJobList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; @SerializedName(SERIALIZED_NAME_API_VERSION) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobSpec.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobSpec.java index b5af3b4..8e14eca 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobSpec.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobSpec.java @@ -30,7 +30,7 @@ * SQL job spec. */ @ApiModel(description = "SQL job spec.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1SqlJobSpec { public static final String SERIALIZED_NAME_SQL = "sql"; @SerializedName(SERIALIZED_NAME_SQL) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobStatus.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobStatus.java index 378f069..3bb11e4 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobStatus.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SqlJobStatus.java @@ -28,7 +28,7 @@ * Current state of the SQL job. */ @ApiModel(description = "Current state of the SQL job.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1SqlJobStatus { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1Subscription.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1Subscription.java index 552a319..fe2f5b0 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1Subscription.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1Subscription.java @@ -31,7 +31,7 @@ * Hoptimator Subscription */ @ApiModel(description = "Hoptimator Subscription") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1Subscription implements io.kubernetes.client.common.KubernetesObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; @SerializedName(SERIALIZED_NAME_API_VERSION) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionList.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionList.java index 7f5185d..2e9551e 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionList.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionList.java @@ -32,7 +32,7 @@ * SubscriptionList is a list of Subscription */ @ApiModel(description = "SubscriptionList is a list of Subscription") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1SubscriptionList implements io.kubernetes.client.common.KubernetesListObject { public static final String SERIALIZED_NAME_API_VERSION = "apiVersion"; @SerializedName(SERIALIZED_NAME_API_VERSION) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionSpec.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionSpec.java index 10f189a..cdc8616 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionSpec.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionSpec.java @@ -28,7 +28,7 @@ * Subscription spec */ @ApiModel(description = "Subscription spec") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1SubscriptionSpec { public static final String SERIALIZED_NAME_DATABASE = "database"; @SerializedName(SERIALIZED_NAME_DATABASE) diff --git a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionStatus.java b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionStatus.java index 8f41d08..04ba8cd 100644 --- a/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionStatus.java +++ b/hoptimator-models/src/main/java/com/linkedin/hoptimator/models/V1alpha1SubscriptionStatus.java @@ -28,7 +28,7 @@ * Filled in by the operator. */ @ApiModel(description = "Filled in by the operator.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-04-28T19:46:31.976Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-07T04:20:03.484Z[Etc/UTC]") public class V1alpha1SubscriptionStatus { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/hoptimator-operator/src/main/java/com/linkedin/hoptimator/operator/.HoptimatorOperatorApp.java.swp b/hoptimator-operator/src/main/java/com/linkedin/hoptimator/operator/.HoptimatorOperatorApp.java.swp deleted file mode 100644 index 378af8e..0000000 Binary files a/hoptimator-operator/src/main/java/com/linkedin/hoptimator/operator/.HoptimatorOperatorApp.java.swp and /dev/null differ