|
|
|
@ -69,6 +69,13 @@ public class OpenGaussReplicationToKafka {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String GetRestartLsn(String slotName) {
|
|
|
|
|
String sql = "select restart_lsn from pg_replication_slots where slot_name=?";
|
|
|
|
|
List<Record> list = Db.find(sql, slotName);
|
|
|
|
|
if (list.size() > 0) return list.get(0).getStr("restart_lsn");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void InsertTestData() {
|
|
|
|
|
String sql = "select max(id) as maxid from test";
|
|
|
|
|
int maxId = 0;
|
|
|
|
@ -157,6 +164,8 @@ public class OpenGaussReplicationToKafka {
|
|
|
|
|
stream.setAppliedLSN(stream.getLastReceiveLSN());
|
|
|
|
|
stream.setFlushedLSN(stream.getLastReceiveLSN());
|
|
|
|
|
stream.forceUpdateStatus();
|
|
|
|
|
|
|
|
|
|
System.out.println(stream.getLastReceiveLSN());
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception err) {
|
|
|
|
|
if (stream != null) {
|
|
|
|
|