Skip to content

Commit

Permalink
DBZ-6962 Added property descriptions and other serialisation configur…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
jcechace committed Oct 16, 2023
1 parent f356836 commit 1d0dd31
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 1 deletion.
43 changes: 43 additions & 0 deletions k8/debeziumservers.debezium.io-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ spec:
spec:
properties:
runtime:
description: Configuration allowing the modification of various aspects
of Debezium Server runtime.
properties:
volumes:
description: Additional volumes mounted to containers.
items:
properties:
hostPath:
Expand Down Expand Up @@ -669,6 +672,8 @@ spec:
type: object
type: array
env:
description: Additional environment variables set from ConfigMaps
or Secrets in containers.
items:
properties:
prefix:
Expand Down Expand Up @@ -1074,13 +1079,21 @@ spec:
type: object
type: object
transforms:
description: Single Message Transformations employed by this instance
of Debezium Server.
items:
properties:
negate:
description: Determines if the result of the applied predicate
will be negated.
type: boolean
predicate:
description: The name of the predicate to be applied to this
transformation.
type: string
type:
description: Fully qualified name of Java class implementing
the transformation.
type: string
config:
properties:
Expand All @@ -1094,10 +1107,13 @@ spec:
type: object
type: array
sink:
description: Sink configuration.
properties:
type:
description: Sink type recognised by Debezium Server.
type: string
config:
description: Sink configuration properties.
properties:
props:
additionalProperties:
Expand All @@ -1108,22 +1124,32 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
storage:
description: Storage configuration to be used by this instance of
Debezium Server.
properties:
claimName:
description: Name of persistent volume claim for persistent storage.
type: string
type:
description: Storage type.
enum:
- persistent
- ephemeral
type: string
type: object
version:
description: Version of Debezium Server to be used.
type: string
image:
description: Image used for Debezium Server container. This property
takes precedence over version.
type: string
quarkus:
description: Quarkus configuration passed down to Debezium Server
process.
properties:
config:
description: Quarkus configuration properties.
properties:
props:
additionalProperties:
Expand All @@ -1137,8 +1163,11 @@ spec:
additionalProperties:
properties:
type:
description: Fully qualified name of Java class implementing
the predicate.
type: string
config:
description: Predicate configuration properties.
properties:
props:
additionalProperties:
Expand All @@ -1148,12 +1177,16 @@ spec:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
description: Predicates employed by this instance of Debezium Server.
type: object
source:
description: Debezium source connector configuration.
properties:
class:
description: Fully qualified name of source connector Java class.
type: string
config:
description: Source connector configuration properties.
properties:
props:
additionalProperties:
Expand All @@ -1164,12 +1197,16 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
format:
description: Message output format configuration.
properties:
key:
description: Message key format configuration.
properties:
type:
description: Format type recognised by Debezium Server.
type: string
config:
description: Format configuration properties.
properties:
props:
additionalProperties:
Expand All @@ -1180,10 +1217,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
value:
description: Message value format configuration.
properties:
type:
description: Format type recognised by Debezium Server.
type: string
config:
description: Format configuration properties.
properties:
props:
additionalProperties:
Expand All @@ -1194,10 +1234,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
type: object
header:
description: Message header format configuration.
properties:
type:
description: Format type recognised by Debezium Server.
type: string
config:
description: Format configuration properties.
properties:
props:
additionalProperties:
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/io/debezium/operator/model/DebeziumServerSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,45 @@
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.debezium.operator.config.ConfigMappable;
import io.debezium.operator.config.ConfigMapping;

@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class DebeziumServerSpec implements ConfigMappable {

@JsonPropertyDescription("Image used for Debezium Server container. This property takes precedence over version.")
private String image;

@JsonPropertyDescription("Version of Debezium Server to be used.")
private String version;

@JsonPropertyDescription("Storage configuration to be used by this instance of Debezium Server.")
private Storage storage;

@JsonPropertyDescription("Sink configuration.")
private Sink sink;

@JsonPropertyDescription("Debezium source connector configuration.")
private Source source;

@JsonPropertyDescription("Message output format configuration.")
private Format format;

@JsonPropertyDescription("Quarkus configuration passed down to Debezium Server process.")
private Quarkus quarkus;

@JsonPropertyDescription("Configuration allowing the modification of various aspects of Debezium Server runtime.")
private Runtime runtime;

@JsonPropertyDescription("Single Message Transformations employed by this instance of Debezium Server.")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<Transformation> transforms;

@JsonPropertyDescription("Predicates employed by this instance of Debezium Server.")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Predicate> predicates;

public DebeziumServerSpec() {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/io/debezium/operator/model/Format.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@
*/
package io.debezium.operator.model;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.debezium.operator.config.ConfigMappable;
import io.debezium.operator.config.ConfigMapping;

public class Format implements ConfigMappable {

@JsonPropertyDescription("Message key format configuration.")
private FormatType key;

@JsonPropertyDescription("Message value format configuration.")
private FormatType value;

@JsonPropertyDescription("Message header format configuration.")
private FormatType header;

public Format() {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/io/debezium/operator/model/FormatType.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
*/
package io.debezium.operator.model;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.debezium.operator.config.ConfigMappable;
import io.debezium.operator.config.ConfigMapping;

public class FormatType implements ConfigMappable {

@JsonPropertyDescription("Format type recognised by Debezium Server.")
private String type;

@JsonPropertyDescription("Format configuration properties.")
private ConfigProperties config;

public FormatType() {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/io/debezium/operator/model/Predicate.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
*/
package io.debezium.operator.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.debezium.operator.config.ConfigMappable;
import io.debezium.operator.config.ConfigMapping;

public class Predicate implements ConfigMappable {

@JsonPropertyDescription("Fully qualified name of Java class implementing the predicate.")
@JsonProperty(required = true)
private String type;

@JsonPropertyDescription("Predicate configuration properties.")
private ConfigProperties config;

public Predicate() {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/io/debezium/operator/model/Quarkus.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
*/
package io.debezium.operator.model;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.debezium.operator.config.ConfigMappable;
import io.debezium.operator.config.ConfigMapping;

public class Quarkus implements ConfigMappable {

@JsonPropertyDescription("Quarkus configuration properties.")
private ConfigProperties config;

public Quarkus() {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/debezium/operator/model/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@

public class Runtime {

@JsonPropertyDescription("Additional environment variables set from ConfigMaps or Secrets in containers.")
private List<EnvFromSource> env;

@JsonPropertyDescription("Additional volumes mounted to containers.")
private List<Volume> volumes;

@JsonPropertyDescription("Debezium Server resource templates.")
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/io/debezium/operator/model/Sink.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
*/
package io.debezium.operator.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.debezium.operator.config.ConfigMappable;
import io.debezium.operator.config.ConfigMapping;

public class Sink implements ConfigMappable {

@JsonPropertyDescription("Sink type recognised by Debezium Server.")
@JsonProperty(required = true)
private String type;

@JsonPropertyDescription("Sink configuration properties.")
private ConfigProperties config;

public Sink() {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/io/debezium/operator/model/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@
package io.debezium.operator.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.debezium.operator.config.ConfigMappable;
import io.debezium.operator.config.ConfigMapping;

public class Source implements ConfigMappable {

@JsonPropertyDescription("Fully qualified name of source connector Java class.")
@JsonProperty(value = "class", required = true)
private String sourceClass;

@JsonPropertyDescription("Source connector configuration properties.")
private ConfigProperties config;

public Source() {
this.config = new ConfigProperties();
}

@JsonProperty("class")
public String getSourceClass() {
return sourceClass;
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/debezium/operator/model/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
*/
package io.debezium.operator.model;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;

public class Storage {

@JsonPropertyDescription("Storage type.")
private StorageType type;

@JsonPropertyDescription("Name of persistent volume claim for persistent storage.")
private String claimName;

public Storage() {
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/io/debezium/operator/model/Transformation.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@
*/
package io.debezium.operator.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;

import io.debezium.operator.config.ConfigMappable;
import io.debezium.operator.config.ConfigMapping;

public class Transformation implements ConfigMappable {

@JsonPropertyDescription("Fully qualified name of Java class implementing the transformation.")
@JsonProperty(required = true)
private String type;

@JsonPropertyDescription("The name of the predicate to be applied to this transformation.")
private String predicate;

@JsonPropertyDescription("Determines if the result of the applied predicate will be negated.")
private boolean negate = false;
private ConfigProperties config;

Expand Down

0 comments on commit 1d0dd31

Please sign in to comment.