-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from Altinity/add_postgres_lsn_support
Added logic to set lsn through REST API.
- Loading branch information
Showing
28 changed files
with
690 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM openjdk:11 | ||
COPY sink-connector-client/sink-connector-client /sink-connector-client | ||
COPY sink-connector-lightweight/target/clickhouse-debezium-embedded-1.0-SNAPSHOT.jar /app.jar | ||
ENV JAVA_OPTS="-Dlog4jDebug=true" | ||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/app.jar", "/config.yml", "com.altinity.clickhouse.debezium.embedded.ClickHouseDebeziumEmbeddedApplication"] |
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,16 @@ | ||
#!/bin/bash | ||
|
||
cd sink-connector-lightweight | ||
mvn clean install -DskipTests=true | ||
today_date=$(date +%F) | ||
|
||
cd .. | ||
cd sink-connector-client | ||
CGO_ENABLED=0 go build | ||
|
||
cd .. | ||
|
||
docker login registry.gitlab.com | ||
docker build -f sink-connector-lightweight/Dockerfile -t clickhouse_debezium_embedded:${today_date} . --no-cache | ||
docker tag clickhouse_debezium_embedded:${today_date} registry.gitlab.com/altinity-public/container-images/clickhouse_debezium_embedded:${today_date} | ||
docker push registry.gitlab.com/altinity-public/container-images/clickhouse_debezium_embedded:${today_date} |
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,11 @@ | ||
Using the `pg_waldump` utility to dump the WAL log information. `pg_waldump` utility needs to be provided the postgresql data directory path. | ||
``` | ||
pg_waldump pg_wal/000000010000000000000001 | ||
``` | ||
|
||
``` | ||
┌─id───────────────────────────────────┬─offset_key────────────────────────────────────┬─offset_val──────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────record_insert_ts─┬─record_insert_seq─┐ | ||
│ 03750062-c862-48c5-9f37-451c0d33511b │ ["\"engine\"",{"server":"embeddedconnector"}] │ {"transaction_id":null,"lsn_proc":27485360,"messageType":"UPDATE","lsn":27485360,"txId":743,"ts_usec":1687876724804733} │ 2023-06-27 14:38:45 │ 1 │ | ||
└──────────────────────────────────────┴───────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────────────────┴───────────────────┘ | ||
``` |
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
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,34 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
"github.com/urfave/cli" | ||
"testing" | ||
) | ||
|
||
func TestGetServerUrl(t *testing.T) { | ||
var c = cli.Context{ | ||
App: cli.NewApp(), | ||
Command: cli.Command{}, | ||
} | ||
c.App.Flags = []cli.Flag{ | ||
cli.StringFlag{ | ||
Name: "host", | ||
Usage: "Host server address of sink connector", | ||
Required: false, | ||
}, | ||
cli.StringFlag{ | ||
Name: "port", | ||
Usage: "Port of sink connector", | ||
Required: false, | ||
}, | ||
cli.BoolFlag{ | ||
Name: "secure", | ||
Usage: "If true, then use https, else http", | ||
Required: false, | ||
}, | ||
} | ||
//var c = cli.NewContext(nil, nil, nil) | ||
var serverUrl = getServerUrl("start", &c) | ||
assert.Equal(t, "http://localhost:7000/start_replica", serverUrl, "they should be equal") | ||
} |
Binary file not shown.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM openjdk:11 | ||
COPY target/clickhouse-debezium-embedded-1.0-SNAPSHOT.jar /app.jar | ||
COPY sink-connector-client/sink-connector-client /sink-connector-client | ||
COPY sink-connector-lightweight/target/clickhouse-debezium-embedded-1.0-SNAPSHOT.jar /app.jar | ||
ENV JAVA_OPTS="-Dlog4jDebug=true" | ||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/app.jar", "/config.yml", "com.altinity.clickhouse.debezium.embedded.ClickHouseDebeziumEmbeddedApplication"] |
8 changes: 8 additions & 0 deletions
8
sink-connector-lightweight/clickhouse-debezium-embedded (2).iml
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module version="4"> | ||
<component name="AdditionalModuleElements"> | ||
<content url="file://$MODULE_DIR$" dumb="true"> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> | ||
</content> | ||
</component> | ||
</module> |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
name: "debezium-embedded-postgres" | ||
database.hostname: "postgres" | ||
database.port: "5432" | ||
database.user: "root" | ||
|
Oops, something went wrong.