.common-binlog-alone-api.6.1.0.source-code.ListenerDef.proto Maven / Gradle / Ivy
The newest version!
syntax = "proto3";
package net.wicp.tams.common.binlog.alone;
option java_outer_classname = "ListenerConf";
/**位点信息**/
message Position{
string gtids = 1;
string fileName =2;
int64 pos =3;
int64 masterServerId =4;
int64 time = 5;
string timeStr = 6;
string serverIp = 7;
int32 clintId = 8;
}
/**列名**/
message ColHis{
string db =1;
string tb = 2;
repeated string cols= 3;
/**字段类型,数据库字段 eg:varchar**/
repeated string ColTypes = 4;
/**字段类型,数据库字段eg: varchar(255)**/
repeated string ColTypes2 = 5;
repeated int32 keyIndex = 6;
int64 time = 7;
string timeStr = 8;
string serverIp = 9;
}
/**启动类型**/
enum HaType {
/**当前数据库最新位点**/
cur=0;
/**存储的最大位点**/
last=1;
/**指定的位点(一般是gtid)**/
pos=2;
}
/**业务关心的对象**/
message ConnConf{
/**大多实例监听时,它会有不同,默认是default**/
string confName = 1;
string host = 2;
int32 port = 3;
string username = 4;
string password = 5;
/**只读实例配置**/
string host2 = 6;
int32 port2 = 7;
string username2 = 8;
string password2 = 9;
/**监听的类**/
string listener = 10;
/**业务处理器**/
string busier = 11;
/**过滤器配置**/
string filterConf = 12;
/**是否rds**/
bool rds = 13;
/**分布式锁groupId**/
string groupId = 14;
/**自定义的clinetId,不能重复,可以不填**/
int32 clientId = 15;
/**启动的gtid**/
Position pos = 16;
/**启动类型**/
HaType haType = 17;
/**规则**/
string rule = 18;
/**checkpoint配置**/
string chk = 19;
/**数据库用于反查的instanceId,**/
int64 dbInstanceId = 20;//
/**库规则**/
//string dbPattern = 13;
/**表规则**/
//string tbPattern = 14;
/**库原始表**/
//string dbOri = 15;
/**表原始表**/
//string tbOri = 16;
/**插件需要关心的扩展字段**/
//string pluginConf = 17;
}
enum OfflineLimitType {
time = 0;
gtid = 1;
}
message ConnConfOffline{
//限制类型
OfflineLimitType offlineLimitType = 1;
//开始结束时间 yyyy-MM-dd
int64 timeBegin = 2;
int64 timeEnd = 3;
//开始结束gtid
string gtidBegin = 4;
string gtidEnd = 5;
//需要解析的binlog文件,逗号隔开
string binlogFiles = 6;
// 日志所在rds主机Id,为数字,task的dbinst是rds实例名,为字符串(rds专用)
int64 dbInstanceId = 7;
}
/**用于做断点续存的对象**/
message CheckPoint{
Position pos = 1;
repeated ColHis cols = 2;
}
//////////////////////////////下面用于
enum ColumnType {
DECIMAL = 0;
TINY = 1;
SHORT = 2;
LONG = 3;
FLOAT = 4;
DOUBLE = 5;
NULL = 6;
TIMESTAMP = 7;
LONGLONG = 8;
INT24 = 9;
DATE = 10;
TIME = 11;
DATETIME = 12;
YEAR = 13;
NEWDATE = 14;
VARCHAR = 15;
BIT = 16;
TIMESTAMP2 = 17;
DATETIME2 = 18;
TIME2 = 19;
JSON = 245;
NEWDECIMAL = 246;
ENUM = 247;
SET = 248;
TINY_BLOB = 249;
MEDIUM_BLOB= 250;
LONG_BLOB = 251;
BLOB = 252;
VAR_STRING = 253;
STRING = 254;
GEOMETRY = 255;
}
//updateBefore在flink的消息serializa里会出现。其它都是正常的状态
enum OptType {
insert=0;
delete=1;
update=2;
updateBefore=3;
}
/**业务关心的对象**/
message DuckulaEvent{
string db = 1;
string tb = 2;
OptType optType = 3;
string gtid = 4;
/**列数,一般与cols长度一致,不一致说明cols与binlog不同步**/
int32 colNum = 5;
/**列名、列类型,如果是幂等版则cols存放的是主键和附加值字段和对应的类型**/
repeated string cols = 6;
repeated ColumnType colsType = 7;
/**主键字段,如果为空则表示cols的第0个字段*/
repeated int32 keyindexs = 8;
repeated DuckulaEventItem items = 9;
/**是否补救信息,true需要反查DB**/
bool isError= 10;
/**事务提交时间**/
int64 commitTime= 11;
/**附加值信息(全局 幂等版使用)**/
/**数据库用于反查的instanceId,在配置中自动带入**/
int64 dbInstanceId = 12;//
repeated string addColNames= 13;
repeated ColumnType addColTypes= 14;
string addProp= 15;
/**是否为cascade数据,通过级联来的数据。对于flink的数据有需求。可以节省内存,默认flase:正常数据 true:由于级联而产生的数据
**/
bool isCascade = 16;
/**全量时间**/
int64 dumpTime = 17;
/**新的数据库名.表名。适合于db类型中间件为**/
//string newDb= 16;
//string newTb= 17;
}
message DuckulaEventItem{
map before = 1;
map after = 2;
/**主档表信息,后期支持,先加上**/
map parent = 3;
/**多线程里需要目标中间件支持gtid*100+index就es的版本号,相同的事务更新100条以上的概率很小**/
int64 version = 4;
}