-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make postgresql flink-cdc UT test pass
- Loading branch information
1 parent
94d6a87
commit a926b5f
Showing
15 changed files
with
1,029 additions
and
78 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
33 changes: 17 additions & 16 deletions
33
...dc-common/src/main/java/com/qlangtech/plugins/incr/flink/cdc/DefaultTableNameConvert.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 |
---|---|---|
@@ -1,30 +1,31 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.qlangtech.plugins.incr.flink.cdc; | ||
|
||
import java.io.Serializable; | ||
import java.util.function.Function; | ||
|
||
/** | ||
* @author: 百岁([email protected]) | ||
* @create: 2022-12-25 10:52 | ||
**/ | ||
public class DefaultTableNameConvert implements Function<String,String> { | ||
public class DefaultTableNameConvert implements Function<String, String>, Serializable { | ||
@Override | ||
public String apply(String physicsTabName) { | ||
return physicsTabName; | ||
|
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 |
---|---|---|
|
@@ -56,4 +56,6 @@ public boolean isAllCols() { | |
public List<CMeta> getCols() { | ||
return cols; | ||
} | ||
|
||
|
||
} |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.qlangtech.plugins.incr.flink.cdc.postgresql; | ||
|
@@ -22,25 +22,34 @@ | |
import com.qlangtech.tis.async.message.client.consumer.IConsumerHandle; | ||
import com.qlangtech.tis.async.message.client.consumer.IMQListener; | ||
import com.qlangtech.tis.async.message.client.consumer.impl.MQListenerFactory; | ||
import com.qlangtech.tis.datax.IDataXPluginMeta; | ||
import com.qlangtech.tis.extension.TISExtension; | ||
import com.qlangtech.tis.plugin.IEndTypeGetter; | ||
import com.qlangtech.tis.plugin.annotation.FormField; | ||
import com.qlangtech.tis.plugin.annotation.FormFieldType; | ||
import com.qlangtech.tis.plugin.annotation.Validator; | ||
|
||
|
||
import java.util.Objects; | ||
import java.util.Optional; | ||
|
||
/** | ||
* https://ververica.github.io/flink-cdc-connectors/master/content/connectors/postgres-cdc.html | ||
* @author: 百岁([email protected]) | ||
* @create: 2021-09-27 15:15 | ||
**/ | ||
@Public | ||
public class FlinkCDCPostreSQLSourceFactory extends MQListenerFactory { | ||
private transient IConsumerHandle consumerHandle; | ||
|
||
|
||
// The name of the Postgres logical decoding plug-in installed on the server. Supported | ||
// * values are decoderbufs, wal2json, wal2json_rds, wal2json_streaming, | ||
// * wal2json_rds_streaming and pgoutput. | ||
|
||
/** | ||
* The name of the Postgres logical decoding plug-in installed on the server. Supported values are decoderbufs, wal2json, wal2json_rds, wal2json_streaming, wal2json_rds_streaming and pgoutput. | ||
*/ | ||
@FormField(ordinal = 0, type = FormFieldType.ENUM, validate = {Validator.require}) | ||
public String decodingPluginName; | ||
|
||
// @FormField(ordinal = 0, type = FormFieldType.ENUM, validate = {Validator.require}) | ||
// public String startupOptions; | ||
|
||
|
@@ -57,6 +66,7 @@ public class FlinkCDCPostreSQLSourceFactory extends MQListenerFactory { | |
// } | ||
// } | ||
|
||
|
||
@Override | ||
public IMQListener create() { | ||
FlinkCDCPostgreSQLSourceFunction sourceFunctionCreator = new FlinkCDCPostgreSQLSourceFunction(this); | ||
|
@@ -84,6 +94,7 @@ public String getDisplayName() { | |
public PluginVender getVender() { | ||
return PluginVender.FLINK_CDC; | ||
} | ||
|
||
@Override | ||
public IEndTypeGetter.EndType getEndType() { | ||
return IEndTypeGetter.EndType.Postgres; | ||
|
33 changes: 33 additions & 0 deletions
33
...urces/com/qlangtech/plugins/incr/flink/cdc/postgresql/FlinkCDCPostreSQLSourceFactory.json
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,33 @@ | ||
{ | ||
"decodingPluginName": { | ||
"dftVal": "decoderbufs", | ||
"label": "解码器", | ||
"help": "The name of the Postgres logical decoding plug-in installed on the server. Supported values are decoderbufs, wal2json, wal2json_rds, wal2json_streaming, wal2json_rds_streaming and pgoutput.", | ||
"enum": [ | ||
{ | ||
"val": "decoderbufs", | ||
"label": "decoderbufs" | ||
}, | ||
{ | ||
"val": "wal2json", | ||
"label": "wal2json" | ||
}, | ||
{ | ||
"val": "wal2json_rds", | ||
"label": "wal2json_rds" | ||
}, | ||
{ | ||
"val": "wal2json_streaming", | ||
"label": "wal2json_streaming" | ||
}, | ||
{ | ||
"val": "wal2json_rds_streaming", | ||
"label": "wal2json_rds_streaming" | ||
}, | ||
{ | ||
"val": "pgoutput", | ||
"label": "pgoutput" | ||
} | ||
] | ||
} | ||
} |
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
Oops, something went wrong.