forked from debezium/debezium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DBZ-5926 Add support for Connect Headers to Debezium Server
Add headers support to ChangeEvent Add SerializationFormat support headers
- Loading branch information
1 parent
107f09a
commit d775104
Showing
18 changed files
with
542 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Debezium Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.debezium.engine; | ||
|
||
/** | ||
* Represents a header that contains a key and a value. | ||
*/ | ||
public interface Header<T> { | ||
|
||
/** | ||
* Key of a header. | ||
*/ | ||
String getKey(); | ||
|
||
/** | ||
* Value of a header. | ||
*/ | ||
T getValue(); | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
debezium-api/src/main/java/io/debezium/engine/format/JsonByteArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright Debezium Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.debezium.engine.format; | ||
|
||
/** | ||
* A {@link SerializationFormat} defining the JSON format serialized as byte[]. | ||
*/ | ||
public class JsonByteArray implements SerializationFormat<byte[]> { | ||
} |
40 changes: 40 additions & 0 deletions
40
debezium-api/src/main/java/io/debezium/engine/format/KeyValueHeaderChangeEventFormat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Debezium Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.debezium.engine.format; | ||
|
||
import io.debezium.common.annotation.Incubating; | ||
|
||
/** | ||
* Describes a change event output format comprising a key, value, and a header. | ||
*/ | ||
@Incubating | ||
public interface KeyValueHeaderChangeEventFormat<K extends SerializationFormat<?>, V extends SerializationFormat<?>, H extends SerializationFormat<?>> | ||
extends KeyValueChangeEventFormat<K, V> { | ||
static <K extends SerializationFormat<?>, V extends SerializationFormat<?>, H extends SerializationFormat<?>> KeyValueHeaderChangeEventFormat<K, V, H> of( | ||
Class<K> keyFormat, | ||
Class<V> valueFormat, | ||
Class<H> headerFormat) { | ||
return new KeyValueHeaderChangeEventFormat<>() { | ||
|
||
@Override | ||
public Class<K> getKeyFormat() { | ||
return keyFormat; | ||
} | ||
|
||
@Override | ||
public Class<V> getValueFormat() { | ||
return valueFormat; | ||
} | ||
|
||
@Override | ||
public Class<H> getHeaderFormat() { | ||
return headerFormat; | ||
} | ||
}; | ||
} | ||
|
||
Class<H> getHeaderFormat(); | ||
} |
Oops, something went wrong.