From c1f92858a27f201504bcd86eea69f0cee34071c5 Mon Sep 17 00:00:00 2001 From: winger Date: Sat, 25 Aug 2018 03:54:38 +0800 Subject: [PATCH 01/42] =?UTF-8?q?fix=20bug:=20=E5=B9=B6=E8=A1=8C=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C=E5=BC=80=E5=90=AF?= =?UTF-8?q?gtid=20=E4=BC=9A=E5=AF=BC=E8=87=B4=E8=A7=A3=E6=9E=90=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbsync/pom.xml | 5 +++++ .../taobao/tddl/dbsync/binlog/LogContext.java | 20 +++++++++++++++++++ .../taobao/tddl/dbsync/binlog/LogDecoder.java | 14 ++++++++++++- .../tddl/dbsync/binlog/event/LogHeader.java | 13 ++++++++++++ .../inbound/mysql/dbsync/LogEventConvert.java | 11 ++++------ 5 files changed, 55 insertions(+), 8 deletions(-) diff --git a/dbsync/pom.xml b/dbsync/pom.xml index f4d20a10..ac606af4 100644 --- a/dbsync/pom.xml +++ b/dbsync/pom.xml @@ -11,6 +11,11 @@ jar canal dbsync module for otter ${project.version} + + com.alibaba.otter + canal.parse.driver + ${project.version} + ch.qos.logback diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java index 8d88d00d..80b2c254 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java @@ -3,7 +3,10 @@ package com.taobao.tddl.dbsync.binlog; import java.util.HashMap; import java.util.Map; +import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; +import com.alibaba.otter.canal.parse.driver.mysql.packets.MysqlGTIDSet; import com.taobao.tddl.dbsync.binlog.event.FormatDescriptionLogEvent; +import com.taobao.tddl.dbsync.binlog.event.GtidLogEvent; import com.taobao.tddl.dbsync.binlog.event.TableMapLogEvent; /** @@ -20,6 +23,8 @@ public final class LogContext { private LogPosition logPosition; + private GTIDSet gtidSet; + public LogContext(){ this.formatDescription = FormatDescriptionLogEvent.FORMAT_DESCRIPTION_EVENT_5_x; } @@ -60,4 +65,19 @@ public final class LogContext { formatDescription = FormatDescriptionLogEvent.FORMAT_DESCRIPTION_EVENT_5_x; mapOfTable.clear(); } + + public final void putGtid(GtidLogEvent logEvent) { + if (logEvent != null) { + String gtid = logEvent.getSid().toString() + ":" + logEvent.getGno(); + if (gtidSet == null) { + gtid = logEvent.getSid().toString() + ":1-" + logEvent.getGno(); + gtidSet = MysqlGTIDSet.parse(gtid); + } + gtidSet.update(gtid); + } + } + + public GTIDSet getGtidSet() { + return gtidSet; + } } diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java index bbb358b7..d094b2fd 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java @@ -3,6 +3,7 @@ package com.taobao.tddl.dbsync.binlog; import java.io.IOException; import java.util.BitSet; +import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -159,18 +160,19 @@ public final class LogDecoder { // remove checksum bytes buffer.limit(header.getEventLen() - LogEvent.BINLOG_CHECKSUM_LEN); } - switch (header.getType()) { case LogEvent.QUERY_EVENT: { QueryLogEvent event = new QueryLogEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.XID_EVENT: { XidLogEvent event = new XidLogEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.TABLE_MAP_EVENT: { @@ -268,12 +270,14 @@ public final class LogDecoder { RandLogEvent event = new RandLogEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.USER_VAR_EVENT: { UserVarLogEvent event = new UserVarLogEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.FORMAT_DESCRIPTION_EVENT: { @@ -324,6 +328,7 @@ public final class LogDecoder { HeartbeatLogEvent event = new HeartbeatLogEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.IGNORABLE_LOG_EVENT: { @@ -336,6 +341,7 @@ public final class LogDecoder { RowsQueryLogEvent event = new RowsQueryLogEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.WRITE_ROWS_EVENT: { @@ -343,6 +349,7 @@ public final class LogDecoder { /* updating position in context */ logPosition.position = header.getLogPos(); event.fillTable(context); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.UPDATE_ROWS_EVENT: { @@ -350,6 +357,7 @@ public final class LogDecoder { /* updating position in context */ logPosition.position = header.getLogPos(); event.fillTable(context); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.DELETE_ROWS_EVENT: { @@ -357,6 +365,7 @@ public final class LogDecoder { /* updating position in context */ logPosition.position = header.getLogPos(); event.fillTable(context); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.GTID_LOG_EVENT: @@ -364,6 +373,8 @@ public final class LogDecoder { GtidLogEvent event = new GtidLogEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); + // update latest gtid + context.putGtid(event); return event; } case LogEvent.PREVIOUS_GTIDS_LOG_EVENT: { @@ -394,6 +405,7 @@ public final class LogDecoder { AnnotateRowsEvent event = new AnnotateRowsEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); + header.putGtidStr(context.getGtidSet()); return event; } case LogEvent.BINLOG_CHECKPOINT_EVENT: { diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/LogHeader.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/LogHeader.java index 229693a2..77e48ddb 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/LogHeader.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/LogHeader.java @@ -1,5 +1,6 @@ package com.taobao.tddl.dbsync.binlog.event; +import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; import com.taobao.tddl.dbsync.binlog.LogBuffer; import com.taobao.tddl.dbsync.binlog.LogEvent; @@ -120,6 +121,8 @@ public final class LogHeader { */ protected String logFileName; + protected String gtidStr; + /* for Start_event_v3 */ public LogHeader(final int type){ this.type = type; @@ -288,4 +291,14 @@ public final class LogHeader { crc = buffer.getUint32(eventLen - LogEvent.BINLOG_CHECKSUM_LEN); } } + + public String getGtidStr() { + return gtidStr; + } + + public void putGtidStr(GTIDSet gtidSet) { + if (gtidSet != null) { + this.gtidStr = gtidSet.toString(); + } + } } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java index e161e34e..5e679639 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java @@ -170,15 +170,13 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar return entryBuilder.build(); } - private Entry parseGTIDLogEvent(GtidLogEvent logEvent) { + public Entry parseGTIDLogEvent(GtidLogEvent logEvent) { LogHeader logHeader = logEvent.getHeader(); String value = logEvent.getSid().toString() + ":" + logEvent.getGno(); Pair.Builder builder = Pair.newBuilder(); builder.setKey("gtid"); builder.setValue(value); - if (gtidSet != null) { - gtidSet.update(value); - } + if (logEvent.getLastCommitted() != null) { builder.setKey("lastCommitted"); builder.setValue(String.valueOf(logEvent.getLastCommitted())); @@ -845,9 +843,8 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar } headerBuilder.setEventLength(logHeader.getEventLen()); // enable gtid position - if (gtidSet != null) { - String gtid = gtidSet.toString(); - headerBuilder.setGtid(gtid); + if (StringUtils.isNotEmpty(logHeader.getGtidStr())) { + headerBuilder.setGtid(logHeader.getGtidStr()); } // add rowsCount suppport From 6fe3ef43d86f77718ea701136c705b3cbc08e3cf Mon Sep 17 00:00:00 2001 From: winger Date: Sat, 25 Aug 2018 09:17:13 +0800 Subject: [PATCH 02/42] =?UTF-8?q?fix=20bug:=20=E5=B9=B6=E8=A1=8C=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C=E5=BC=80=E5=90=AF?= =?UTF-8?q?gtid=20=E4=BC=9A=E5=AF=BC=E8=87=B4=E8=A7=A3=E6=9E=90=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java index 5e679639..cb579961 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java @@ -170,7 +170,7 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar return entryBuilder.build(); } - public Entry parseGTIDLogEvent(GtidLogEvent logEvent) { + private Entry parseGTIDLogEvent(GtidLogEvent logEvent) { LogHeader logHeader = logEvent.getHeader(); String value = logEvent.getSid().toString() + ":" + logEvent.getGno(); Pair.Builder builder = Pair.newBuilder(); From b5e05c8c77fd7091901500360e28f568b20ca89b Mon Sep 17 00:00:00 2001 From: mcy Date: Tue, 28 Aug 2018 13:51:23 +0800 Subject: [PATCH 03/42] =?UTF-8?q?kafka=20client=20keep=20alive=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/adapter/loader/CanalAdapterKafkaWorker.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java index 5bccb51a..aecaceb2 100644 --- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java +++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java @@ -143,9 +143,13 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker { }); // 间隔一段时间ack一次, 防止因超时未响应切换到另外台客户端 + long currentTS = System.currentTimeMillis(); while (executing.get()) { - connector.ack(); - Thread.sleep(500); + // 大于1分钟未消费完ack一次keep alive + if (System.currentTimeMillis() - currentTS > 60000) { + connector.ack(); + currentTS = System.currentTimeMillis(); + } } } else { connector.ack(); From bcf30a9a05934e30220b9f8e6aec41f2d0246b6f Mon Sep 17 00:00:00 2001 From: mcy Date: Tue, 28 Aug 2018 15:52:36 +0800 Subject: [PATCH 04/42] =?UTF-8?q?=E5=8E=BB=E6=8E=89kafka=20canalBatchSize?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=BB=98=E8=AE=A450?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployer/src/main/resources/kafka.yml | 2 -- .../java/com/alibaba/otter/canal/kafka/KafkaProperties.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/kafka.yml index 93d4d557..8abf4934 100644 --- a/deployer/src/main/resources/kafka.yml +++ b/deployer/src/main/resources/kafka.yml @@ -3,8 +3,6 @@ retries: 0 batchSize: 16384 lingerMs: 1 bufferMemory: 33554432 -# canal的批次大小,单位 k,量大建议改为1M -canalBatchSize: 50 filterTransactionEntry: true canalDestinations: diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java b/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java index 140ce965..9194c0ab 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java @@ -19,7 +19,7 @@ public class KafkaProperties { private int lingerMs = 1; private long bufferMemory = 33554432L; private boolean filterTransactionEntry = true; - private int canalBatchSize = 5; + private int canalBatchSize = 50; private List canalDestinations = new ArrayList(); From ea81b1dc92cdfd0ddadd6db36c25ca4989257109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=91=AB?= Date: Wed, 29 Aug 2018 14:37:27 +0800 Subject: [PATCH 05/42] fix #893 index name contains "on" keyword --- .../parse/inbound/mysql/ddl/SimpleDdlParser.java | 4 ++-- .../parse/inbound/mysql/SimpleDdlParserTest.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/ddl/SimpleDdlParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/ddl/SimpleDdlParser.java index 53f7de82..57d95dcc 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/ddl/SimpleDdlParser.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/ddl/SimpleDdlParser.java @@ -44,8 +44,8 @@ public class SimpleDdlParser { * http://dev.mysql.com/doc/refman/5.6/en/create-index.html * */ - public static final String CREATE_INDEX_PATTERN = "^\\s*CREATE\\s*(UNIQUE)?(FULLTEXT)?(SPATIAL)?\\s*INDEX\\s*(.*?)\\s*ON\\s*(.*?)$"; - public static final String DROP_INDEX_PATTERN = "^\\s*DROP\\s*INDEX\\s*(.*?)\\s*ON\\s*(.*?)$"; + public static final String CREATE_INDEX_PATTERN = "^\\s*CREATE\\s*(UNIQUE)?(FULLTEXT)?(SPATIAL)?\\s*INDEX\\s*(.*?)\\s+ON\\s+(.*?)$"; + public static final String DROP_INDEX_PATTERN = "^\\s*DROP\\s*INDEX\\s*(.*?)\\s+ON\\s+(.*?)$"; public static DdlResult parse(String queryString, String schmeaName) { queryString = removeComment(queryString); // 去除/* */的sql注释内容 diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java index f2bb1ce4..f0aaf67a 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java @@ -225,5 +225,19 @@ public class SimpleDdlParserTest { Assert.assertNotNull(result); Assert.assertEquals("retl", result.getSchemaName()); Assert.assertEquals("retl_mark", result.getTableName()); + + //test index name contains 'on' -- version + queryString = "create index schema_new_index_version_s_idx on q_contract_account (contract_id,main_contract_id)"; + result = SimpleDdlParser.parse(queryString, "retl"); + Assert.assertNotNull(result); + Assert.assertEquals("retl", result.getSchemaName()); + Assert.assertEquals("q_contract_account", result.getTableName()); + + queryString = "drop index schema_new_index_version_s_idx on q_contract_account"; + result = SimpleDdlParser.parse(queryString, "retl"); + Assert.assertNotNull(result); + Assert.assertEquals("retl", result.getSchemaName()); + Assert.assertEquals("q_contract_account", result.getTableName()); + } } From 06275a46ed0a0dfbf8a1a9aa2e4699d005084e7a Mon Sep 17 00:00:00 2001 From: Chuanyi Li Date: Wed, 29 Aug 2018 19:52:09 +0800 Subject: [PATCH 06/42] Fix no data points while execTime exceeding current time of canal server. --- .../canal/prometheus/impl/EntryCollector.java | 6 +++--- .../canal/prometheus/impl/StoreCollector.java | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/EntryCollector.java b/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/EntryCollector.java index 9242bd11..bbd51720 100644 --- a/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/EntryCollector.java +++ b/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/EntryCollector.java @@ -53,9 +53,9 @@ public class EntryCollector extends Collector implements InstanceRegistry { for (EntryMetricsHolder emh : instances.values()) { long now = System.currentTimeMillis(); long latest = emh.latestExecTime.get(); - if (now >= latest) { - delay.addMetric(emh.destLabelValues, (now - latest)); - } + // execTime > now,delay显示为0 + long d = (now >= latest) ? (now - latest) : 0; + delay.addMetric(emh.destLabelValues, d); transactions.addMetric(emh.destLabelValues, emh.transactionCounter.doubleValue()); } mfs.add(delay); diff --git a/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/StoreCollector.java b/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/StoreCollector.java index 40186dc0..cb26f228 100644 --- a/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/StoreCollector.java +++ b/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/StoreCollector.java @@ -99,15 +99,13 @@ public class StoreCollector extends Collector implements InstanceRegistry { long get = Math.min(smh.getExecTime.get(), pet); long aet = Math.min(smh.ackExecTime.get(), get); long now = System.currentTimeMillis(); - if (now >= pet) { - putDelay.addMetric(smh.destLabelValues, (now - pet)); - } - if (now >= get) { - getDelay.addMetric(smh.destLabelValues, (now - get)); - } - if (now >= aet) { - ackDelay.addMetric(smh.destLabelValues, (now - aet)); - } + // execTime > now,delay显示为0 + long pd = (now >= pet) ? (now - pet) : 0; + putDelay.addMetric(smh.destLabelValues, pd); + long gd = (now >= get) ? (now - get) : 0; + getDelay.addMetric(smh.destLabelValues, gd); + long ad = (now >= aet) ? (now - aet) : 0; + ackDelay.addMetric(smh.destLabelValues, ad); putRows.addMetric(smh.destLabelValues, smh.putTableRows.doubleValue()); getRows.addMetric(smh.destLabelValues, smh.getTableRows.doubleValue()); ackRows.addMetric(smh.destLabelValues, smh.ackTableRows.doubleValue()); From ee5775ce05acfc053842a69f24ef745c76c74171 Mon Sep 17 00:00:00 2001 From: machey Date: Sun, 2 Sep 2018 20:21:07 +0800 Subject: [PATCH 07/42] =?UTF-8?q?=E5=8E=BB=E6=8E=89kafka=20server=E7=AB=AF?= =?UTF-8?q?TRANSACTIONBEGIN=E5=92=8CTRANSACTIONEND=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/kafka/KafkaCanalConnector.java | 2 +- .../otter/canal/kafka/CanalKafkaProducer.java | 28 +------------------ .../otter/canal/kafka/CanalKafkaStarter.java | 6 ++-- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnector.java index c5b2f8fc..7afb9c09 100644 --- a/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnector.java +++ b/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnector.java @@ -45,7 +45,7 @@ public class KafkaCanalConnector { properties.put("auto.offset.reset", "latest"); // 如果没有offset则从最后的offset开始读 properties.put("request.timeout.ms", "40000"); // 必须大于session.timeout.ms的设置 properties.put("session.timeout.ms", "30000"); // 默认为30秒 - properties.put("max.poll.records", "1"); // 所以一次只取一条数据 + properties.put("max.poll.records", "1"); // 一次只取一条message数据 properties.put("key.deserializer", StringDeserializer.class.getName()); properties.put("value.deserializer", MessageDeserializer.class.getName()); diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java index b6dba051..a6d084e4 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java @@ -48,33 +48,7 @@ public class CanalKafkaProducer { } } - public void send(KafkaProperties.Topic topic, Message message) throws IOException { - // set canal.instance.filter.transaction.entry = true - - // boolean valid = false; - // if (message != null) { - // if (message.isRaw() && !message.getRawEntries().isEmpty()) { - // for (ByteString byteString : message.getRawEntries()) { - // CanalEntry.Entry entry = CanalEntry.Entry.parseFrom(byteString); - // if (entry.getEntryType() != CanalEntry.EntryType.TRANSACTIONBEGIN - // && entry.getEntryType() != CanalEntry.EntryType.TRANSACTIONEND) { - // valid = true; - // break; - // } - // } - // } else if (!message.getEntries().isEmpty()){ - // for (CanalEntry.Entry entry : message.getEntries()) { - // if (entry.getEntryType() != CanalEntry.EntryType.TRANSACTIONBEGIN - // && entry.getEntryType() != CanalEntry.EntryType.TRANSACTIONEND) { - // valid = true; - // break; - // } - // } - // } - // } - // if (!valid) { - // return; - // } + public void send(KafkaProperties.Topic topic, Message message) { ProducerRecord record; if (topic.getPartition() != null) { record = new ProducerRecord(topic.getTopic(), topic.getPartition(), null, message); diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java index d244ce31..feef8038 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java @@ -54,9 +54,9 @@ public class CanalKafkaStarter implements CanalServerStarter { canalKafkaProducer = new CanalKafkaProducer(); canalKafkaProducer.init(kafkaProperties); // set filterTransactionEntry - if (kafkaProperties.isFilterTransactionEntry()) { - System.setProperty("canal.instance.filter.transaction.entry", "true"); - } + // if (kafkaProperties.isFilterTransactionEntry()) { + // System.setProperty("canal.instance.filter.transaction.entry", "true"); + // } // 对应每个instance启动一个worker线程 List destinations = kafkaProperties.getCanalDestinations(); From 7de40091a34aaef868fa1244dc29a46602f625e9 Mon Sep 17 00:00:00 2001 From: winger Date: Mon, 3 Sep 2018 15:28:15 +0800 Subject: [PATCH 08/42] fix bug #890 --- .../taobao/tddl/dbsync/binlog/LogContext.java | 15 ++++--------- .../taobao/tddl/dbsync/binlog/LogDecoder.java | 21 ++++++++++++------- .../dbsync/binlog/event/GtidLogEvent.java | 7 +++++++ .../parse/inbound/AbstractEventParser.java | 10 ++++++--- .../mysql/AbstractMysqlEventParser.java | 7 ------- .../parse/inbound/mysql/MysqlConnection.java | 2 ++ .../mysql/MysqlMultiStageCoprocessor.java | 8 +++++++ .../inbound/mysql/dbsync/LogEventConvert.java | 14 +------------ 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java index 80b2c254..11005197 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java @@ -66,18 +66,11 @@ public final class LogContext { mapOfTable.clear(); } - public final void putGtid(GtidLogEvent logEvent) { - if (logEvent != null) { - String gtid = logEvent.getSid().toString() + ":" + logEvent.getGno(); - if (gtidSet == null) { - gtid = logEvent.getSid().toString() + ":1-" + logEvent.getGno(); - gtidSet = MysqlGTIDSet.parse(gtid); - } - gtidSet.update(gtid); - } - } - public GTIDSet getGtidSet() { return gtidSet; } + + public void setGtidSet(GTIDSet gtidSet) { + this.gtidSet = gtidSet; + } } diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java index d094b2fd..c4a99852 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.util.BitSet; import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; +import com.alibaba.otter.canal.parse.driver.mysql.packets.MysqlGTIDSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -47,22 +48,22 @@ import com.taobao.tddl.dbsync.binlog.event.mariadb.StartEncryptionLogEvent; /** * Implements a binary-log decoder. - * + * *
  * LogDecoder decoder = new LogDecoder();
  * decoder.handle(...);
- * 
+ *
  * LogEvent event;
  * do
  * {
  *     event = decoder.decode(buffer, context);
- * 
+ *
  *     // process log event.
  * }
  * while (event != null);
  * // no more events in buffer.
  * 
- * + * * @author Changyuan.lh * @version 1.0 */ @@ -89,7 +90,7 @@ public final class LogDecoder { /** * Decoding an event from binary-log buffer. - * + * * @return UknownLogEvent if event type is unknown or skipped, * null if buffer is not including a full event. */ @@ -141,7 +142,7 @@ public final class LogDecoder { /** * Deserialize an event from buffer. - * + * * @return UknownLogEvent if event type is unknown or skipped. */ public static LogEvent decode(LogBuffer buffer, LogHeader header, LogContext context) throws IOException { @@ -160,6 +161,7 @@ public final class LogDecoder { // remove checksum bytes buffer.limit(header.getEventLen() - LogEvent.BINLOG_CHECKSUM_LEN); } + GTIDSet gtidSet = context.getGtidSet(); switch (header.getType()) { case LogEvent.QUERY_EVENT: { QueryLogEvent event = new QueryLogEvent(header, buffer, descriptionEvent); @@ -373,8 +375,11 @@ public final class LogDecoder { GtidLogEvent event = new GtidLogEvent(header, buffer, descriptionEvent); /* updating position in context */ logPosition.position = header.getLogPos(); - // update latest gtid - context.putGtid(event); + if (gtidSet != null) { + gtidSet.update(event.getGtidStr()); + // update latest gtid + header.putGtidStr(gtidSet); + } return event; } case LogEvent.PREVIOUS_GTIDS_LOG_EVENT: { diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java index 5c2678b5..b2897d58 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java @@ -82,4 +82,11 @@ public class GtidLogEvent extends LogEvent { public Long getSequenceNumber() { return sequenceNumber; } + + public String getGtidStr() { + StringBuilder sb = new StringBuilder(); + sb.append(sid.toString()).append(":"); + sb.append(gno); + return sb.toString(); + } } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java index fcae1317..be2354dd 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java @@ -8,6 +8,8 @@ import java.util.TimerTask; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; +import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; +import com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.commons.lang.math.RandomUtils; @@ -235,12 +237,14 @@ public abstract class AbstractEventParser extends AbstractCanalLifeCycle if (parallel) { // build stage processor multiStageCoprocessor = buildMultiStageCoprocessor(); - multiStageCoprocessor.start(); - if (isGTIDMode()) { // 判断所属instance是否启用GTID模式,是的话调用ErosaConnection中GTID对应方法dump数据 - erosaConnection.dump(MysqlGTIDSet.parse(startPosition.getGtid()), multiStageCoprocessor); + GTIDSet gtidSet = MysqlGTIDSet.parse(startPosition.getGtid()); + ((MysqlMultiStageCoprocessor) multiStageCoprocessor).setGtidSet(gtidSet); + multiStageCoprocessor.start(); + erosaConnection.dump(gtidSet, multiStageCoprocessor); } else { + multiStageCoprocessor.start(); if (StringUtils.isEmpty(startPosition.getJournalName()) && startPosition.getTimestamp() != null) { erosaConnection.dump(startPosition.getTimestamp(), multiStageCoprocessor); diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java index 941f5ebc..4883d971 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java @@ -76,13 +76,6 @@ public abstract class AbstractMysqlEventParser extends AbstractEventParser { * @return */ protected boolean processTableMeta(EntryPosition position) { - if (isGTIDMode()) { - if (binlogParser instanceof LogEventConvert) { - // 记录gtid - ((LogEventConvert) binlogParser).setGtidSet(MysqlGTIDSet.parse(position.getGtid())); - } - } - if (tableMetaTSDB != null) { if (position.getTimestamp() == null || position.getTimestamp() <= 0) { throw new CanalParseException("use gtid and TableMeta TSDB should be config timestamp > 0"); diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java index eb3c0e31..256b1ecc 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java @@ -179,6 +179,8 @@ public class MysqlConnection implements ErosaConnection { fetcher.start(connector.getChannel()); LogDecoder decoder = new LogDecoder(LogEvent.UNKNOWN_EVENT, LogEvent.ENUM_END_EVENT); LogContext context = new LogContext(); + // fix bug: #890 将gtid传输至context中,供decode使用 + context.setGtidSet(gtidSet); while (fetcher.fetch()) { accumulateReceivedBytes(fetcher.limit()); LogEvent event = null; diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java index 722450dd..89c6e842 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java @@ -7,6 +7,7 @@ import java.util.concurrent.locks.LockSupport; import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; import com.alibaba.otter.canal.common.utils.NamedThreadFactory; +import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.parse.inbound.ErosaConnection; import com.alibaba.otter.canal.parse.inbound.EventTransactionBuffer; @@ -63,6 +64,7 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement private String destination; private volatile CanalParseException exception; private AtomicLong eventsPublishBlockingTime; + private GTIDSet gtidSet; public MysqlMultiStageCoprocessor(int ringBufferSize, int parserThreadCount, LogEventConvert logEventConvert, EventTransactionBuffer transactionBuffer, String destination){ @@ -227,6 +229,9 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement public SimpleParserStage(){ decoder = new LogDecoder(LogEvent.UNKNOWN_EVENT, LogEvent.ENUM_END_EVENT); context = new LogContext(); + if (gtidSet != null) { + context.setGtidSet(gtidSet); + } } public void onEvent(MessageEvent event, long sequence, boolean endOfBatch) throws Exception { @@ -447,4 +452,7 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement this.eventsPublishBlockingTime = eventsPublishBlockingTime; } + public void setGtidSet(GTIDSet gtidSet) { + this.gtidSet = gtidSet; + } } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java index cb579961..17c55e8d 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java @@ -99,13 +99,6 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar private boolean filterRows = false; private boolean useDruidDdlFilter = true; - // latest gtid - private GTIDSet gtidSet; - - public LogEventConvert(GTIDSet gtidSet){ - this.gtidSet = gtidSet; - } - public LogEventConvert(){ } @@ -172,10 +165,9 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar private Entry parseGTIDLogEvent(GtidLogEvent logEvent) { LogHeader logHeader = logEvent.getHeader(); - String value = logEvent.getSid().toString() + ":" + logEvent.getGno(); Pair.Builder builder = Pair.newBuilder(); builder.setKey("gtid"); - builder.setValue(value); + builder.setValue(logEvent.getGtidStr()); if (logEvent.getLastCommitted() != null) { builder.setKey("lastCommitted"); @@ -974,8 +966,4 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar public void setFilterRows(boolean filterRows) { this.filterRows = filterRows; } - - public void setGtidSet(GTIDSet gtidSet) { - this.gtidSet = gtidSet; - } } From ebf91397627e22cfbf07263663e40bdb67dbdc4a Mon Sep 17 00:00:00 2001 From: mcy Date: Mon, 3 Sep 2018 17:40:30 +0800 Subject: [PATCH 09/42] =?UTF-8?q?=E5=A2=9E=E5=8A=A0kafka=20producer=20send?= =?UTF-8?q?er=E7=9A=84callback=EF=BC=8Ccanal=E5=92=8Ckafka=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=8F=90=E4=BA=A4=E5=9B=9E=E6=BB=9A=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E4=B8=80=E4=B8=AAcanal=E5=AE=9E=E4=BE=8B=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E5=A4=9A=E4=B8=AAkafka=20topic=E7=9A=84=E6=9C=BA?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E4=B8=80=E4=B8=AA=E5=AE=9E=E4=BE=8B=E5=8F=AA?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E4=B8=80=E4=B8=AAtopic=20kafka=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8Bserver=E7=AB=AF=E7=9A=84=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E4=B8=8D=E8=83=BD=E8=B6=85=E8=BF=871M?= =?UTF-8?q?=EF=BC=8C=E6=9C=80=E5=A4=A7=E4=B8=BA900K?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loader/CanalAdapterKafkaWorker.java | 6 +-- .../adapter/loader/CanalAdapterLoader.java | 15 +++---- .../adapter/loader/CanalAdapterWorker.java | 13 +++--- deployer/src/main/resources/kafka.yml | 6 +-- .../otter/canal/kafka/CanalKafkaProducer.java | 38 +++++++++++++----- .../otter/canal/kafka/CanalKafkaStarter.java | 40 ++++++++++--------- 6 files changed, 66 insertions(+), 52 deletions(-) diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java index aecaceb2..5cf86611 100644 --- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java +++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java @@ -97,9 +97,9 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker { try { logger.info("=============> Start to connect topic: {} <=============", this.topic); connector.connect(); - logger.info("=============> Start to subscribe topic: {}<=============", this.topic); + logger.info("=============> Start to subscribe topic: {} <=============", this.topic); connector.subscribe(); - logger.info("=============> Subscribe topic: {} succeed<=============", this.topic); + logger.info("=============> Subscribe topic: {} succeed <=============", this.topic); while (running) { try { // switcher.get(); //等待开关开启 @@ -146,7 +146,7 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker { long currentTS = System.currentTimeMillis(); while (executing.get()) { // 大于1分钟未消费完ack一次keep alive - if (System.currentTimeMillis() - currentTS > 60000) { + if (System.currentTimeMillis() - currentTS > 60000) { connector.ack(); currentTS = System.currentTimeMillis(); } diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterLoader.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterLoader.java index 98973f11..14efe493 100644 --- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterLoader.java +++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterLoader.java @@ -1,12 +1,5 @@ package com.alibaba.otter.canal.client.adapter.loader; -import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter; -import com.alibaba.otter.canal.client.adapter.support.CanalClientConfig; -import com.alibaba.otter.canal.client.adapter.support.CanalOuterAdapterConfiguration; -import com.alibaba.otter.canal.client.adapter.support.ExtensionLoader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.ArrayList; @@ -16,6 +9,14 @@ import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter; +import com.alibaba.otter.canal.client.adapter.support.CanalClientConfig; +import com.alibaba.otter.canal.client.adapter.support.CanalOuterAdapterConfiguration; +import com.alibaba.otter.canal.client.adapter.support.ExtensionLoader; + /** * 外部适配器的加载器 * diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterWorker.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterWorker.java index bca40041..e341c6a3 100644 --- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterWorker.java +++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterWorker.java @@ -1,16 +1,15 @@ package com.alibaba.otter.canal.client.adapter.loader; -import com.alibaba.otter.canal.client.CanalConnector; -import com.alibaba.otter.canal.client.CanalConnectors; -import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter; -import com.alibaba.otter.canal.client.adapter.loader.AbstractCanalAdapterWorker; -import com.alibaba.otter.canal.client.impl.ClusterCanalConnector; -import com.alibaba.otter.canal.protocol.Message; - import java.net.SocketAddress; import java.util.List; import java.util.concurrent.Executors; +import com.alibaba.otter.canal.client.CanalConnector; +import com.alibaba.otter.canal.client.CanalConnectors; +import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter; +import com.alibaba.otter.canal.client.impl.ClusterCanalConnector; +import com.alibaba.otter.canal.protocol.Message; + /** * 原生canal-server对应的client适配器工作线程 * diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/kafka.yml index 8abf4934..8f897e6d 100644 --- a/deployer/src/main/resources/kafka.yml +++ b/deployer/src/main/resources/kafka.yml @@ -3,15 +3,11 @@ retries: 0 batchSize: 16384 lingerMs: 1 bufferMemory: 33554432 -filterTransactionEntry: true +canalBatchSize: 50 # Canal的batch size, 默认50K, 由于kafka最大消息体限制请勿超过1M(900K以下) canalDestinations: - canalDestination: example topic: example partition: - # 一个destination可以对应多个topic - #topics: - # - topic: example - # partition: diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java index a6d084e4..ae63f415 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java @@ -1,11 +1,11 @@ package com.alibaba.otter.canal.kafka; -import java.io.IOException; import java.util.Properties; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.ProducerRecord; +import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.serialization.StringSerializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,16 +48,32 @@ public class CanalKafkaProducer { } } - public void send(KafkaProperties.Topic topic, Message message) { - ProducerRecord record; - if (topic.getPartition() != null) { - record = new ProducerRecord(topic.getTopic(), topic.getPartition(), null, message); - } else { - record = new ProducerRecord(topic.getTopic(), message); - } - producer.send(record); - if (logger.isDebugEnabled()) { - logger.debug("send message to kafka topic: {} \n {}", topic.getTopic(), message.toString()); + public void send(KafkaProperties.Topic topic, Message message, Callback callback) { + producer.initTransactions(); + try { + producer.beginTransaction(); + ProducerRecord record; + if (topic.getPartition() != null) { + record = new ProducerRecord(topic.getTopic(), topic.getPartition(), null, message); + } else { + record = new ProducerRecord(topic.getTopic(), message); + } + producer.send(record); + producer.commitTransaction(); + callback.commit(); + if (logger.isDebugEnabled()) { + logger.debug("send message to kafka topic: {} \n {}", topic.getTopic(), message.toString()); + } + } catch (KafkaException e) { + producer.abortTransaction(); + callback.rollback(); } } + + public interface Callback { + + void commit(); + + void rollback(); + } } diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java index feef8038..4ad17e25 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java @@ -33,9 +33,9 @@ public class CanalKafkaStarter implements CanalServerStarter { private ExecutorService executorService; - private CanalKafkaProducer canalKafkaProducer; + private CanalKafkaProducer canalKafkaProducer; - private KafkaProperties kafkaProperties; + private KafkaProperties kafkaProperties; public void init() { try { @@ -55,7 +55,7 @@ public class CanalKafkaStarter implements CanalServerStarter { canalKafkaProducer.init(kafkaProperties); // set filterTransactionEntry // if (kafkaProperties.isFilterTransactionEntry()) { - // System.setProperty("canal.instance.filter.transaction.entry", "true"); + // System.setProperty("canal.instance.filter.transaction.entry", "true"); // } // 对应每个instance启动一个worker线程 List destinations = kafkaProperties.getCanalDestinations(); @@ -101,8 +101,8 @@ public class CanalKafkaStarter implements CanalServerStarter { while (!running) ; logger.info("## start the canal consumer: {}.", destination.getCanalDestination()); - CanalServerWithEmbedded server = CanalServerWithEmbedded.instance(); - ClientIdentity clientIdentity = new ClientIdentity(destination.getCanalDestination(), (short) 1001, ""); + final CanalServerWithEmbedded server = CanalServerWithEmbedded.instance(); + final ClientIdentity clientIdentity = new ClientIdentity(destination.getCanalDestination(), (short) 1001, ""); while (running) { try { if (!server.getCanalInstances().containsKey(clientIdentity.getDestination())) { @@ -118,26 +118,28 @@ public class CanalKafkaStarter implements CanalServerStarter { while (running) { Message message = server.getWithoutAck(clientIdentity, kafkaProperties.getCanalBatchSize()); // 获取指定数量的数据 - long batchId = message.getId(); + final long batchId = message.getId(); try { int size = message.isRaw() ? message.getRawEntries().size() : message.getEntries().size(); if (batchId != -1 && size != 0) { - if (!StringUtils.isEmpty(destination.getTopic())) { - Topic topic = new Topic(); - topic.setTopic(destination.getTopic()); - topic.setPartition(destination.getPartition()); - destination.getTopics().add(topic); - } - for (Topic topic : destination.getTopics()) { - canalKafkaProducer.send(topic, message); // 发送message到所有topic - } + Topic topic = new Topic(); + topic.setTopic(destination.getTopic()); + topic.setPartition(destination.getPartition()); + canalKafkaProducer.send(topic, message, new CanalKafkaProducer.Callback() { + + @Override + public void commit() { + server.ack(clientIdentity, batchId); // 提交确认 + } + + @Override + public void rollback() { + server.rollback(clientIdentity, batchId); + } + }); // 发送message到topic } - if (batchId != -1) { - server.ack(clientIdentity, batchId); // 提交确认 - } } catch (Exception e) { - server.rollback(clientIdentity); logger.error(e.getMessage(), e); } } From 17f345bfe5bdf7d7eb00ffe6667573d7ec5bab84 Mon Sep 17 00:00:00 2001 From: mcy Date: Mon, 3 Sep 2018 18:07:43 +0800 Subject: [PATCH 10/42] =?UTF-8?q?0.11=E7=9A=84=E7=8E=AF=E5=A2=83=E6=9C=AA?= =?UTF-8?q?=E6=B5=8B=E8=BF=87=EF=BC=8C=E5=85=88=E5=8E=BB=E9=99=A4kafka?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/alibaba/otter/canal/kafka/CanalKafkaProducer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java index ae63f415..ec1a5926 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java @@ -35,6 +35,7 @@ public class CanalKafkaProducer { properties.put("key.serializer", StringSerializer.class.getName()); properties.put("value.serializer", MessageSerializer.class.getName()); producer = new KafkaProducer(properties); + // producer.initTransactions(); } public void stop() { @@ -49,9 +50,8 @@ public class CanalKafkaProducer { } public void send(KafkaProperties.Topic topic, Message message, Callback callback) { - producer.initTransactions(); try { - producer.beginTransaction(); + // producer.beginTransaction(); ProducerRecord record; if (topic.getPartition() != null) { record = new ProducerRecord(topic.getTopic(), topic.getPartition(), null, message); @@ -59,13 +59,13 @@ public class CanalKafkaProducer { record = new ProducerRecord(topic.getTopic(), message); } producer.send(record); - producer.commitTransaction(); + // producer.commitTransaction(); callback.commit(); if (logger.isDebugEnabled()) { logger.debug("send message to kafka topic: {} \n {}", topic.getTopic(), message.toString()); } } catch (KafkaException e) { - producer.abortTransaction(); + // producer.abortTransaction(); callback.rollback(); } } From 81c216f1c16a113047202b188a158074c0797612 Mon Sep 17 00:00:00 2001 From: mcy Date: Tue, 4 Sep 2018 09:39:02 +0800 Subject: [PATCH 11/42] =?UTF-8?q?=E5=A2=9E=E5=8A=A0kafka=20get=E7=9A=84?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployer/src/main/resources/kafka.yml | 6 +++++- .../alibaba/otter/canal/kafka/CanalKafkaStarter.java | 12 +++++++++++- .../alibaba/otter/canal/kafka/KafkaProperties.java | 9 +++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/kafka.yml index 8f897e6d..edd6b464 100644 --- a/deployer/src/main/resources/kafka.yml +++ b/deployer/src/main/resources/kafka.yml @@ -3,7 +3,11 @@ retries: 0 batchSize: 16384 lingerMs: 1 bufferMemory: 33554432 -canalBatchSize: 50 # Canal的batch size, 默认50K, 由于kafka最大消息体限制请勿超过1M(900K以下) + +# Canal的batch size, 默认50K, 由于kafka最大消息体限制请勿超过1M(900K以下) +canalBatchSize: 50 +# Canal get数据的超时时间, 单位: 毫秒, 空为不限超时 +canalGetTimeout: 100 canalDestinations: - canalDestination: example diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java index 4ad17e25..717a4525 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java @@ -4,6 +4,7 @@ import java.io.FileInputStream; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; @@ -117,7 +118,16 @@ public class CanalKafkaStarter implements CanalServerStarter { logger.info("## the canal consumer {} is running now ......", destination.getCanalDestination()); while (running) { - Message message = server.getWithoutAck(clientIdentity, kafkaProperties.getCanalBatchSize()); // 获取指定数量的数据 + Message message; + if (kafkaProperties.getCanalGetTimeout() != null) { + message = server.getWithoutAck(clientIdentity, + kafkaProperties.getCanalBatchSize(), + kafkaProperties.getCanalGetTimeout(), + TimeUnit.MILLISECONDS); + } else { + message = server.getWithoutAck(clientIdentity, kafkaProperties.getCanalBatchSize()); + } + final long batchId = message.getId(); try { int size = message.isRaw() ? message.getRawEntries().size() : message.getEntries().size(); diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java b/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java index 9194c0ab..40f11bf5 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java @@ -20,6 +20,7 @@ public class KafkaProperties { private long bufferMemory = 33554432L; private boolean filterTransactionEntry = true; private int canalBatchSize = 50; + private Long canalGetTimeout; private List canalDestinations = new ArrayList(); @@ -151,6 +152,14 @@ public class KafkaProperties { this.canalBatchSize = canalBatchSize; } + public Long getCanalGetTimeout() { + return canalGetTimeout; + } + + public void setCanalGetTimeout(Long canalGetTimeout) { + this.canalGetTimeout = canalGetTimeout; + } + public List getCanalDestinations() { return canalDestinations; } From 728550cac3dd9a400f2d0077c363a25b4a3a399b Mon Sep 17 00:00:00 2001 From: mcy Date: Tue, 4 Sep 2018 09:56:51 +0800 Subject: [PATCH 12/42] =?UTF-8?q?=E5=A2=9E=E5=8A=A0kafka=20producer=20send?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=90=8C=E6=AD=A5=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alibaba/otter/canal/kafka/CanalKafkaProducer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java index ec1a5926..0685f76e 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java @@ -1,11 +1,12 @@ package com.alibaba.otter.canal.kafka; import java.util.Properties; +import java.util.concurrent.Future; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.ProducerRecord; -import org.apache.kafka.common.KafkaException; +import org.apache.kafka.clients.producer.RecordMetadata; import org.apache.kafka.common.serialization.StringSerializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -58,13 +59,15 @@ public class CanalKafkaProducer { } else { record = new ProducerRecord(topic.getTopic(), message); } - producer.send(record); + Future future = producer.send(record); + future.get(); // producer.commitTransaction(); callback.commit(); if (logger.isDebugEnabled()) { - logger.debug("send message to kafka topic: {} \n {}", topic.getTopic(), message.toString()); + logger.debug("send message to kafka topic: {}", topic.getTopic()); } - } catch (KafkaException e) { + } catch (Exception e) { + logger.error(e.getMessage(), e); // producer.abortTransaction(); callback.rollback(); } From 47ac10ca185ef128ccdd055cb83fea5def7428c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=83=E9=94=8B?= Date: Tue, 4 Sep 2018 11:28:56 +0800 Subject: [PATCH 13/42] fixed issue #868 , NPE fixed --- .../otter/canal/store/memory/MemoryEventStoreWithBuffer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/src/main/java/com/alibaba/otter/canal/store/memory/MemoryEventStoreWithBuffer.java b/store/src/main/java/com/alibaba/otter/canal/store/memory/MemoryEventStoreWithBuffer.java index fb74d5f8..6c6d08ff 100644 --- a/store/src/main/java/com/alibaba/otter/canal/store/memory/MemoryEventStoreWithBuffer.java +++ b/store/src/main/java/com/alibaba/otter/canal/store/memory/MemoryEventStoreWithBuffer.java @@ -435,7 +435,7 @@ public class MemoryEventStoreWithBuffer extends AbstractCanalStoreScavenge imple if (batchMode.isMemSize()) { ackMemSize.addAndGet(memsize); // 尝试清空buffer中的内存,将ack之前的内存全部释放掉 - for (long index = sequence + 1; index <= next; index++) { + for (long index = sequence + 1; index < next; index++) { entries[getIndex(index)] = null;// 设置为null } } From a9cccb3017709f335c57d74354eef72ac97e9df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=83=E9=94=8B?= Date: Tue, 4 Sep 2018 11:39:23 +0800 Subject: [PATCH 14/42] fixed format --- .../com/taobao/tddl/dbsync/binlog/LogContext.java | 2 -- .../com/taobao/tddl/dbsync/binlog/LogDecoder.java | 7 +++---- .../tddl/dbsync/binlog/event/GtidLogEvent.java | 8 +++----- .../taobao/tddl/dbsync/FetcherPerformanceTest.java | 4 +--- .../parse/exception/PositionNotFoundException.java | 10 +++++----- .../parse/exception/ServerIdNotMatchException.java | 12 ++++++------ .../canal/parse/inbound/AbstractEventParser.java | 4 ++-- .../canal/parse/inbound/ParserExceptionHandler.java | 1 + .../inbound/mysql/AbstractMysqlEventParser.java | 1 - .../inbound/mysql/MysqlMultiStageCoprocessor.java | 4 ++-- .../parse/inbound/mysql/dbsync/LogEventConvert.java | 1 - .../parse/inbound/mysql/SimpleDdlParserTest.java | 2 +- 12 files changed, 24 insertions(+), 32 deletions(-) diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java index 11005197..d8699629 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java @@ -4,9 +4,7 @@ import java.util.HashMap; import java.util.Map; import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; -import com.alibaba.otter.canal.parse.driver.mysql.packets.MysqlGTIDSet; import com.taobao.tddl.dbsync.binlog.event.FormatDescriptionLogEvent; -import com.taobao.tddl.dbsync.binlog.event.GtidLogEvent; import com.taobao.tddl.dbsync.binlog.event.TableMapLogEvent; /** diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java index c4a99852..cfe51a1c 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java @@ -3,11 +3,10 @@ package com.taobao.tddl.dbsync.binlog; import java.io.IOException; import java.util.BitSet; -import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; -import com.alibaba.otter.canal.parse.driver.mysql.packets.MysqlGTIDSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet; import com.taobao.tddl.dbsync.binlog.event.AppendBlockLogEvent; import com.taobao.tddl.dbsync.binlog.event.BeginLoadQueryLogEvent; import com.taobao.tddl.dbsync.binlog.event.CreateFileLogEvent; @@ -52,12 +51,12 @@ import com.taobao.tddl.dbsync.binlog.event.mariadb.StartEncryptionLogEvent; *
  * LogDecoder decoder = new LogDecoder();
  * decoder.handle(...);
- *
+ * 
  * LogEvent event;
  * do
  * {
  *     event = decoder.decode(buffer, context);
- *
+ * 
  *     // process log event.
  * }
  * while (event != null);
diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java
index b2897d58..49557fc6 100644
--- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java
+++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/GtidLogEvent.java
@@ -14,10 +14,10 @@ import com.taobao.tddl.dbsync.binlog.LogEvent;
 public class GtidLogEvent extends LogEvent {
 
     // / Length of the commit_flag in event encoding
-    public static final int ENCODED_FLAG_LENGTH = 1;
+    public static final int ENCODED_FLAG_LENGTH         = 1;
     // / Length of SID in event encoding
-    public static final int ENCODED_SID_LENGTH  = 16;
-    public static final int LOGICAL_TIMESTAMP_TYPE_CODE  = 2;
+    public static final int ENCODED_SID_LENGTH          = 16;
+    public static final int LOGICAL_TIMESTAMP_TYPE_CODE = 2;
 
     private boolean         commitFlag;
     private UUID            sid;
@@ -50,8 +50,6 @@ public class GtidLogEvent extends LogEvent {
             sequenceNumber = buffer.getLong64();
         }
 
-
-
         // ignore gtid info read
         // sid.copy_from((uchar *)ptr_buffer);
         // ptr_buffer+= ENCODED_SID_LENGTH;
diff --git a/dbsync/src/test/java/com/taobao/tddl/dbsync/FetcherPerformanceTest.java b/dbsync/src/test/java/com/taobao/tddl/dbsync/FetcherPerformanceTest.java
index f5af66e3..d9b6355b 100644
--- a/dbsync/src/test/java/com/taobao/tddl/dbsync/FetcherPerformanceTest.java
+++ b/dbsync/src/test/java/com/taobao/tddl/dbsync/FetcherPerformanceTest.java
@@ -15,9 +15,7 @@ public class FetcherPerformanceTest {
         DirectLogFetcher fetcher = new DirectLogFetcher();
         try {
             Class.forName("com.mysql.jdbc.Driver");
-            Connection connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306",
-                "root",
-                "hello");
+            Connection connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306", "root", "hello");
             Statement statement = connection.createStatement();
             statement.execute("SET @master_binlog_checksum='@@global.binlog_checksum'");
             statement.execute("SET @mariadb_slave_capability='" + LogEvent.MARIA_SLAVE_CAPABILITY_MINE + "'");
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/exception/PositionNotFoundException.java b/parse/src/main/java/com/alibaba/otter/canal/parse/exception/PositionNotFoundException.java
index d5552a9f..67a1d72d 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/exception/PositionNotFoundException.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/exception/PositionNotFoundException.java
@@ -8,23 +8,23 @@ public class PositionNotFoundException extends CanalParseException {
 
     private static final long serialVersionUID = -7382448928116244017L;
 
-    public PositionNotFoundException(String errorCode) {
+    public PositionNotFoundException(String errorCode){
         super(errorCode);
     }
 
-    public PositionNotFoundException(String errorCode, Throwable cause) {
+    public PositionNotFoundException(String errorCode, Throwable cause){
         super(errorCode, cause);
     }
 
-    public PositionNotFoundException(String errorCode, String errorDesc) {
+    public PositionNotFoundException(String errorCode, String errorDesc){
         super(errorCode, errorDesc);
     }
 
-    public PositionNotFoundException(String errorCode, String errorDesc, Throwable cause) {
+    public PositionNotFoundException(String errorCode, String errorDesc, Throwable cause){
         super(errorCode, errorDesc, cause);
     }
 
-    public PositionNotFoundException(Throwable cause) {
+    public PositionNotFoundException(Throwable cause){
         super(cause);
     }
 }
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/exception/ServerIdNotMatchException.java b/parse/src/main/java/com/alibaba/otter/canal/parse/exception/ServerIdNotMatchException.java
index 05baee02..4186c6ec 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/exception/ServerIdNotMatchException.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/exception/ServerIdNotMatchException.java
@@ -6,27 +6,27 @@ import com.alibaba.otter.canal.common.CanalException;
  * @author chengjin.lyf on 2018/8/8 下午1:07
  * @since 1.0.25
  */
-public class ServerIdNotMatchException extends CanalException{
+public class ServerIdNotMatchException extends CanalException {
 
     private static final long serialVersionUID = -6124989280379293953L;
 
-    public ServerIdNotMatchException(String errorCode) {
+    public ServerIdNotMatchException(String errorCode){
         super(errorCode);
     }
 
-    public ServerIdNotMatchException(String errorCode, Throwable cause) {
+    public ServerIdNotMatchException(String errorCode, Throwable cause){
         super(errorCode, cause);
     }
 
-    public ServerIdNotMatchException(String errorCode, String errorDesc) {
+    public ServerIdNotMatchException(String errorCode, String errorDesc){
         super(errorCode, errorDesc);
     }
 
-    public ServerIdNotMatchException(String errorCode, String errorDesc, Throwable cause) {
+    public ServerIdNotMatchException(String errorCode, String errorDesc, Throwable cause){
         super(errorCode, errorDesc, cause);
     }
 
-    public ServerIdNotMatchException(Throwable cause) {
+    public ServerIdNotMatchException(Throwable cause){
         super(cause);
     }
 }
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java
index be2354dd..e1f80d76 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java
@@ -8,8 +8,6 @@ import java.util.TimerTask;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
 
-import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet;
-import com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.commons.lang.math.RandomUtils;
@@ -21,11 +19,13 @@ import com.alibaba.otter.canal.common.AbstractCanalLifeCycle;
 import com.alibaba.otter.canal.common.alarm.CanalAlarmHandler;
 import com.alibaba.otter.canal.filter.CanalEventFilter;
 import com.alibaba.otter.canal.parse.CanalEventParser;
+import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet;
 import com.alibaba.otter.canal.parse.driver.mysql.packets.MysqlGTIDSet;
 import com.alibaba.otter.canal.parse.exception.CanalParseException;
 import com.alibaba.otter.canal.parse.exception.PositionNotFoundException;
 import com.alibaba.otter.canal.parse.exception.TableIdNotFoundException;
 import com.alibaba.otter.canal.parse.inbound.EventTransactionBuffer.TransactionFlushCallback;
+import com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor;
 import com.alibaba.otter.canal.parse.index.CanalLogPositionManager;
 import com.alibaba.otter.canal.parse.support.AuthenticationInfo;
 import com.alibaba.otter.canal.protocol.CanalEntry;
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/ParserExceptionHandler.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/ParserExceptionHandler.java
index d0face01..3a77291d 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/ParserExceptionHandler.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/ParserExceptionHandler.java
@@ -5,5 +5,6 @@ package com.alibaba.otter.canal.parse.inbound;
  * @since 1.0.25
  */
 public interface ParserExceptionHandler {
+
     void handle(Throwable e);
 }
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java
index 4883d971..e36893a3 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java
@@ -9,7 +9,6 @@ import org.slf4j.LoggerFactory;
 import com.alibaba.otter.canal.filter.CanalEventFilter;
 import com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter;
 import com.alibaba.otter.canal.parse.CanalEventParser;
-import com.alibaba.otter.canal.parse.driver.mysql.packets.MysqlGTIDSet;
 import com.alibaba.otter.canal.parse.exception.CanalParseException;
 import com.alibaba.otter.canal.parse.inbound.AbstractEventParser;
 import com.alibaba.otter.canal.parse.inbound.BinlogParser;
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java
index 89c6e842..99bb94f5 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java
@@ -83,8 +83,8 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement
             ringBufferSize,
             new BlockingWaitStrategy());
         int tc = parserThreadCount > 0 ? parserThreadCount : 1;
-        this.parserExecutor = Executors.newFixedThreadPool(tc,
-            new NamedThreadFactory("MultiStageCoprocessor-Parser-" + destination));
+        this.parserExecutor = Executors.newFixedThreadPool(tc, new NamedThreadFactory("MultiStageCoprocessor-Parser-"
+                                                                                      + destination));
 
         this.stageExecutor = Executors.newFixedThreadPool(2, new NamedThreadFactory("MultiStageCoprocessor-other-"
                                                                                     + destination));
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java
index 17c55e8d..55090f65 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java
@@ -17,7 +17,6 @@ import org.slf4j.LoggerFactory;
 
 import com.alibaba.otter.canal.common.AbstractCanalLifeCycle;
 import com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter;
-import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet;
 import com.alibaba.otter.canal.parse.exception.CanalParseException;
 import com.alibaba.otter.canal.parse.exception.TableIdNotFoundException;
 import com.alibaba.otter.canal.parse.inbound.BinlogParser;
diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java
index f0aaf67a..ed528d86 100644
--- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java
+++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java
@@ -226,7 +226,7 @@ public class SimpleDdlParserTest {
         Assert.assertEquals("retl", result.getSchemaName());
         Assert.assertEquals("retl_mark", result.getTableName());
 
-        //test index name contains 'on' -- version
+        // test index name contains 'on' -- version
         queryString = "create index schema_new_index_version_s_idx on q_contract_account (contract_id,main_contract_id)";
         result = SimpleDdlParser.parse(queryString, "retl");
         Assert.assertNotNull(result);

From f5bf1667a9bdb5559532ea822615628a6dd68bef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=83=E9=94=8B?= 
Date: Tue, 4 Sep 2018 12:35:20 +0800
Subject: [PATCH 15/42] fixed mq and client launcher

---
 client-launcher/src/main/bin/startup.sh                   | 2 +-
 client-launcher/src/main/bin/stop.sh                      | 4 ++--
 .../com/alibaba/otter/canal/deployer/CanalController.java | 2 +-
 .../com/alibaba/otter/canal/deployer/CanalLauncher.java   | 8 +++++---
 deployer/src/main/resources/kafka.yml                     | 4 +---
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/client-launcher/src/main/bin/startup.sh b/client-launcher/src/main/bin/startup.sh
index d467b4d2..0e09ddff 100644
--- a/client-launcher/src/main/bin/startup.sh
+++ b/client-launcher/src/main/bin/startup.sh
@@ -74,7 +74,7 @@ else
 fi
 
 JAVA_OPTS=" $JAVA_OPTS -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8"
-CANAL_OPTS="-DappName=otter-canal -Dlogback.configurationFile=$logback_configurationFile -Dcanal.conf=$canal_conf"
+CANAL_OPTS="-DappName=otter-canal-client -Dlogback.configurationFile=$logback_configurationFile -Dcanal.conf=$canal_conf"
 
 if [ -e $canal_conf -a -e $logback_configurationFile ]
 then 
diff --git a/client-launcher/src/main/bin/stop.sh b/client-launcher/src/main/bin/stop.sh
index 0cfcc712..c96f2807 100644
--- a/client-launcher/src/main/bin/stop.sh
+++ b/client-launcher/src/main/bin/stop.sh
@@ -45,7 +45,7 @@ fi
 
 pid=`cat $pidfile`
 if [ "$pid" == "" ] ; then
-	pid=`get_pid "appName=otter-canal"`
+	pid=`get_pid "appName=otter-canal-client"`
 fi
 
 echo -e "`hostname`: stopping canal $pid ... "
@@ -54,7 +54,7 @@ kill $pid
 LOOPS=0
 while (true); 
 do 
-	gpid=`get_pid "appName=otter-canal" "$pid"`
+	gpid=`get_pid "appName=otter-canal-client" "$pid"`
     if [ "$gpid" == "" ] ; then
     	echo "Oook! cost:$LOOPS"
     	`rm $pidfile`
diff --git a/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java b/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java
index aacace84..42821405 100644
--- a/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java
+++ b/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java
@@ -387,7 +387,7 @@ public class CanalController {
         return config;
     }
 
-    private String getProperty(Properties properties, String key) {
+    public String getProperty(Properties properties, String key) {
         key = StringUtils.trim(key);
         String value = System.getProperty(key);
 
diff --git a/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalLauncher.java b/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalLauncher.java
index 2524186a..62b73b1d 100644
--- a/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalLauncher.java
+++ b/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalLauncher.java
@@ -3,12 +3,13 @@ package com.alibaba.otter.canal.deployer;
 import java.io.FileInputStream;
 import java.util.Properties;
 
-import com.alibaba.otter.canal.kafka.CanalKafkaStarter;
-import com.alibaba.otter.canal.server.CanalServerStarter;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.alibaba.otter.canal.kafka.CanalKafkaStarter;
+import com.alibaba.otter.canal.server.CanalServerStarter;
+
 /**
  * canal独立版本启动的入口类
  * 
@@ -55,12 +56,13 @@ public class CanalLauncher {
             });
 
             CanalServerStarter canalServerStarter = null;
-            String serverMode = properties.getProperty(CanalConstants.CANAL_SERVER_MODE, "tcp");
+            String serverMode = controller.getProperty(properties, CanalConstants.CANAL_SERVER_MODE);
             if (serverMode.equalsIgnoreCase("kafka")) {
                 canalServerStarter = new CanalKafkaStarter();
             } else if (serverMode.equalsIgnoreCase("rocketMQ")) {
                 // 预留rocketMQ启动
             }
+
             if (canalServerStarter != null) {
                 canalServerStarter.init();
             }
diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/kafka.yml
index edd6b464..db4a9abe 100644
--- a/deployer/src/main/resources/kafka.yml
+++ b/deployer/src/main/resources/kafka.yml
@@ -12,6 +12,4 @@ canalGetTimeout: 100
 canalDestinations:
   - canalDestination: example
     topic: example
-    partition:
-
-
+    partition:
\ No newline at end of file

From 82f8a9fc980dd428eb45c8f66789564632723897 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=83=E9=94=8B?= 
Date: Tue, 4 Sep 2018 12:55:16 +0800
Subject: [PATCH 16/42] fixed issue #483 , show slave hosts

---
 .../parse/driver/mysql/socket/BioSocketChannel.java | 10 ++++++++++
 .../driver/mysql/socket/NettySocketChannel.java     |  4 ++++
 .../parse/driver/mysql/socket/SocketChannel.java    |  2 ++
 .../canal/parse/inbound/mysql/MysqlConnection.java  | 13 +++++++++++--
 .../canal/parse/MysqlBinlogDumpPerformanceTest.java |  4 ++--
 5 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/BioSocketChannel.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/BioSocketChannel.java
index f746189e..8de2acfd 100644
--- a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/BioSocketChannel.java
+++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/BioSocketChannel.java
@@ -138,6 +138,16 @@ public class BioSocketChannel implements SocketChannel {
         if (socket != null) {
             return socket.getRemoteSocketAddress();
         }
+
+        return null;
+    }
+
+    public SocketAddress getLocalSocketAddress() {
+        Socket socket = this.socket;
+        if (socket != null) {
+            return socket.getLocalSocketAddress();
+        }
+
         return null;
     }
 
diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/NettySocketChannel.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/NettySocketChannel.java
index 782af21e..878dc605 100644
--- a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/NettySocketChannel.java
+++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/NettySocketChannel.java
@@ -216,6 +216,10 @@ public class NettySocketChannel implements SocketChannel {
         return channel != null ? channel.remoteAddress() : null;
     }
 
+    public SocketAddress getLocalSocketAddress() {
+        return channel != null ? channel.localAddress() : null;
+    }
+
     public void close() {
         if (channel != null) {
             channel.close();
diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannel.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannel.java
index 67f967ab..b67702ae 100644
--- a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannel.java
+++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannel.java
@@ -21,5 +21,7 @@ public interface SocketChannel {
 
     public SocketAddress getRemoteSocketAddress();
 
+    public SocketAddress getLocalSocketAddress();
+
     public void close();
 }
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java
index 256b1ecc..4348dc29 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java
@@ -4,6 +4,7 @@ import static com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetche
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.net.SocketAddress;
 import java.nio.charset.Charset;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
@@ -254,10 +255,18 @@ public class MysqlConnection implements ErosaConnection {
 
     private void sendRegisterSlave() throws IOException {
         RegisterSlaveCommandPacket cmd = new RegisterSlaveCommandPacket();
-        cmd.reportHost = authInfo.getAddress().getAddress().getHostAddress();
+        SocketAddress socketAddress = connector.getChannel().getLocalSocketAddress();
+        if (socketAddress == null || !(socketAddress instanceof InetSocketAddress)) {
+            return;
+        }
+
+        InetSocketAddress address = (InetSocketAddress) socketAddress;
+        String host = address.getHostString();
+        int port = address.getPort();
+        cmd.reportHost = host;
+        cmd.reportPort = port;
         cmd.reportPasswd = authInfo.getPassword();
         cmd.reportUser = authInfo.getUsername();
-        cmd.reportPort = authInfo.getAddress().getPort(); // 暂时先用master节点的port
         cmd.serverId = this.slaveId;
         byte[] cmdBody = cmd.toBytes();
 
diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/MysqlBinlogDumpPerformanceTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/MysqlBinlogDumpPerformanceTest.java
index 8ca9b044..25c88764 100644
--- a/parse/src/test/java/com/alibaba/otter/canal/parse/MysqlBinlogDumpPerformanceTest.java
+++ b/parse/src/test/java/com/alibaba/otter/canal/parse/MysqlBinlogDumpPerformanceTest.java
@@ -20,12 +20,12 @@ public class MysqlBinlogDumpPerformanceTest {
 
     public static void main(String args[]) {
         final MysqlEventParser controller = new MysqlEventParser();
-        final EntryPosition startPosition = new EntryPosition("mysql-bin.001699", 120L, 100L);
+        final EntryPosition startPosition = new EntryPosition("mysql-bin.000007", 89796293L, 100L);
         controller.setConnectionCharset(Charset.forName("UTF-8"));
         controller.setSlaveId(3344L);
         controller.setDetectingEnable(false);
         controller.setFilterQueryDml(true);
-        controller.setMasterInfo(new AuthenticationInfo(new InetSocketAddress("127.0.0.1", 3328), "root", "hello"));
+        controller.setMasterInfo(new AuthenticationInfo(new InetSocketAddress("100.81.154.142", 3306), "canal", "canal"));
         controller.setMasterPosition(startPosition);
         controller.setEnableTsdb(false);
         controller.setDestination("example");

From a49796215390b8e74c201ead54e4db95093f5acb Mon Sep 17 00:00:00 2001
From: WithLin 
Date: Fri, 7 Sep 2018 14:25:46 +0800
Subject: [PATCH 17/42] Fix upgrade protobuf version

---
 pom.xml                                       |     2 +-
 .../otter/canal/protocol/CanalEntry.java      |  7191 +++---
 .../otter/canal/protocol/CanalPacket.java     | 20567 +++++++++-------
 .../otter/canal/protocol/CanalProtocol.proto  |     1 +
 .../otter/canal/protocol/EntryProtocol.proto  |     1 +
 .../listener/ChannelFutureAggregator.java     |    18 +-
 6 files changed, 15212 insertions(+), 12568 deletions(-)

diff --git a/pom.xml b/pom.xml
index 505e987e..ea1e393c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -237,7 +237,7 @@
             
                 com.google.protobuf
                 protobuf-java
-                2.6.1
+                3.6.1
             
             
                 org.apache.ibatis
diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalEntry.java b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalEntry.java
index 051d8bf6..8807b1fd 100644
--- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalEntry.java
+++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalEntry.java
@@ -5,42 +5,48 @@ package com.alibaba.otter.canal.protocol;
 
 public final class CanalEntry {
   private CanalEntry() {}
+  public static void registerAllExtensions(
+      com.google.protobuf.ExtensionRegistryLite registry) {
+  }
+
   public static void registerAllExtensions(
       com.google.protobuf.ExtensionRegistry registry) {
+    registerAllExtensions(
+        (com.google.protobuf.ExtensionRegistryLite) registry);
   }
   /**
-   * Protobuf enum {@code com.alibaba.otter.canal.protocol.EntryType}
-   *
    * 
    **打散后的事件类型,主要用于标识事务的开始,变更数据,结束*
    * 
+ * + * Protobuf enum {@code com.alibaba.otter.canal.protocol.EntryType} */ public enum EntryType implements com.google.protobuf.ProtocolMessageEnum { /** * TRANSACTIONBEGIN = 1; */ - TRANSACTIONBEGIN(0, 1), + TRANSACTIONBEGIN(1), /** * ROWDATA = 2; */ - ROWDATA(1, 2), + ROWDATA(2), /** * TRANSACTIONEND = 3; */ - TRANSACTIONEND(2, 3), + TRANSACTIONEND(3), /** - * HEARTBEAT = 4; - * *
      ** 心跳类型,内部使用,外部暂不可见,可忽略 *
      * 
+ * + * HEARTBEAT = 4; */ - HEARTBEAT(3, 4), + HEARTBEAT(4), /** * GTIDLOG = 5; */ - GTIDLOG(4, 5), + GTIDLOG(5), ; /** @@ -56,11 +62,11 @@ public final class CanalEntry { */ public static final int TRANSACTIONEND_VALUE = 3; /** - * HEARTBEAT = 4; - * *
      ** 心跳类型,内部使用,外部暂不可见,可忽略 *
      * 
+ * + * HEARTBEAT = 4; */ public static final int HEARTBEAT_VALUE = 4; /** @@ -69,9 +75,19 @@ public final class CanalEntry { public static final int GTIDLOG_VALUE = 5; - public final int getNumber() { return value; } + public final int getNumber() { + return value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated public static EntryType valueOf(int value) { + return forNumber(value); + } + + public static EntryType forNumber(int value) { switch (value) { case 1: return TRANSACTIONBEGIN; case 2: return ROWDATA; @@ -86,17 +102,17 @@ public final class CanalEntry { internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = + private static final com.google.protobuf.Internal.EnumLiteMap< + EntryType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { public EntryType findValueByNumber(int number) { - return EntryType.valueOf(number); + return EntryType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(index); + return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { @@ -104,7 +120,7 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return CanalEntry.getDescriptor().getEnumTypes().get(0); + return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(0); } private static final EntryType[] VALUES = values(); @@ -112,17 +128,15 @@ public final class CanalEntry { public static EntryType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { - throw new IllegalArgumentException( + throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; } - private final int index; private final int value; - private EntryType(int index, int value) { - this.index = index; + private EntryType(int value) { this.value = value; } @@ -130,86 +144,86 @@ public final class CanalEntry { } /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.EventType} - * *
    ** 事件类型 *
    * 
+ * + * Protobuf enum {@code com.alibaba.otter.canal.protocol.EventType} */ public enum EventType implements com.google.protobuf.ProtocolMessageEnum { /** * INSERT = 1; */ - INSERT(0, 1), + INSERT(1), /** * UPDATE = 2; */ - UPDATE(1, 2), + UPDATE(2), /** * DELETE = 3; */ - DELETE(2, 3), + DELETE(3), /** * CREATE = 4; */ - CREATE(3, 4), + CREATE(4), /** * ALTER = 5; */ - ALTER(4, 5), + ALTER(5), /** * ERASE = 6; */ - ERASE(5, 6), + ERASE(6), /** * QUERY = 7; */ - QUERY(6, 7), + QUERY(7), /** * TRUNCATE = 8; */ - TRUNCATE(7, 8), + TRUNCATE(8), /** * RENAME = 9; */ - RENAME(8, 9), + RENAME(9), /** - * CINDEX = 10; - * *
      **CREATE INDEX*
      * 
+ * + * CINDEX = 10; */ - CINDEX(9, 10), + CINDEX(10), /** * DINDEX = 11; */ - DINDEX(10, 11), + DINDEX(11), /** * GTID = 12; */ - GTID(11, 12), + GTID(12), /** - * XACOMMIT = 13; - * *
      ** XA *
      * 
+ * + * XACOMMIT = 13; */ - XACOMMIT(12, 13), + XACOMMIT(13), /** * XAROLLBACK = 14; */ - XAROLLBACK(13, 14), + XAROLLBACK(14), /** - * MHEARTBEAT = 15; - * *
      ** MASTER HEARTBEAT *
      * 
+ * + * MHEARTBEAT = 15; */ - MHEARTBEAT(14, 15), + MHEARTBEAT(15), ; /** @@ -249,11 +263,11 @@ public final class CanalEntry { */ public static final int RENAME_VALUE = 9; /** - * CINDEX = 10; - * *
      **CREATE INDEX*
      * 
+ * + * CINDEX = 10; */ public static final int CINDEX_VALUE = 10; /** @@ -265,11 +279,11 @@ public final class CanalEntry { */ public static final int GTID_VALUE = 12; /** - * XACOMMIT = 13; - * *
      ** XA *
      * 
+ * + * XACOMMIT = 13; */ public static final int XACOMMIT_VALUE = 13; /** @@ -277,18 +291,28 @@ public final class CanalEntry { */ public static final int XAROLLBACK_VALUE = 14; /** - * MHEARTBEAT = 15; - * *
      ** MASTER HEARTBEAT *
      * 
+ * + * MHEARTBEAT = 15; */ public static final int MHEARTBEAT_VALUE = 15; - public final int getNumber() { return value; } + public final int getNumber() { + return value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated public static EventType valueOf(int value) { + return forNumber(value); + } + + public static EventType forNumber(int value) { switch (value) { case 1: return INSERT; case 2: return UPDATE; @@ -313,17 +337,17 @@ public final class CanalEntry { internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = + private static final com.google.protobuf.Internal.EnumLiteMap< + EventType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { public EventType findValueByNumber(int number) { - return EventType.valueOf(number); + return EventType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(index); + return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { @@ -331,7 +355,7 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return CanalEntry.getDescriptor().getEnumTypes().get(1); + return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(1); } private static final EventType[] VALUES = values(); @@ -339,17 +363,15 @@ public final class CanalEntry { public static EventType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { - throw new IllegalArgumentException( + throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; } - private final int index; private final int value; - private EventType(int index, int value) { - this.index = index; + private EventType(int value) { this.value = value; } @@ -357,26 +379,26 @@ public final class CanalEntry { } /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.Type} - * *
    **数据库类型*
    * 
+ * + * Protobuf enum {@code com.alibaba.otter.canal.protocol.Type} */ public enum Type implements com.google.protobuf.ProtocolMessageEnum { /** * ORACLE = 1; */ - ORACLE(0, 1), + ORACLE(1), /** * MYSQL = 2; */ - MYSQL(1, 2), + MYSQL(2), /** * PGSQL = 3; */ - PGSQL(2, 3), + PGSQL(3), ; /** @@ -393,9 +415,19 @@ public final class CanalEntry { public static final int PGSQL_VALUE = 3; - public final int getNumber() { return value; } + public final int getNumber() { + return value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated public static Type valueOf(int value) { + return forNumber(value); + } + + public static Type forNumber(int value) { switch (value) { case 1: return ORACLE; case 2: return MYSQL; @@ -408,17 +440,17 @@ public final class CanalEntry { internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = + private static final com.google.protobuf.Internal.EnumLiteMap< + Type> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { public Type findValueByNumber(int number) { - return Type.valueOf(number); + return Type.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(index); + return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { @@ -426,7 +458,7 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return CanalEntry.getDescriptor().getEnumTypes().get(2); + return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(2); } private static final Type[] VALUES = values(); @@ -434,17 +466,15 @@ public final class CanalEntry { public static Type valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { - throw new IllegalArgumentException( + throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; } - private final int index; private final int value; - private Type(int index, int value) { - this.index = index; + private Type(int value) { this.value = value; } @@ -456,105 +486,101 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
      **协议头部信息*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ boolean hasHeader(); /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
      **协议头部信息*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - Header getHeader(); + com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader(); /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
      **协议头部信息*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - HeaderOrBuilder getHeaderOrBuilder(); + com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder(); /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * *
      **打散后的事件类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; */ boolean hasEntryType(); /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * *
      **打散后的事件类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; */ - EntryType getEntryType(); + com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType(); /** - * optional bytes storeValue = 3; - * *
      **传输的二进制数组*
      * 
+ * + * optional bytes storeValue = 3; */ boolean hasStoreValue(); /** - * optional bytes storeValue = 3; - * *
      **传输的二进制数组*
      * 
+ * + * optional bytes storeValue = 3; */ com.google.protobuf.ByteString getStoreValue(); } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Entry} - * *
    ****************************************************************
    * message model
    *如果要在Enum中新增类型,确保以前的类型的下标值不变.
    ***************************************************************
    * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Entry} */ - public static final class Entry extends - com.google.protobuf.GeneratedMessage implements + public static final class Entry extends + com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Entry) EntryOrBuilder { + private static final long serialVersionUID = 0L; // Use Entry.newBuilder() to construct. - private Entry(com.google.protobuf.GeneratedMessage.Builder builder) { + private Entry(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); - this.unknownFields = builder.getUnknownFields(); } - private Entry(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Entry defaultInstance; - public static Entry getDefaultInstance() { - return defaultInstance; + private Entry() { + entryType_ = 2; + storeValue_ = com.google.protobuf.ByteString.EMPTY; } - public Entry getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @Override + @java.lang.Override public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { + getUnknownFields() { return this.unknownFields; } private Entry( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -566,19 +592,12 @@ public final class CanalEntry { case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 10: { - Header.Builder subBuilder = null; + com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder subBuilder = null; if (((bitField0_ & 0x00000001) == 0x00000001)) { subBuilder = header_.toBuilder(); } - header_ = input.readMessage(Header.PARSER, extensionRegistry); + header_ = input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Header.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(header_); header_ = subBuilder.buildPartial(); @@ -588,12 +607,13 @@ public final class CanalEntry { } case 16: { int rawValue = input.readEnum(); - EntryType value = EntryType.valueOf(rawValue); + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EntryType value = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(2, rawValue); } else { bitField0_ |= 0x00000002; - entryType_ = value; + entryType_ = rawValue; } break; } @@ -602,13 +622,20 @@ public final class CanalEntry { storeValue_ = input.readBytes(); break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); + e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -616,117 +643,101 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable .ensureFieldAccessorsInitialized( - Entry.class, Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Entry parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Entry(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + com.alibaba.otter.canal.protocol.CanalEntry.Entry.class, com.alibaba.otter.canal.protocol.CanalEntry.Entry.Builder.class); } private int bitField0_; public static final int HEADER_FIELD_NUMBER = 1; - private Header header_; + private com.alibaba.otter.canal.protocol.CanalEntry.Header header_; /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
      **协议头部信息*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ public boolean hasHeader() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
      **协议头部信息*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - public Header getHeader() { - return header_; + public com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader() { + return header_ == null ? com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance() : header_; } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
      **协议头部信息*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - public HeaderOrBuilder getHeaderOrBuilder() { - return header_; + public com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder() { + return header_ == null ? com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance() : header_; } public static final int ENTRYTYPE_FIELD_NUMBER = 2; - private EntryType entryType_; + private int entryType_; /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * *
      **打散后的事件类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; */ public boolean hasEntryType() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * *
      **打散后的事件类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; */ - public EntryType getEntryType() { - return entryType_; + public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EntryType result = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf(entryType_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA : result; } public static final int STOREVALUE_FIELD_NUMBER = 3; private com.google.protobuf.ByteString storeValue_; /** - * optional bytes storeValue = 3; - * *
      **传输的二进制数组*
      * 
+ * + * optional bytes storeValue = 3; */ public boolean hasStoreValue() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional bytes storeValue = 3; - * *
      **传输的二进制数组*
      * 
+ * + * optional bytes storeValue = 3; */ public com.google.protobuf.ByteString getStoreValue() { return storeValue_; } - private void initFields() { - header_ = Header.getDefaultInstance(); - entryType_ = EntryType.ROWDATA; - storeValue_ = com.google.protobuf.ByteString.EMPTY; - } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -736,141 +747,212 @@ public final class CanalEntry { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, header_); + output.writeMessage(1, getHeader()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, entryType_.getNumber()); + output.writeEnum(2, entryType_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, storeValue_); } - getUnknownFields().writeTo(output); + unknownFields.writeTo(output); } - private int memoizedSerializedSize = -1; + @java.lang.Override public int getSerializedSize() { - int size = memoizedSerializedSize; + int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, header_); + .computeMessageSize(1, getHeader()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, entryType_.getNumber()); + .computeEnumSize(2, entryType_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, storeValue_); } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; + size += unknownFields.getSerializedSize(); + memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalEntry.Entry)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalEntry.Entry other = (com.alibaba.otter.canal.protocol.CanalEntry.Entry) obj; + + boolean result = true; + result = result && (hasHeader() == other.hasHeader()); + if (hasHeader()) { + result = result && getHeader() + .equals(other.getHeader()); + } + result = result && (hasEntryType() == other.hasEntryType()); + if (hasEntryType()) { + result = result && entryType_ == other.entryType_; + } + result = result && (hasStoreValue() == other.hasStoreValue()); + if (hasStoreValue()) { + result = result && getStoreValue() + .equals(other.getStoreValue()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; } - public static Entry parseFrom( + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasHeader()) { + hash = (37 * hash) + HEADER_FIELD_NUMBER; + hash = (53 * hash) + getHeader().hashCode(); + } + if (hasEntryType()) { + hash = (37 * hash) + ENTRYTYPE_FIELD_NUMBER; + hash = (53 * hash) + entryType_; + } + if (hasStoreValue()) { + hash = (37 * hash) + STOREVALUE_FIELD_NUMBER; + hash = (53 * hash) + getStoreValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Entry parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Entry parseFrom(byte[] data) + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Entry parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Entry parseFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static Entry parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Entry parseDelimitedFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); } - public static Entry parseDelimitedFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static Entry parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static Entry parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Builder newBuilder() { return Builder.create(); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(Entry prototype) { - return newBuilder().mergeFrom(prototype); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Entry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } - public Builder toBuilder() { return newBuilder(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Entry} - * *
      ****************************************************************
      * message model
      *如果要在Enum中新增类型,确保以前的类型的下标值不变.
      ***************************************************************
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Entry} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Entry) - EntryOrBuilder { + com.alibaba.otter.canal.protocol.CanalEntry.EntryOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable .ensureFieldAccessorsInitialized( - Entry.class, Builder.class); + com.alibaba.otter.canal.protocol.CanalEntry.Entry.class, com.alibaba.otter.canal.protocol.CanalEntry.Entry.Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Entry.newBuilder() @@ -879,57 +961,55 @@ public final class CanalEntry { } private Builder( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { getHeaderFieldBuilder(); } } - private static Builder create() { - return new Builder(); - } - + @java.lang.Override public Builder clear() { super.clear(); if (headerBuilder_ == null) { - header_ = Header.getDefaultInstance(); + header_ = null; } else { headerBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); - entryType_ = EntryType.ROWDATA; + entryType_ = 2; bitField0_ = (bitField0_ & ~0x00000002); storeValue_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000004); return this; } - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; } - public Entry getDefaultInstanceForType() { - return Entry.getDefaultInstance(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Entry getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.Entry.getDefaultInstance(); } - public Entry build() { - Entry result = buildPartial(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Entry build() { + com.alibaba.otter.canal.protocol.CanalEntry.Entry result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Entry buildPartial() { - Entry result = new Entry(this); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Entry buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.Entry result = new com.alibaba.otter.canal.protocol.CanalEntry.Entry(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -953,17 +1033,50 @@ public final class CanalEntry { return result; } + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Entry) { - return mergeFrom((Entry)other); + if (other instanceof com.alibaba.otter.canal.protocol.CanalEntry.Entry) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.Entry)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Entry other) { - if (other == Entry.getDefaultInstance()) return this; + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.Entry other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.Entry.getDefaultInstance()) return this; if (other.hasHeader()) { mergeHeader(other.getHeader()); } @@ -973,24 +1086,27 @@ public final class CanalEntry { if (other.hasStoreValue()) { setStoreValue(other.getStoreValue()); } - this.mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Entry parsedMessage = null; + com.alibaba.otter.canal.protocol.CanalEntry.Entry parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Entry) e.getUnfinishedMessage(); - throw e; + parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.Entry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -1000,41 +1116,41 @@ public final class CanalEntry { } private int bitField0_; - private Header header_ = Header.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - Header, Header.Builder, HeaderOrBuilder> headerBuilder_; + private com.alibaba.otter.canal.protocol.CanalEntry.Header header_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Header, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder, com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder> headerBuilder_; /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ public boolean hasHeader() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - public Header getHeader() { + public com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader() { if (headerBuilder_ == null) { - return header_; + return header_ == null ? com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance() : header_; } else { return headerBuilder_.getMessage(); } } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - public Builder setHeader(Header value) { + public Builder setHeader(com.alibaba.otter.canal.protocol.CanalEntry.Header value) { if (headerBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -1048,14 +1164,14 @@ public final class CanalEntry { return this; } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ public Builder setHeader( - Header.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder builderForValue) { if (headerBuilder_ == null) { header_ = builderForValue.build(); onChanged(); @@ -1066,18 +1182,19 @@ public final class CanalEntry { return this; } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - public Builder mergeHeader(Header value) { + public Builder mergeHeader(com.alibaba.otter.canal.protocol.CanalEntry.Header value) { if (headerBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && - header_ != Header.getDefaultInstance()) { + header_ != null && + header_ != com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance()) { header_ = - Header.newBuilder(header_).mergeFrom(value).buildPartial(); + com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder(header_).mergeFrom(value).buildPartial(); } else { header_ = value; } @@ -1089,15 +1206,15 @@ public final class CanalEntry { return this; } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ public Builder clearHeader() { if (headerBuilder_ == null) { - header_ = Header.getDefaultInstance(); + header_ = null; onChanged(); } else { headerBuilder_.clear(); @@ -1106,44 +1223,45 @@ public final class CanalEntry { return this; } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - public Header.Builder getHeaderBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder getHeaderBuilder() { bitField0_ |= 0x00000001; onChanged(); return getHeaderFieldBuilder().getBuilder(); } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - public HeaderOrBuilder getHeaderOrBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder() { if (headerBuilder_ != null) { return headerBuilder_.getMessageOrBuilder(); } else { - return header_; + return header_ == null ? + com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance() : header_; } } /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * *
        **协议头部信息*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Header header = 1; */ - private com.google.protobuf.SingleFieldBuilder< - Header, Header.Builder, HeaderOrBuilder> + private com.google.protobuf.SingleFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Header, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder, com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder> getHeaderFieldBuilder() { if (headerBuilder_ == null) { - headerBuilder_ = new com.google.protobuf.SingleFieldBuilder< - Header, Header.Builder, HeaderOrBuilder>( + headerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Header, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder, com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder>( getHeader(), getParentForChildren(), isClean()); @@ -1152,84 +1270,86 @@ public final class CanalEntry { return headerBuilder_; } - private EntryType entryType_ = EntryType.ROWDATA; + private int entryType_ = 2; /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * *
        **打散后的事件类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; */ public boolean hasEntryType() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * *
        **打散后的事件类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; */ - public EntryType getEntryType() { - return entryType_; + public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EntryType result = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf(entryType_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA : result; } /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * *
        **打散后的事件类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; */ - public Builder setEntryType(EntryType value) { + public Builder setEntryType(com.alibaba.otter.canal.protocol.CanalEntry.EntryType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; - entryType_ = value; + entryType_ = value.getNumber(); onChanged(); return this; } /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * *
        **打散后的事件类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; */ public Builder clearEntryType() { bitField0_ = (bitField0_ & ~0x00000002); - entryType_ = EntryType.ROWDATA; + entryType_ = 2; onChanged(); return this; } private com.google.protobuf.ByteString storeValue_ = com.google.protobuf.ByteString.EMPTY; /** - * optional bytes storeValue = 3; - * *
        **传输的二进制数组*
        * 
+ * + * optional bytes storeValue = 3; */ public boolean hasStoreValue() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional bytes storeValue = 3; - * *
        **传输的二进制数组*
        * 
+ * + * optional bytes storeValue = 3; */ public com.google.protobuf.ByteString getStoreValue() { return storeValue_; } /** - * optional bytes storeValue = 3; - * *
        **传输的二进制数组*
        * 
+ * + * optional bytes storeValue = 3; */ public Builder setStoreValue(com.google.protobuf.ByteString value) { if (value == null) { @@ -1241,11 +1361,11 @@ public final class CanalEntry { return this; } /** - * optional bytes storeValue = 3; - * *
        **传输的二进制数组*
        * 
+ * + * optional bytes storeValue = 3; */ public Builder clearStoreValue() { bitField0_ = (bitField0_ & ~0x00000004); @@ -1253,16 +1373,57 @@ public final class CanalEntry { onChanged(); return this; } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Entry) } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Entry) + private static final com.alibaba.otter.canal.protocol.CanalEntry.Entry DEFAULT_INSTANCE; static { - defaultInstance = new Entry(true); - defaultInstance.initFields(); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.Entry(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Entry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Entry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Entry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Entry) } public interface HeaderOrBuilder extends @@ -1270,335 +1431,343 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * optional int32 version = 1 [default = 1]; - * *
      **协议的版本号*
      * 
+ * + * optional int32 version = 1 [default = 1]; */ boolean hasVersion(); /** - * optional int32 version = 1 [default = 1]; - * *
      **协议的版本号*
      * 
+ * + * optional int32 version = 1 [default = 1]; */ int getVersion(); /** - * optional string logfileName = 2; - * *
      **binlog/redolog 文件名*
      * 
+ * + * optional string logfileName = 2; */ boolean hasLogfileName(); /** - * optional string logfileName = 2; - * *
      **binlog/redolog 文件名*
      * 
+ * + * optional string logfileName = 2; */ - String getLogfileName(); + java.lang.String getLogfileName(); /** - * optional string logfileName = 2; - * *
      **binlog/redolog 文件名*
      * 
+ * + * optional string logfileName = 2; */ com.google.protobuf.ByteString getLogfileNameBytes(); /** - * optional int64 logfileOffset = 3; - * *
      **binlog/redolog 文件的偏移位置*
      * 
+ * + * optional int64 logfileOffset = 3; */ boolean hasLogfileOffset(); /** - * optional int64 logfileOffset = 3; - * *
      **binlog/redolog 文件的偏移位置*
      * 
+ * + * optional int64 logfileOffset = 3; */ long getLogfileOffset(); /** - * optional int64 serverId = 4; - * *
      **服务端serverId*
      * 
+ * + * optional int64 serverId = 4; */ boolean hasServerId(); /** - * optional int64 serverId = 4; - * *
      **服务端serverId*
      * 
+ * + * optional int64 serverId = 4; */ long getServerId(); /** - * optional string serverenCode = 5; - * *
      ** 变更数据的编码 *
      * 
+ * + * optional string serverenCode = 5; */ boolean hasServerenCode(); /** - * optional string serverenCode = 5; - * *
      ** 变更数据的编码 *
      * 
+ * + * optional string serverenCode = 5; */ - String getServerenCode(); + java.lang.String getServerenCode(); /** - * optional string serverenCode = 5; - * *
      ** 变更数据的编码 *
      * 
+ * + * optional string serverenCode = 5; */ com.google.protobuf.ByteString getServerenCodeBytes(); /** - * optional int64 executeTime = 6; - * *
      **变更数据的执行时间 *
      * 
+ * + * optional int64 executeTime = 6; */ boolean hasExecuteTime(); /** - * optional int64 executeTime = 6; - * *
      **变更数据的执行时间 *
      * 
+ * + * optional int64 executeTime = 6; */ long getExecuteTime(); /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * *
      ** 变更数据的来源*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; */ boolean hasSourceType(); /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * *
      ** 变更数据的来源*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; */ - Type getSourceType(); + com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType(); /** - * optional string schemaName = 8; - * *
      ** 变更数据的schemaname*
      * 
+ * + * optional string schemaName = 8; */ boolean hasSchemaName(); /** - * optional string schemaName = 8; - * *
      ** 变更数据的schemaname*
      * 
+ * + * optional string schemaName = 8; */ - String getSchemaName(); + java.lang.String getSchemaName(); /** - * optional string schemaName = 8; - * *
      ** 变更数据的schemaname*
      * 
+ * + * optional string schemaName = 8; */ com.google.protobuf.ByteString getSchemaNameBytes(); /** - * optional string tableName = 9; - * *
      **变更数据的tablename*
      * 
+ * + * optional string tableName = 9; */ boolean hasTableName(); /** - * optional string tableName = 9; - * *
      **变更数据的tablename*
      * 
+ * + * optional string tableName = 9; */ - String getTableName(); + java.lang.String getTableName(); /** - * optional string tableName = 9; - * *
      **变更数据的tablename*
      * 
+ * + * optional string tableName = 9; */ com.google.protobuf.ByteString getTableNameBytes(); /** - * optional int64 eventLength = 10; - * *
      **每个event的长度*
      * 
+ * + * optional int64 eventLength = 10; */ boolean hasEventLength(); /** - * optional int64 eventLength = 10; - * *
      **每个event的长度*
      * 
+ * + * optional int64 eventLength = 10; */ long getEventLength(); /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * *
      **数据变更类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; */ boolean hasEventType(); /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * *
      **数据变更类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; */ - EventType getEventType(); + com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - java.util.List + java.util.List getPropsList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - Pair getProps(int index); + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ int getPropsCount(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - java.util.List + java.util.List getPropsOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - PairOrBuilder getPropsOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + int index); /** - * optional string gtid = 13; - * *
      **当前事务的gitd*
      * 
+ * + * optional string gtid = 13; */ boolean hasGtid(); /** - * optional string gtid = 13; - * *
      **当前事务的gitd*
      * 
+ * + * optional string gtid = 13; */ - String getGtid(); + java.lang.String getGtid(); /** - * optional string gtid = 13; - * *
      **当前事务的gitd*
      * 
+ * + * optional string gtid = 13; */ com.google.protobuf.ByteString getGtidBytes(); } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Header} - * *
    **message Header*
    * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Header} */ - public static final class Header extends - com.google.protobuf.GeneratedMessage implements + public static final class Header extends + com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Header) HeaderOrBuilder { + private static final long serialVersionUID = 0L; // Use Header.newBuilder() to construct. - private Header(com.google.protobuf.GeneratedMessage.Builder builder) { + private Header(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); - this.unknownFields = builder.getUnknownFields(); } - private Header(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Header defaultInstance; - public static Header getDefaultInstance() { - return defaultInstance; + private Header() { + version_ = 1; + logfileName_ = ""; + logfileOffset_ = 0L; + serverId_ = 0L; + serverenCode_ = ""; + executeTime_ = 0L; + sourceType_ = 2; + schemaName_ = ""; + tableName_ = ""; + eventLength_ = 0L; + eventType_ = 2; + props_ = java.util.Collections.emptyList(); + gtid_ = ""; } - public Header getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @Override + @java.lang.Override public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { + getUnknownFields() { return this.unknownFields; } private Header( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -1610,13 +1779,6 @@ public final class CanalEntry { case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 8: { bitField0_ |= 0x00000001; version_ = input.readInt32(); @@ -1651,12 +1813,13 @@ public final class CanalEntry { } case 56: { int rawValue = input.readEnum(); - Type value = Type.valueOf(rawValue); + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.Type value = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(7, rawValue); } else { bitField0_ |= 0x00000040; - sourceType_ = value; + sourceType_ = rawValue; } break; } @@ -1679,21 +1842,23 @@ public final class CanalEntry { } case 88: { int rawValue = input.readEnum(); - EventType value = EventType.valueOf(rawValue); + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType value = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(11, rawValue); } else { bitField0_ |= 0x00000400; - eventType_ = value; + eventType_ = rawValue; } break; } case 98: { if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - props_ = new java.util.ArrayList(); + props_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000800; } - props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); + props_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); break; } case 106: { @@ -1702,13 +1867,20 @@ public final class CanalEntry { gtid_ = bs; break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); + e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -1719,82 +1891,68 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable .ensureFieldAccessorsInitialized( - Header.class, Builder.class); - } - - public static com.google.protobuf.Parser
PARSER = - new com.google.protobuf.AbstractParser
() { - public Header parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Header(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser
getParserForType() { - return PARSER; + com.alibaba.otter.canal.protocol.CanalEntry.Header.class, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder.class); } private int bitField0_; public static final int VERSION_FIELD_NUMBER = 1; private int version_; /** - * optional int32 version = 1 [default = 1]; - * *
      **协议的版本号*
      * 
+ * + * optional int32 version = 1 [default = 1]; */ public boolean hasVersion() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 version = 1 [default = 1]; - * *
      **协议的版本号*
      * 
+ * + * optional int32 version = 1 [default = 1]; */ public int getVersion() { return version_; } public static final int LOGFILENAME_FIELD_NUMBER = 2; - private Object logfileName_; + private volatile java.lang.Object logfileName_; /** - * optional string logfileName = 2; - * *
      **binlog/redolog 文件名*
      * 
+ * + * optional string logfileName = 2; */ public boolean hasLogfileName() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional string logfileName = 2; - * *
      **binlog/redolog 文件名*
      * 
+ * + * optional string logfileName = 2; */ - public String getLogfileName() { - Object ref = logfileName_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getLogfileName() { + java.lang.Object ref = logfileName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { logfileName_ = s; } @@ -1802,19 +1960,19 @@ public final class CanalEntry { } } /** - * optional string logfileName = 2; - * *
      **binlog/redolog 文件名*
      * 
+ * + * optional string logfileName = 2; */ public com.google.protobuf.ByteString getLogfileNameBytes() { - Object ref = logfileName_; - if (ref instanceof String) { + java.lang.Object ref = logfileName_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); logfileName_ = b; return b; } else { @@ -1825,21 +1983,21 @@ public final class CanalEntry { public static final int LOGFILEOFFSET_FIELD_NUMBER = 3; private long logfileOffset_; /** - * optional int64 logfileOffset = 3; - * *
      **binlog/redolog 文件的偏移位置*
      * 
+ * + * optional int64 logfileOffset = 3; */ public boolean hasLogfileOffset() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional int64 logfileOffset = 3; - * *
      **binlog/redolog 文件的偏移位置*
      * 
+ * + * optional int64 logfileOffset = 3; */ public long getLogfileOffset() { return logfileOffset_; @@ -1848,53 +2006,53 @@ public final class CanalEntry { public static final int SERVERID_FIELD_NUMBER = 4; private long serverId_; /** - * optional int64 serverId = 4; - * *
      **服务端serverId*
      * 
+ * + * optional int64 serverId = 4; */ public boolean hasServerId() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional int64 serverId = 4; - * *
      **服务端serverId*
      * 
+ * + * optional int64 serverId = 4; */ public long getServerId() { return serverId_; } public static final int SERVERENCODE_FIELD_NUMBER = 5; - private Object serverenCode_; + private volatile java.lang.Object serverenCode_; /** - * optional string serverenCode = 5; - * *
      ** 变更数据的编码 *
      * 
+ * + * optional string serverenCode = 5; */ public boolean hasServerenCode() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * optional string serverenCode = 5; - * *
      ** 变更数据的编码 *
      * 
+ * + * optional string serverenCode = 5; */ - public String getServerenCode() { - Object ref = serverenCode_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getServerenCode() { + java.lang.Object ref = serverenCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { serverenCode_ = s; } @@ -1902,19 +2060,19 @@ public final class CanalEntry { } } /** - * optional string serverenCode = 5; - * *
      ** 变更数据的编码 *
      * 
+ * + * optional string serverenCode = 5; */ public com.google.protobuf.ByteString getServerenCodeBytes() { - Object ref = serverenCode_; - if (ref instanceof String) { + java.lang.Object ref = serverenCode_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); serverenCode_ = b; return b; } else { @@ -1925,76 +2083,78 @@ public final class CanalEntry { public static final int EXECUTETIME_FIELD_NUMBER = 6; private long executeTime_; /** - * optional int64 executeTime = 6; - * *
      **变更数据的执行时间 *
      * 
+ * + * optional int64 executeTime = 6; */ public boolean hasExecuteTime() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * optional int64 executeTime = 6; - * *
      **变更数据的执行时间 *
      * 
+ * + * optional int64 executeTime = 6; */ public long getExecuteTime() { return executeTime_; } public static final int SOURCETYPE_FIELD_NUMBER = 7; - private Type sourceType_; + private int sourceType_; /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * *
      ** 变更数据的来源*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; */ public boolean hasSourceType() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * *
      ** 变更数据的来源*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; */ - public Type getSourceType() { - return sourceType_; + public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.Type result = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf(sourceType_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL : result; } public static final int SCHEMANAME_FIELD_NUMBER = 8; - private Object schemaName_; + private volatile java.lang.Object schemaName_; /** - * optional string schemaName = 8; - * *
      ** 变更数据的schemaname*
      * 
+ * + * optional string schemaName = 8; */ public boolean hasSchemaName() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** - * optional string schemaName = 8; - * *
      ** 变更数据的schemaname*
      * 
+ * + * optional string schemaName = 8; */ - public String getSchemaName() { - Object ref = schemaName_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getSchemaName() { + java.lang.Object ref = schemaName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { schemaName_ = s; } @@ -2002,19 +2162,19 @@ public final class CanalEntry { } } /** - * optional string schemaName = 8; - * *
      ** 变更数据的schemaname*
      * 
+ * + * optional string schemaName = 8; */ public com.google.protobuf.ByteString getSchemaNameBytes() { - Object ref = schemaName_; - if (ref instanceof String) { + java.lang.Object ref = schemaName_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); schemaName_ = b; return b; } else { @@ -2023,32 +2183,32 @@ public final class CanalEntry { } public static final int TABLENAME_FIELD_NUMBER = 9; - private Object tableName_; + private volatile java.lang.Object tableName_; /** - * optional string tableName = 9; - * *
      **变更数据的tablename*
      * 
+ * + * optional string tableName = 9; */ public boolean hasTableName() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** - * optional string tableName = 9; - * *
      **变更数据的tablename*
      * 
+ * + * optional string tableName = 9; */ - public String getTableName() { - Object ref = tableName_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { tableName_ = s; } @@ -2056,19 +2216,19 @@ public final class CanalEntry { } } /** - * optional string tableName = 9; - * *
      **变更数据的tablename*
      * 
+ * + * optional string tableName = 9; */ public com.google.protobuf.ByteString getTableNameBytes() { - Object ref = tableName_; - if (ref instanceof String) { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); tableName_ = b; return b; } else { @@ -2079,131 +2239,133 @@ public final class CanalEntry { public static final int EVENTLENGTH_FIELD_NUMBER = 10; private long eventLength_; /** - * optional int64 eventLength = 10; - * *
      **每个event的长度*
      * 
+ * + * optional int64 eventLength = 10; */ public boolean hasEventLength() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** - * optional int64 eventLength = 10; - * *
      **每个event的长度*
      * 
+ * + * optional int64 eventLength = 10; */ public long getEventLength() { return eventLength_; } public static final int EVENTTYPE_FIELD_NUMBER = 11; - private EventType eventType_; + private int eventType_; /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * *
      **数据变更类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; */ public boolean hasEventType() { return ((bitField0_ & 0x00000400) == 0x00000400); } /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * *
      **数据变更类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; */ - public EventType getEventType() { - return eventType_; + public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(eventType_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE : result; } public static final int PROPS_FIELD_NUMBER = 12; - private java.util.List props_; + private java.util.List props_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public int getPropsCount() { return props_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { return props_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } public static final int GTID_FIELD_NUMBER = 13; - private Object gtid_; + private volatile java.lang.Object gtid_; /** - * optional string gtid = 13; - * *
      **当前事务的gitd*
      * 
+ * + * optional string gtid = 13; */ public boolean hasGtid() { return ((bitField0_ & 0x00000800) == 0x00000800); } /** - * optional string gtid = 13; - * *
      **当前事务的gitd*
      * 
+ * + * optional string gtid = 13; */ - public String getGtid() { - Object ref = gtid_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getGtid() { + java.lang.Object ref = gtid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { gtid_ = s; } @@ -2211,19 +2373,19 @@ public final class CanalEntry { } } /** - * optional string gtid = 13; - * *
      **当前事务的gitd*
      * 
+ * + * optional string gtid = 13; */ public com.google.protobuf.ByteString getGtidBytes() { - Object ref = gtid_; - if (ref instanceof String) { + java.lang.Object ref = gtid_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); gtid_ = b; return b; } else { @@ -2231,22 +2393,8 @@ public final class CanalEntry { } } - private void initFields() { - version_ = 1; - logfileName_ = ""; - logfileOffset_ = 0L; - serverId_ = 0L; - serverenCode_ = ""; - executeTime_ = 0L; - sourceType_ = Type.MYSQL; - schemaName_ = ""; - tableName_ = ""; - eventLength_ = 0L; - eventType_ = EventType.UPDATE; - props_ = java.util.Collections.emptyList(); - gtid_ = ""; - } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -2256,14 +2404,14 @@ public final class CanalEntry { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, version_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getLogfileNameBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, logfileName_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt64(3, logfileOffset_); @@ -2272,38 +2420,38 @@ public final class CanalEntry { output.writeInt64(4, serverId_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, getServerenCodeBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serverenCode_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeInt64(6, executeTime_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeEnum(7, sourceType_.getNumber()); + output.writeEnum(7, sourceType_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeBytes(8, getSchemaNameBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, schemaName_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeBytes(9, getTableNameBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, tableName_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { output.writeInt64(10, eventLength_); } if (((bitField0_ & 0x00000400) == 0x00000400)) { - output.writeEnum(11, eventType_.getNumber()); + output.writeEnum(11, eventType_); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(12, props_.get(i)); } if (((bitField0_ & 0x00000800) == 0x00000800)) { - output.writeBytes(13, getGtidBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, gtid_); } - getUnknownFields().writeTo(output); + unknownFields.writeTo(output); } - private int memoizedSerializedSize = -1; + @java.lang.Override public int getSerializedSize() { - int size = memoizedSerializedSize; + int size = memoizedSize; if (size != -1) return size; size = 0; @@ -2312,8 +2460,7 @@ public final class CanalEntry { .computeInt32Size(1, version_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getLogfileNameBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, logfileName_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream @@ -2324,8 +2471,7 @@ public final class CanalEntry { .computeInt64Size(4, serverId_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, getServerenCodeBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serverenCode_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream @@ -2333,15 +2479,13 @@ public final class CanalEntry { } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, sourceType_.getNumber()); + .computeEnumSize(7, sourceType_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(8, getSchemaNameBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, schemaName_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(9, getTableNameBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, tableName_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { size += com.google.protobuf.CodedOutputStream @@ -2349,115 +2493,275 @@ public final class CanalEntry { } if (((bitField0_ & 0x00000400) == 0x00000400)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(11, eventType_.getNumber()); + .computeEnumSize(11, eventType_); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(12, props_.get(i)); } if (((bitField0_ & 0x00000800) == 0x00000800)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(13, getGtidBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, gtid_); } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; + size += unknownFields.getSerializedSize(); + memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalEntry.Header)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalEntry.Header other = (com.alibaba.otter.canal.protocol.CanalEntry.Header) obj; + + boolean result = true; + result = result && (hasVersion() == other.hasVersion()); + if (hasVersion()) { + result = result && (getVersion() + == other.getVersion()); + } + result = result && (hasLogfileName() == other.hasLogfileName()); + if (hasLogfileName()) { + result = result && getLogfileName() + .equals(other.getLogfileName()); + } + result = result && (hasLogfileOffset() == other.hasLogfileOffset()); + if (hasLogfileOffset()) { + result = result && (getLogfileOffset() + == other.getLogfileOffset()); + } + result = result && (hasServerId() == other.hasServerId()); + if (hasServerId()) { + result = result && (getServerId() + == other.getServerId()); + } + result = result && (hasServerenCode() == other.hasServerenCode()); + if (hasServerenCode()) { + result = result && getServerenCode() + .equals(other.getServerenCode()); + } + result = result && (hasExecuteTime() == other.hasExecuteTime()); + if (hasExecuteTime()) { + result = result && (getExecuteTime() + == other.getExecuteTime()); + } + result = result && (hasSourceType() == other.hasSourceType()); + if (hasSourceType()) { + result = result && sourceType_ == other.sourceType_; + } + result = result && (hasSchemaName() == other.hasSchemaName()); + if (hasSchemaName()) { + result = result && getSchemaName() + .equals(other.getSchemaName()); + } + result = result && (hasTableName() == other.hasTableName()); + if (hasTableName()) { + result = result && getTableName() + .equals(other.getTableName()); + } + result = result && (hasEventLength() == other.hasEventLength()); + if (hasEventLength()) { + result = result && (getEventLength() + == other.getEventLength()); + } + result = result && (hasEventType() == other.hasEventType()); + if (hasEventType()) { + result = result && eventType_ == other.eventType_; + } + result = result && getPropsList() + .equals(other.getPropsList()); + result = result && (hasGtid() == other.hasGtid()); + if (hasGtid()) { + result = result && getGtid() + .equals(other.getGtid()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; } - public static Header parseFrom( + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + } + if (hasLogfileName()) { + hash = (37 * hash) + LOGFILENAME_FIELD_NUMBER; + hash = (53 * hash) + getLogfileName().hashCode(); + } + if (hasLogfileOffset()) { + hash = (37 * hash) + LOGFILEOFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLogfileOffset()); + } + if (hasServerId()) { + hash = (37 * hash) + SERVERID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getServerId()); + } + if (hasServerenCode()) { + hash = (37 * hash) + SERVERENCODE_FIELD_NUMBER; + hash = (53 * hash) + getServerenCode().hashCode(); + } + if (hasExecuteTime()) { + hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExecuteTime()); + } + if (hasSourceType()) { + hash = (37 * hash) + SOURCETYPE_FIELD_NUMBER; + hash = (53 * hash) + sourceType_; + } + if (hasSchemaName()) { + hash = (37 * hash) + SCHEMANAME_FIELD_NUMBER; + hash = (53 * hash) + getSchemaName().hashCode(); + } + if (hasTableName()) { + hash = (37 * hash) + TABLENAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + } + if (hasEventLength()) { + hash = (37 * hash) + EVENTLENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getEventLength()); + } + if (hasEventType()) { + hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER; + hash = (53 * hash) + eventType_; + } + if (getPropsCount() > 0) { + hash = (37 * hash) + PROPS_FIELD_NUMBER; + hash = (53 * hash) + getPropsList().hashCode(); + } + if (hasGtid()) { + hash = (37 * hash) + GTID_FIELD_NUMBER; + hash = (53 * hash) + getGtid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Header parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Header parseFrom(byte[] data) + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Header parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Header parseFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static Header parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Header parseDelimitedFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); } - public static Header parseDelimitedFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static Header parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static Header parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Builder newBuilder() { return Builder.create(); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(Header prototype) { - return newBuilder().mergeFrom(prototype); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Header prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } - public Builder toBuilder() { return newBuilder(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Header} - * *
      **message Header*
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Header} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Header) - HeaderOrBuilder { + com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable .ensureFieldAccessorsInitialized( - Header.class, Builder.class); + com.alibaba.otter.canal.protocol.CanalEntry.Header.class, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder() @@ -2466,19 +2770,17 @@ public final class CanalEntry { } private Builder( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { getPropsFieldBuilder(); } } - private static Builder create() { - return new Builder(); - } - + @java.lang.Override public Builder clear() { super.clear(); version_ = 1; @@ -2493,7 +2795,7 @@ public final class CanalEntry { bitField0_ = (bitField0_ & ~0x00000010); executeTime_ = 0L; bitField0_ = (bitField0_ & ~0x00000020); - sourceType_ = Type.MYSQL; + sourceType_ = 2; bitField0_ = (bitField0_ & ~0x00000040); schemaName_ = ""; bitField0_ = (bitField0_ & ~0x00000080); @@ -2501,7 +2803,7 @@ public final class CanalEntry { bitField0_ = (bitField0_ & ~0x00000100); eventLength_ = 0L; bitField0_ = (bitField0_ & ~0x00000200); - eventType_ = EventType.UPDATE; + eventType_ = 2; bitField0_ = (bitField0_ & ~0x00000400); if (propsBuilder_ == null) { props_ = java.util.Collections.emptyList(); @@ -2514,29 +2816,29 @@ public final class CanalEntry { return this; } - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; } - public Header getDefaultInstanceForType() { - return Header.getDefaultInstance(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Header getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); } - public Header build() { - Header result = buildPartial(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Header build() { + com.alibaba.otter.canal.protocol.CanalEntry.Header result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Header buildPartial() { - Header result = new Header(this); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Header buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.Header result = new com.alibaba.otter.canal.protocol.CanalEntry.Header(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -2601,17 +2903,50 @@ public final class CanalEntry { return result; } + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Header) { - return mergeFrom((Header)other); + if (other instanceof com.alibaba.otter.canal.protocol.CanalEntry.Header) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.Header)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Header other) { - if (other == Header.getDefaultInstance()) return this; + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.Header other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance()) return this; if (other.hasVersion()) { setVersion(other.getVersion()); } @@ -2672,7 +3007,7 @@ public final class CanalEntry { props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000800); propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); @@ -2684,24 +3019,27 @@ public final class CanalEntry { gtid_ = other.gtid_; onChanged(); } - this.mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Header parsedMessage = null; + com.alibaba.otter.canal.protocol.CanalEntry.Header parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Header) e.getUnfinishedMessage(); - throw e; + parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.Header) e.getUnfinishedMessage(); + throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -2713,31 +3051,31 @@ public final class CanalEntry { private int version_ = 1; /** - * optional int32 version = 1 [default = 1]; - * *
        **协议的版本号*
        * 
+ * + * optional int32 version = 1 [default = 1]; */ public boolean hasVersion() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 version = 1 [default = 1]; - * *
        **协议的版本号*
        * 
+ * + * optional int32 version = 1 [default = 1]; */ public int getVersion() { return version_; } /** - * optional int32 version = 1 [default = 1]; - * *
        **协议的版本号*
        * 
+ * + * optional int32 version = 1 [default = 1]; */ public Builder setVersion(int value) { bitField0_ |= 0x00000001; @@ -2746,11 +3084,11 @@ public final class CanalEntry { return this; } /** - * optional int32 version = 1 [default = 1]; - * *
        **协议的版本号*
        * 
+ * + * optional int32 version = 1 [default = 1]; */ public Builder clearVersion() { bitField0_ = (bitField0_ & ~0x00000001); @@ -2759,52 +3097,52 @@ public final class CanalEntry { return this; } - private Object logfileName_ = ""; + private java.lang.Object logfileName_ = ""; /** - * optional string logfileName = 2; - * *
        **binlog/redolog 文件名*
        * 
+ * + * optional string logfileName = 2; */ public boolean hasLogfileName() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional string logfileName = 2; - * *
        **binlog/redolog 文件名*
        * 
+ * + * optional string logfileName = 2; */ - public String getLogfileName() { - Object ref = logfileName_; - if (!(ref instanceof String)) { + public java.lang.String getLogfileName() { + java.lang.Object ref = logfileName_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { logfileName_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string logfileName = 2; - * *
        **binlog/redolog 文件名*
        * 
+ * + * optional string logfileName = 2; */ public com.google.protobuf.ByteString getLogfileNameBytes() { - Object ref = logfileName_; + java.lang.Object ref = logfileName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); logfileName_ = b; return b; } else { @@ -2812,14 +3150,14 @@ public final class CanalEntry { } } /** - * optional string logfileName = 2; - * *
        **binlog/redolog 文件名*
        * 
+ * + * optional string logfileName = 2; */ public Builder setLogfileName( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -2829,11 +3167,11 @@ public final class CanalEntry { return this; } /** - * optional string logfileName = 2; - * *
        **binlog/redolog 文件名*
        * 
+ * + * optional string logfileName = 2; */ public Builder clearLogfileName() { bitField0_ = (bitField0_ & ~0x00000002); @@ -2842,11 +3180,11 @@ public final class CanalEntry { return this; } /** - * optional string logfileName = 2; - * *
        **binlog/redolog 文件名*
        * 
+ * + * optional string logfileName = 2; */ public Builder setLogfileNameBytes( com.google.protobuf.ByteString value) { @@ -2861,31 +3199,31 @@ public final class CanalEntry { private long logfileOffset_ ; /** - * optional int64 logfileOffset = 3; - * *
        **binlog/redolog 文件的偏移位置*
        * 
+ * + * optional int64 logfileOffset = 3; */ public boolean hasLogfileOffset() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional int64 logfileOffset = 3; - * *
        **binlog/redolog 文件的偏移位置*
        * 
+ * + * optional int64 logfileOffset = 3; */ public long getLogfileOffset() { return logfileOffset_; } /** - * optional int64 logfileOffset = 3; - * *
        **binlog/redolog 文件的偏移位置*
        * 
+ * + * optional int64 logfileOffset = 3; */ public Builder setLogfileOffset(long value) { bitField0_ |= 0x00000004; @@ -2894,11 +3232,11 @@ public final class CanalEntry { return this; } /** - * optional int64 logfileOffset = 3; - * *
        **binlog/redolog 文件的偏移位置*
        * 
+ * + * optional int64 logfileOffset = 3; */ public Builder clearLogfileOffset() { bitField0_ = (bitField0_ & ~0x00000004); @@ -2909,31 +3247,31 @@ public final class CanalEntry { private long serverId_ ; /** - * optional int64 serverId = 4; - * *
        **服务端serverId*
        * 
+ * + * optional int64 serverId = 4; */ public boolean hasServerId() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional int64 serverId = 4; - * *
        **服务端serverId*
        * 
+ * + * optional int64 serverId = 4; */ public long getServerId() { return serverId_; } /** - * optional int64 serverId = 4; - * *
        **服务端serverId*
        * 
+ * + * optional int64 serverId = 4; */ public Builder setServerId(long value) { bitField0_ |= 0x00000008; @@ -2942,11 +3280,11 @@ public final class CanalEntry { return this; } /** - * optional int64 serverId = 4; - * *
        **服务端serverId*
        * 
+ * + * optional int64 serverId = 4; */ public Builder clearServerId() { bitField0_ = (bitField0_ & ~0x00000008); @@ -2955,52 +3293,52 @@ public final class CanalEntry { return this; } - private Object serverenCode_ = ""; + private java.lang.Object serverenCode_ = ""; /** - * optional string serverenCode = 5; - * *
        ** 变更数据的编码 *
        * 
+ * + * optional string serverenCode = 5; */ public boolean hasServerenCode() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * optional string serverenCode = 5; - * *
        ** 变更数据的编码 *
        * 
+ * + * optional string serverenCode = 5; */ - public String getServerenCode() { - Object ref = serverenCode_; - if (!(ref instanceof String)) { + public java.lang.String getServerenCode() { + java.lang.Object ref = serverenCode_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { serverenCode_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string serverenCode = 5; - * *
        ** 变更数据的编码 *
        * 
+ * + * optional string serverenCode = 5; */ public com.google.protobuf.ByteString getServerenCodeBytes() { - Object ref = serverenCode_; + java.lang.Object ref = serverenCode_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); serverenCode_ = b; return b; } else { @@ -3008,14 +3346,14 @@ public final class CanalEntry { } } /** - * optional string serverenCode = 5; - * *
        ** 变更数据的编码 *
        * 
+ * + * optional string serverenCode = 5; */ public Builder setServerenCode( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -3025,11 +3363,11 @@ public final class CanalEntry { return this; } /** - * optional string serverenCode = 5; - * *
        ** 变更数据的编码 *
        * 
+ * + * optional string serverenCode = 5; */ public Builder clearServerenCode() { bitField0_ = (bitField0_ & ~0x00000010); @@ -3038,11 +3376,11 @@ public final class CanalEntry { return this; } /** - * optional string serverenCode = 5; - * *
        ** 变更数据的编码 *
        * 
+ * + * optional string serverenCode = 5; */ public Builder setServerenCodeBytes( com.google.protobuf.ByteString value) { @@ -3057,31 +3395,31 @@ public final class CanalEntry { private long executeTime_ ; /** - * optional int64 executeTime = 6; - * *
        **变更数据的执行时间 *
        * 
+ * + * optional int64 executeTime = 6; */ public boolean hasExecuteTime() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * optional int64 executeTime = 6; - * *
        **变更数据的执行时间 *
        * 
+ * + * optional int64 executeTime = 6; */ public long getExecuteTime() { return executeTime_; } /** - * optional int64 executeTime = 6; - * *
        **变更数据的执行时间 *
        * 
+ * + * optional int64 executeTime = 6; */ public Builder setExecuteTime(long value) { bitField0_ |= 0x00000020; @@ -3090,11 +3428,11 @@ public final class CanalEntry { return this; } /** - * optional int64 executeTime = 6; - * *
        **变更数据的执行时间 *
        * 
+ * + * optional int64 executeTime = 6; */ public Builder clearExecuteTime() { bitField0_ = (bitField0_ & ~0x00000020); @@ -3103,103 +3441,105 @@ public final class CanalEntry { return this; } - private Type sourceType_ = Type.MYSQL; + private int sourceType_ = 2; /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * *
        ** 变更数据的来源*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; */ public boolean hasSourceType() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * *
        ** 变更数据的来源*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; */ - public Type getSourceType() { - return sourceType_; + public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.Type result = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf(sourceType_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL : result; } /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * *
        ** 变更数据的来源*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; */ - public Builder setSourceType(Type value) { + public Builder setSourceType(com.alibaba.otter.canal.protocol.CanalEntry.Type value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000040; - sourceType_ = value; + sourceType_ = value.getNumber(); onChanged(); return this; } /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * *
        ** 变更数据的来源*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; */ public Builder clearSourceType() { bitField0_ = (bitField0_ & ~0x00000040); - sourceType_ = Type.MYSQL; + sourceType_ = 2; onChanged(); return this; } - private Object schemaName_ = ""; + private java.lang.Object schemaName_ = ""; /** - * optional string schemaName = 8; - * *
        ** 变更数据的schemaname*
        * 
+ * + * optional string schemaName = 8; */ public boolean hasSchemaName() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** - * optional string schemaName = 8; - * *
        ** 变更数据的schemaname*
        * 
+ * + * optional string schemaName = 8; */ - public String getSchemaName() { - Object ref = schemaName_; - if (!(ref instanceof String)) { + public java.lang.String getSchemaName() { + java.lang.Object ref = schemaName_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { schemaName_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string schemaName = 8; - * *
        ** 变更数据的schemaname*
        * 
+ * + * optional string schemaName = 8; */ public com.google.protobuf.ByteString getSchemaNameBytes() { - Object ref = schemaName_; + java.lang.Object ref = schemaName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); schemaName_ = b; return b; } else { @@ -3207,14 +3547,14 @@ public final class CanalEntry { } } /** - * optional string schemaName = 8; - * *
        ** 变更数据的schemaname*
        * 
+ * + * optional string schemaName = 8; */ public Builder setSchemaName( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -3224,11 +3564,11 @@ public final class CanalEntry { return this; } /** - * optional string schemaName = 8; - * *
        ** 变更数据的schemaname*
        * 
+ * + * optional string schemaName = 8; */ public Builder clearSchemaName() { bitField0_ = (bitField0_ & ~0x00000080); @@ -3237,11 +3577,11 @@ public final class CanalEntry { return this; } /** - * optional string schemaName = 8; - * *
        ** 变更数据的schemaname*
        * 
+ * + * optional string schemaName = 8; */ public Builder setSchemaNameBytes( com.google.protobuf.ByteString value) { @@ -3254,52 +3594,52 @@ public final class CanalEntry { return this; } - private Object tableName_ = ""; + private java.lang.Object tableName_ = ""; /** - * optional string tableName = 9; - * *
        **变更数据的tablename*
        * 
+ * + * optional string tableName = 9; */ public boolean hasTableName() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** - * optional string tableName = 9; - * *
        **变更数据的tablename*
        * 
+ * + * optional string tableName = 9; */ - public String getTableName() { - Object ref = tableName_; - if (!(ref instanceof String)) { + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { tableName_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string tableName = 9; - * *
        **变更数据的tablename*
        * 
+ * + * optional string tableName = 9; */ public com.google.protobuf.ByteString getTableNameBytes() { - Object ref = tableName_; + java.lang.Object ref = tableName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); tableName_ = b; return b; } else { @@ -3307,14 +3647,14 @@ public final class CanalEntry { } } /** - * optional string tableName = 9; - * *
        **变更数据的tablename*
        * 
+ * + * optional string tableName = 9; */ public Builder setTableName( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -3324,11 +3664,11 @@ public final class CanalEntry { return this; } /** - * optional string tableName = 9; - * *
        **变更数据的tablename*
        * 
+ * + * optional string tableName = 9; */ public Builder clearTableName() { bitField0_ = (bitField0_ & ~0x00000100); @@ -3337,11 +3677,11 @@ public final class CanalEntry { return this; } /** - * optional string tableName = 9; - * *
        **变更数据的tablename*
        * 
+ * + * optional string tableName = 9; */ public Builder setTableNameBytes( com.google.protobuf.ByteString value) { @@ -3356,31 +3696,31 @@ public final class CanalEntry { private long eventLength_ ; /** - * optional int64 eventLength = 10; - * *
        **每个event的长度*
        * 
+ * + * optional int64 eventLength = 10; */ public boolean hasEventLength() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** - * optional int64 eventLength = 10; - * *
        **每个event的长度*
        * 
+ * + * optional int64 eventLength = 10; */ public long getEventLength() { return eventLength_; } /** - * optional int64 eventLength = 10; - * *
        **每个event的长度*
        * 
+ * + * optional int64 eventLength = 10; */ public Builder setEventLength(long value) { bitField0_ |= 0x00000200; @@ -3389,11 +3729,11 @@ public final class CanalEntry { return this; } /** - * optional int64 eventLength = 10; - * *
        **每个event的长度*
        * 
+ * + * optional int64 eventLength = 10; */ public Builder clearEventLength() { bitField0_ = (bitField0_ & ~0x00000200); @@ -3402,77 +3742,79 @@ public final class CanalEntry { return this; } - private EventType eventType_ = EventType.UPDATE; + private int eventType_ = 2; /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * *
        **数据变更类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; */ public boolean hasEventType() { return ((bitField0_ & 0x00000400) == 0x00000400); } /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * *
        **数据变更类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; */ - public EventType getEventType() { - return eventType_; + public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(eventType_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE : result; } /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * *
        **数据变更类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; */ - public Builder setEventType(EventType value) { + public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000400; - eventType_ = value; + eventType_ = value.getNumber(); onChanged(); return this; } /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * *
        **数据变更类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; */ public Builder clearEventType() { bitField0_ = (bitField0_ & ~0x00000400); - eventType_ = EventType.UPDATE; + eventType_ = 2; onChanged(); return this; } - private java.util.List props_ = + private java.util.List props_ = java.util.Collections.emptyList(); private void ensurePropsIsMutable() { if (!((bitField0_ & 0x00000800) == 0x00000800)) { - props_ = new java.util.ArrayList(props_); + props_ = new java.util.ArrayList(props_); bitField0_ |= 0x00000800; } } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { if (propsBuilder_ == null) { return java.util.Collections.unmodifiableList(props_); } else { @@ -3480,11 +3822,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public int getPropsCount() { if (propsBuilder_ == null) { @@ -3494,13 +3836,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -3508,14 +3850,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public Builder setProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3529,14 +3871,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public Builder setProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -3547,13 +3889,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public Builder addProps(Pair value) { + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3567,14 +3909,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public Builder addProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3588,14 +3930,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public Builder addProps( - Pair.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -3606,14 +3948,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public Builder addProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -3624,14 +3966,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public Builder addAllProps( - Iterable values) { + java.lang.Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -3643,11 +3985,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public Builder clearProps() { if (propsBuilder_ == null) { @@ -3660,11 +4002,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ public Builder removeProps(int index) { if (propsBuilder_ == null) { @@ -3677,24 +4019,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public Pair.Builder getPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( int index) { return getPropsFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -3702,13 +4044,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { if (propsBuilder_ != null) { return propsBuilder_.getMessageOrBuilderList(); @@ -3717,45 +4059,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public Pair.Builder addPropsBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - Pair.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public Pair.Builder addPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, Pair.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public java.util.List + public java.util.List getPropsBuilderList() { return getPropsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( props_, ((bitField0_ & 0x00000800) == 0x00000800), getParentForChildren(), @@ -3765,52 +4107,52 @@ public final class CanalEntry { return propsBuilder_; } - private Object gtid_ = ""; + private java.lang.Object gtid_ = ""; /** - * optional string gtid = 13; - * *
        **当前事务的gitd*
        * 
+ * + * optional string gtid = 13; */ public boolean hasGtid() { return ((bitField0_ & 0x00001000) == 0x00001000); } /** - * optional string gtid = 13; - * *
        **当前事务的gitd*
        * 
+ * + * optional string gtid = 13; */ - public String getGtid() { - Object ref = gtid_; - if (!(ref instanceof String)) { + public java.lang.String getGtid() { + java.lang.Object ref = gtid_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { gtid_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string gtid = 13; - * *
        **当前事务的gitd*
        * 
+ * + * optional string gtid = 13; */ public com.google.protobuf.ByteString getGtidBytes() { - Object ref = gtid_; + java.lang.Object ref = gtid_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); gtid_ = b; return b; } else { @@ -3818,14 +4160,14 @@ public final class CanalEntry { } } /** - * optional string gtid = 13; - * *
        **当前事务的gitd*
        * 
+ * + * optional string gtid = 13; */ public Builder setGtid( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -3835,11 +4177,11 @@ public final class CanalEntry { return this; } /** - * optional string gtid = 13; - * *
        **当前事务的gitd*
        * 
+ * + * optional string gtid = 13; */ public Builder clearGtid() { bitField0_ = (bitField0_ & ~0x00001000); @@ -3848,11 +4190,11 @@ public final class CanalEntry { return this; } /** - * optional string gtid = 13; - * *
        **当前事务的gitd*
        * 
+ * + * optional string gtid = 13; */ public Builder setGtidBytes( com.google.protobuf.ByteString value) { @@ -3864,16 +4206,57 @@ public final class CanalEntry { onChanged(); return this; } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Header) } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Header) + private static final com.alibaba.otter.canal.protocol.CanalEntry.Header DEFAULT_INSTANCE; static { - defaultInstance = new Header(true); - defaultInstance.initFields(); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.Header(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Header parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Header(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Header getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Header) } public interface ColumnOrBuilder extends @@ -3881,266 +4264,271 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * optional int32 index = 1; - * *
      **字段下标*
      * 
+ * + * optional int32 index = 1; */ boolean hasIndex(); /** - * optional int32 index = 1; - * *
      **字段下标*
      * 
+ * + * optional int32 index = 1; */ int getIndex(); /** - * optional int32 sqlType = 2; - * *
      **字段java中类型*
      * 
+ * + * optional int32 sqlType = 2; */ boolean hasSqlType(); /** - * optional int32 sqlType = 2; - * *
      **字段java中类型*
      * 
+ * + * optional int32 sqlType = 2; */ int getSqlType(); /** - * optional string name = 3; - * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
+ * + * optional string name = 3; */ boolean hasName(); /** - * optional string name = 3; - * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
+ * + * optional string name = 3; */ - String getName(); + java.lang.String getName(); /** - * optional string name = 3; - * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
+ * + * optional string name = 3; */ com.google.protobuf.ByteString getNameBytes(); /** - * optional bool isKey = 4; - * *
      **是否是主键*
      * 
+ * + * optional bool isKey = 4; */ boolean hasIsKey(); /** - * optional bool isKey = 4; - * *
      **是否是主键*
      * 
+ * + * optional bool isKey = 4; */ boolean getIsKey(); /** - * optional bool updated = 5; - * *
      **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      * 
+ * + * optional bool updated = 5; */ boolean hasUpdated(); /** - * optional bool updated = 5; - * *
      **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      * 
+ * + * optional bool updated = 5; */ boolean getUpdated(); /** - * optional bool isNull = 6 [default = false]; - * *
      ** 标识是否为空  *
      * 
+ * + * optional bool isNull = 6 [default = false]; */ boolean hasIsNull(); /** - * optional bool isNull = 6 [default = false]; - * *
      ** 标识是否为空  *
      * 
+ * + * optional bool isNull = 6 [default = false]; */ boolean getIsNull(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - java.util.List + java.util.List getPropsList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - Pair getProps(int index); + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ int getPropsCount(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - java.util.List + java.util.List getPropsOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - PairOrBuilder getPropsOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + int index); /** - * optional string value = 8; - * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
+ * + * optional string value = 8; */ boolean hasValue(); /** - * optional string value = 8; - * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
+ * + * optional string value = 8; */ - String getValue(); + java.lang.String getValue(); /** - * optional string value = 8; - * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
+ * + * optional string value = 8; */ com.google.protobuf.ByteString getValueBytes(); /** - * optional int32 length = 9; - * *
      ** 对应数据对象原始长度 *
      * 
+ * + * optional int32 length = 9; */ boolean hasLength(); /** - * optional int32 length = 9; - * *
      ** 对应数据对象原始长度 *
      * 
+ * + * optional int32 length = 9; */ int getLength(); /** - * optional string mysqlType = 10; - * *
      **字段mysql类型*
      * 
+ * + * optional string mysqlType = 10; */ boolean hasMysqlType(); /** - * optional string mysqlType = 10; - * *
      **字段mysql类型*
      * 
+ * + * optional string mysqlType = 10; */ - String getMysqlType(); + java.lang.String getMysqlType(); /** - * optional string mysqlType = 10; - * *
      **字段mysql类型*
      * 
+ * + * optional string mysqlType = 10; */ com.google.protobuf.ByteString getMysqlTypeBytes(); } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Column} - * *
    **每个字段的数据结构*
    * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Column} */ - public static final class Column extends - com.google.protobuf.GeneratedMessage implements + public static final class Column extends + com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Column) ColumnOrBuilder { + private static final long serialVersionUID = 0L; // Use Column.newBuilder() to construct. - private Column(com.google.protobuf.GeneratedMessage.Builder builder) { + private Column(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); - this.unknownFields = builder.getUnknownFields(); } - private Column(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Column defaultInstance; - public static Column getDefaultInstance() { - return defaultInstance; + private Column() { + index_ = 0; + sqlType_ = 0; + name_ = ""; + isKey_ = false; + updated_ = false; + isNull_ = false; + props_ = java.util.Collections.emptyList(); + value_ = ""; + length_ = 0; + mysqlType_ = ""; } - public Column getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @Override + @java.lang.Override public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { + getUnknownFields() { return this.unknownFields; } private Column( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -4152,13 +4540,6 @@ public final class CanalEntry { case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 8: { bitField0_ |= 0x00000001; index_ = input.readInt32(); @@ -4192,10 +4573,11 @@ public final class CanalEntry { } case 58: { if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - props_ = new java.util.ArrayList(); + props_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000040; } - props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); + props_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); break; } case 66: { @@ -4215,13 +4597,20 @@ public final class CanalEntry { mysqlType_ = bs; break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); + e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -4232,50 +4621,36 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable .ensureFieldAccessorsInitialized( - Column.class, Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Column parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Column(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + com.alibaba.otter.canal.protocol.CanalEntry.Column.class, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder.class); } private int bitField0_; public static final int INDEX_FIELD_NUMBER = 1; private int index_; /** - * optional int32 index = 1; - * *
      **字段下标*
      * 
+ * + * optional int32 index = 1; */ public boolean hasIndex() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 index = 1; - * *
      **字段下标*
      * 
+ * + * optional int32 index = 1; */ public int getIndex() { return index_; @@ -4284,53 +4659,53 @@ public final class CanalEntry { public static final int SQLTYPE_FIELD_NUMBER = 2; private int sqlType_; /** - * optional int32 sqlType = 2; - * *
      **字段java中类型*
      * 
+ * + * optional int32 sqlType = 2; */ public boolean hasSqlType() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional int32 sqlType = 2; - * *
      **字段java中类型*
      * 
+ * + * optional int32 sqlType = 2; */ public int getSqlType() { return sqlType_; } public static final int NAME_FIELD_NUMBER = 3; - private Object name_; + private volatile java.lang.Object name_; /** - * optional string name = 3; - * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
+ * + * optional string name = 3; */ public boolean hasName() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional string name = 3; - * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
+ * + * optional string name = 3; */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { name_ = s; } @@ -4338,19 +4713,19 @@ public final class CanalEntry { } } /** - * optional string name = 3; - * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
+ * + * optional string name = 3; */ public com.google.protobuf.ByteString getNameBytes() { - Object ref = name_; - if (ref instanceof String) { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); name_ = b; return b; } else { @@ -4361,21 +4736,21 @@ public final class CanalEntry { public static final int ISKEY_FIELD_NUMBER = 4; private boolean isKey_; /** - * optional bool isKey = 4; - * *
      **是否是主键*
      * 
+ * + * optional bool isKey = 4; */ public boolean hasIsKey() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional bool isKey = 4; - * *
      **是否是主键*
      * 
+ * + * optional bool isKey = 4; */ public boolean getIsKey() { return isKey_; @@ -4384,21 +4759,21 @@ public final class CanalEntry { public static final int UPDATED_FIELD_NUMBER = 5; private boolean updated_; /** - * optional bool updated = 5; - * *
      **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      * 
+ * + * optional bool updated = 5; */ public boolean hasUpdated() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * optional bool updated = 5; - * *
      **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      * 
+ * + * optional bool updated = 5; */ public boolean getUpdated() { return updated_; @@ -4407,108 +4782,108 @@ public final class CanalEntry { public static final int ISNULL_FIELD_NUMBER = 6; private boolean isNull_; /** - * optional bool isNull = 6 [default = false]; - * *
      ** 标识是否为空  *
      * 
+ * + * optional bool isNull = 6 [default = false]; */ public boolean hasIsNull() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * optional bool isNull = 6 [default = false]; - * *
      ** 标识是否为空  *
      * 
+ * + * optional bool isNull = 6 [default = false]; */ public boolean getIsNull() { return isNull_; } public static final int PROPS_FIELD_NUMBER = 7; - private java.util.List props_; + private java.util.List props_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public int getPropsCount() { return props_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { return props_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } public static final int VALUE_FIELD_NUMBER = 8; - private Object value_; + private volatile java.lang.Object value_; /** - * optional string value = 8; - * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
+ * + * optional string value = 8; */ public boolean hasValue() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * optional string value = 8; - * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
+ * + * optional string value = 8; */ - public String getValue() { - Object ref = value_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { value_ = s; } @@ -4516,19 +4891,19 @@ public final class CanalEntry { } } /** - * optional string value = 8; - * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
+ * + * optional string value = 8; */ public com.google.protobuf.ByteString getValueBytes() { - Object ref = value_; - if (ref instanceof String) { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); value_ = b; return b; } else { @@ -4539,53 +4914,53 @@ public final class CanalEntry { public static final int LENGTH_FIELD_NUMBER = 9; private int length_; /** - * optional int32 length = 9; - * *
      ** 对应数据对象原始长度 *
      * 
+ * + * optional int32 length = 9; */ public boolean hasLength() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** - * optional int32 length = 9; - * *
      ** 对应数据对象原始长度 *
      * 
+ * + * optional int32 length = 9; */ public int getLength() { return length_; } public static final int MYSQLTYPE_FIELD_NUMBER = 10; - private Object mysqlType_; + private volatile java.lang.Object mysqlType_; /** - * optional string mysqlType = 10; - * *
      **字段mysql类型*
      * 
+ * + * optional string mysqlType = 10; */ public boolean hasMysqlType() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** - * optional string mysqlType = 10; - * *
      **字段mysql类型*
      * 
+ * + * optional string mysqlType = 10; */ - public String getMysqlType() { - Object ref = mysqlType_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getMysqlType() { + java.lang.Object ref = mysqlType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { mysqlType_ = s; } @@ -4593,19 +4968,19 @@ public final class CanalEntry { } } /** - * optional string mysqlType = 10; - * *
      **字段mysql类型*
      * 
+ * + * optional string mysqlType = 10; */ public com.google.protobuf.ByteString getMysqlTypeBytes() { - Object ref = mysqlType_; - if (ref instanceof String) { + java.lang.Object ref = mysqlType_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); mysqlType_ = b; return b; } else { @@ -4613,19 +4988,8 @@ public final class CanalEntry { } } - private void initFields() { - index_ = 0; - sqlType_ = 0; - name_ = ""; - isKey_ = false; - updated_ = false; - isNull_ = false; - props_ = java.util.Collections.emptyList(); - value_ = ""; - length_ = 0; - mysqlType_ = ""; - } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -4635,9 +4999,9 @@ public final class CanalEntry { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, index_); } @@ -4645,7 +5009,7 @@ public final class CanalEntry { output.writeInt32(2, sqlType_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getNameBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeBool(4, isKey_); @@ -4660,20 +5024,20 @@ public final class CanalEntry { output.writeMessage(7, props_.get(i)); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeBytes(8, getValueBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, value_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeInt32(9, length_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeBytes(10, getMysqlTypeBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, mysqlType_); } - getUnknownFields().writeTo(output); + unknownFields.writeTo(output); } - private int memoizedSerializedSize = -1; + @java.lang.Override public int getSerializedSize() { - int size = memoizedSerializedSize; + int size = memoizedSize; if (size != -1) return size; size = 0; @@ -4686,8 +5050,7 @@ public final class CanalEntry { .computeInt32Size(2, sqlType_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getNameBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream @@ -4706,116 +5069,249 @@ public final class CanalEntry { .computeMessageSize(7, props_.get(i)); } if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(8, getValueBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, value_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(9, length_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(10, getMysqlTypeBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, mysqlType_); } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; + size += unknownFields.getSerializedSize(); + memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalEntry.Column)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalEntry.Column other = (com.alibaba.otter.canal.protocol.CanalEntry.Column) obj; + + boolean result = true; + result = result && (hasIndex() == other.hasIndex()); + if (hasIndex()) { + result = result && (getIndex() + == other.getIndex()); + } + result = result && (hasSqlType() == other.hasSqlType()); + if (hasSqlType()) { + result = result && (getSqlType() + == other.getSqlType()); + } + result = result && (hasName() == other.hasName()); + if (hasName()) { + result = result && getName() + .equals(other.getName()); + } + result = result && (hasIsKey() == other.hasIsKey()); + if (hasIsKey()) { + result = result && (getIsKey() + == other.getIsKey()); + } + result = result && (hasUpdated() == other.hasUpdated()); + if (hasUpdated()) { + result = result && (getUpdated() + == other.getUpdated()); + } + result = result && (hasIsNull() == other.hasIsNull()); + if (hasIsNull()) { + result = result && (getIsNull() + == other.getIsNull()); + } + result = result && getPropsList() + .equals(other.getPropsList()); + result = result && (hasValue() == other.hasValue()); + if (hasValue()) { + result = result && getValue() + .equals(other.getValue()); + } + result = result && (hasLength() == other.hasLength()); + if (hasLength()) { + result = result && (getLength() + == other.getLength()); + } + result = result && (hasMysqlType() == other.hasMysqlType()); + if (hasMysqlType()) { + result = result && getMysqlType() + .equals(other.getMysqlType()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; } - public static Column parseFrom( + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasIndex()) { + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + } + if (hasSqlType()) { + hash = (37 * hash) + SQLTYPE_FIELD_NUMBER; + hash = (53 * hash) + getSqlType(); + } + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasIsKey()) { + hash = (37 * hash) + ISKEY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsKey()); + } + if (hasUpdated()) { + hash = (37 * hash) + UPDATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUpdated()); + } + if (hasIsNull()) { + hash = (37 * hash) + ISNULL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsNull()); + } + if (getPropsCount() > 0) { + hash = (37 * hash) + PROPS_FIELD_NUMBER; + hash = (53 * hash) + getPropsList().hashCode(); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + if (hasLength()) { + hash = (37 * hash) + LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getLength(); + } + if (hasMysqlType()) { + hash = (37 * hash) + MYSQLTYPE_FIELD_NUMBER; + hash = (53 * hash) + getMysqlType().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Column parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Column parseFrom(byte[] data) + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Column parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Column parseFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static Column parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Column parseDelimitedFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); } - public static Column parseDelimitedFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static Column parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static Column parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Builder newBuilder() { return Builder.create(); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(Column prototype) { - return newBuilder().mergeFrom(prototype); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Column prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } - public Builder toBuilder() { return newBuilder(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Column} - * *
      **每个字段的数据结构*
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Column} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Column) - ColumnOrBuilder { + com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable .ensureFieldAccessorsInitialized( - Column.class, Builder.class); + com.alibaba.otter.canal.protocol.CanalEntry.Column.class, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Column.newBuilder() @@ -4824,19 +5320,17 @@ public final class CanalEntry { } private Builder( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { getPropsFieldBuilder(); } } - private static Builder create() { - return new Builder(); - } - + @java.lang.Override public Builder clear() { super.clear(); index_ = 0; @@ -4866,29 +5360,29 @@ public final class CanalEntry { return this; } - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; } - public Column getDefaultInstanceForType() { - return Column.getDefaultInstance(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Column getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance(); } - public Column build() { - Column result = buildPartial(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Column build() { + com.alibaba.otter.canal.protocol.CanalEntry.Column result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Column buildPartial() { - Column result = new Column(this); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Column buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.Column result = new com.alibaba.otter.canal.protocol.CanalEntry.Column(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -4941,17 +5435,50 @@ public final class CanalEntry { return result; } + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Column) { - return mergeFrom((Column)other); + if (other instanceof com.alibaba.otter.canal.protocol.CanalEntry.Column) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.Column)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Column other) { - if (other == Column.getDefaultInstance()) return this; + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.Column other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()) return this; if (other.hasIndex()) { setIndex(other.getIndex()); } @@ -4991,7 +5518,7 @@ public final class CanalEntry { props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000040); propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); @@ -5011,24 +5538,27 @@ public final class CanalEntry { mysqlType_ = other.mysqlType_; onChanged(); } - this.mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Column parsedMessage = null; + com.alibaba.otter.canal.protocol.CanalEntry.Column parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Column) e.getUnfinishedMessage(); - throw e; + parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.Column) e.getUnfinishedMessage(); + throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -5040,31 +5570,31 @@ public final class CanalEntry { private int index_ ; /** - * optional int32 index = 1; - * *
        **字段下标*
        * 
+ * + * optional int32 index = 1; */ public boolean hasIndex() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 index = 1; - * *
        **字段下标*
        * 
+ * + * optional int32 index = 1; */ public int getIndex() { return index_; } /** - * optional int32 index = 1; - * *
        **字段下标*
        * 
+ * + * optional int32 index = 1; */ public Builder setIndex(int value) { bitField0_ |= 0x00000001; @@ -5073,11 +5603,11 @@ public final class CanalEntry { return this; } /** - * optional int32 index = 1; - * *
        **字段下标*
        * 
+ * + * optional int32 index = 1; */ public Builder clearIndex() { bitField0_ = (bitField0_ & ~0x00000001); @@ -5088,31 +5618,31 @@ public final class CanalEntry { private int sqlType_ ; /** - * optional int32 sqlType = 2; - * *
        **字段java中类型*
        * 
+ * + * optional int32 sqlType = 2; */ public boolean hasSqlType() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional int32 sqlType = 2; - * *
        **字段java中类型*
        * 
+ * + * optional int32 sqlType = 2; */ public int getSqlType() { return sqlType_; } /** - * optional int32 sqlType = 2; - * *
        **字段java中类型*
        * 
+ * + * optional int32 sqlType = 2; */ public Builder setSqlType(int value) { bitField0_ |= 0x00000002; @@ -5121,11 +5651,11 @@ public final class CanalEntry { return this; } /** - * optional int32 sqlType = 2; - * *
        **字段java中类型*
        * 
+ * + * optional int32 sqlType = 2; */ public Builder clearSqlType() { bitField0_ = (bitField0_ & ~0x00000002); @@ -5134,52 +5664,52 @@ public final class CanalEntry { return this; } - private Object name_ = ""; + private java.lang.Object name_ = ""; /** - * optional string name = 3; - * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
+ * + * optional string name = 3; */ public boolean hasName() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional string name = 3; - * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
+ * + * optional string name = 3; */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { name_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string name = 3; - * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
+ * + * optional string name = 3; */ public com.google.protobuf.ByteString getNameBytes() { - Object ref = name_; + java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); name_ = b; return b; } else { @@ -5187,14 +5717,14 @@ public final class CanalEntry { } } /** - * optional string name = 3; - * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
+ * + * optional string name = 3; */ public Builder setName( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -5204,11 +5734,11 @@ public final class CanalEntry { return this; } /** - * optional string name = 3; - * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
+ * + * optional string name = 3; */ public Builder clearName() { bitField0_ = (bitField0_ & ~0x00000004); @@ -5217,11 +5747,11 @@ public final class CanalEntry { return this; } /** - * optional string name = 3; - * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
+ * + * optional string name = 3; */ public Builder setNameBytes( com.google.protobuf.ByteString value) { @@ -5236,31 +5766,31 @@ public final class CanalEntry { private boolean isKey_ ; /** - * optional bool isKey = 4; - * *
        **是否是主键*
        * 
+ * + * optional bool isKey = 4; */ public boolean hasIsKey() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional bool isKey = 4; - * *
        **是否是主键*
        * 
+ * + * optional bool isKey = 4; */ public boolean getIsKey() { return isKey_; } /** - * optional bool isKey = 4; - * *
        **是否是主键*
        * 
+ * + * optional bool isKey = 4; */ public Builder setIsKey(boolean value) { bitField0_ |= 0x00000008; @@ -5269,11 +5799,11 @@ public final class CanalEntry { return this; } /** - * optional bool isKey = 4; - * *
        **是否是主键*
        * 
+ * + * optional bool isKey = 4; */ public Builder clearIsKey() { bitField0_ = (bitField0_ & ~0x00000008); @@ -5284,31 +5814,31 @@ public final class CanalEntry { private boolean updated_ ; /** - * optional bool updated = 5; - * *
        **如果EventType=UPDATE,用于标识这个字段值是否有修改*
        * 
+ * + * optional bool updated = 5; */ public boolean hasUpdated() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * optional bool updated = 5; - * *
        **如果EventType=UPDATE,用于标识这个字段值是否有修改*
        * 
+ * + * optional bool updated = 5; */ public boolean getUpdated() { return updated_; } /** - * optional bool updated = 5; - * *
        **如果EventType=UPDATE,用于标识这个字段值是否有修改*
        * 
+ * + * optional bool updated = 5; */ public Builder setUpdated(boolean value) { bitField0_ |= 0x00000010; @@ -5317,11 +5847,11 @@ public final class CanalEntry { return this; } /** - * optional bool updated = 5; - * *
        **如果EventType=UPDATE,用于标识这个字段值是否有修改*
        * 
+ * + * optional bool updated = 5; */ public Builder clearUpdated() { bitField0_ = (bitField0_ & ~0x00000010); @@ -5332,31 +5862,31 @@ public final class CanalEntry { private boolean isNull_ ; /** - * optional bool isNull = 6 [default = false]; - * *
        ** 标识是否为空  *
        * 
+ * + * optional bool isNull = 6 [default = false]; */ public boolean hasIsNull() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * optional bool isNull = 6 [default = false]; - * *
        ** 标识是否为空  *
        * 
+ * + * optional bool isNull = 6 [default = false]; */ public boolean getIsNull() { return isNull_; } /** - * optional bool isNull = 6 [default = false]; - * *
        ** 标识是否为空  *
        * 
+ * + * optional bool isNull = 6 [default = false]; */ public Builder setIsNull(boolean value) { bitField0_ |= 0x00000020; @@ -5365,11 +5895,11 @@ public final class CanalEntry { return this; } /** - * optional bool isNull = 6 [default = false]; - * *
        ** 标识是否为空  *
        * 
+ * + * optional bool isNull = 6 [default = false]; */ public Builder clearIsNull() { bitField0_ = (bitField0_ & ~0x00000020); @@ -5378,26 +5908,26 @@ public final class CanalEntry { return this; } - private java.util.List props_ = + private java.util.List props_ = java.util.Collections.emptyList(); private void ensurePropsIsMutable() { if (!((bitField0_ & 0x00000040) == 0x00000040)) { - props_ = new java.util.ArrayList(props_); + props_ = new java.util.ArrayList(props_); bitField0_ |= 0x00000040; } } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { if (propsBuilder_ == null) { return java.util.Collections.unmodifiableList(props_); } else { @@ -5405,11 +5935,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public int getPropsCount() { if (propsBuilder_ == null) { @@ -5419,13 +5949,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -5433,14 +5963,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public Builder setProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5454,14 +5984,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public Builder setProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -5472,13 +6002,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public Builder addProps(Pair value) { + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5492,14 +6022,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public Builder addProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5513,14 +6043,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public Builder addProps( - Pair.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -5531,14 +6061,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public Builder addProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -5549,14 +6079,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public Builder addAllProps( - Iterable values) { + java.lang.Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -5568,11 +6098,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public Builder clearProps() { if (propsBuilder_ == null) { @@ -5585,11 +6115,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ public Builder removeProps(int index) { if (propsBuilder_ == null) { @@ -5602,24 +6132,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public Pair.Builder getPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( int index) { return getPropsFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -5627,13 +6157,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { if (propsBuilder_ != null) { return propsBuilder_.getMessageOrBuilderList(); @@ -5642,45 +6172,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public Pair.Builder addPropsBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - Pair.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public Pair.Builder addPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, Pair.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public java.util.List + public java.util.List getPropsBuilderList() { return getPropsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( props_, ((bitField0_ & 0x00000040) == 0x00000040), getParentForChildren(), @@ -5690,52 +6220,52 @@ public final class CanalEntry { return propsBuilder_; } - private Object value_ = ""; + private java.lang.Object value_ = ""; /** - * optional string value = 8; - * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
+ * + * optional string value = 8; */ public boolean hasValue() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** - * optional string value = 8; - * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
+ * + * optional string value = 8; */ - public String getValue() { - Object ref = value_; - if (!(ref instanceof String)) { + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { value_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string value = 8; - * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
+ * + * optional string value = 8; */ public com.google.protobuf.ByteString getValueBytes() { - Object ref = value_; + java.lang.Object ref = value_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); value_ = b; return b; } else { @@ -5743,14 +6273,14 @@ public final class CanalEntry { } } /** - * optional string value = 8; - * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
+ * + * optional string value = 8; */ public Builder setValue( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -5760,11 +6290,11 @@ public final class CanalEntry { return this; } /** - * optional string value = 8; - * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
+ * + * optional string value = 8; */ public Builder clearValue() { bitField0_ = (bitField0_ & ~0x00000080); @@ -5773,11 +6303,11 @@ public final class CanalEntry { return this; } /** - * optional string value = 8; - * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
+ * + * optional string value = 8; */ public Builder setValueBytes( com.google.protobuf.ByteString value) { @@ -5792,31 +6322,31 @@ public final class CanalEntry { private int length_ ; /** - * optional int32 length = 9; - * *
        ** 对应数据对象原始长度 *
        * 
+ * + * optional int32 length = 9; */ public boolean hasLength() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** - * optional int32 length = 9; - * *
        ** 对应数据对象原始长度 *
        * 
+ * + * optional int32 length = 9; */ public int getLength() { return length_; } /** - * optional int32 length = 9; - * *
        ** 对应数据对象原始长度 *
        * 
+ * + * optional int32 length = 9; */ public Builder setLength(int value) { bitField0_ |= 0x00000100; @@ -5825,11 +6355,11 @@ public final class CanalEntry { return this; } /** - * optional int32 length = 9; - * *
        ** 对应数据对象原始长度 *
        * 
+ * + * optional int32 length = 9; */ public Builder clearLength() { bitField0_ = (bitField0_ & ~0x00000100); @@ -5838,52 +6368,52 @@ public final class CanalEntry { return this; } - private Object mysqlType_ = ""; + private java.lang.Object mysqlType_ = ""; /** - * optional string mysqlType = 10; - * *
        **字段mysql类型*
        * 
+ * + * optional string mysqlType = 10; */ public boolean hasMysqlType() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** - * optional string mysqlType = 10; - * *
        **字段mysql类型*
        * 
+ * + * optional string mysqlType = 10; */ - public String getMysqlType() { - Object ref = mysqlType_; - if (!(ref instanceof String)) { + public java.lang.String getMysqlType() { + java.lang.Object ref = mysqlType_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { mysqlType_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string mysqlType = 10; - * *
        **字段mysql类型*
        * 
+ * + * optional string mysqlType = 10; */ public com.google.protobuf.ByteString getMysqlTypeBytes() { - Object ref = mysqlType_; + java.lang.Object ref = mysqlType_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); mysqlType_ = b; return b; } else { @@ -5891,14 +6421,14 @@ public final class CanalEntry { } } /** - * optional string mysqlType = 10; - * *
        **字段mysql类型*
        * 
+ * + * optional string mysqlType = 10; */ public Builder setMysqlType( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -5908,11 +6438,11 @@ public final class CanalEntry { return this; } /** - * optional string mysqlType = 10; - * *
        **字段mysql类型*
        * 
+ * + * optional string mysqlType = 10; */ public Builder clearMysqlType() { bitField0_ = (bitField0_ & ~0x00000200); @@ -5921,11 +6451,11 @@ public final class CanalEntry { return this; } /** - * optional string mysqlType = 10; - * *
        **字段mysql类型*
        * 
+ * + * optional string mysqlType = 10; */ public Builder setMysqlTypeBytes( com.google.protobuf.ByteString value) { @@ -5937,16 +6467,57 @@ public final class CanalEntry { onChanged(); return this; } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Column) } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Column) + private static final com.alibaba.otter.canal.protocol.CanalEntry.Column DEFAULT_INSTANCE; static { - defaultInstance = new Column(true); - defaultInstance.initFields(); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.Column(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Column parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Column(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Column getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Column) } public interface RowDataOrBuilder extends @@ -5954,168 +6525,168 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - java.util.List + java.util.List getBeforeColumnsList(); /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - Column getBeforeColumns(int index); + com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index); /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ int getBeforeColumnsCount(); /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - java.util.List + java.util.List getBeforeColumnsOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - ColumnOrBuilder getBeforeColumnsOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( + int index); /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - java.util.List + java.util.List getAfterColumnsList(); /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - Column getAfterColumns(int index); + com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index); /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ int getAfterColumnsCount(); /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - java.util.List + java.util.List getAfterColumnsOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - ColumnOrBuilder getAfterColumnsOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( + int index); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - java.util.List + java.util.List getPropsList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - Pair getProps(int index); + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ int getPropsCount(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - java.util.List + java.util.List getPropsOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - PairOrBuilder getPropsOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + int index); } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.RowData} */ - public static final class RowData extends - com.google.protobuf.GeneratedMessage implements + public static final class RowData extends + com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.RowData) RowDataOrBuilder { + private static final long serialVersionUID = 0L; // Use RowData.newBuilder() to construct. - private RowData(com.google.protobuf.GeneratedMessage.Builder builder) { + private RowData(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); - this.unknownFields = builder.getUnknownFields(); } - private RowData(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final RowData defaultInstance; - public static RowData getDefaultInstance() { - return defaultInstance; + private RowData() { + beforeColumns_ = java.util.Collections.emptyList(); + afterColumns_ = java.util.Collections.emptyList(); + props_ = java.util.Collections.emptyList(); } - public RowData getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @Override + @java.lang.Override public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { + getUnknownFields() { return this.unknownFields; } private RowData( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -6127,35 +6698,38 @@ public final class CanalEntry { case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - beforeColumns_ = new java.util.ArrayList(); + beforeColumns_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - beforeColumns_.add(input.readMessage(Column.PARSER, extensionRegistry)); + beforeColumns_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.PARSER, extensionRegistry)); break; } case 18: { if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - afterColumns_ = new java.util.ArrayList(); + afterColumns_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000002; } - afterColumns_.add(input.readMessage(Column.PARSER, extensionRegistry)); + afterColumns_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.PARSER, extensionRegistry)); break; } case 26: { if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(); + props_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } - props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); + props_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } break; } } @@ -6164,7 +6738,7 @@ public final class CanalEntry { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); + e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { beforeColumns_ = java.util.Collections.unmodifiableList(beforeColumns_); @@ -6181,202 +6755,184 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable .ensureFieldAccessorsInitialized( - RowData.class, Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public RowData parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RowData(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + com.alibaba.otter.canal.protocol.CanalEntry.RowData.class, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder.class); } public static final int BEFORECOLUMNS_FIELD_NUMBER = 1; - private java.util.List beforeColumns_; + private java.util.List beforeColumns_; /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public java.util.List getBeforeColumnsList() { + public java.util.List getBeforeColumnsList() { return beforeColumns_; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public java.util.List + public java.util.List getBeforeColumnsOrBuilderList() { return beforeColumns_; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public int getBeforeColumnsCount() { return beforeColumns_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public Column getBeforeColumns(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index) { return beforeColumns_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
      ** 字段信息,增量数据(修改前,删除前) *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public ColumnOrBuilder getBeforeColumnsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( int index) { return beforeColumns_.get(index); } public static final int AFTERCOLUMNS_FIELD_NUMBER = 2; - private java.util.List afterColumns_; + private java.util.List afterColumns_; /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public java.util.List getAfterColumnsList() { + public java.util.List getAfterColumnsList() { return afterColumns_; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public java.util.List + public java.util.List getAfterColumnsOrBuilderList() { return afterColumns_; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public int getAfterColumnsCount() { return afterColumns_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public Column getAfterColumns(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index) { return afterColumns_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
      ** 字段信息,增量数据(修改后,新增后)  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public ColumnOrBuilder getAfterColumnsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( int index) { return afterColumns_.get(index); } public static final int PROPS_FIELD_NUMBER = 3; - private java.util.List props_; + private java.util.List props_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public int getPropsCount() { return props_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { return props_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } - private void initFields() { - beforeColumns_ = java.util.Collections.emptyList(); - afterColumns_ = java.util.Collections.emptyList(); - props_ = java.util.Collections.emptyList(); - } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -6386,9 +6942,9 @@ public final class CanalEntry { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); for (int i = 0; i < beforeColumns_.size(); i++) { output.writeMessage(1, beforeColumns_.get(i)); } @@ -6398,12 +6954,12 @@ public final class CanalEntry { for (int i = 0; i < props_.size(); i++) { output.writeMessage(3, props_.get(i)); } - getUnknownFields().writeTo(output); + unknownFields.writeTo(output); } - private int memoizedSerializedSize = -1; + @java.lang.Override public int getSerializedSize() { - int size = memoizedSerializedSize; + int size = memoizedSize; if (size != -1) return size; size = 0; @@ -6419,81 +6975,143 @@ public final class CanalEntry { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, props_.get(i)); } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; + size += unknownFields.getSerializedSize(); + memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalEntry.RowData)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalEntry.RowData other = (com.alibaba.otter.canal.protocol.CanalEntry.RowData) obj; + + boolean result = true; + result = result && getBeforeColumnsList() + .equals(other.getBeforeColumnsList()); + result = result && getAfterColumnsList() + .equals(other.getAfterColumnsList()); + result = result && getPropsList() + .equals(other.getPropsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; } - public static RowData parseFrom( + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBeforeColumnsCount() > 0) { + hash = (37 * hash) + BEFORECOLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getBeforeColumnsList().hashCode(); + } + if (getAfterColumnsCount() > 0) { + hash = (37 * hash) + AFTERCOLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getAfterColumnsList().hashCode(); + } + if (getPropsCount() > 0) { + hash = (37 * hash) + PROPS_FIELD_NUMBER; + hash = (53 * hash) + getPropsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static RowData parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static RowData parseFrom(byte[] data) + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static RowData parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static RowData parseFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static RowData parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static RowData parseDelimitedFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); } - public static RowData parseDelimitedFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static RowData parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static RowData parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Builder newBuilder() { return Builder.create(); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(RowData prototype) { - return newBuilder().mergeFrom(prototype); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.RowData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } - public Builder toBuilder() { return newBuilder(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -6501,19 +7119,20 @@ public final class CanalEntry { * Protobuf type {@code com.alibaba.otter.canal.protocol.RowData} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.RowData) - RowDataOrBuilder { + com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable .ensureFieldAccessorsInitialized( - RowData.class, Builder.class); + com.alibaba.otter.canal.protocol.CanalEntry.RowData.class, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.RowData.newBuilder() @@ -6522,21 +7141,19 @@ public final class CanalEntry { } private Builder( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { getBeforeColumnsFieldBuilder(); getAfterColumnsFieldBuilder(); getPropsFieldBuilder(); } } - private static Builder create() { - return new Builder(); - } - + @java.lang.Override public Builder clear() { super.clear(); if (beforeColumnsBuilder_ == null) { @@ -6560,29 +7177,29 @@ public final class CanalEntry { return this; } - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; } - public RowData getDefaultInstanceForType() { - return RowData.getDefaultInstance(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.RowData getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance(); } - public RowData build() { - RowData result = buildPartial(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.RowData build() { + com.alibaba.otter.canal.protocol.CanalEntry.RowData result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public RowData buildPartial() { - RowData result = new RowData(this); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.RowData buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.RowData result = new com.alibaba.otter.canal.protocol.CanalEntry.RowData(this); int from_bitField0_ = bitField0_; if (beforeColumnsBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -6615,17 +7232,50 @@ public final class CanalEntry { return result; } + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof RowData) { - return mergeFrom((RowData)other); + if (other instanceof com.alibaba.otter.canal.protocol.CanalEntry.RowData) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.RowData)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(RowData other) { - if (other == RowData.getDefaultInstance()) return this; + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.RowData other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()) return this; if (beforeColumnsBuilder_ == null) { if (!other.beforeColumns_.isEmpty()) { if (beforeColumns_.isEmpty()) { @@ -6645,7 +7295,7 @@ public final class CanalEntry { beforeColumns_ = other.beforeColumns_; bitField0_ = (bitField0_ & ~0x00000001); beforeColumnsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getBeforeColumnsFieldBuilder() : null; } else { beforeColumnsBuilder_.addAllMessages(other.beforeColumns_); @@ -6671,7 +7321,7 @@ public final class CanalEntry { afterColumns_ = other.afterColumns_; bitField0_ = (bitField0_ & ~0x00000002); afterColumnsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getAfterColumnsFieldBuilder() : null; } else { afterColumnsBuilder_.addAllMessages(other.afterColumns_); @@ -6697,31 +7347,34 @@ public final class CanalEntry { props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000004); propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); } } } - this.mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - RowData parsedMessage = null; + com.alibaba.otter.canal.protocol.CanalEntry.RowData parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (RowData) e.getUnfinishedMessage(); - throw e; + parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.RowData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -6731,26 +7384,26 @@ public final class CanalEntry { } private int bitField0_; - private java.util.List beforeColumns_ = + private java.util.List beforeColumns_ = java.util.Collections.emptyList(); private void ensureBeforeColumnsIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { - beforeColumns_ = new java.util.ArrayList(beforeColumns_); + beforeColumns_ = new java.util.ArrayList(beforeColumns_); bitField0_ |= 0x00000001; } } - private com.google.protobuf.RepeatedFieldBuilder< - Column, Column.Builder, ColumnOrBuilder> beforeColumnsBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> beforeColumnsBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public java.util.List getBeforeColumnsList() { + public java.util.List getBeforeColumnsList() { if (beforeColumnsBuilder_ == null) { return java.util.Collections.unmodifiableList(beforeColumns_); } else { @@ -6758,11 +7411,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public int getBeforeColumnsCount() { if (beforeColumnsBuilder_ == null) { @@ -6772,13 +7425,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public Column getBeforeColumns(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index) { if (beforeColumnsBuilder_ == null) { return beforeColumns_.get(index); } else { @@ -6786,14 +7439,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public Builder setBeforeColumns( - int index, Column value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { if (beforeColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6807,14 +7460,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public Builder setBeforeColumns( - int index, Column.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { if (beforeColumnsBuilder_ == null) { ensureBeforeColumnsIsMutable(); beforeColumns_.set(index, builderForValue.build()); @@ -6825,13 +7478,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public Builder addBeforeColumns(Column value) { + public Builder addBeforeColumns(com.alibaba.otter.canal.protocol.CanalEntry.Column value) { if (beforeColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6845,14 +7498,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public Builder addBeforeColumns( - int index, Column value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { if (beforeColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -6866,14 +7519,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public Builder addBeforeColumns( - Column.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { if (beforeColumnsBuilder_ == null) { ensureBeforeColumnsIsMutable(); beforeColumns_.add(builderForValue.build()); @@ -6884,14 +7537,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public Builder addBeforeColumns( - int index, Column.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { if (beforeColumnsBuilder_ == null) { ensureBeforeColumnsIsMutable(); beforeColumns_.add(index, builderForValue.build()); @@ -6902,14 +7555,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public Builder addAllBeforeColumns( - Iterable values) { + java.lang.Iterable values) { if (beforeColumnsBuilder_ == null) { ensureBeforeColumnsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -6921,11 +7574,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public Builder clearBeforeColumns() { if (beforeColumnsBuilder_ == null) { @@ -6938,11 +7591,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ public Builder removeBeforeColumns(int index) { if (beforeColumnsBuilder_ == null) { @@ -6955,24 +7608,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public Column.Builder getBeforeColumnsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder getBeforeColumnsBuilder( int index) { return getBeforeColumnsFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public ColumnOrBuilder getBeforeColumnsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( int index) { if (beforeColumnsBuilder_ == null) { return beforeColumns_.get(index); } else { @@ -6980,13 +7633,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public java.util.List + public java.util.List getBeforeColumnsOrBuilderList() { if (beforeColumnsBuilder_ != null) { return beforeColumnsBuilder_.getMessageOrBuilderList(); @@ -6995,45 +7648,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public Column.Builder addBeforeColumnsBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addBeforeColumnsBuilder() { return getBeforeColumnsFieldBuilder().addBuilder( - Column.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public Column.Builder addBeforeColumnsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addBeforeColumnsBuilder( int index) { return getBeforeColumnsFieldBuilder().addBuilder( - index, Column.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public java.util.List + public java.util.List getBeforeColumnsBuilderList() { return getBeforeColumnsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - Column, Column.Builder, ColumnOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> getBeforeColumnsFieldBuilder() { if (beforeColumnsBuilder_ == null) { - beforeColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - Column, Column.Builder, ColumnOrBuilder>( + beforeColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder>( beforeColumns_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), @@ -7043,26 +7696,26 @@ public final class CanalEntry { return beforeColumnsBuilder_; } - private java.util.List afterColumns_ = + private java.util.List afterColumns_ = java.util.Collections.emptyList(); private void ensureAfterColumnsIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { - afterColumns_ = new java.util.ArrayList(afterColumns_); + afterColumns_ = new java.util.ArrayList(afterColumns_); bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilder< - Column, Column.Builder, ColumnOrBuilder> afterColumnsBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> afterColumnsBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public java.util.List getAfterColumnsList() { + public java.util.List getAfterColumnsList() { if (afterColumnsBuilder_ == null) { return java.util.Collections.unmodifiableList(afterColumns_); } else { @@ -7070,11 +7723,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public int getAfterColumnsCount() { if (afterColumnsBuilder_ == null) { @@ -7084,13 +7737,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public Column getAfterColumns(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index) { if (afterColumnsBuilder_ == null) { return afterColumns_.get(index); } else { @@ -7098,14 +7751,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public Builder setAfterColumns( - int index, Column value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { if (afterColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7119,14 +7772,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public Builder setAfterColumns( - int index, Column.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { if (afterColumnsBuilder_ == null) { ensureAfterColumnsIsMutable(); afterColumns_.set(index, builderForValue.build()); @@ -7137,13 +7790,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public Builder addAfterColumns(Column value) { + public Builder addAfterColumns(com.alibaba.otter.canal.protocol.CanalEntry.Column value) { if (afterColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7157,14 +7810,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public Builder addAfterColumns( - int index, Column value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { if (afterColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7178,14 +7831,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public Builder addAfterColumns( - Column.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { if (afterColumnsBuilder_ == null) { ensureAfterColumnsIsMutable(); afterColumns_.add(builderForValue.build()); @@ -7196,14 +7849,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public Builder addAfterColumns( - int index, Column.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { if (afterColumnsBuilder_ == null) { ensureAfterColumnsIsMutable(); afterColumns_.add(index, builderForValue.build()); @@ -7214,14 +7867,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public Builder addAllAfterColumns( - Iterable values) { + java.lang.Iterable values) { if (afterColumnsBuilder_ == null) { ensureAfterColumnsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -7233,11 +7886,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public Builder clearAfterColumns() { if (afterColumnsBuilder_ == null) { @@ -7250,11 +7903,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ public Builder removeAfterColumns(int index) { if (afterColumnsBuilder_ == null) { @@ -7267,24 +7920,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public Column.Builder getAfterColumnsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder getAfterColumnsBuilder( int index) { return getAfterColumnsFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public ColumnOrBuilder getAfterColumnsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( int index) { if (afterColumnsBuilder_ == null) { return afterColumns_.get(index); } else { @@ -7292,13 +7945,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public java.util.List + public java.util.List getAfterColumnsOrBuilderList() { if (afterColumnsBuilder_ != null) { return afterColumnsBuilder_.getMessageOrBuilderList(); @@ -7307,45 +7960,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public Column.Builder addAfterColumnsBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addAfterColumnsBuilder() { return getAfterColumnsFieldBuilder().addBuilder( - Column.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public Column.Builder addAfterColumnsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addAfterColumnsBuilder( int index) { return getAfterColumnsFieldBuilder().addBuilder( - index, Column.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public java.util.List + public java.util.List getAfterColumnsBuilderList() { return getAfterColumnsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - Column, Column.Builder, ColumnOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> getAfterColumnsFieldBuilder() { if (afterColumnsBuilder_ == null) { - afterColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - Column, Column.Builder, ColumnOrBuilder>( + afterColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder>( afterColumns_, ((bitField0_ & 0x00000002) == 0x00000002), getParentForChildren(), @@ -7355,26 +8008,26 @@ public final class CanalEntry { return afterColumnsBuilder_; } - private java.util.List props_ = + private java.util.List props_ = java.util.Collections.emptyList(); private void ensurePropsIsMutable() { if (!((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(props_); + props_ = new java.util.ArrayList(props_); bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { if (propsBuilder_ == null) { return java.util.Collections.unmodifiableList(props_); } else { @@ -7382,11 +8035,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public int getPropsCount() { if (propsBuilder_ == null) { @@ -7396,13 +8049,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -7410,14 +8063,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder setProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7431,14 +8084,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder setProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -7449,13 +8102,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Builder addProps(Pair value) { + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7469,14 +8122,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7490,14 +8143,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - Pair.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -7508,14 +8161,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -7526,14 +8179,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addAllProps( - Iterable values) { + java.lang.Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -7545,11 +8198,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder clearProps() { if (propsBuilder_ == null) { @@ -7562,11 +8215,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder removeProps(int index) { if (propsBuilder_ == null) { @@ -7579,24 +8232,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder getPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( int index) { return getPropsFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -7604,13 +8257,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { if (propsBuilder_ != null) { return propsBuilder_.getMessageOrBuilderList(); @@ -7619,45 +8272,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder addPropsBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - Pair.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder addPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, Pair.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsBuilderList() { return getPropsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( props_, ((bitField0_ & 0x00000004) == 0x00000004), getParentForChildren(), @@ -7666,16 +8319,57 @@ public final class CanalEntry { } return propsBuilder_; } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.RowData) } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowData) + private static final com.alibaba.otter.canal.protocol.CanalEntry.RowData DEFAULT_INSTANCE; static { - defaultInstance = new RowData(true); - defaultInstance.initFields(); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.RowData(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RowData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RowData(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.RowData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowData) } public interface RowChangeOrBuilder extends @@ -7683,232 +8377,235 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * optional int64 tableId = 1; - * *
      **tableId,由数据库产生*
      * 
+ * + * optional int64 tableId = 1; */ boolean hasTableId(); /** - * optional int64 tableId = 1; - * *
      **tableId,由数据库产生*
      * 
+ * + * optional int64 tableId = 1; */ long getTableId(); /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * *
      **数据变更类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; */ boolean hasEventType(); /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * *
      **数据变更类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; */ - EventType getEventType(); + com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); /** - * optional bool isDdl = 10 [default = false]; - * *
      ** 标识是否是ddl语句  *
      * 
+ * + * optional bool isDdl = 10 [default = false]; */ boolean hasIsDdl(); /** - * optional bool isDdl = 10 [default = false]; - * *
      ** 标识是否是ddl语句  *
      * 
+ * + * optional bool isDdl = 10 [default = false]; */ boolean getIsDdl(); /** - * optional string sql = 11; - * *
      ** ddl/query的sql语句  *
      * 
+ * + * optional string sql = 11; */ boolean hasSql(); /** - * optional string sql = 11; - * *
      ** ddl/query的sql语句  *
      * 
+ * + * optional string sql = 11; */ - String getSql(); + java.lang.String getSql(); /** - * optional string sql = 11; - * *
      ** ddl/query的sql语句  *
      * 
+ * + * optional string sql = 11; */ com.google.protobuf.ByteString getSqlBytes(); /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - java.util.List + java.util.List getRowDatasList(); /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - RowData getRowDatas(int index); + com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index); /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ int getRowDatasCount(); /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - java.util.List + java.util.List getRowDatasOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - RowDataOrBuilder getRowDatasOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( + int index); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - java.util.List + java.util.List getPropsList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - Pair getProps(int index); + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ int getPropsCount(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - java.util.List + java.util.List getPropsOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - PairOrBuilder getPropsOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + int index); /** - * optional string ddlSchemaName = 14; - * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
+ * + * optional string ddlSchemaName = 14; */ boolean hasDdlSchemaName(); /** - * optional string ddlSchemaName = 14; - * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
+ * + * optional string ddlSchemaName = 14; */ - String getDdlSchemaName(); + java.lang.String getDdlSchemaName(); /** - * optional string ddlSchemaName = 14; - * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
+ * + * optional string ddlSchemaName = 14; */ com.google.protobuf.ByteString getDdlSchemaNameBytes(); } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.RowChange} - * *
    **message row 每行变更数据的数据结构*
    * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.RowChange} */ - public static final class RowChange extends - com.google.protobuf.GeneratedMessage implements + public static final class RowChange extends + com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.RowChange) RowChangeOrBuilder { + private static final long serialVersionUID = 0L; // Use RowChange.newBuilder() to construct. - private RowChange(com.google.protobuf.GeneratedMessage.Builder builder) { + private RowChange(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); - this.unknownFields = builder.getUnknownFields(); } - private RowChange(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final RowChange defaultInstance; - public static RowChange getDefaultInstance() { - return defaultInstance; + private RowChange() { + tableId_ = 0L; + eventType_ = 2; + isDdl_ = false; + sql_ = ""; + rowDatas_ = java.util.Collections.emptyList(); + props_ = java.util.Collections.emptyList(); + ddlSchemaName_ = ""; } - public RowChange getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @Override + @java.lang.Override public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { + getUnknownFields() { return this.unknownFields; } private RowChange( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -7920,13 +8617,6 @@ public final class CanalEntry { case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 8: { bitField0_ |= 0x00000001; tableId_ = input.readInt64(); @@ -7934,12 +8624,13 @@ public final class CanalEntry { } case 16: { int rawValue = input.readEnum(); - EventType value = EventType.valueOf(rawValue); + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType value = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(2, rawValue); } else { bitField0_ |= 0x00000002; - eventType_ = value; + eventType_ = rawValue; } break; } @@ -7956,18 +8647,20 @@ public final class CanalEntry { } case 98: { if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - rowDatas_ = new java.util.ArrayList(); + rowDatas_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000010; } - rowDatas_.add(input.readMessage(RowData.PARSER, extensionRegistry)); + rowDatas_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.RowData.PARSER, extensionRegistry)); break; } case 106: { if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - props_ = new java.util.ArrayList(); + props_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000020; } - props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); + props_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); break; } case 114: { @@ -7976,13 +8669,20 @@ public final class CanalEntry { ddlSchemaName_ = bs; break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); + e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { rowDatas_ = java.util.Collections.unmodifiableList(rowDatas_); @@ -7996,128 +8696,116 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable .ensureFieldAccessorsInitialized( - RowChange.class, Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public RowChange parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RowChange(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + com.alibaba.otter.canal.protocol.CanalEntry.RowChange.class, com.alibaba.otter.canal.protocol.CanalEntry.RowChange.Builder.class); } private int bitField0_; public static final int TABLEID_FIELD_NUMBER = 1; private long tableId_; /** - * optional int64 tableId = 1; - * *
      **tableId,由数据库产生*
      * 
+ * + * optional int64 tableId = 1; */ public boolean hasTableId() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int64 tableId = 1; - * *
      **tableId,由数据库产生*
      * 
+ * + * optional int64 tableId = 1; */ public long getTableId() { return tableId_; } public static final int EVENTTYPE_FIELD_NUMBER = 2; - private EventType eventType_; + private int eventType_; /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * *
      **数据变更类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; */ public boolean hasEventType() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * *
      **数据变更类型*
      * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; */ - public EventType getEventType() { - return eventType_; + public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(eventType_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE : result; } public static final int ISDDL_FIELD_NUMBER = 10; private boolean isDdl_; /** - * optional bool isDdl = 10 [default = false]; - * *
      ** 标识是否是ddl语句  *
      * 
+ * + * optional bool isDdl = 10 [default = false]; */ public boolean hasIsDdl() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional bool isDdl = 10 [default = false]; - * *
      ** 标识是否是ddl语句  *
      * 
+ * + * optional bool isDdl = 10 [default = false]; */ public boolean getIsDdl() { return isDdl_; } public static final int SQL_FIELD_NUMBER = 11; - private Object sql_; + private volatile java.lang.Object sql_; /** - * optional string sql = 11; - * *
      ** ddl/query的sql语句  *
      * 
+ * + * optional string sql = 11; */ public boolean hasSql() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional string sql = 11; - * *
      ** ddl/query的sql语句  *
      * 
+ * + * optional string sql = 11; */ - public String getSql() { - Object ref = sql_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getSql() { + java.lang.Object ref = sql_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { sql_ = s; } @@ -8125,19 +8813,19 @@ public final class CanalEntry { } } /** - * optional string sql = 11; - * *
      ** ddl/query的sql语句  *
      * 
+ * + * optional string sql = 11; */ public com.google.protobuf.ByteString getSqlBytes() { - Object ref = sql_; - if (ref instanceof String) { + java.lang.Object ref = sql_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); sql_ = b; return b; } else { @@ -8146,142 +8834,142 @@ public final class CanalEntry { } public static final int ROWDATAS_FIELD_NUMBER = 12; - private java.util.List rowDatas_; + private java.util.List rowDatas_; /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public java.util.List getRowDatasList() { + public java.util.List getRowDatasList() { return rowDatas_; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public java.util.List + public java.util.List getRowDatasOrBuilderList() { return rowDatas_; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public int getRowDatasCount() { return rowDatas_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public RowData getRowDatas(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index) { return rowDatas_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
      ** 一次数据库变更可能存在多行  *
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public RowDataOrBuilder getRowDatasOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( int index) { return rowDatas_.get(index); } public static final int PROPS_FIELD_NUMBER = 13; - private java.util.List props_; + private java.util.List props_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public int getPropsCount() { return props_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { return props_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } public static final int DDLSCHEMANAME_FIELD_NUMBER = 14; - private Object ddlSchemaName_; + private volatile java.lang.Object ddlSchemaName_; /** - * optional string ddlSchemaName = 14; - * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
+ * + * optional string ddlSchemaName = 14; */ public boolean hasDdlSchemaName() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** - * optional string ddlSchemaName = 14; - * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
+ * + * optional string ddlSchemaName = 14; */ - public String getDdlSchemaName() { - Object ref = ddlSchemaName_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getDdlSchemaName() { + java.lang.Object ref = ddlSchemaName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { ddlSchemaName_ = s; } @@ -8289,19 +8977,19 @@ public final class CanalEntry { } } /** - * optional string ddlSchemaName = 14; - * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
+ * + * optional string ddlSchemaName = 14; */ public com.google.protobuf.ByteString getDdlSchemaNameBytes() { - Object ref = ddlSchemaName_; - if (ref instanceof String) { + java.lang.Object ref = ddlSchemaName_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); ddlSchemaName_ = b; return b; } else { @@ -8309,16 +8997,8 @@ public final class CanalEntry { } } - private void initFields() { - tableId_ = 0L; - eventType_ = EventType.UPDATE; - isDdl_ = false; - sql_ = ""; - rowDatas_ = java.util.Collections.emptyList(); - props_ = java.util.Collections.emptyList(); - ddlSchemaName_ = ""; - } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -8328,20 +9008,20 @@ public final class CanalEntry { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, tableId_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, eventType_.getNumber()); + output.writeEnum(2, eventType_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBool(10, isDdl_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(11, getSqlBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, sql_); } for (int i = 0; i < rowDatas_.size(); i++) { output.writeMessage(12, rowDatas_.get(i)); @@ -8350,14 +9030,14 @@ public final class CanalEntry { output.writeMessage(13, props_.get(i)); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(14, getDdlSchemaNameBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, ddlSchemaName_); } - getUnknownFields().writeTo(output); + unknownFields.writeTo(output); } - private int memoizedSerializedSize = -1; + @java.lang.Override public int getSerializedSize() { - int size = memoizedSerializedSize; + int size = memoizedSize; if (size != -1) return size; size = 0; @@ -8367,15 +9047,14 @@ public final class CanalEntry { } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, eventType_.getNumber()); + .computeEnumSize(2, eventType_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(10, isDdl_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(11, getSqlBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, sql_); } for (int i = 0; i < rowDatas_.size(); i++) { size += com.google.protobuf.CodedOutputStream @@ -8386,108 +9065,210 @@ public final class CanalEntry { .computeMessageSize(13, props_.get(i)); } if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(14, getDdlSchemaNameBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, ddlSchemaName_); } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; + size += unknownFields.getSerializedSize(); + memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalEntry.RowChange)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalEntry.RowChange other = (com.alibaba.otter.canal.protocol.CanalEntry.RowChange) obj; + + boolean result = true; + result = result && (hasTableId() == other.hasTableId()); + if (hasTableId()) { + result = result && (getTableId() + == other.getTableId()); + } + result = result && (hasEventType() == other.hasEventType()); + if (hasEventType()) { + result = result && eventType_ == other.eventType_; + } + result = result && (hasIsDdl() == other.hasIsDdl()); + if (hasIsDdl()) { + result = result && (getIsDdl() + == other.getIsDdl()); + } + result = result && (hasSql() == other.hasSql()); + if (hasSql()) { + result = result && getSql() + .equals(other.getSql()); + } + result = result && getRowDatasList() + .equals(other.getRowDatasList()); + result = result && getPropsList() + .equals(other.getPropsList()); + result = result && (hasDdlSchemaName() == other.hasDdlSchemaName()); + if (hasDdlSchemaName()) { + result = result && getDdlSchemaName() + .equals(other.getDdlSchemaName()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; } - public static RowChange parseFrom( + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTableId()) { + hash = (37 * hash) + TABLEID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTableId()); + } + if (hasEventType()) { + hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER; + hash = (53 * hash) + eventType_; + } + if (hasIsDdl()) { + hash = (37 * hash) + ISDDL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsDdl()); + } + if (hasSql()) { + hash = (37 * hash) + SQL_FIELD_NUMBER; + hash = (53 * hash) + getSql().hashCode(); + } + if (getRowDatasCount() > 0) { + hash = (37 * hash) + ROWDATAS_FIELD_NUMBER; + hash = (53 * hash) + getRowDatasList().hashCode(); + } + if (getPropsCount() > 0) { + hash = (37 * hash) + PROPS_FIELD_NUMBER; + hash = (53 * hash) + getPropsList().hashCode(); + } + if (hasDdlSchemaName()) { + hash = (37 * hash) + DDLSCHEMANAME_FIELD_NUMBER; + hash = (53 * hash) + getDdlSchemaName().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static RowChange parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static RowChange parseFrom(byte[] data) + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static RowChange parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static RowChange parseFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static RowChange parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static RowChange parseDelimitedFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); } - public static RowChange parseDelimitedFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static RowChange parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static RowChange parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Builder newBuilder() { return Builder.create(); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(RowChange prototype) { - return newBuilder().mergeFrom(prototype); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.RowChange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } - public Builder toBuilder() { return newBuilder(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.RowChange} - * *
      **message row 每行变更数据的数据结构*
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.RowChange} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.RowChange) - RowChangeOrBuilder { + com.alibaba.otter.canal.protocol.CanalEntry.RowChangeOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable .ensureFieldAccessorsInitialized( - RowChange.class, Builder.class); + com.alibaba.otter.canal.protocol.CanalEntry.RowChange.class, com.alibaba.otter.canal.protocol.CanalEntry.RowChange.Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.RowChange.newBuilder() @@ -8496,25 +9277,23 @@ public final class CanalEntry { } private Builder( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { getRowDatasFieldBuilder(); getPropsFieldBuilder(); } } - private static Builder create() { - return new Builder(); - } - + @java.lang.Override public Builder clear() { super.clear(); tableId_ = 0L; bitField0_ = (bitField0_ & ~0x00000001); - eventType_ = EventType.UPDATE; + eventType_ = 2; bitField0_ = (bitField0_ & ~0x00000002); isDdl_ = false; bitField0_ = (bitField0_ & ~0x00000004); @@ -8537,29 +9316,29 @@ public final class CanalEntry { return this; } - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; } - public RowChange getDefaultInstanceForType() { - return RowChange.getDefaultInstance(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.RowChange.getDefaultInstance(); } - public RowChange build() { - RowChange result = buildPartial(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange build() { + com.alibaba.otter.canal.protocol.CanalEntry.RowChange result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public RowChange buildPartial() { - RowChange result = new RowChange(this); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.RowChange result = new com.alibaba.otter.canal.protocol.CanalEntry.RowChange(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -8605,17 +9384,50 @@ public final class CanalEntry { return result; } + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof RowChange) { - return mergeFrom((RowChange)other); + if (other instanceof com.alibaba.otter.canal.protocol.CanalEntry.RowChange) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.RowChange)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(RowChange other) { - if (other == RowChange.getDefaultInstance()) return this; + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.RowChange other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.RowChange.getDefaultInstance()) return this; if (other.hasTableId()) { setTableId(other.getTableId()); } @@ -8649,7 +9461,7 @@ public final class CanalEntry { rowDatas_ = other.rowDatas_; bitField0_ = (bitField0_ & ~0x00000010); rowDatasBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRowDatasFieldBuilder() : null; } else { rowDatasBuilder_.addAllMessages(other.rowDatas_); @@ -8675,7 +9487,7 @@ public final class CanalEntry { props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000020); propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); @@ -8687,24 +9499,27 @@ public final class CanalEntry { ddlSchemaName_ = other.ddlSchemaName_; onChanged(); } - this.mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - RowChange parsedMessage = null; + com.alibaba.otter.canal.protocol.CanalEntry.RowChange parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (RowChange) e.getUnfinishedMessage(); - throw e; + parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.RowChange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -8716,31 +9531,31 @@ public final class CanalEntry { private long tableId_ ; /** - * optional int64 tableId = 1; - * *
        **tableId,由数据库产生*
        * 
+ * + * optional int64 tableId = 1; */ public boolean hasTableId() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int64 tableId = 1; - * *
        **tableId,由数据库产生*
        * 
+ * + * optional int64 tableId = 1; */ public long getTableId() { return tableId_; } /** - * optional int64 tableId = 1; - * *
        **tableId,由数据库产生*
        * 
+ * + * optional int64 tableId = 1; */ public Builder setTableId(long value) { bitField0_ |= 0x00000001; @@ -8749,11 +9564,11 @@ public final class CanalEntry { return this; } /** - * optional int64 tableId = 1; - * *
        **tableId,由数据库产生*
        * 
+ * + * optional int64 tableId = 1; */ public Builder clearTableId() { bitField0_ = (bitField0_ & ~0x00000001); @@ -8762,84 +9577,86 @@ public final class CanalEntry { return this; } - private EventType eventType_ = EventType.UPDATE; + private int eventType_ = 2; /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * *
        **数据变更类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; */ public boolean hasEventType() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * *
        **数据变更类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; */ - public EventType getEventType() { - return eventType_; + public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(eventType_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE : result; } /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * *
        **数据变更类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; */ - public Builder setEventType(EventType value) { + public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; - eventType_ = value; + eventType_ = value.getNumber(); onChanged(); return this; } /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * *
        **数据变更类型*
        * 
+ * + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; */ public Builder clearEventType() { bitField0_ = (bitField0_ & ~0x00000002); - eventType_ = EventType.UPDATE; + eventType_ = 2; onChanged(); return this; } private boolean isDdl_ ; /** - * optional bool isDdl = 10 [default = false]; - * *
        ** 标识是否是ddl语句  *
        * 
+ * + * optional bool isDdl = 10 [default = false]; */ public boolean hasIsDdl() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional bool isDdl = 10 [default = false]; - * *
        ** 标识是否是ddl语句  *
        * 
+ * + * optional bool isDdl = 10 [default = false]; */ public boolean getIsDdl() { return isDdl_; } /** - * optional bool isDdl = 10 [default = false]; - * *
        ** 标识是否是ddl语句  *
        * 
+ * + * optional bool isDdl = 10 [default = false]; */ public Builder setIsDdl(boolean value) { bitField0_ |= 0x00000004; @@ -8848,11 +9665,11 @@ public final class CanalEntry { return this; } /** - * optional bool isDdl = 10 [default = false]; - * *
        ** 标识是否是ddl语句  *
        * 
+ * + * optional bool isDdl = 10 [default = false]; */ public Builder clearIsDdl() { bitField0_ = (bitField0_ & ~0x00000004); @@ -8861,52 +9678,52 @@ public final class CanalEntry { return this; } - private Object sql_ = ""; + private java.lang.Object sql_ = ""; /** - * optional string sql = 11; - * *
        ** ddl/query的sql语句  *
        * 
+ * + * optional string sql = 11; */ public boolean hasSql() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional string sql = 11; - * *
        ** ddl/query的sql语句  *
        * 
+ * + * optional string sql = 11; */ - public String getSql() { - Object ref = sql_; - if (!(ref instanceof String)) { + public java.lang.String getSql() { + java.lang.Object ref = sql_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { sql_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string sql = 11; - * *
        ** ddl/query的sql语句  *
        * 
+ * + * optional string sql = 11; */ public com.google.protobuf.ByteString getSqlBytes() { - Object ref = sql_; + java.lang.Object ref = sql_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); sql_ = b; return b; } else { @@ -8914,14 +9731,14 @@ public final class CanalEntry { } } /** - * optional string sql = 11; - * *
        ** ddl/query的sql语句  *
        * 
+ * + * optional string sql = 11; */ public Builder setSql( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -8931,11 +9748,11 @@ public final class CanalEntry { return this; } /** - * optional string sql = 11; - * *
        ** ddl/query的sql语句  *
        * 
+ * + * optional string sql = 11; */ public Builder clearSql() { bitField0_ = (bitField0_ & ~0x00000008); @@ -8944,11 +9761,11 @@ public final class CanalEntry { return this; } /** - * optional string sql = 11; - * *
        ** ddl/query的sql语句  *
        * 
+ * + * optional string sql = 11; */ public Builder setSqlBytes( com.google.protobuf.ByteString value) { @@ -8961,26 +9778,26 @@ public final class CanalEntry { return this; } - private java.util.List rowDatas_ = + private java.util.List rowDatas_ = java.util.Collections.emptyList(); private void ensureRowDatasIsMutable() { if (!((bitField0_ & 0x00000010) == 0x00000010)) { - rowDatas_ = new java.util.ArrayList(rowDatas_); + rowDatas_ = new java.util.ArrayList(rowDatas_); bitField0_ |= 0x00000010; } } - private com.google.protobuf.RepeatedFieldBuilder< - RowData, RowData.Builder, RowDataOrBuilder> rowDatasBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.RowData, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder, com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder> rowDatasBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public java.util.List getRowDatasList() { + public java.util.List getRowDatasList() { if (rowDatasBuilder_ == null) { return java.util.Collections.unmodifiableList(rowDatas_); } else { @@ -8988,11 +9805,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public int getRowDatasCount() { if (rowDatasBuilder_ == null) { @@ -9002,13 +9819,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public RowData getRowDatas(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index) { if (rowDatasBuilder_ == null) { return rowDatas_.get(index); } else { @@ -9016,14 +9833,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public Builder setRowDatas( - int index, RowData value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { if (rowDatasBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9037,14 +9854,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public Builder setRowDatas( - int index, RowData.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { if (rowDatasBuilder_ == null) { ensureRowDatasIsMutable(); rowDatas_.set(index, builderForValue.build()); @@ -9055,13 +9872,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public Builder addRowDatas(RowData value) { + public Builder addRowDatas(com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { if (rowDatasBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9075,14 +9892,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public Builder addRowDatas( - int index, RowData value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { if (rowDatasBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9096,14 +9913,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public Builder addRowDatas( - RowData.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { if (rowDatasBuilder_ == null) { ensureRowDatasIsMutable(); rowDatas_.add(builderForValue.build()); @@ -9114,14 +9931,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public Builder addRowDatas( - int index, RowData.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { if (rowDatasBuilder_ == null) { ensureRowDatasIsMutable(); rowDatas_.add(index, builderForValue.build()); @@ -9132,14 +9949,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public Builder addAllRowDatas( - Iterable values) { + java.lang.Iterable values) { if (rowDatasBuilder_ == null) { ensureRowDatasIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -9151,11 +9968,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public Builder clearRowDatas() { if (rowDatasBuilder_ == null) { @@ -9168,11 +9985,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ public Builder removeRowDatas(int index) { if (rowDatasBuilder_ == null) { @@ -9185,24 +10002,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public RowData.Builder getRowDatasBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder getRowDatasBuilder( int index) { return getRowDatasFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public RowDataOrBuilder getRowDatasOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( int index) { if (rowDatasBuilder_ == null) { return rowDatas_.get(index); } else { @@ -9210,13 +10027,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public java.util.List + public java.util.List getRowDatasOrBuilderList() { if (rowDatasBuilder_ != null) { return rowDatasBuilder_.getMessageOrBuilderList(); @@ -9225,45 +10042,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public RowData.Builder addRowDatasBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder addRowDatasBuilder() { return getRowDatasFieldBuilder().addBuilder( - RowData.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public RowData.Builder addRowDatasBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder addRowDatasBuilder( int index) { return getRowDatasFieldBuilder().addBuilder( - index, RowData.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * *
        ** 一次数据库变更可能存在多行  *
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public java.util.List + public java.util.List getRowDatasBuilderList() { return getRowDatasFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - RowData, RowData.Builder, RowDataOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.RowData, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder, com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder> getRowDatasFieldBuilder() { if (rowDatasBuilder_ == null) { - rowDatasBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - RowData, RowData.Builder, RowDataOrBuilder>( + rowDatasBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.RowData, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder, com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder>( rowDatas_, ((bitField0_ & 0x00000010) == 0x00000010), getParentForChildren(), @@ -9273,26 +10090,26 @@ public final class CanalEntry { return rowDatasBuilder_; } - private java.util.List props_ = + private java.util.List props_ = java.util.Collections.emptyList(); private void ensurePropsIsMutable() { if (!((bitField0_ & 0x00000020) == 0x00000020)) { - props_ = new java.util.ArrayList(props_); + props_ = new java.util.ArrayList(props_); bitField0_ |= 0x00000020; } } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { if (propsBuilder_ == null) { return java.util.Collections.unmodifiableList(props_); } else { @@ -9300,11 +10117,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public int getPropsCount() { if (propsBuilder_ == null) { @@ -9314,13 +10131,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -9328,14 +10145,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public Builder setProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9349,14 +10166,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public Builder setProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -9367,13 +10184,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public Builder addProps(Pair value) { + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9387,14 +10204,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public Builder addProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9408,14 +10225,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public Builder addProps( - Pair.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -9426,14 +10243,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public Builder addProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -9444,14 +10261,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public Builder addAllProps( - Iterable values) { + java.lang.Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -9463,11 +10280,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public Builder clearProps() { if (propsBuilder_ == null) { @@ -9480,11 +10297,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ public Builder removeProps(int index) { if (propsBuilder_ == null) { @@ -9497,24 +10314,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public Pair.Builder getPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( int index) { return getPropsFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -9522,13 +10339,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { if (propsBuilder_ != null) { return propsBuilder_.getMessageOrBuilderList(); @@ -9537,45 +10354,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public Pair.Builder addPropsBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - Pair.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public Pair.Builder addPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, Pair.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public java.util.List + public java.util.List getPropsBuilderList() { return getPropsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( props_, ((bitField0_ & 0x00000020) == 0x00000020), getParentForChildren(), @@ -9585,52 +10402,52 @@ public final class CanalEntry { return propsBuilder_; } - private Object ddlSchemaName_ = ""; + private java.lang.Object ddlSchemaName_ = ""; /** - * optional string ddlSchemaName = 14; - * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
+ * + * optional string ddlSchemaName = 14; */ public boolean hasDdlSchemaName() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * optional string ddlSchemaName = 14; - * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
+ * + * optional string ddlSchemaName = 14; */ - public String getDdlSchemaName() { - Object ref = ddlSchemaName_; - if (!(ref instanceof String)) { + public java.lang.String getDdlSchemaName() { + java.lang.Object ref = ddlSchemaName_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { ddlSchemaName_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string ddlSchemaName = 14; - * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
+ * + * optional string ddlSchemaName = 14; */ public com.google.protobuf.ByteString getDdlSchemaNameBytes() { - Object ref = ddlSchemaName_; + java.lang.Object ref = ddlSchemaName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); ddlSchemaName_ = b; return b; } else { @@ -9638,14 +10455,14 @@ public final class CanalEntry { } } /** - * optional string ddlSchemaName = 14; - * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
+ * + * optional string ddlSchemaName = 14; */ public Builder setDdlSchemaName( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -9655,11 +10472,11 @@ public final class CanalEntry { return this; } /** - * optional string ddlSchemaName = 14; - * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
+ * + * optional string ddlSchemaName = 14; */ public Builder clearDdlSchemaName() { bitField0_ = (bitField0_ & ~0x00000040); @@ -9668,11 +10485,11 @@ public final class CanalEntry { return this; } /** - * optional string ddlSchemaName = 14; - * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
+ * + * optional string ddlSchemaName = 14; */ public Builder setDdlSchemaNameBytes( com.google.protobuf.ByteString value) { @@ -9684,16 +10501,57 @@ public final class CanalEntry { onChanged(); return this; } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.RowChange) } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowChange) + private static final com.alibaba.otter.canal.protocol.CanalEntry.RowChange DEFAULT_INSTANCE; static { - defaultInstance = new RowChange(true); - defaultInstance.initFields(); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.RowChange(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RowChange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RowChange(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowChange) } public interface TransactionBeginOrBuilder extends @@ -9701,146 +10559,145 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * optional int64 executeTime = 1; - * *
      **已废弃,请使用header里的executeTime*
      * 
+ * + * optional int64 executeTime = 1; */ boolean hasExecuteTime(); /** - * optional int64 executeTime = 1; - * *
      **已废弃,请使用header里的executeTime*
      * 
+ * + * optional int64 executeTime = 1; */ long getExecuteTime(); /** - * optional string transactionId = 2; - * *
      **已废弃,Begin里不提供事务id*
      * 
+ * + * optional string transactionId = 2; */ boolean hasTransactionId(); /** - * optional string transactionId = 2; - * *
      **已废弃,Begin里不提供事务id*
      * 
+ * + * optional string transactionId = 2; */ - String getTransactionId(); + java.lang.String getTransactionId(); /** - * optional string transactionId = 2; - * *
      **已废弃,Begin里不提供事务id*
      * 
+ * + * optional string transactionId = 2; */ com.google.protobuf.ByteString getTransactionIdBytes(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - java.util.List + java.util.List getPropsList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - Pair getProps(int index); + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ int getPropsCount(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - java.util.List + java.util.List getPropsOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - PairOrBuilder getPropsOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + int index); /** - * optional int64 threadId = 4; - * *
      **执行的thread Id*
      * 
+ * + * optional int64 threadId = 4; */ boolean hasThreadId(); /** - * optional int64 threadId = 4; - * *
      **执行的thread Id*
      * 
+ * + * optional int64 threadId = 4; */ long getThreadId(); } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionBegin} - * *
    **开始事务的一些信息*
    * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionBegin} */ - public static final class TransactionBegin extends - com.google.protobuf.GeneratedMessage implements + public static final class TransactionBegin extends + com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.TransactionBegin) TransactionBeginOrBuilder { + private static final long serialVersionUID = 0L; // Use TransactionBegin.newBuilder() to construct. - private TransactionBegin(com.google.protobuf.GeneratedMessage.Builder builder) { + private TransactionBegin(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); - this.unknownFields = builder.getUnknownFields(); } - private TransactionBegin(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final TransactionBegin defaultInstance; - public static TransactionBegin getDefaultInstance() { - return defaultInstance; + private TransactionBegin() { + executeTime_ = 0L; + transactionId_ = ""; + props_ = java.util.Collections.emptyList(); + threadId_ = 0L; } - public TransactionBegin getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @Override + @java.lang.Override public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { + getUnknownFields() { return this.unknownFields; } private TransactionBegin( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -9852,13 +10709,6 @@ public final class CanalEntry { case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 8: { bitField0_ |= 0x00000001; executeTime_ = input.readInt64(); @@ -9872,10 +10722,11 @@ public final class CanalEntry { } case 26: { if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(); + props_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } - props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); + props_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); break; } case 32: { @@ -9883,13 +10734,20 @@ public final class CanalEntry { threadId_ = input.readInt64(); break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); + e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -9900,82 +10758,68 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable .ensureFieldAccessorsInitialized( - TransactionBegin.class, Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public TransactionBegin parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TransactionBegin(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.class, com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.Builder.class); } private int bitField0_; public static final int EXECUTETIME_FIELD_NUMBER = 1; private long executeTime_; /** - * optional int64 executeTime = 1; - * *
      **已废弃,请使用header里的executeTime*
      * 
+ * + * optional int64 executeTime = 1; */ public boolean hasExecuteTime() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int64 executeTime = 1; - * *
      **已废弃,请使用header里的executeTime*
      * 
+ * + * optional int64 executeTime = 1; */ public long getExecuteTime() { return executeTime_; } public static final int TRANSACTIONID_FIELD_NUMBER = 2; - private Object transactionId_; + private volatile java.lang.Object transactionId_; /** - * optional string transactionId = 2; - * *
      **已废弃,Begin里不提供事务id*
      * 
+ * + * optional string transactionId = 2; */ public boolean hasTransactionId() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional string transactionId = 2; - * *
      **已废弃,Begin里不提供事务id*
      * 
+ * + * optional string transactionId = 2; */ - public String getTransactionId() { - Object ref = transactionId_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { transactionId_ = s; } @@ -9983,19 +10827,19 @@ public final class CanalEntry { } } /** - * optional string transactionId = 2; - * *
      **已废弃,Begin里不提供事务id*
      * 
+ * + * optional string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { - Object ref = transactionId_; - if (ref instanceof String) { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); transactionId_ = b; return b; } else { @@ -10004,56 +10848,56 @@ public final class CanalEntry { } public static final int PROPS_FIELD_NUMBER = 3; - private java.util.List props_; + private java.util.List props_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public int getPropsCount() { return props_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { return props_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } @@ -10061,33 +10905,28 @@ public final class CanalEntry { public static final int THREADID_FIELD_NUMBER = 4; private long threadId_; /** - * optional int64 threadId = 4; - * *
      **执行的thread Id*
      * 
+ * + * optional int64 threadId = 4; */ public boolean hasThreadId() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional int64 threadId = 4; - * *
      **执行的thread Id*
      * 
+ * + * optional int64 threadId = 4; */ public long getThreadId() { return threadId_; } - private void initFields() { - executeTime_ = 0L; - transactionId_ = ""; - props_ = java.util.Collections.emptyList(); - threadId_ = 0L; - } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -10097,14 +10936,14 @@ public final class CanalEntry { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, executeTime_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getTransactionIdBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, transactionId_); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(3, props_.get(i)); @@ -10112,12 +10951,12 @@ public final class CanalEntry { if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt64(4, threadId_); } - getUnknownFields().writeTo(output); + unknownFields.writeTo(output); } - private int memoizedSerializedSize = -1; + @java.lang.Override public int getSerializedSize() { - int size = memoizedSerializedSize; + int size = memoizedSize; if (size != -1) return size; size = 0; @@ -10126,8 +10965,7 @@ public final class CanalEntry { .computeInt64Size(1, executeTime_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getTransactionIdBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, transactionId_); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream @@ -10137,105 +10975,185 @@ public final class CanalEntry { size += com.google.protobuf.CodedOutputStream .computeInt64Size(4, threadId_); } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; + size += unknownFields.getSerializedSize(); + memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin other = (com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin) obj; + + boolean result = true; + result = result && (hasExecuteTime() == other.hasExecuteTime()); + if (hasExecuteTime()) { + result = result && (getExecuteTime() + == other.getExecuteTime()); + } + result = result && (hasTransactionId() == other.hasTransactionId()); + if (hasTransactionId()) { + result = result && getTransactionId() + .equals(other.getTransactionId()); + } + result = result && getPropsList() + .equals(other.getPropsList()); + result = result && (hasThreadId() == other.hasThreadId()); + if (hasThreadId()) { + result = result && (getThreadId() + == other.getThreadId()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; } - public static TransactionBegin parseFrom( + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasExecuteTime()) { + hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExecuteTime()); + } + if (hasTransactionId()) { + hash = (37 * hash) + TRANSACTIONID_FIELD_NUMBER; + hash = (53 * hash) + getTransactionId().hashCode(); + } + if (getPropsCount() > 0) { + hash = (37 * hash) + PROPS_FIELD_NUMBER; + hash = (53 * hash) + getPropsList().hashCode(); + } + if (hasThreadId()) { + hash = (37 * hash) + THREADID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getThreadId()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static TransactionBegin parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static TransactionBegin parseFrom(byte[] data) + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static TransactionBegin parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static TransactionBegin parseFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static TransactionBegin parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static TransactionBegin parseDelimitedFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); } - public static TransactionBegin parseDelimitedFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static TransactionBegin parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static TransactionBegin parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Builder newBuilder() { return Builder.create(); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(TransactionBegin prototype) { - return newBuilder().mergeFrom(prototype); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } - public Builder toBuilder() { return newBuilder(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionBegin} - * *
      **开始事务的一些信息*
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionBegin} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.TransactionBegin) - TransactionBeginOrBuilder { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBeginOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable .ensureFieldAccessorsInitialized( - TransactionBegin.class, Builder.class); + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.class, com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.newBuilder() @@ -10244,19 +11162,17 @@ public final class CanalEntry { } private Builder( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { getPropsFieldBuilder(); } } - private static Builder create() { - return new Builder(); - } - + @java.lang.Override public Builder clear() { super.clear(); executeTime_ = 0L; @@ -10274,29 +11190,29 @@ public final class CanalEntry { return this; } - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; } - public TransactionBegin getDefaultInstanceForType() { - return TransactionBegin.getDefaultInstance(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.getDefaultInstance(); } - public TransactionBegin build() { - TransactionBegin result = buildPartial(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin build() { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public TransactionBegin buildPartial() { - TransactionBegin result = new TransactionBegin(this); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin result = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -10325,17 +11241,50 @@ public final class CanalEntry { return result; } + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof TransactionBegin) { - return mergeFrom((TransactionBegin)other); + if (other instanceof com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(TransactionBegin other) { - if (other == TransactionBegin.getDefaultInstance()) return this; + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.getDefaultInstance()) return this; if (other.hasExecuteTime()) { setExecuteTime(other.getExecuteTime()); } @@ -10363,7 +11312,7 @@ public final class CanalEntry { props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000004); propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); @@ -10373,24 +11322,27 @@ public final class CanalEntry { if (other.hasThreadId()) { setThreadId(other.getThreadId()); } - this.mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - TransactionBegin parsedMessage = null; + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (TransactionBegin) e.getUnfinishedMessage(); - throw e; + parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin) e.getUnfinishedMessage(); + throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -10402,31 +11354,31 @@ public final class CanalEntry { private long executeTime_ ; /** - * optional int64 executeTime = 1; - * *
        **已废弃,请使用header里的executeTime*
        * 
+ * + * optional int64 executeTime = 1; */ public boolean hasExecuteTime() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int64 executeTime = 1; - * *
        **已废弃,请使用header里的executeTime*
        * 
+ * + * optional int64 executeTime = 1; */ public long getExecuteTime() { return executeTime_; } /** - * optional int64 executeTime = 1; - * *
        **已废弃,请使用header里的executeTime*
        * 
+ * + * optional int64 executeTime = 1; */ public Builder setExecuteTime(long value) { bitField0_ |= 0x00000001; @@ -10435,11 +11387,11 @@ public final class CanalEntry { return this; } /** - * optional int64 executeTime = 1; - * *
        **已废弃,请使用header里的executeTime*
        * 
+ * + * optional int64 executeTime = 1; */ public Builder clearExecuteTime() { bitField0_ = (bitField0_ & ~0x00000001); @@ -10448,52 +11400,52 @@ public final class CanalEntry { return this; } - private Object transactionId_ = ""; + private java.lang.Object transactionId_ = ""; /** - * optional string transactionId = 2; - * *
        **已废弃,Begin里不提供事务id*
        * 
+ * + * optional string transactionId = 2; */ public boolean hasTransactionId() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional string transactionId = 2; - * *
        **已废弃,Begin里不提供事务id*
        * 
+ * + * optional string transactionId = 2; */ - public String getTransactionId() { - Object ref = transactionId_; - if (!(ref instanceof String)) { + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { transactionId_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string transactionId = 2; - * *
        **已废弃,Begin里不提供事务id*
        * 
+ * + * optional string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { - Object ref = transactionId_; + java.lang.Object ref = transactionId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); transactionId_ = b; return b; } else { @@ -10501,14 +11453,14 @@ public final class CanalEntry { } } /** - * optional string transactionId = 2; - * *
        **已废弃,Begin里不提供事务id*
        * 
+ * + * optional string transactionId = 2; */ public Builder setTransactionId( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -10518,11 +11470,11 @@ public final class CanalEntry { return this; } /** - * optional string transactionId = 2; - * *
        **已废弃,Begin里不提供事务id*
        * 
+ * + * optional string transactionId = 2; */ public Builder clearTransactionId() { bitField0_ = (bitField0_ & ~0x00000002); @@ -10531,11 +11483,11 @@ public final class CanalEntry { return this; } /** - * optional string transactionId = 2; - * *
        **已废弃,Begin里不提供事务id*
        * 
+ * + * optional string transactionId = 2; */ public Builder setTransactionIdBytes( com.google.protobuf.ByteString value) { @@ -10548,26 +11500,26 @@ public final class CanalEntry { return this; } - private java.util.List props_ = + private java.util.List props_ = java.util.Collections.emptyList(); private void ensurePropsIsMutable() { if (!((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(props_); + props_ = new java.util.ArrayList(props_); bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { if (propsBuilder_ == null) { return java.util.Collections.unmodifiableList(props_); } else { @@ -10575,11 +11527,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public int getPropsCount() { if (propsBuilder_ == null) { @@ -10589,13 +11541,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -10603,14 +11555,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder setProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -10624,14 +11576,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder setProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -10642,13 +11594,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Builder addProps(Pair value) { + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -10662,14 +11614,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -10683,14 +11635,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - Pair.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -10701,14 +11653,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -10719,14 +11671,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addAllProps( - Iterable values) { + java.lang.Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -10738,11 +11690,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder clearProps() { if (propsBuilder_ == null) { @@ -10755,11 +11707,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder removeProps(int index) { if (propsBuilder_ == null) { @@ -10772,24 +11724,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder getPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( int index) { return getPropsFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -10797,13 +11749,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { if (propsBuilder_ != null) { return propsBuilder_.getMessageOrBuilderList(); @@ -10812,45 +11764,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder addPropsBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - Pair.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder addPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, Pair.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsBuilderList() { return getPropsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( props_, ((bitField0_ & 0x00000004) == 0x00000004), getParentForChildren(), @@ -10862,31 +11814,31 @@ public final class CanalEntry { private long threadId_ ; /** - * optional int64 threadId = 4; - * *
        **执行的thread Id*
        * 
+ * + * optional int64 threadId = 4; */ public boolean hasThreadId() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional int64 threadId = 4; - * *
        **执行的thread Id*
        * 
+ * + * optional int64 threadId = 4; */ public long getThreadId() { return threadId_; } /** - * optional int64 threadId = 4; - * *
        **执行的thread Id*
        * 
+ * + * optional int64 threadId = 4; */ public Builder setThreadId(long value) { bitField0_ |= 0x00000008; @@ -10895,11 +11847,11 @@ public final class CanalEntry { return this; } /** - * optional int64 threadId = 4; - * *
        **执行的thread Id*
        * 
+ * + * optional int64 threadId = 4; */ public Builder clearThreadId() { bitField0_ = (bitField0_ & ~0x00000008); @@ -10907,16 +11859,57 @@ public final class CanalEntry { onChanged(); return this; } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.TransactionBegin) } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionBegin) + private static final com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin DEFAULT_INSTANCE; static { - defaultInstance = new TransactionBegin(true); - defaultInstance.initFields(); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransactionBegin parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransactionBegin(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionBegin) } public interface TransactionEndOrBuilder extends @@ -10924,129 +11917,127 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * optional int64 executeTime = 1; - * *
      **已废弃,请使用header里的executeTime*
      * 
+ * + * optional int64 executeTime = 1; */ boolean hasExecuteTime(); /** - * optional int64 executeTime = 1; - * *
      **已废弃,请使用header里的executeTime*
      * 
+ * + * optional int64 executeTime = 1; */ long getExecuteTime(); /** - * optional string transactionId = 2; - * *
      **事务号*
      * 
+ * + * optional string transactionId = 2; */ boolean hasTransactionId(); /** - * optional string transactionId = 2; - * *
      **事务号*
      * 
+ * + * optional string transactionId = 2; */ - String getTransactionId(); + java.lang.String getTransactionId(); /** - * optional string transactionId = 2; - * *
      **事务号*
      * 
+ * + * optional string transactionId = 2; */ com.google.protobuf.ByteString getTransactionIdBytes(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - java.util.List + java.util.List getPropsList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - Pair getProps(int index); + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ int getPropsCount(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - java.util.List + java.util.List getPropsOrBuilderList(); /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - PairOrBuilder getPropsOrBuilder(int index); + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + int index); } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionEnd} - * *
    **结束事务的一些信息*
    * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionEnd} */ - public static final class TransactionEnd extends - com.google.protobuf.GeneratedMessage implements + public static final class TransactionEnd extends + com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.TransactionEnd) TransactionEndOrBuilder { + private static final long serialVersionUID = 0L; // Use TransactionEnd.newBuilder() to construct. - private TransactionEnd(com.google.protobuf.GeneratedMessage.Builder builder) { + private TransactionEnd(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); - this.unknownFields = builder.getUnknownFields(); } - private TransactionEnd(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final TransactionEnd defaultInstance; - public static TransactionEnd getDefaultInstance() { - return defaultInstance; + private TransactionEnd() { + executeTime_ = 0L; + transactionId_ = ""; + props_ = java.util.Collections.emptyList(); } - public TransactionEnd getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @Override + @java.lang.Override public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { + getUnknownFields() { return this.unknownFields; } private TransactionEnd( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -11058,13 +12049,6 @@ public final class CanalEntry { case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 8: { bitField0_ |= 0x00000001; executeTime_ = input.readInt64(); @@ -11078,10 +12062,18 @@ public final class CanalEntry { } case 26: { if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(); + props_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } - props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); + props_.add( + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } break; } } @@ -11090,7 +12082,7 @@ public final class CanalEntry { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); + e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -11101,82 +12093,68 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable .ensureFieldAccessorsInitialized( - TransactionEnd.class, Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public TransactionEnd parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TransactionEnd(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.class, com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.Builder.class); } private int bitField0_; public static final int EXECUTETIME_FIELD_NUMBER = 1; private long executeTime_; /** - * optional int64 executeTime = 1; - * *
      **已废弃,请使用header里的executeTime*
      * 
+ * + * optional int64 executeTime = 1; */ public boolean hasExecuteTime() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int64 executeTime = 1; - * *
      **已废弃,请使用header里的executeTime*
      * 
+ * + * optional int64 executeTime = 1; */ public long getExecuteTime() { return executeTime_; } public static final int TRANSACTIONID_FIELD_NUMBER = 2; - private Object transactionId_; + private volatile java.lang.Object transactionId_; /** - * optional string transactionId = 2; - * *
      **事务号*
      * 
+ * + * optional string transactionId = 2; */ public boolean hasTransactionId() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional string transactionId = 2; - * *
      **事务号*
      * 
+ * + * optional string transactionId = 2; */ - public String getTransactionId() { - Object ref = transactionId_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { transactionId_ = s; } @@ -11184,19 +12162,19 @@ public final class CanalEntry { } } /** - * optional string transactionId = 2; - * *
      **事务号*
      * 
+ * + * optional string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { - Object ref = transactionId_; - if (ref instanceof String) { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); transactionId_ = b; return b; } else { @@ -11205,66 +12183,62 @@ public final class CanalEntry { } public static final int PROPS_FIELD_NUMBER = 3; - private java.util.List props_; + private java.util.List props_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { return props_; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public int getPropsCount() { return props_.size(); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { return props_.get(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
      **预留扩展*
      * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } - private void initFields() { - executeTime_ = 0L; - transactionId_ = ""; - props_ = java.util.Collections.emptyList(); - } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -11274,24 +12248,24 @@ public final class CanalEntry { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, executeTime_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getTransactionIdBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, transactionId_); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(3, props_.get(i)); } - getUnknownFields().writeTo(output); + unknownFields.writeTo(output); } - private int memoizedSerializedSize = -1; + @java.lang.Override public int getSerializedSize() { - int size = memoizedSerializedSize; + int size = memoizedSize; if (size != -1) return size; size = 0; @@ -11300,112 +12274,181 @@ public final class CanalEntry { .computeInt64Size(1, executeTime_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getTransactionIdBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, transactionId_); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, props_.get(i)); } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; + size += unknownFields.getSerializedSize(); + memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd other = (com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd) obj; + + boolean result = true; + result = result && (hasExecuteTime() == other.hasExecuteTime()); + if (hasExecuteTime()) { + result = result && (getExecuteTime() + == other.getExecuteTime()); + } + result = result && (hasTransactionId() == other.hasTransactionId()); + if (hasTransactionId()) { + result = result && getTransactionId() + .equals(other.getTransactionId()); + } + result = result && getPropsList() + .equals(other.getPropsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; } - public static TransactionEnd parseFrom( + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasExecuteTime()) { + hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExecuteTime()); + } + if (hasTransactionId()) { + hash = (37 * hash) + TRANSACTIONID_FIELD_NUMBER; + hash = (53 * hash) + getTransactionId().hashCode(); + } + if (getPropsCount() > 0) { + hash = (37 * hash) + PROPS_FIELD_NUMBER; + hash = (53 * hash) + getPropsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static TransactionEnd parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static TransactionEnd parseFrom(byte[] data) + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static TransactionEnd parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static TransactionEnd parseFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static TransactionEnd parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static TransactionEnd parseDelimitedFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); } - public static TransactionEnd parseDelimitedFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static TransactionEnd parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static TransactionEnd parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Builder newBuilder() { return Builder.create(); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(TransactionEnd prototype) { - return newBuilder().mergeFrom(prototype); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } - public Builder toBuilder() { return newBuilder(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionEnd} - * *
      **结束事务的一些信息*
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionEnd} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.TransactionEnd) - TransactionEndOrBuilder { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEndOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable .ensureFieldAccessorsInitialized( - TransactionEnd.class, Builder.class); + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.class, com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.newBuilder() @@ -11414,19 +12457,17 @@ public final class CanalEntry { } private Builder( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { getPropsFieldBuilder(); } } - private static Builder create() { - return new Builder(); - } - + @java.lang.Override public Builder clear() { super.clear(); executeTime_ = 0L; @@ -11442,29 +12483,29 @@ public final class CanalEntry { return this; } - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; } - public TransactionEnd getDefaultInstanceForType() { - return TransactionEnd.getDefaultInstance(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.getDefaultInstance(); } - public TransactionEnd build() { - TransactionEnd result = buildPartial(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd build() { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public TransactionEnd buildPartial() { - TransactionEnd result = new TransactionEnd(this); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd result = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -11489,17 +12530,50 @@ public final class CanalEntry { return result; } + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof TransactionEnd) { - return mergeFrom((TransactionEnd)other); + if (other instanceof com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(TransactionEnd other) { - if (other == TransactionEnd.getDefaultInstance()) return this; + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.getDefaultInstance()) return this; if (other.hasExecuteTime()) { setExecuteTime(other.getExecuteTime()); } @@ -11527,31 +12601,34 @@ public final class CanalEntry { props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000004); propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); } } } - this.mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - TransactionEnd parsedMessage = null; + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (TransactionEnd) e.getUnfinishedMessage(); - throw e; + parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd) e.getUnfinishedMessage(); + throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -11563,31 +12640,31 @@ public final class CanalEntry { private long executeTime_ ; /** - * optional int64 executeTime = 1; - * *
        **已废弃,请使用header里的executeTime*
        * 
+ * + * optional int64 executeTime = 1; */ public boolean hasExecuteTime() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int64 executeTime = 1; - * *
        **已废弃,请使用header里的executeTime*
        * 
+ * + * optional int64 executeTime = 1; */ public long getExecuteTime() { return executeTime_; } /** - * optional int64 executeTime = 1; - * *
        **已废弃,请使用header里的executeTime*
        * 
+ * + * optional int64 executeTime = 1; */ public Builder setExecuteTime(long value) { bitField0_ |= 0x00000001; @@ -11596,11 +12673,11 @@ public final class CanalEntry { return this; } /** - * optional int64 executeTime = 1; - * *
        **已废弃,请使用header里的executeTime*
        * 
+ * + * optional int64 executeTime = 1; */ public Builder clearExecuteTime() { bitField0_ = (bitField0_ & ~0x00000001); @@ -11609,52 +12686,52 @@ public final class CanalEntry { return this; } - private Object transactionId_ = ""; + private java.lang.Object transactionId_ = ""; /** - * optional string transactionId = 2; - * *
        **事务号*
        * 
+ * + * optional string transactionId = 2; */ public boolean hasTransactionId() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional string transactionId = 2; - * *
        **事务号*
        * 
+ * + * optional string transactionId = 2; */ - public String getTransactionId() { - Object ref = transactionId_; - if (!(ref instanceof String)) { + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { transactionId_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string transactionId = 2; - * *
        **事务号*
        * 
+ * + * optional string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { - Object ref = transactionId_; + java.lang.Object ref = transactionId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); transactionId_ = b; return b; } else { @@ -11662,14 +12739,14 @@ public final class CanalEntry { } } /** - * optional string transactionId = 2; - * *
        **事务号*
        * 
+ * + * optional string transactionId = 2; */ public Builder setTransactionId( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -11679,11 +12756,11 @@ public final class CanalEntry { return this; } /** - * optional string transactionId = 2; - * *
        **事务号*
        * 
+ * + * optional string transactionId = 2; */ public Builder clearTransactionId() { bitField0_ = (bitField0_ & ~0x00000002); @@ -11692,11 +12769,11 @@ public final class CanalEntry { return this; } /** - * optional string transactionId = 2; - * *
        **事务号*
        * 
+ * + * optional string transactionId = 2; */ public Builder setTransactionIdBytes( com.google.protobuf.ByteString value) { @@ -11709,26 +12786,26 @@ public final class CanalEntry { return this; } - private java.util.List props_ = + private java.util.List props_ = java.util.Collections.emptyList(); private void ensurePropsIsMutable() { if (!((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(props_); + props_ = new java.util.ArrayList(props_); bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List getPropsList() { + public java.util.List getPropsList() { if (propsBuilder_ == null) { return java.util.Collections.unmodifiableList(props_); } else { @@ -11736,11 +12813,11 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public int getPropsCount() { if (propsBuilder_ == null) { @@ -11750,13 +12827,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair getProps(int index) { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -11764,14 +12841,14 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder setProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -11785,14 +12862,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder setProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -11803,13 +12880,13 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Builder addProps(Pair value) { + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -11823,14 +12900,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - int index, Pair value) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -11844,14 +12921,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - Pair.Builder builderForValue) { + com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -11862,14 +12939,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addProps( - int index, Pair.Builder builderForValue) { + int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -11880,14 +12957,14 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder addAllProps( - Iterable values) { + java.lang.Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -11899,11 +12976,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder clearProps() { if (propsBuilder_ == null) { @@ -11916,11 +12993,11 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ public Builder removeProps(int index) { if (propsBuilder_ == null) { @@ -11933,24 +13010,24 @@ public final class CanalEntry { return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder getPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( int index) { return getPropsFieldBuilder().getBuilder(index); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public PairOrBuilder getPropsOrBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -11958,13 +13035,13 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsOrBuilderList() { if (propsBuilder_ != null) { return propsBuilder_.getMessageOrBuilderList(); @@ -11973,45 +13050,45 @@ public final class CanalEntry { } } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder addPropsBuilder() { + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - Pair.getDefaultInstance()); + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public Pair.Builder addPropsBuilder( + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, Pair.getDefaultInstance()); + index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); } /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * *
        **预留扩展*
        * 
+ * + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public java.util.List + public java.util.List getPropsBuilderList() { return getPropsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - Pair, Pair.Builder, PairOrBuilder>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( props_, ((bitField0_ & 0x00000004) == 0x00000004), getParentForChildren(), @@ -12020,16 +13097,57 @@ public final class CanalEntry { } return propsBuilder_; } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.TransactionEnd) } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionEnd) + private static final com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd DEFAULT_INSTANCE; static { - defaultInstance = new TransactionEnd(true); - defaultInstance.initFields(); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransactionEnd parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransactionEnd(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionEnd) } public interface PairOrBuilder extends @@ -12043,7 +13161,7 @@ public final class CanalEntry { /** * optional string key = 1; */ - String getKey(); + java.lang.String getKey(); /** * optional string key = 1; */ @@ -12057,7 +13175,7 @@ public final class CanalEntry { /** * optional string value = 2; */ - String getValue(); + java.lang.String getValue(); /** * optional string value = 2; */ @@ -12065,43 +13183,39 @@ public final class CanalEntry { getValueBytes(); } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Pair} - * *
    **预留扩展*
    * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Pair} */ - public static final class Pair extends - com.google.protobuf.GeneratedMessage implements + public static final class Pair extends + com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Pair) PairOrBuilder { + private static final long serialVersionUID = 0L; // Use Pair.newBuilder() to construct. - private Pair(com.google.protobuf.GeneratedMessage.Builder builder) { + private Pair(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); - this.unknownFields = builder.getUnknownFields(); } - private Pair(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Pair defaultInstance; - public static Pair getDefaultInstance() { - return defaultInstance; + private Pair() { + key_ = ""; + value_ = ""; } - public Pair getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @Override + @java.lang.Override public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { + getUnknownFields() { return this.unknownFields; } private Pair( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -12113,13 +13227,6 @@ public final class CanalEntry { case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 10: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000001; @@ -12132,13 +13239,20 @@ public final class CanalEntry { value_ = bs; break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); + e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -12146,34 +13260,20 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable .ensureFieldAccessorsInitialized( - Pair.class, Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Pair parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Pair(input, extensionRegistry); - } - }; - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + com.alibaba.otter.canal.protocol.CanalEntry.Pair.class, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder.class); } private int bitField0_; public static final int KEY_FIELD_NUMBER = 1; - private Object key_; + private volatile java.lang.Object key_; /** * optional string key = 1; */ @@ -12183,14 +13283,14 @@ public final class CanalEntry { /** * optional string key = 1; */ - public String getKey() { - Object ref = key_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { key_ = s; } @@ -12202,11 +13302,11 @@ public final class CanalEntry { */ public com.google.protobuf.ByteString getKeyBytes() { - Object ref = key_; - if (ref instanceof String) { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); key_ = b; return b; } else { @@ -12215,7 +13315,7 @@ public final class CanalEntry { } public static final int VALUE_FIELD_NUMBER = 2; - private Object value_; + private volatile java.lang.Object value_; /** * optional string value = 2; */ @@ -12225,14 +13325,14 @@ public final class CanalEntry { /** * optional string value = 2; */ - public String getValue() { - Object ref = value_; - if (ref instanceof String) { - return (String) ref; + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { value_ = s; } @@ -12244,11 +13344,11 @@ public final class CanalEntry { */ public com.google.protobuf.ByteString getValueBytes() { - Object ref = value_; - if (ref instanceof String) { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); value_ = b; return b; } else { @@ -12256,11 +13356,8 @@ public final class CanalEntry { } } - private void initFields() { - key_ = ""; - value_ = ""; - } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -12270,131 +13367,192 @@ public final class CanalEntry { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getKeyBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getValueBytes()); + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); } - getUnknownFields().writeTo(output); + unknownFields.writeTo(output); } - private int memoizedSerializedSize = -1; + @java.lang.Override public int getSerializedSize() { - int size = memoizedSerializedSize; + int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getKeyBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getValueBytes()); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; + size += unknownFields.getSerializedSize(); + memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - protected Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalEntry.Pair)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalEntry.Pair other = (com.alibaba.otter.canal.protocol.CanalEntry.Pair) obj; + + boolean result = true; + result = result && (hasKey() == other.hasKey()); + if (hasKey()) { + result = result && getKey() + .equals(other.getKey()); + } + result = result && (hasValue() == other.hasValue()); + if (hasValue()) { + result = result && getValue() + .equals(other.getValue()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; } - public static Pair parseFrom( + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKey()) { + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Pair parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Pair parseFrom(byte[] data) + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Pair parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Pair parseFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static Pair parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Pair parseDelimitedFrom(java.io.InputStream input) + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); } - public static Pair parseDelimitedFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static Pair parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return PARSER.parseFrom(input); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); } - public static Pair parseFrom( + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); } - public static Builder newBuilder() { return Builder.create(); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(Pair prototype) { - return newBuilder().mergeFrom(prototype); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); } - public Builder toBuilder() { return newBuilder(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Pair} - * *
      **预留扩展*
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Pair} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Pair) - PairOrBuilder { + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; } - protected FieldAccessorTable + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable .ensureFieldAccessorsInitialized( - Pair.class, Builder.class); + com.alibaba.otter.canal.protocol.CanalEntry.Pair.class, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Pair.newBuilder() @@ -12403,18 +13561,16 @@ public final class CanalEntry { } private Builder( - BuilderParent parent) { + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } } - private static Builder create() { - return new Builder(); - } - + @java.lang.Override public Builder clear() { super.clear(); key_ = ""; @@ -12424,29 +13580,29 @@ public final class CanalEntry { return this; } - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; } - public Pair getDefaultInstanceForType() { - return Pair.getDefaultInstance(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance(); } - public Pair build() { - Pair result = buildPartial(); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Pair build() { + com.alibaba.otter.canal.protocol.CanalEntry.Pair result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Pair buildPartial() { - Pair result = new Pair(this); + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Pair buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.Pair result = new com.alibaba.otter.canal.protocol.CanalEntry.Pair(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -12462,17 +13618,50 @@ public final class CanalEntry { return result; } + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Pair) { - return mergeFrom((Pair)other); + if (other instanceof com.alibaba.otter.canal.protocol.CanalEntry.Pair) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.Pair)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Pair other) { - if (other == Pair.getDefaultInstance()) return this; + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.Pair other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()) return this; if (other.hasKey()) { bitField0_ |= 0x00000001; key_ = other.key_; @@ -12483,24 +13672,27 @@ public final class CanalEntry { value_ = other.value_; onChanged(); } - this.mergeUnknownFields(other.getUnknownFields()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Pair parsedMessage = null; + com.alibaba.otter.canal.protocol.CanalEntry.Pair parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Pair) e.getUnfinishedMessage(); - throw e; + parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.Pair) e.getUnfinishedMessage(); + throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -12510,7 +13702,7 @@ public final class CanalEntry { } private int bitField0_; - private Object key_ = ""; + private java.lang.Object key_ = ""; /** * optional string key = 1; */ @@ -12520,18 +13712,18 @@ public final class CanalEntry { /** * optional string key = 1; */ - public String getKey() { - Object ref = key_; - if (!(ref instanceof String)) { + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { key_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** @@ -12539,11 +13731,11 @@ public final class CanalEntry { */ public com.google.protobuf.ByteString getKeyBytes() { - Object ref = key_; + java.lang.Object ref = key_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); key_ = b; return b; } else { @@ -12554,7 +13746,7 @@ public final class CanalEntry { * optional string key = 1; */ public Builder setKey( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -12586,7 +13778,7 @@ public final class CanalEntry { return this; } - private Object value_ = ""; + private java.lang.Object value_ = ""; /** * optional string value = 2; */ @@ -12596,18 +13788,18 @@ public final class CanalEntry { /** * optional string value = 2; */ - public String getValue() { - Object ref = value_; - if (!(ref instanceof String)) { + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { value_ = s; } return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** @@ -12615,11 +13807,11 @@ public final class CanalEntry { */ public com.google.protobuf.ByteString getValueBytes() { - Object ref = value_; + java.lang.Object ref = value_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + (java.lang.String) ref); value_ = b; return b; } else { @@ -12630,7 +13822,7 @@ public final class CanalEntry { * optional string value = 2; */ public Builder setValue( - String value) { + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -12661,67 +13853,108 @@ public final class CanalEntry { onChanged(); return this; } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Pair) } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Pair) + private static final com.alibaba.otter.canal.protocol.CanalEntry.Pair DEFAULT_INSTANCE; static { - defaultInstance = new Pair(true); - defaultInstance.initFields(); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.Pair(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Pair parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Pair(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Pair) } private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } - private static com.google.protobuf.Descriptors.FileDescriptor + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { - String[] descriptorData = { + java.lang.String[] descriptorData = { "\n\023EntryProtocol.proto\022 com.alibaba.otter" + ".canal.protocol\"\236\001\n\005Entry\0228\n\006header\030\001 \001(" + "\0132(.com.alibaba.otter.canal.protocol.Hea" + @@ -12731,7 +13964,7 @@ public final class CanalEntry { " \001(\005:\0011\022\023\n\013logfileName\030\002 \001(\t\022\025\n\rlogfileO" + "ffset\030\003 \001(\003\022\020\n\010serverId\030\004 \001(\003\022\024\n\014servere" + "nCode\030\005 \001(\t\022\023\n\013executeTime\030\006 \001(\003\022A\n\nsour" + - "ceType\030\007 \001(\0162&.com.alibaba.otter.canal.p", + "ceType\030\007 \001(\0162&.com.alibaba.otter.canal.p" + "rotocol.Type:\005MYSQL\022\022\n\nschemaName\030\010 \001(\t\022" + "\021\n\ttableName\030\t \001(\t\022\023\n\013eventLength\030\n \001(\003\022" + "F\n\teventType\030\013 \001(\0162+.com.alibaba.otter.c" + @@ -12741,7 +13974,7 @@ public final class CanalEntry { "\030\001 \001(\005\022\017\n\007sqlType\030\002 \001(\005\022\014\n\004name\030\003 \001(\t\022\r\n" + "\005isKey\030\004 \001(\010\022\017\n\007updated\030\005 \001(\010\022\025\n\006isNull\030" + "\006 \001(\010:\005false\0225\n\005props\030\007 \003(\0132&.com.alibab" + - "a.otter.canal.protocol.Pair\022\r\n\005value\030\010 \001", + "a.otter.canal.protocol.Pair\022\r\n\005value\030\010 \001" + "(\t\022\016\n\006length\030\t \001(\005\022\021\n\tmysqlType\030\n \001(\t\"\301\001" + "\n\007RowData\022?\n\rbeforeColumns\030\001 \003(\0132(.com.a" + "libaba.otter.canal.protocol.Column\022>\n\014af" + @@ -12751,7 +13984,7 @@ public final class CanalEntry { "wChange\022\017\n\007tableId\030\001 \001(\003\022F\n\teventType\030\002 " + "\001(\0162+.com.alibaba.otter.canal.protocol.E" + "ventType:\006UPDATE\022\024\n\005isDdl\030\n \001(\010:\005false\022\013" + - "\n\003sql\030\013 \001(\t\022;\n\010rowDatas\030\014 \003(\0132).com.alib", + "\n\003sql\030\013 \001(\t\022;\n\010rowDatas\030\014 \003(\0132).com.alib" + "aba.otter.canal.protocol.RowData\0225\n\005prop" + "s\030\r \003(\0132&.com.alibaba.otter.canal.protoc" + "ol.Pair\022\025\n\rddlSchemaName\030\016 \001(\t\"\207\001\n\020Trans" + @@ -12761,7 +13994,7 @@ public final class CanalEntry { "Id\030\004 \001(\003\"s\n\016TransactionEnd\022\023\n\013executeTim" + "e\030\001 \001(\003\022\025\n\rtransactionId\030\002 \001(\t\0225\n\005props\030" + "\003 \003(\0132&.com.alibaba.otter.canal.protocol" + - ".Pair\"\"\n\004Pair\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(", + ".Pair\"\"\n\004Pair\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(" + "\t*^\n\tEntryType\022\024\n\020TRANSACTIONBEGIN\020\001\022\013\n\007" + "ROWDATA\020\002\022\022\n\016TRANSACTIONEND\020\003\022\r\n\tHEARTBE" + "AT\020\004\022\013\n\007GTIDLOG\020\005*\306\001\n\tEventType\022\n\n\006INSER" + @@ -12788,51 +14021,51 @@ public final class CanalEntry { internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor, - new String[] { "Header", "EntryType", "StoreValue", }); + new java.lang.String[] { "Header", "EntryType", "StoreValue", }); internal_static_com_alibaba_otter_canal_protocol_Header_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Header_descriptor, - new String[] { "Version", "LogfileName", "LogfileOffset", "ServerId", "ServerenCode", "ExecuteTime", "SourceType", "SchemaName", "TableName", "EventLength", "EventType", "Props", "Gtid", }); + new java.lang.String[] { "Version", "LogfileName", "LogfileOffset", "ServerId", "ServerenCode", "ExecuteTime", "SourceType", "SchemaName", "TableName", "EventLength", "EventType", "Props", "Gtid", }); internal_static_com_alibaba_otter_canal_protocol_Column_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Column_descriptor, - new String[] { "Index", "SqlType", "Name", "IsKey", "Updated", "IsNull", "Props", "Value", "Length", "MysqlType", }); + new java.lang.String[] { "Index", "SqlType", "Name", "IsKey", "Updated", "IsNull", "Props", "Value", "Length", "MysqlType", }); internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor, - new String[] { "BeforeColumns", "AfterColumns", "Props", }); + new java.lang.String[] { "BeforeColumns", "AfterColumns", "Props", }); internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor, - new String[] { "TableId", "EventType", "IsDdl", "Sql", "RowDatas", "Props", "DdlSchemaName", }); + new java.lang.String[] { "TableId", "EventType", "IsDdl", "Sql", "RowDatas", "Props", "DdlSchemaName", }); internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor, - new String[] { "ExecuteTime", "TransactionId", "Props", "ThreadId", }); + new java.lang.String[] { "ExecuteTime", "TransactionId", "Props", "ThreadId", }); internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor, - new String[] { "ExecuteTime", "TransactionId", "Props", }); + new java.lang.String[] { "ExecuteTime", "TransactionId", "Props", }); internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor, - new String[] { "Key", "Value", }); + new java.lang.String[] { "Key", "Value", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java index 3909668a..9c912af7 100644 --- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java +++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java @@ -4,9847 +4,11256 @@ package com.alibaba.otter.canal.protocol; public final class CanalPacket { + private CanalPacket() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } - private CanalPacket(){ - } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code com.alibaba.otter.canal.protocol.Compression} + */ + public enum Compression + implements com.google.protobuf.ProtocolMessageEnum { + /** + * NONE = 1; + */ + NONE(1), + /** + * ZLIB = 2; + */ + ZLIB(2), + /** + * GZIP = 3; + */ + GZIP(3), + /** + * LZF = 4; + */ + LZF(4), + ; - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + /** + * NONE = 1; + */ + public static final int NONE_VALUE = 1; + /** + * ZLIB = 2; + */ + public static final int ZLIB_VALUE = 2; + /** + * GZIP = 3; + */ + public static final int GZIP_VALUE = 3; + /** + * LZF = 4; + */ + public static final int LZF_VALUE = 4; + + + public final int getNumber() { + return value; } /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.Compression} + * @deprecated Use {@link #forNumber(int)} instead. */ - public enum Compression implements com.google.protobuf.ProtocolMessageEnum { - /** - * NONE = 1; - */ - NONE(0, 1), - /** - * ZLIB = 2; - */ - ZLIB(1, 2), - /** - * GZIP = 3; - */ - GZIP(2, 3), - /** - * LZF = 4; - */ - LZF(3, 4), ; + @java.lang.Deprecated + public static Compression valueOf(int value) { + return forNumber(value); + } - /** - * NONE = 1; - */ - public static final int NONE_VALUE = 1; - /** - * ZLIB = 2; - */ - public static final int ZLIB_VALUE = 2; - /** - * GZIP = 3; - */ - public static final int GZIP_VALUE = 3; - /** - * LZF = 4; - */ - public static final int LZF_VALUE = 4; + public static Compression forNumber(int value) { + switch (value) { + case 1: return NONE; + case 2: return ZLIB; + case 3: return GZIP; + case 4: return LZF; + default: return null; + } + } - public final int getNumber() { - return value; - } - - public static Compression valueOf(int value) { - switch (value) { - case 1: - return NONE; - case 2: - return ZLIB; - case 3: - return GZIP; - case 4: - return LZF; - default: - return null; + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Compression> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Compression findValueByNumber(int number) { + return Compression.forNumber(number); } - } + }; - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.getDescriptor().getEnumTypes().get(0); + } - private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + private static final Compression[] VALUES = values(); - public Compression findValueByNumber(int number) { - return Compression.valueOf(number); - } - }; + public static Compression valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(index); - } + private final int value; - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } + private Compression(int value) { + this.value = value; + } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.getDescriptor().getEnumTypes().get(0); - } + // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.Compression) + } - private static final Compression[] VALUES = values(); + /** + * Protobuf enum {@code com.alibaba.otter.canal.protocol.PacketType} + */ + public enum PacketType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * HANDSHAKE = 1; + */ + HANDSHAKE(1), + /** + * CLIENTAUTHENTICATION = 2; + */ + CLIENTAUTHENTICATION(2), + /** + * ACK = 3; + */ + ACK(3), + /** + * SUBSCRIPTION = 4; + */ + SUBSCRIPTION(4), + /** + * UNSUBSCRIPTION = 5; + */ + UNSUBSCRIPTION(5), + /** + * GET = 6; + */ + GET(6), + /** + * MESSAGES = 7; + */ + MESSAGES(7), + /** + * CLIENTACK = 8; + */ + CLIENTACK(8), + /** + *
+     * management part
+     * 
+ * + * SHUTDOWN = 9; + */ + SHUTDOWN(9), + /** + *
+     * integration
+     * 
+ * + * DUMP = 10; + */ + DUMP(10), + /** + * HEARTBEAT = 11; + */ + HEARTBEAT(11), + /** + * CLIENTROLLBACK = 12; + */ + CLIENTROLLBACK(12), + ; - public static Compression valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } + /** + * HANDSHAKE = 1; + */ + public static final int HANDSHAKE_VALUE = 1; + /** + * CLIENTAUTHENTICATION = 2; + */ + public static final int CLIENTAUTHENTICATION_VALUE = 2; + /** + * ACK = 3; + */ + public static final int ACK_VALUE = 3; + /** + * SUBSCRIPTION = 4; + */ + public static final int SUBSCRIPTION_VALUE = 4; + /** + * UNSUBSCRIPTION = 5; + */ + public static final int UNSUBSCRIPTION_VALUE = 5; + /** + * GET = 6; + */ + public static final int GET_VALUE = 6; + /** + * MESSAGES = 7; + */ + public static final int MESSAGES_VALUE = 7; + /** + * CLIENTACK = 8; + */ + public static final int CLIENTACK_VALUE = 8; + /** + *
+     * management part
+     * 
+ * + * SHUTDOWN = 9; + */ + public static final int SHUTDOWN_VALUE = 9; + /** + *
+     * integration
+     * 
+ * + * DUMP = 10; + */ + public static final int DUMP_VALUE = 10; + /** + * HEARTBEAT = 11; + */ + public static final int HEARTBEAT_VALUE = 11; + /** + * CLIENTROLLBACK = 12; + */ + public static final int CLIENTROLLBACK_VALUE = 12; - private final int index; - private final int value; - private Compression(int index, int value){ - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.Compression) + public final int getNumber() { + return value; } /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.PacketType} + * @deprecated Use {@link #forNumber(int)} instead. */ - public enum PacketType implements com.google.protobuf.ProtocolMessageEnum { - /** - * HANDSHAKE = 1; - */ - HANDSHAKE(0, 1), - /** - * CLIENTAUTHENTICATION = 2; - */ - CLIENTAUTHENTICATION(1, 2), - /** - * ACK = 3; - */ - ACK(2, 3), - /** - * SUBSCRIPTION = 4; - */ - SUBSCRIPTION(3, 4), - /** - * UNSUBSCRIPTION = 5; - */ - UNSUBSCRIPTION(4, 5), - /** - * GET = 6; - */ - GET(5, 6), - /** - * MESSAGES = 7; - */ - MESSAGES(6, 7), - /** - * CLIENTACK = 8; - */ - CLIENTACK(7, 8), - /** - * SHUTDOWN = 9; - * - *
-         * management part
-         * 
- */ - SHUTDOWN(8, 9), - /** - * DUMP = 10; - * - *
-         * integration
-         * 
- */ - DUMP(9, 10), - /** - * HEARTBEAT = 11; - */ - HEARTBEAT(10, 11), - /** - * CLIENTROLLBACK = 12; - */ - CLIENTROLLBACK(11, 12), ; - - /** - * HANDSHAKE = 1; - */ - public static final int HANDSHAKE_VALUE = 1; - /** - * CLIENTAUTHENTICATION = 2; - */ - public static final int CLIENTAUTHENTICATION_VALUE = 2; - /** - * ACK = 3; - */ - public static final int ACK_VALUE = 3; - /** - * SUBSCRIPTION = 4; - */ - public static final int SUBSCRIPTION_VALUE = 4; - /** - * UNSUBSCRIPTION = 5; - */ - public static final int UNSUBSCRIPTION_VALUE = 5; - /** - * GET = 6; - */ - public static final int GET_VALUE = 6; - /** - * MESSAGES = 7; - */ - public static final int MESSAGES_VALUE = 7; - /** - * CLIENTACK = 8; - */ - public static final int CLIENTACK_VALUE = 8; - /** - * SHUTDOWN = 9; - * - *
-         * management part
-         * 
- */ - public static final int SHUTDOWN_VALUE = 9; - /** - * DUMP = 10; - * - *
-         * integration
-         * 
- */ - public static final int DUMP_VALUE = 10; - /** - * HEARTBEAT = 11; - */ - public static final int HEARTBEAT_VALUE = 11; - /** - * CLIENTROLLBACK = 12; - */ - public static final int CLIENTROLLBACK_VALUE = 12; - - public final int getNumber() { - return value; - } - - public static PacketType valueOf(int value) { - switch (value) { - case 1: - return HANDSHAKE; - case 2: - return CLIENTAUTHENTICATION; - case 3: - return ACK; - case 4: - return SUBSCRIPTION; - case 5: - return UNSUBSCRIPTION; - case 6: - return GET; - case 7: - return MESSAGES; - case 8: - return CLIENTACK; - case 9: - return SHUTDOWN; - case 10: - return DUMP; - case 11: - return HEARTBEAT; - case 12: - return CLIENTROLLBACK; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { - - public PacketType findValueByNumber(int number) { - return PacketType.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.getDescriptor().getEnumTypes().get(1); - } - - private static final PacketType[] VALUES = values(); - - public static PacketType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private PacketType(int index, int value){ - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.PacketType) + @java.lang.Deprecated + public static PacketType valueOf(int value) { + return forNumber(value); } - public interface PacketOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Packet) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - boolean hasMagicNumber(); - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - int getMagicNumber(); - - /** - * optional int32 version = 2 [default = 1]; - */ - boolean hasVersion(); - - /** - * optional int32 version = 2 [default = 1]; - */ - int getVersion(); - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - boolean hasType(); - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType(); - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - boolean hasCompression(); - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression(); - - /** - * optional bytes body = 5; - */ - boolean hasBody(); - - /** - * optional bytes body = 5; - */ - com.google.protobuf.ByteString getBody(); + public static PacketType forNumber(int value) { + switch (value) { + case 1: return HANDSHAKE; + case 2: return CLIENTAUTHENTICATION; + case 3: return ACK; + case 4: return SUBSCRIPTION; + case 5: return UNSUBSCRIPTION; + case 6: return GET; + case 7: return MESSAGES; + case 8: return CLIENTACK; + case 9: return SHUTDOWN; + case 10: return DUMP; + case 11: return HEARTBEAT; + case 12: return CLIENTROLLBACK; + default: return null; + } } + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + PacketType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PacketType findValueByNumber(int number) { + return PacketType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.getDescriptor().getEnumTypes().get(1); + } + + private static final PacketType[] VALUES = values(); + + public static PacketType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PacketType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.PacketType) + } + + public interface PacketOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Packet) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + boolean hasMagicNumber(); + /** + * optional int32 magic_number = 1 [default = 17]; + */ + int getMagicNumber(); + + /** + * optional int32 version = 2 [default = 1]; + */ + boolean hasVersion(); + /** + * optional int32 version = 2 [default = 1]; + */ + int getVersion(); + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + boolean hasType(); + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType(); + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + boolean hasCompression(); + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression(); + + /** + * optional bytes body = 5; + */ + boolean hasBody(); + /** + * optional bytes body = 5; + */ + com.google.protobuf.ByteString getBody(); + } + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Packet} + */ + public static final class Packet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Packet) + PacketOrBuilder { + private static final long serialVersionUID = 0L; + // Use Packet.newBuilder() to construct. + private Packet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Packet() { + magicNumber_ = 17; + version_ = 1; + type_ = 1; + compression_ = 1; + body_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Packet( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + magicNumber_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + version_ = input.readInt32(); + break; + } + case 24: { + int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.PacketType value = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + bitField0_ |= 0x00000004; + type_ = rawValue; + } + break; + } + case 32: { + int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(4, rawValue); + } else { + bitField0_ |= 0x00000008; + compression_ = rawValue; + } + break; + } + case 42: { + bitField0_ |= 0x00000010; + body_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); + } + + private int bitField0_; + public static final int MAGIC_NUMBER_FIELD_NUMBER = 1; + private int magicNumber_; + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public boolean hasMagicNumber() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public int getMagicNumber() { + return magicNumber_; + } + + public static final int VERSION_FIELD_NUMBER = 2; + private int version_; + /** + * optional int32 version = 2 [default = 1]; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 version = 2 [default = 1]; + */ + public int getVersion() { + return version_; + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_; + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.PacketType result = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(type_); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE : result; + } + + public static final int COMPRESSION_FIELD_NUMBER = 4; + private int compression_; + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public boolean hasCompression() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(compression_); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE : result; + } + + public static final int BODY_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString body_; + /** + * optional bytes body = 5; + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bytes body = 5; + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, magicNumber_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, version_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, type_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeEnum(4, compression_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, body_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, magicNumber_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, version_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, type_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, compression_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, body_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.Packet)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.Packet other = (com.alibaba.otter.canal.protocol.CanalPacket.Packet) obj; + + boolean result = true; + result = result && (hasMagicNumber() == other.hasMagicNumber()); + if (hasMagicNumber()) { + result = result && (getMagicNumber() + == other.getMagicNumber()); + } + result = result && (hasVersion() == other.hasVersion()); + if (hasVersion()) { + result = result && (getVersion() + == other.getVersion()); + } + result = result && (hasType() == other.hasType()); + if (hasType()) { + result = result && type_ == other.type_; + } + result = result && (hasCompression() == other.hasCompression()); + if (hasCompression()) { + result = result && compression_ == other.compression_; + } + result = result && (hasBody() == other.hasBody()); + if (hasBody()) { + result = result && getBody() + .equals(other.getBody()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMagicNumber()) { + hash = (37 * hash) + MAGIC_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getMagicNumber(); + } + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + } + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + } + if (hasCompression()) { + hash = (37 * hash) + COMPRESSION_FIELD_NUMBER; + hash = (53 * hash) + compression_; + } + if (hasBody()) { + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Packet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Packet} */ - public static final class Packet extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Packet) - PacketOrBuilder { - - // Use Packet.newBuilder() to construct. - private Packet(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private Packet(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final Packet defaultInstance; - - public static Packet getDefaultInstance() { - return defaultInstance; - } - - public Packet getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Packet(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - magicNumber_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - version_ = input.readInt32(); - break; - } - case 24: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalPacket.PacketType value = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - bitField0_ |= 0x00000004; - type_ = value; - } - break; - } - case 32: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(4, rawValue); - } else { - bitField0_ |= 0x00000008; - compression_ = value; - } - break; - } - case 42: { - bitField0_ |= 0x00000010; - body_ = input.readBytes(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, - com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public Packet parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Packet(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int MAGIC_NUMBER_FIELD_NUMBER = 1; - private int magicNumber_; - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public boolean hasMagicNumber() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public int getMagicNumber() { - return magicNumber_; - } - - public static final int VERSION_FIELD_NUMBER = 2; - private int version_; - - /** - * optional int32 version = 2 [default = 1]; - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional int32 version = 2 [default = 1]; - */ - public int getVersion() { - return version_; - } - - public static final int TYPE_FIELD_NUMBER = 3; - private com.alibaba.otter.canal.protocol.CanalPacket.PacketType type_; - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { - return type_; - } - - public static final int COMPRESSION_FIELD_NUMBER = 4; - private com.alibaba.otter.canal.protocol.CanalPacket.Compression compression_; - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public boolean hasCompression() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { - return compression_; - } - - public static final int BODY_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString body_; - - /** - * optional bytes body = 5; - */ - public boolean hasBody() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - - /** - * optional bytes body = 5; - */ - public com.google.protobuf.ByteString getBody() { - return body_; - } - - private void initFields() { - magicNumber_ = 17; - version_ = 1; - type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; - compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; - body_ = com.google.protobuf.ByteString.EMPTY; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, magicNumber_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, version_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeEnum(3, type_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeEnum(4, compression_.getNumber()); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, body_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, magicNumber_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, version_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, compression_.getNumber()); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, body_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Packet prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Packet} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Packet) com.alibaba.otter.canal.protocol.CanalPacket.PacketOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, - com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Packet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.Packet.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - magicNumber_ = 17; - bitField0_ = (bitField0_ & ~0x00000001); - version_ = 1; - bitField0_ = (bitField0_ & ~0x00000002); - type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; - bitField0_ = (bitField0_ & ~0x00000004); - compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; - bitField0_ = (bitField0_ & ~0x00000008); - body_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Packet getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Packet build() { - com.alibaba.otter.canal.protocol.CanalPacket.Packet result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Packet buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Packet result = new com.alibaba.otter.canal.protocol.CanalPacket.Packet(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.magicNumber_ = magicNumber_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.version_ = version_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.compression_ = compression_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.body_ = body_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Packet) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Packet) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Packet other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance()) return this; - if (other.hasMagicNumber()) { - setMagicNumber(other.getMagicNumber()); - } - if (other.hasVersion()) { - setVersion(other.getVersion()); - } - if (other.hasType()) { - setType(other.getType()); - } - if (other.hasCompression()) { - setCompression(other.getCompression()); - } - if (other.hasBody()) { - setBody(other.getBody()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Packet parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Packet) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private int magicNumber_ = 17; - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public boolean hasMagicNumber() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public int getMagicNumber() { - return magicNumber_; - } - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public Builder setMagicNumber(int value) { - bitField0_ |= 0x00000001; - magicNumber_ = value; - onChanged(); - return this; - } - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public Builder clearMagicNumber() { - bitField0_ = (bitField0_ & ~0x00000001); - magicNumber_ = 17; - onChanged(); - return this; - } - - private int version_ = 1; - - /** - * optional int32 version = 2 [default = 1]; - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional int32 version = 2 [default = 1]; - */ - public int getVersion() { - return version_; - } - - /** - * optional int32 version = 2 [default = 1]; - */ - public Builder setVersion(int value) { - bitField0_ |= 0x00000002; - version_ = value; - onChanged(); - return this; - } - - /** - * optional int32 version = 2 [default = 1]; - */ - public Builder clearVersion() { - bitField0_ = (bitField0_ & ~0x00000002); - version_ = 1; - onChanged(); - return this; - } - - private com.alibaba.otter.canal.protocol.CanalPacket.PacketType type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { - return type_; - } - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public Builder setType(com.alibaba.otter.canal.protocol.CanalPacket.PacketType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - type_ = value; - onChanged(); - return this; - } - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000004); - type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; - onChanged(); - return this; - } - - private com.alibaba.otter.canal.protocol.CanalPacket.Compression compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public boolean hasCompression() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { - return compression_; - } - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public Builder setCompression(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - compression_ = value; - onChanged(); - return this; - } - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public Builder clearCompression() { - bitField0_ = (bitField0_ & ~0x00000008); - compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; - - /** - * optional bytes body = 5; - */ - public boolean hasBody() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - - /** - * optional bytes body = 5; - */ - public com.google.protobuf.ByteString getBody() { - return body_; - } - - /** - * optional bytes body = 5; - */ - public Builder setBody(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - body_ = value; - onChanged(); - return this; - } - - /** - * optional bytes body = 5; - */ - public Builder clearBody() { - bitField0_ = (bitField0_ & ~0x00000010); - body_ = getDefaultInstance().getBody(); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Packet) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + magicNumber_ = 17; + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 1; + bitField0_ = (bitField0_ & ~0x00000002); + type_ = 1; + bitField0_ = (bitField0_ & ~0x00000004); + compression_ = 1; + bitField0_ = (bitField0_ & ~0x00000008); + body_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } - static { - defaultInstance = new Packet(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Packet getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Packet build() { + com.alibaba.otter.canal.protocol.CanalPacket.Packet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Packet) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Packet buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Packet result = new com.alibaba.otter.canal.protocol.CanalPacket.Packet(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.magicNumber_ = magicNumber_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.version_ = version_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.compression_ = compression_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.body_ = body_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Packet) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Packet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Packet other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance()) return this; + if (other.hasMagicNumber()) { + setMagicNumber(other.getMagicNumber()); + } + if (other.hasVersion()) { + setVersion(other.getVersion()); + } + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasCompression()) { + setCompression(other.getCompression()); + } + if (other.hasBody()) { + setBody(other.getBody()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Packet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Packet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int magicNumber_ = 17; + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public boolean hasMagicNumber() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public int getMagicNumber() { + return magicNumber_; + } + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public Builder setMagicNumber(int value) { + bitField0_ |= 0x00000001; + magicNumber_ = value; + onChanged(); + return this; + } + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public Builder clearMagicNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + magicNumber_ = 17; + onChanged(); + return this; + } + + private int version_ = 1; + /** + * optional int32 version = 2 [default = 1]; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 version = 2 [default = 1]; + */ + public int getVersion() { + return version_; + } + /** + * optional int32 version = 2 [default = 1]; + */ + public Builder setVersion(int value) { + bitField0_ |= 0x00000002; + version_ = value; + onChanged(); + return this; + } + /** + * optional int32 version = 2 [default = 1]; + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + version_ = 1; + onChanged(); + return this; + } + + private int type_ = 1; + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.PacketType result = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(type_); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE : result; + } + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public Builder setType(com.alibaba.otter.canal.protocol.CanalPacket.PacketType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000004); + type_ = 1; + onChanged(); + return this; + } + + private int compression_ = 1; + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public boolean hasCompression() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(compression_); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE : result; + } + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public Builder setCompression(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + compression_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public Builder clearCompression() { + bitField0_ = (bitField0_ & ~0x00000008); + compression_ = 1; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes body = 5; + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bytes body = 5; + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + /** + * optional bytes body = 5; + */ + public Builder setBody(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + body_ = value; + onChanged(); + return this; + } + /** + * optional bytes body = 5; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000010); + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Packet) } - public interface HeartBeatOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.HeartBeat) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 send_timestamp = 1; - */ - boolean hasSendTimestamp(); - - /** - * optional int64 send_timestamp = 1; - */ - long getSendTimestamp(); - - /** - * optional int64 start_timestamp = 2; - */ - boolean hasStartTimestamp(); - - /** - * optional int64 start_timestamp = 2; - */ - long getStartTimestamp(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Packet) + private static final com.alibaba.otter.canal.protocol.CanalPacket.Packet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.Packet(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Packet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Packet(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Packet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HeartBeatOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.HeartBeat) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 send_timestamp = 1; + */ + boolean hasSendTimestamp(); + /** + * optional int64 send_timestamp = 1; + */ + long getSendTimestamp(); + + /** + * optional int64 start_timestamp = 2; + */ + boolean hasStartTimestamp(); + /** + * optional int64 start_timestamp = 2; + */ + long getStartTimestamp(); + } + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.HeartBeat} + */ + public static final class HeartBeat extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.HeartBeat) + HeartBeatOrBuilder { + private static final long serialVersionUID = 0L; + // Use HeartBeat.newBuilder() to construct. + private HeartBeat(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HeartBeat() { + sendTimestamp_ = 0L; + startTimestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HeartBeat( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + sendTimestamp_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + startTimestamp_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); + } + + private int bitField0_; + public static final int SEND_TIMESTAMP_FIELD_NUMBER = 1; + private long sendTimestamp_; + /** + * optional int64 send_timestamp = 1; + */ + public boolean hasSendTimestamp() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 send_timestamp = 1; + */ + public long getSendTimestamp() { + return sendTimestamp_; + } + + public static final int START_TIMESTAMP_FIELD_NUMBER = 2; + private long startTimestamp_; + /** + * optional int64 start_timestamp = 2; + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int64 start_timestamp = 2; + */ + public long getStartTimestamp() { + return startTimestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, sendTimestamp_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, startTimestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, sendTimestamp_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, startTimestamp_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat other = (com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) obj; + + boolean result = true; + result = result && (hasSendTimestamp() == other.hasSendTimestamp()); + if (hasSendTimestamp()) { + result = result && (getSendTimestamp() + == other.getSendTimestamp()); + } + result = result && (hasStartTimestamp() == other.hasStartTimestamp()); + if (hasStartTimestamp()) { + result = result && (getStartTimestamp() + == other.getStartTimestamp()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSendTimestamp()) { + hash = (37 * hash) + SEND_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSendTimestamp()); + } + if (hasStartTimestamp()) { + hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStartTimestamp()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.HeartBeat} */ - public static final class HeartBeat extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.HeartBeat) - HeartBeatOrBuilder { - - // Use HeartBeat.newBuilder() to construct. - private HeartBeat(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private HeartBeat(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final HeartBeat defaultInstance; - - public static HeartBeat getDefaultInstance() { - return defaultInstance; - } - - public HeartBeat getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private HeartBeat(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - sendTimestamp_ = input.readInt64(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - startTimestamp_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public HeartBeat parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HeartBeat(input, - extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int SEND_TIMESTAMP_FIELD_NUMBER = 1; - private long sendTimestamp_; - - /** - * optional int64 send_timestamp = 1; - */ - public boolean hasSendTimestamp() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional int64 send_timestamp = 1; - */ - public long getSendTimestamp() { - return sendTimestamp_; - } - - public static final int START_TIMESTAMP_FIELD_NUMBER = 2; - private long startTimestamp_; - - /** - * optional int64 start_timestamp = 2; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional int64 start_timestamp = 2; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - - private void initFields() { - sendTimestamp_ = 0L; - startTimestamp_ = 0L; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, sendTimestamp_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt64(2, startTimestamp_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, sendTimestamp_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, startTimestamp_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.HeartBeat} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.HeartBeat) com.alibaba.otter.canal.protocol.CanalPacket.HeartBeatOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); + } + + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + sendTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + startTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat build() { + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = new com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.sendTimestamp_ = sendTimestamp_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.startTimestamp_ = startTimestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance()) return this; + if (other.hasSendTimestamp()) { + setSendTimestamp(other.getSendTimestamp()); + } + if (other.hasStartTimestamp()) { + setStartTimestamp(other.getStartTimestamp()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long sendTimestamp_ ; + /** + * optional int64 send_timestamp = 1; + */ + public boolean hasSendTimestamp() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 send_timestamp = 1; + */ + public long getSendTimestamp() { + return sendTimestamp_; + } + /** + * optional int64 send_timestamp = 1; + */ + public Builder setSendTimestamp(long value) { + bitField0_ |= 0x00000001; + sendTimestamp_ = value; + onChanged(); + return this; + } + /** + * optional int64 send_timestamp = 1; + */ + public Builder clearSendTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + sendTimestamp_ = 0L; + onChanged(); + return this; + } + + private long startTimestamp_ ; + /** + * optional int64 start_timestamp = 2; + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int64 start_timestamp = 2; + */ + public long getStartTimestamp() { + return startTimestamp_; + } + /** + * optional int64 start_timestamp = 2; + */ + public Builder setStartTimestamp(long value) { + bitField0_ |= 0x00000002; + startTimestamp_ = value; + onChanged(); + return this; + } + /** + * optional int64 start_timestamp = 2; + */ + public Builder clearStartTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + startTimestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.HeartBeat) + } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.HeartBeat) + private static final com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HeartBeat parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HeartBeat(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HandshakeOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Handshake) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + boolean hasCommunicationEncoding(); + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + java.lang.String getCommunicationEncoding(); + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + com.google.protobuf.ByteString + getCommunicationEncodingBytes(); + + /** + * optional bytes seeds = 2; + */ + boolean hasSeeds(); + /** + * optional bytes seeds = 2; + */ + com.google.protobuf.ByteString getSeeds(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + java.util.List getSupportedCompressionsList(); + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + int getSupportedCompressionsCount(); + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index); + } + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Handshake} + */ + public static final class Handshake extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Handshake) + HandshakeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Handshake.newBuilder() to construct. + private Handshake(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Handshake() { + communicationEncoding_ = "utf8"; + seeds_ = com.google.protobuf.ByteString.EMPTY; + supportedCompressions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Handshake( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + communicationEncoding_ = bs; + break; } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); + case 18: { + bitField0_ |= 0x00000002; + seeds_ = input.readBytes(); + break; } - - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + case 24: { + int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; } + supportedCompressions_.add(rawValue); + } + break; } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - sendTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - startTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat build() { - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = new com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.sendTimestamp_ = sendTimestamp_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.startTimestamp_ = startTimestamp_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) other); + case 26: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); } else { - super.mergeFrom(other); - return this; + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + supportedCompressions_.add(rawValue); } + } + input.popLimit(oldLimit); + break; } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance()) return this; - if (other.hasSendTimestamp()) { - setSendTimestamp(other.getSendTimestamp()); - } - if (other.hasStartTimestamp()) { - setStartTimestamp(other.getStartTimestamp()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private long sendTimestamp_; - - /** - * optional int64 send_timestamp = 1; - */ - public boolean hasSendTimestamp() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional int64 send_timestamp = 1; - */ - public long getSendTimestamp() { - return sendTimestamp_; - } - - /** - * optional int64 send_timestamp = 1; - */ - public Builder setSendTimestamp(long value) { - bitField0_ |= 0x00000001; - sendTimestamp_ = value; - onChanged(); - return this; - } - - /** - * optional int64 send_timestamp = 1; - */ - public Builder clearSendTimestamp() { - bitField0_ = (bitField0_ & ~0x00000001); - sendTimestamp_ = 0L; - onChanged(); - return this; - } - - private long startTimestamp_; - - /** - * optional int64 start_timestamp = 2; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional int64 start_timestamp = 2; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - - /** - * optional int64 start_timestamp = 2; - */ - public Builder setStartTimestamp(long value) { - bitField0_ |= 0x00000002; - startTimestamp_ = value; - onChanged(); - return this; - } - - /** - * optional int64 start_timestamp = 2; - */ - public Builder clearStartTimestamp() { - bitField0_ = (bitField0_ & ~0x00000002); - startTimestamp_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.HeartBeat) + } } - - static { - defaultInstance = new HeartBeat(true); - defaultInstance.initFields(); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.HeartBeat) + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; } - public interface HandshakeOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Handshake) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - boolean hasCommunicationEncoding(); - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - java.lang.String getCommunicationEncoding(); - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - com.google.protobuf.ByteString getCommunicationEncodingBytes(); - - /** - * optional bytes seeds = 2; - */ - boolean hasSeeds(); - - /** - * optional bytes seeds = 2; - */ - com.google.protobuf.ByteString getSeeds(); - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - java.util.List getSupportedCompressionsList(); - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - int getSupportedCompressionsCount(); - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index); + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); } + private int bitField0_; + public static final int COMMUNICATION_ENCODING_FIELD_NUMBER = 1; + private volatile java.lang.Object communicationEncoding_; + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public boolean hasCommunicationEncoding() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public java.lang.String getCommunicationEncoding() { + java.lang.Object ref = communicationEncoding_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + communicationEncoding_ = s; + } + return s; + } + } + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public com.google.protobuf.ByteString + getCommunicationEncodingBytes() { + java.lang.Object ref = communicationEncoding_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + communicationEncoding_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEEDS_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString seeds_; + /** + * optional bytes seeds = 2; + */ + public boolean hasSeeds() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional bytes seeds = 2; + */ + public com.google.protobuf.ByteString getSeeds() { + return seeds_; + } + + public static final int SUPPORTED_COMPRESSIONS_FIELD_NUMBER = 3; + private java.util.List supportedCompressions_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.alibaba.otter.canal.protocol.CanalPacket.Compression> supportedCompressions_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.alibaba.otter.canal.protocol.CanalPacket.Compression>() { + public com.alibaba.otter.canal.protocol.CanalPacket.Compression convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(from); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE : result; + } + }; + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public java.util.List getSupportedCompressionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.alibaba.otter.canal.protocol.CanalPacket.Compression>(supportedCompressions_, supportedCompressions_converter_); + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public int getSupportedCompressionsCount() { + return supportedCompressions_.size(); + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { + return supportedCompressions_converter_.convert(supportedCompressions_.get(index)); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, communicationEncoding_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, seeds_); + } + for (int i = 0; i < supportedCompressions_.size(); i++) { + output.writeEnum(3, supportedCompressions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, communicationEncoding_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, seeds_); + } + { + int dataSize = 0; + for (int i = 0; i < supportedCompressions_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(supportedCompressions_.get(i)); + } + size += dataSize; + size += 1 * supportedCompressions_.size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.Handshake)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.Handshake other = (com.alibaba.otter.canal.protocol.CanalPacket.Handshake) obj; + + boolean result = true; + result = result && (hasCommunicationEncoding() == other.hasCommunicationEncoding()); + if (hasCommunicationEncoding()) { + result = result && getCommunicationEncoding() + .equals(other.getCommunicationEncoding()); + } + result = result && (hasSeeds() == other.hasSeeds()); + if (hasSeeds()) { + result = result && getSeeds() + .equals(other.getSeeds()); + } + result = result && supportedCompressions_.equals(other.supportedCompressions_); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommunicationEncoding()) { + hash = (37 * hash) + COMMUNICATION_ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getCommunicationEncoding().hashCode(); + } + if (hasSeeds()) { + hash = (37 * hash) + SEEDS_FIELD_NUMBER; + hash = (53 * hash) + getSeeds().hashCode(); + } + if (getSupportedCompressionsCount() > 0) { + hash = (37 * hash) + SUPPORTED_COMPRESSIONS_FIELD_NUMBER; + hash = (53 * hash) + supportedCompressions_.hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Handshake prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Handshake} */ - public static final class Handshake extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Handshake) - HandshakeOrBuilder { - - // Use Handshake.newBuilder() to construct. - private Handshake(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private Handshake(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final Handshake defaultInstance; - - public static Handshake getDefaultInstance() { - return defaultInstance; - } - - public Handshake getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Handshake(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - communicationEncoding_ = bs; - break; - } - case 18: { - bitField0_ |= 0x00000002; - seeds_ = input.readBytes(); - break; - } - case 24: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - supportedCompressions_.add(value); - } - break; - } - case 26: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - supportedCompressions_.add(value); - } - } - input.popLimit(oldLimit); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, - com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public Handshake parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Handshake(input, - extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int COMMUNICATION_ENCODING_FIELD_NUMBER = 1; - private java.lang.Object communicationEncoding_; - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public boolean hasCommunicationEncoding() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public java.lang.String getCommunicationEncoding() { - java.lang.Object ref = communicationEncoding_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - communicationEncoding_ = s; - } - return s; - } - } - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public com.google.protobuf.ByteString getCommunicationEncodingBytes() { - java.lang.Object ref = communicationEncoding_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - communicationEncoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SEEDS_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString seeds_; - - /** - * optional bytes seeds = 2; - */ - public boolean hasSeeds() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional bytes seeds = 2; - */ - public com.google.protobuf.ByteString getSeeds() { - return seeds_; - } - - public static final int SUPPORTED_COMPRESSIONS_FIELD_NUMBER = 3; - private java.util.List supportedCompressions_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public java.util.List getSupportedCompressionsList() { - return supportedCompressions_; - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public int getSupportedCompressionsCount() { - return supportedCompressions_.size(); - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { - return supportedCompressions_.get(index); - } - - private void initFields() { - communicationEncoding_ = "utf8"; - seeds_ = com.google.protobuf.ByteString.EMPTY; - supportedCompressions_ = java.util.Collections.emptyList(); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getCommunicationEncodingBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, seeds_); - } - for (int i = 0; i < supportedCompressions_.size(); i++) { - output.writeEnum(3, supportedCompressions_.get(i).getNumber()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getCommunicationEncodingBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, seeds_); - } - { - int dataSize = 0; - for (int i = 0; i < supportedCompressions_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(supportedCompressions_.get(i) - .getNumber()); - } - size += dataSize; - size += 1 * supportedCompressions_.size(); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Handshake prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Handshake} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Handshake) com.alibaba.otter.canal.protocol.CanalPacket.HandshakeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, - com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Handshake.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.Handshake.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - communicationEncoding_ = "utf8"; - bitField0_ = (bitField0_ & ~0x00000001); - seeds_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - supportedCompressions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Handshake getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Handshake build() { - com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Handshake buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = new com.alibaba.otter.canal.protocol.CanalPacket.Handshake(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.communicationEncoding_ = communicationEncoding_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.seeds_ = seeds_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.supportedCompressions_ = supportedCompressions_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Handshake) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Handshake) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Handshake other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance()) return this; - if (other.hasCommunicationEncoding()) { - bitField0_ |= 0x00000001; - communicationEncoding_ = other.communicationEncoding_; - onChanged(); - } - if (other.hasSeeds()) { - setSeeds(other.getSeeds()); - } - if (!other.supportedCompressions_.isEmpty()) { - if (supportedCompressions_.isEmpty()) { - supportedCompressions_ = other.supportedCompressions_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.addAll(other.supportedCompressions_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Handshake parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Handshake) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object communicationEncoding_ = "utf8"; - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public boolean hasCommunicationEncoding() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public java.lang.String getCommunicationEncoding() { - java.lang.Object ref = communicationEncoding_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - communicationEncoding_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public com.google.protobuf.ByteString getCommunicationEncodingBytes() { - java.lang.Object ref = communicationEncoding_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - communicationEncoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public Builder setCommunicationEncoding(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - communicationEncoding_ = value; - onChanged(); - return this; - } - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public Builder clearCommunicationEncoding() { - bitField0_ = (bitField0_ & ~0x00000001); - communicationEncoding_ = getDefaultInstance().getCommunicationEncoding(); - onChanged(); - return this; - } - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public Builder setCommunicationEncodingBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - communicationEncoding_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString seeds_ = com.google.protobuf.ByteString.EMPTY; - - /** - * optional bytes seeds = 2; - */ - public boolean hasSeeds() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional bytes seeds = 2; - */ - public com.google.protobuf.ByteString getSeeds() { - return seeds_; - } - - /** - * optional bytes seeds = 2; - */ - public Builder setSeeds(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - seeds_ = value; - onChanged(); - return this; - } - - /** - * optional bytes seeds = 2; - */ - public Builder clearSeeds() { - bitField0_ = (bitField0_ & ~0x00000002); - seeds_ = getDefaultInstance().getSeeds(); - onChanged(); - return this; - } - - private java.util.List supportedCompressions_ = java.util.Collections.emptyList(); - - private void ensureSupportedCompressionsIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(supportedCompressions_); - bitField0_ |= 0x00000004; - } - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public java.util.List getSupportedCompressionsList() { - return java.util.Collections.unmodifiableList(supportedCompressions_); - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public int getSupportedCompressionsCount() { - return supportedCompressions_.size(); - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { - return supportedCompressions_.get(index); - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder setSupportedCompressions(int index, - com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.set(index, value); - onChanged(); - return this; - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder addSupportedCompressions(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.add(value); - onChanged(); - return this; - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder addAllSupportedCompressions(java.lang.Iterable values) { - ensureSupportedCompressionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, supportedCompressions_); - onChanged(); - return this; - } - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder clearSupportedCompressions() { - supportedCompressions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Handshake) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + communicationEncoding_ = "utf8"; + bitField0_ = (bitField0_ & ~0x00000001); + seeds_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + supportedCompressions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } - static { - defaultInstance = new Handshake(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Handshake getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Handshake build() { + com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Handshake) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Handshake buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = new com.alibaba.otter.canal.protocol.CanalPacket.Handshake(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.communicationEncoding_ = communicationEncoding_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.seeds_ = seeds_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.supportedCompressions_ = supportedCompressions_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Handshake) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Handshake)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Handshake other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance()) return this; + if (other.hasCommunicationEncoding()) { + bitField0_ |= 0x00000001; + communicationEncoding_ = other.communicationEncoding_; + onChanged(); + } + if (other.hasSeeds()) { + setSeeds(other.getSeeds()); + } + if (!other.supportedCompressions_.isEmpty()) { + if (supportedCompressions_.isEmpty()) { + supportedCompressions_ = other.supportedCompressions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSupportedCompressionsIsMutable(); + supportedCompressions_.addAll(other.supportedCompressions_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Handshake parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Handshake) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object communicationEncoding_ = "utf8"; + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public boolean hasCommunicationEncoding() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public java.lang.String getCommunicationEncoding() { + java.lang.Object ref = communicationEncoding_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + communicationEncoding_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public com.google.protobuf.ByteString + getCommunicationEncodingBytes() { + java.lang.Object ref = communicationEncoding_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + communicationEncoding_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public Builder setCommunicationEncoding( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + communicationEncoding_ = value; + onChanged(); + return this; + } + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public Builder clearCommunicationEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + communicationEncoding_ = getDefaultInstance().getCommunicationEncoding(); + onChanged(); + return this; + } + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public Builder setCommunicationEncodingBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + communicationEncoding_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString seeds_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes seeds = 2; + */ + public boolean hasSeeds() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional bytes seeds = 2; + */ + public com.google.protobuf.ByteString getSeeds() { + return seeds_; + } + /** + * optional bytes seeds = 2; + */ + public Builder setSeeds(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + seeds_ = value; + onChanged(); + return this; + } + /** + * optional bytes seeds = 2; + */ + public Builder clearSeeds() { + bitField0_ = (bitField0_ & ~0x00000002); + seeds_ = getDefaultInstance().getSeeds(); + onChanged(); + return this; + } + + private java.util.List supportedCompressions_ = + java.util.Collections.emptyList(); + private void ensureSupportedCompressionsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = new java.util.ArrayList(supportedCompressions_); + bitField0_ |= 0x00000004; + } + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public java.util.List getSupportedCompressionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.alibaba.otter.canal.protocol.CanalPacket.Compression>(supportedCompressions_, supportedCompressions_converter_); + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public int getSupportedCompressionsCount() { + return supportedCompressions_.size(); + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { + return supportedCompressions_converter_.convert(supportedCompressions_.get(index)); + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public Builder setSupportedCompressions( + int index, com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedCompressionsIsMutable(); + supportedCompressions_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public Builder addSupportedCompressions(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedCompressionsIsMutable(); + supportedCompressions_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public Builder addAllSupportedCompressions( + java.lang.Iterable values) { + ensureSupportedCompressionsIsMutable(); + for (com.alibaba.otter.canal.protocol.CanalPacket.Compression value : values) { + supportedCompressions_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public Builder clearSupportedCompressions() { + supportedCompressions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Handshake) } - public interface ClientAuthOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientAuth) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string username = 1; - */ - boolean hasUsername(); - - /** - * optional string username = 1; - */ - java.lang.String getUsername(); - - /** - * optional string username = 1; - */ - com.google.protobuf.ByteString getUsernameBytes(); - - /** - * optional bytes password = 2; - * - *
-         * hashed password with seeds from Handshake message
-         * 
- */ - boolean hasPassword(); - - /** - * optional bytes password = 2; - * - *
-         * hashed password with seeds from Handshake message
-         * 
- */ - com.google.protobuf.ByteString getPassword(); - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
-         * in seconds
-         * 
- */ - boolean hasNetReadTimeout(); - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
-         * in seconds
-         * 
- */ - int getNetReadTimeout(); - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
-         * in seconds
-         * 
- */ - boolean hasNetWriteTimeout(); - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
-         * in seconds
-         * 
- */ - int getNetWriteTimeout(); - - /** - * optional string destination = 5; - */ - boolean hasDestination(); - - /** - * optional string destination = 5; - */ - java.lang.String getDestination(); - - /** - * optional string destination = 5; - */ - com.google.protobuf.ByteString getDestinationBytes(); - - /** - * optional string client_id = 6; - */ - boolean hasClientId(); - - /** - * optional string client_id = 6; - */ - java.lang.String getClientId(); - - /** - * optional string client_id = 6; - */ - com.google.protobuf.ByteString getClientIdBytes(); - - /** - * optional string filter = 7; - */ - boolean hasFilter(); - - /** - * optional string filter = 7; - */ - java.lang.String getFilter(); - - /** - * optional string filter = 7; - */ - com.google.protobuf.ByteString getFilterBytes(); - - /** - * optional int64 start_timestamp = 8; - */ - boolean hasStartTimestamp(); - - /** - * optional int64 start_timestamp = 8; - */ - long getStartTimestamp(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Handshake) + private static final com.alibaba.otter.canal.protocol.CanalPacket.Handshake DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.Handshake(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Handshake parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Handshake(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Handshake getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ClientAuthOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientAuth) + com.google.protobuf.MessageOrBuilder { + /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAuth} + * optional string username = 1; + */ + boolean hasUsername(); + /** + * optional string username = 1; + */ + java.lang.String getUsername(); + /** + * optional string username = 1; + */ + com.google.protobuf.ByteString + getUsernameBytes(); + + /** + *
+     * hashed password with seeds from Handshake message
+     * 
* + * optional bytes password = 2; + */ + boolean hasPassword(); + /** + *
+     * hashed password with seeds from Handshake message
+     * 
+ * + * optional bytes password = 2; + */ + com.google.protobuf.ByteString getPassword(); + + /** + *
+     * in seconds
+     * 
+ * + * optional int32 net_read_timeout = 3 [default = 0]; + */ + boolean hasNetReadTimeout(); + /** + *
+     * in seconds
+     * 
+ * + * optional int32 net_read_timeout = 3 [default = 0]; + */ + int getNetReadTimeout(); + + /** + *
+     * in seconds
+     * 
+ * + * optional int32 net_write_timeout = 4 [default = 0]; + */ + boolean hasNetWriteTimeout(); + /** + *
+     * in seconds
+     * 
+ * + * optional int32 net_write_timeout = 4 [default = 0]; + */ + int getNetWriteTimeout(); + + /** + * optional string destination = 5; + */ + boolean hasDestination(); + /** + * optional string destination = 5; + */ + java.lang.String getDestination(); + /** + * optional string destination = 5; + */ + com.google.protobuf.ByteString + getDestinationBytes(); + + /** + * optional string client_id = 6; + */ + boolean hasClientId(); + /** + * optional string client_id = 6; + */ + java.lang.String getClientId(); + /** + * optional string client_id = 6; + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + * optional string filter = 7; + */ + boolean hasFilter(); + /** + * optional string filter = 7; + */ + java.lang.String getFilter(); + /** + * optional string filter = 7; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + * optional int64 start_timestamp = 8; + */ + boolean hasStartTimestamp(); + /** + * optional int64 start_timestamp = 8; + */ + long getStartTimestamp(); + } + /** + *
+   * client authentication
+   * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAuth} + */ + public static final class ClientAuth extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientAuth) + ClientAuthOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClientAuth.newBuilder() to construct. + private ClientAuth(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClientAuth() { + username_ = ""; + password_ = com.google.protobuf.ByteString.EMPTY; + netReadTimeout_ = 0; + netWriteTimeout_ = 0; + destination_ = ""; + clientId_ = ""; + filter_ = ""; + startTimestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClientAuth( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + username_ = bs; + break; + } + case 18: { + bitField0_ |= 0x00000002; + password_ = input.readBytes(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + netReadTimeout_ = input.readInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + netWriteTimeout_ = input.readInt32(); + break; + } + case 42: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + destination_ = bs; + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + clientId_ = bs; + break; + } + case 58: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000040; + filter_ = bs; + break; + } + case 64: { + bitField0_ |= 0x00000080; + startTimestamp_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class); + } + + private int bitField0_; + public static final int USERNAME_FIELD_NUMBER = 1; + private volatile java.lang.Object username_; + /** + * optional string username = 1; + */ + public boolean hasUsername() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string username = 1; + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + username_ = s; + } + return s; + } + } + /** + * optional string username = 1; + */ + public com.google.protobuf.ByteString + getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString password_; + /** + *
+     * hashed password with seeds from Handshake message
+     * 
+ * + * optional bytes password = 2; + */ + public boolean hasPassword() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * hashed password with seeds from Handshake message
+     * 
+ * + * optional bytes password = 2; + */ + public com.google.protobuf.ByteString getPassword() { + return password_; + } + + public static final int NET_READ_TIMEOUT_FIELD_NUMBER = 3; + private int netReadTimeout_; + /** + *
+     * in seconds
+     * 
+ * + * optional int32 net_read_timeout = 3 [default = 0]; + */ + public boolean hasNetReadTimeout() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+     * in seconds
+     * 
+ * + * optional int32 net_read_timeout = 3 [default = 0]; + */ + public int getNetReadTimeout() { + return netReadTimeout_; + } + + public static final int NET_WRITE_TIMEOUT_FIELD_NUMBER = 4; + private int netWriteTimeout_; + /** + *
+     * in seconds
+     * 
+ * + * optional int32 net_write_timeout = 4 [default = 0]; + */ + public boolean hasNetWriteTimeout() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     * in seconds
+     * 
+ * + * optional int32 net_write_timeout = 4 [default = 0]; + */ + public int getNetWriteTimeout() { + return netWriteTimeout_; + } + + public static final int DESTINATION_FIELD_NUMBER = 5; + private volatile java.lang.Object destination_; + /** + * optional string destination = 5; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string destination = 5; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + /** + * optional string destination = 5; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 6; + private volatile java.lang.Object clientId_; + /** + * optional string client_id = 6; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional string client_id = 6; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + /** + * optional string client_id = 6; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 7; + private volatile java.lang.Object filter_; + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } + } + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIMESTAMP_FIELD_NUMBER = 8; + private long startTimestamp_; + /** + * optional int64 start_timestamp = 8; + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int64 start_timestamp = 8; + */ + public long getStartTimestamp() { + return startTimestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, password_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, netReadTimeout_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, netWriteTimeout_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, destination_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, clientId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeInt64(8, startTimestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, password_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, netReadTimeout_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, netWriteTimeout_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, destination_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, clientId_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, startTimestamp_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth other = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) obj; + + boolean result = true; + result = result && (hasUsername() == other.hasUsername()); + if (hasUsername()) { + result = result && getUsername() + .equals(other.getUsername()); + } + result = result && (hasPassword() == other.hasPassword()); + if (hasPassword()) { + result = result && getPassword() + .equals(other.getPassword()); + } + result = result && (hasNetReadTimeout() == other.hasNetReadTimeout()); + if (hasNetReadTimeout()) { + result = result && (getNetReadTimeout() + == other.getNetReadTimeout()); + } + result = result && (hasNetWriteTimeout() == other.hasNetWriteTimeout()); + if (hasNetWriteTimeout()) { + result = result && (getNetWriteTimeout() + == other.getNetWriteTimeout()); + } + result = result && (hasDestination() == other.hasDestination()); + if (hasDestination()) { + result = result && getDestination() + .equals(other.getDestination()); + } + result = result && (hasClientId() == other.hasClientId()); + if (hasClientId()) { + result = result && getClientId() + .equals(other.getClientId()); + } + result = result && (hasFilter() == other.hasFilter()); + if (hasFilter()) { + result = result && getFilter() + .equals(other.getFilter()); + } + result = result && (hasStartTimestamp() == other.hasStartTimestamp()); + if (hasStartTimestamp()) { + result = result && (getStartTimestamp() + == other.getStartTimestamp()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUsername()) { + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + } + if (hasPassword()) { + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + } + if (hasNetReadTimeout()) { + hash = (37 * hash) + NET_READ_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getNetReadTimeout(); + } + if (hasNetWriteTimeout()) { + hash = (37 * hash) + NET_WRITE_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getNetWriteTimeout(); + } + if (hasDestination()) { + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + } + if (hasClientId()) { + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + } + if (hasFilter()) { + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + } + if (hasStartTimestamp()) { + hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStartTimestamp()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** *
      * client authentication
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAuth} */ - public static final class ClientAuth extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientAuth) - ClientAuthOrBuilder { - - // Use ClientAuth.newBuilder() to construct. - private ClientAuth(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private ClientAuth(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final ClientAuth defaultInstance; - - public static ClientAuth getDefaultInstance() { - return defaultInstance; - } - - public ClientAuth getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ClientAuth(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - username_ = bs; - break; - } - case 18: { - bitField0_ |= 0x00000002; - password_ = input.readBytes(); - break; - } - case 24: { - bitField0_ |= 0x00000004; - netReadTimeout_ = input.readInt32(); - break; - } - case 32: { - bitField0_ |= 0x00000008; - netWriteTimeout_ = input.readInt32(); - break; - } - case 42: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000010; - destination_ = bs; - break; - } - case 50: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000020; - clientId_ = bs; - break; - } - case 58: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000040; - filter_ = bs; - break; - } - case 64: { - bitField0_ |= 0x00000080; - startTimestamp_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public ClientAuth parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClientAuth(input, - extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int USERNAME_FIELD_NUMBER = 1; - private java.lang.Object username_; - - /** - * optional string username = 1; - */ - public boolean hasUsername() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string username = 1; - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - username_ = s; - } - return s; - } - } - - /** - * optional string username = 1; - */ - public com.google.protobuf.ByteString getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PASSWORD_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString password_; - - /** - * optional bytes password = 2; - * - *
-         * hashed password with seeds from Handshake message
-         * 
- */ - public boolean hasPassword() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional bytes password = 2; - * - *
-         * hashed password with seeds from Handshake message
-         * 
- */ - public com.google.protobuf.ByteString getPassword() { - return password_; - } - - public static final int NET_READ_TIMEOUT_FIELD_NUMBER = 3; - private int netReadTimeout_; - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
-         * in seconds
-         * 
- */ - public boolean hasNetReadTimeout() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
-         * in seconds
-         * 
- */ - public int getNetReadTimeout() { - return netReadTimeout_; - } - - public static final int NET_WRITE_TIMEOUT_FIELD_NUMBER = 4; - private int netWriteTimeout_; - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
-         * in seconds
-         * 
- */ - public boolean hasNetWriteTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
-         * in seconds
-         * 
- */ - public int getNetWriteTimeout() { - return netWriteTimeout_; - } - - public static final int DESTINATION_FIELD_NUMBER = 5; - private java.lang.Object destination_; - - /** - * optional string destination = 5; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - - /** - * optional string destination = 5; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } - } - - /** - * optional string destination = 5; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLIENT_ID_FIELD_NUMBER = 6; - private java.lang.Object clientId_; - - /** - * optional string client_id = 6; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - - /** - * optional string client_id = 6; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - - /** - * optional string client_id = 6; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 7; - private java.lang.Object filter_; - - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } - } - - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int START_TIMESTAMP_FIELD_NUMBER = 8; - private long startTimestamp_; - - /** - * optional int64 start_timestamp = 8; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - - /** - * optional int64 start_timestamp = 8; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - - private void initFields() { - username_ = ""; - password_ = com.google.protobuf.ByteString.EMPTY; - netReadTimeout_ = 0; - netWriteTimeout_ = 0; - destination_ = ""; - clientId_ = ""; - filter_ = ""; - startTimestamp_ = 0L; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getUsernameBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, password_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, netReadTimeout_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(4, netWriteTimeout_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, getDestinationBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBytes(6, getClientIdBytes()); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeBytes(7, getFilterBytes()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeInt64(8, startTimestamp_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getUsernameBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, password_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, netReadTimeout_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, netWriteTimeout_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, getDestinationBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(6, getClientIdBytes()); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, getFilterBytes()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, startTimestamp_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAuth} - * - *
-         * client authentication
-         * 
- */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.ClientAuth) com.alibaba.otter.canal.protocol.CanalPacket.ClientAuthOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class); - } - - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - username_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - password_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - netReadTimeout_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - netWriteTimeout_ = 0; - bitField0_ = (bitField0_ & ~0x00000008); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000010); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000020); - filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000040); - startTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000080); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth build() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.username_ = username_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.password_ = password_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.netReadTimeout_ = netReadTimeout_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.netWriteTimeout_ = netWriteTimeout_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - result.filter_ = filter_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; - } - result.startTimestamp_ = startTimestamp_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance()) return this; - if (other.hasUsername()) { - bitField0_ |= 0x00000001; - username_ = other.username_; - onChanged(); - } - if (other.hasPassword()) { - setPassword(other.getPassword()); - } - if (other.hasNetReadTimeout()) { - setNetReadTimeout(other.getNetReadTimeout()); - } - if (other.hasNetWriteTimeout()) { - setNetWriteTimeout(other.getNetWriteTimeout()); - } - if (other.hasDestination()) { - bitField0_ |= 0x00000010; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000020; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasFilter()) { - bitField0_ |= 0x00000040; - filter_ = other.filter_; - onChanged(); - } - if (other.hasStartTimestamp()) { - setStartTimestamp(other.getStartTimestamp()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object username_ = ""; - - /** - * optional string username = 1; - */ - public boolean hasUsername() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string username = 1; - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - username_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string username = 1; - */ - public com.google.protobuf.ByteString getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string username = 1; - */ - public Builder setUsername(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - username_ = value; - onChanged(); - return this; - } - - /** - * optional string username = 1; - */ - public Builder clearUsername() { - bitField0_ = (bitField0_ & ~0x00000001); - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - - /** - * optional string username = 1; - */ - public Builder setUsernameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - username_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString password_ = com.google.protobuf.ByteString.EMPTY; - - /** - * optional bytes password = 2; - * - *
-             * hashed password with seeds from Handshake message
-             * 
- */ - public boolean hasPassword() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional bytes password = 2; - * - *
-             * hashed password with seeds from Handshake message
-             * 
- */ - public com.google.protobuf.ByteString getPassword() { - return password_; - } - - /** - * optional bytes password = 2; - * - *
-             * hashed password with seeds from Handshake message
-             * 
- */ - public Builder setPassword(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - password_ = value; - onChanged(); - return this; - } - - /** - * optional bytes password = 2; - * - *
-             * hashed password with seeds from Handshake message
-             * 
- */ - public Builder clearPassword() { - bitField0_ = (bitField0_ & ~0x00000002); - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - - private int netReadTimeout_; - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
-             * in seconds
-             * 
- */ - public boolean hasNetReadTimeout() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
-             * in seconds
-             * 
- */ - public int getNetReadTimeout() { - return netReadTimeout_; - } - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
-             * in seconds
-             * 
- */ - public Builder setNetReadTimeout(int value) { - bitField0_ |= 0x00000004; - netReadTimeout_ = value; - onChanged(); - return this; - } - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
-             * in seconds
-             * 
- */ - public Builder clearNetReadTimeout() { - bitField0_ = (bitField0_ & ~0x00000004); - netReadTimeout_ = 0; - onChanged(); - return this; - } - - private int netWriteTimeout_; - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
-             * in seconds
-             * 
- */ - public boolean hasNetWriteTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
-             * in seconds
-             * 
- */ - public int getNetWriteTimeout() { - return netWriteTimeout_; - } - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
-             * in seconds
-             * 
- */ - public Builder setNetWriteTimeout(int value) { - bitField0_ |= 0x00000008; - netWriteTimeout_ = value; - onChanged(); - return this; - } - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
-             * in seconds
-             * 
- */ - public Builder clearNetWriteTimeout() { - bitField0_ = (bitField0_ & ~0x00000008); - netWriteTimeout_ = 0; - onChanged(); - return this; - } - - private java.lang.Object destination_ = ""; - - /** - * optional string destination = 5; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - - /** - * optional string destination = 5; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string destination = 5; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string destination = 5; - */ - public Builder setDestination(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - destination_ = value; - onChanged(); - return this; - } - - /** - * optional string destination = 5; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000010); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - - /** - * optional string destination = 5; - */ - public Builder setDestinationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - - /** - * optional string client_id = 6; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - - /** - * optional string client_id = 6; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string client_id = 6; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string client_id = 6; - */ - public Builder setClientId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - clientId_ = value; - onChanged(); - return this; - } - - /** - * optional string client_id = 6; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000020); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - - /** - * optional string client_id = 6; - */ - public Builder setClientIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - clientId_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string filter = 7; - */ - public Builder setFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000040; - filter_ = value; - onChanged(); - return this; - } - - /** - * optional string filter = 7; - */ - public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000040); - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - - /** - * optional string filter = 7; - */ - public Builder setFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000040; - filter_ = value; - onChanged(); - return this; - } - - private long startTimestamp_; - - /** - * optional int64 start_timestamp = 8; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - - /** - * optional int64 start_timestamp = 8; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - - /** - * optional int64 start_timestamp = 8; - */ - public Builder setStartTimestamp(long value) { - bitField0_ |= 0x00000080; - startTimestamp_ = value; - onChanged(); - return this; - } - - /** - * optional int64 start_timestamp = 8; - */ - public Builder clearStartTimestamp() { - bitField0_ = (bitField0_ & ~0x00000080); - startTimestamp_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientAuth) + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class); + } + + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + username_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + password_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + netReadTimeout_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + netWriteTimeout_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + filter_ = ""; + bitField0_ = (bitField0_ & ~0x00000040); + startTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } - static { - defaultInstance = new ClientAuth(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth build() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientAuth) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.username_ = username_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.password_ = password_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.netReadTimeout_ = netReadTimeout_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.netWriteTimeout_ = netWriteTimeout_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.filter_ = filter_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.startTimestamp_ = startTimestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance()) return this; + if (other.hasUsername()) { + bitField0_ |= 0x00000001; + username_ = other.username_; + onChanged(); + } + if (other.hasPassword()) { + setPassword(other.getPassword()); + } + if (other.hasNetReadTimeout()) { + setNetReadTimeout(other.getNetReadTimeout()); + } + if (other.hasNetWriteTimeout()) { + setNetWriteTimeout(other.getNetWriteTimeout()); + } + if (other.hasDestination()) { + bitField0_ |= 0x00000010; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000020; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasFilter()) { + bitField0_ |= 0x00000040; + filter_ = other.filter_; + onChanged(); + } + if (other.hasStartTimestamp()) { + setStartTimestamp(other.getStartTimestamp()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object username_ = ""; + /** + * optional string username = 1; + */ + public boolean hasUsername() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string username = 1; + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + username_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string username = 1; + */ + public com.google.protobuf.ByteString + getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string username = 1; + */ + public Builder setUsername( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + username_ = value; + onChanged(); + return this; + } + /** + * optional string username = 1; + */ + public Builder clearUsername() { + bitField0_ = (bitField0_ & ~0x00000001); + username_ = getDefaultInstance().getUsername(); + onChanged(); + return this; + } + /** + * optional string username = 1; + */ + public Builder setUsernameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + username_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString password_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * hashed password with seeds from Handshake message
+       * 
+ * + * optional bytes password = 2; + */ + public boolean hasPassword() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * hashed password with seeds from Handshake message
+       * 
+ * + * optional bytes password = 2; + */ + public com.google.protobuf.ByteString getPassword() { + return password_; + } + /** + *
+       * hashed password with seeds from Handshake message
+       * 
+ * + * optional bytes password = 2; + */ + public Builder setPassword(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + password_ = value; + onChanged(); + return this; + } + /** + *
+       * hashed password with seeds from Handshake message
+       * 
+ * + * optional bytes password = 2; + */ + public Builder clearPassword() { + bitField0_ = (bitField0_ & ~0x00000002); + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + + private int netReadTimeout_ ; + /** + *
+       * in seconds
+       * 
+ * + * optional int32 net_read_timeout = 3 [default = 0]; + */ + public boolean hasNetReadTimeout() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + *
+       * in seconds
+       * 
+ * + * optional int32 net_read_timeout = 3 [default = 0]; + */ + public int getNetReadTimeout() { + return netReadTimeout_; + } + /** + *
+       * in seconds
+       * 
+ * + * optional int32 net_read_timeout = 3 [default = 0]; + */ + public Builder setNetReadTimeout(int value) { + bitField0_ |= 0x00000004; + netReadTimeout_ = value; + onChanged(); + return this; + } + /** + *
+       * in seconds
+       * 
+ * + * optional int32 net_read_timeout = 3 [default = 0]; + */ + public Builder clearNetReadTimeout() { + bitField0_ = (bitField0_ & ~0x00000004); + netReadTimeout_ = 0; + onChanged(); + return this; + } + + private int netWriteTimeout_ ; + /** + *
+       * in seconds
+       * 
+ * + * optional int32 net_write_timeout = 4 [default = 0]; + */ + public boolean hasNetWriteTimeout() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       * in seconds
+       * 
+ * + * optional int32 net_write_timeout = 4 [default = 0]; + */ + public int getNetWriteTimeout() { + return netWriteTimeout_; + } + /** + *
+       * in seconds
+       * 
+ * + * optional int32 net_write_timeout = 4 [default = 0]; + */ + public Builder setNetWriteTimeout(int value) { + bitField0_ |= 0x00000008; + netWriteTimeout_ = value; + onChanged(); + return this; + } + /** + *
+       * in seconds
+       * 
+ * + * optional int32 net_write_timeout = 4 [default = 0]; + */ + public Builder clearNetWriteTimeout() { + bitField0_ = (bitField0_ & ~0x00000008); + netWriteTimeout_ = 0; + onChanged(); + return this; + } + + private java.lang.Object destination_ = ""; + /** + * optional string destination = 5; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string destination = 5; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string destination = 5; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string destination = 5; + */ + public Builder setDestination( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + destination_ = value; + onChanged(); + return this; + } + /** + * optional string destination = 5; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000010); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + /** + * optional string destination = 5; + */ + public Builder setDestinationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + /** + * optional string client_id = 6; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional string client_id = 6; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string client_id = 6; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string client_id = 6; + */ + public Builder setClientId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + clientId_ = value; + onChanged(); + return this; + } + /** + * optional string client_id = 6; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000020); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + /** + * optional string client_id = 6; + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + clientId_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string filter = 7; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + filter_ = value; + onChanged(); + return this; + } + /** + * optional string filter = 7; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000040); + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * optional string filter = 7; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + filter_ = value; + onChanged(); + return this; + } + + private long startTimestamp_ ; + /** + * optional int64 start_timestamp = 8; + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int64 start_timestamp = 8; + */ + public long getStartTimestamp() { + return startTimestamp_; + } + /** + * optional int64 start_timestamp = 8; + */ + public Builder setStartTimestamp(long value) { + bitField0_ |= 0x00000080; + startTimestamp_ = value; + onChanged(); + return this; + } + /** + * optional int64 start_timestamp = 8; + */ + public Builder clearStartTimestamp() { + bitField0_ = (bitField0_ & ~0x00000080); + startTimestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientAuth) } - public interface AckOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Ack) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int32 error_code = 1 [default = 0]; - */ - boolean hasErrorCode(); - - /** - * optional int32 error_code = 1 [default = 0]; - */ - int getErrorCode(); - - /** - * optional string error_message = 2; - * - *
-         * if something like compression is not supported, erorr_message will tell about it.
-         * 
- */ - boolean hasErrorMessage(); - - /** - * optional string error_message = 2; - * - *
-         * if something like compression is not supported, erorr_message will tell about it.
-         * 
- */ - java.lang.String getErrorMessage(); - - /** - * optional string error_message = 2; - * - *
-         * if something like compression is not supported, erorr_message will tell about it.
-         * 
- */ - com.google.protobuf.ByteString getErrorMessageBytes(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientAuth) + private static final com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientAuth parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientAuth(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AckOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Ack) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 error_code = 1 [default = 0]; + */ + boolean hasErrorCode(); + /** + * optional int32 error_code = 1 [default = 0]; + */ + int getErrorCode(); + + /** + *
+     * if something like compression is not supported, erorr_message will tell about it.
+     * 
+ * + * optional string error_message = 2; + */ + boolean hasErrorMessage(); + /** + *
+     * if something like compression is not supported, erorr_message will tell about it.
+     * 
+ * + * optional string error_message = 2; + */ + java.lang.String getErrorMessage(); + /** + *
+     * if something like compression is not supported, erorr_message will tell about it.
+     * 
+ * + * optional string error_message = 2; + */ + com.google.protobuf.ByteString + getErrorMessageBytes(); + } + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Ack} + */ + public static final class Ack extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Ack) + AckOrBuilder { + private static final long serialVersionUID = 0L; + // Use Ack.newBuilder() to construct. + private Ack(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Ack() { + errorCode_ = 0; + errorMessage_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Ack( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + errorCode_ = input.readInt32(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + errorMessage_ = bs; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); + } + + private int bitField0_; + public static final int ERROR_CODE_FIELD_NUMBER = 1; + private int errorCode_; + /** + * optional int32 error_code = 1 [default = 0]; + */ + public boolean hasErrorCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 error_code = 1 [default = 0]; + */ + public int getErrorCode() { + return errorCode_; + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object errorMessage_; + /** + *
+     * if something like compression is not supported, erorr_message will tell about it.
+     * 
+ * + * optional string error_message = 2; + */ + public boolean hasErrorMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+     * if something like compression is not supported, erorr_message will tell about it.
+     * 
+ * + * optional string error_message = 2; + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + errorMessage_ = s; + } + return s; + } + } + /** + *
+     * if something like compression is not supported, erorr_message will tell about it.
+     * 
+ * + * optional string error_message = 2; + */ + public com.google.protobuf.ByteString + getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, errorCode_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, errorCode_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.Ack)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.Ack other = (com.alibaba.otter.canal.protocol.CanalPacket.Ack) obj; + + boolean result = true; + result = result && (hasErrorCode() == other.hasErrorCode()); + if (hasErrorCode()) { + result = result && (getErrorCode() + == other.getErrorCode()); + } + result = result && (hasErrorMessage() == other.hasErrorMessage()); + if (hasErrorMessage()) { + result = result && getErrorMessage() + .equals(other.getErrorMessage()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasErrorCode()) { + hash = (37 * hash) + ERROR_CODE_FIELD_NUMBER; + hash = (53 * hash) + getErrorCode(); + } + if (hasErrorMessage()) { + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Ack prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Ack} */ - public static final class Ack extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Ack) - AckOrBuilder { - - // Use Ack.newBuilder() to construct. - private Ack(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private Ack(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final Ack defaultInstance; - - public static Ack getDefaultInstance() { - return defaultInstance; - } - - public Ack getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Ack(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - errorCode_ = input.readInt32(); - break; - } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - errorMessage_ = bs; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, - com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public Ack parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Ack(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int ERROR_CODE_FIELD_NUMBER = 1; - private int errorCode_; - - /** - * optional int32 error_code = 1 [default = 0]; - */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional int32 error_code = 1 [default = 0]; - */ - public int getErrorCode() { - return errorCode_; - } - - public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; - private java.lang.Object errorMessage_; - - /** - * optional string error_message = 2; - * - *
-         * if something like compression is not supported, erorr_message will tell about it.
-         * 
- */ - public boolean hasErrorMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string error_message = 2; - * - *
-         * if something like compression is not supported, erorr_message will tell about it.
-         * 
- */ - public java.lang.String getErrorMessage() { - java.lang.Object ref = errorMessage_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - errorMessage_ = s; - } - return s; - } - } - - /** - * optional string error_message = 2; - * - *
-         * if something like compression is not supported, erorr_message will tell about it.
-         * 
- */ - public com.google.protobuf.ByteString getErrorMessageBytes() { - java.lang.Object ref = errorMessage_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - errorMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - errorCode_ = 0; - errorMessage_ = ""; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, errorCode_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getErrorMessageBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, errorCode_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getErrorMessageBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Ack prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Ack} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Ack) com.alibaba.otter.canal.protocol.CanalPacket.AckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, - com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Ack.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.Ack.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - errorCode_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - errorMessage_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Ack getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Ack build() { - com.alibaba.otter.canal.protocol.CanalPacket.Ack result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Ack buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Ack result = new com.alibaba.otter.canal.protocol.CanalPacket.Ack(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.errorCode_ = errorCode_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.errorMessage_ = errorMessage_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Ack) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Ack) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Ack other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance()) return this; - if (other.hasErrorCode()) { - setErrorCode(other.getErrorCode()); - } - if (other.hasErrorMessage()) { - bitField0_ |= 0x00000002; - errorMessage_ = other.errorMessage_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Ack parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Ack) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private int errorCode_; - - /** - * optional int32 error_code = 1 [default = 0]; - */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional int32 error_code = 1 [default = 0]; - */ - public int getErrorCode() { - return errorCode_; - } - - /** - * optional int32 error_code = 1 [default = 0]; - */ - public Builder setErrorCode(int value) { - bitField0_ |= 0x00000001; - errorCode_ = value; - onChanged(); - return this; - } - - /** - * optional int32 error_code = 1 [default = 0]; - */ - public Builder clearErrorCode() { - bitField0_ = (bitField0_ & ~0x00000001); - errorCode_ = 0; - onChanged(); - return this; - } - - private java.lang.Object errorMessage_ = ""; - - /** - * optional string error_message = 2; - * - *
-             * if something like compression is not supported, erorr_message will tell about it.
-             * 
- */ - public boolean hasErrorMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string error_message = 2; - * - *
-             * if something like compression is not supported, erorr_message will tell about it.
-             * 
- */ - public java.lang.String getErrorMessage() { - java.lang.Object ref = errorMessage_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - errorMessage_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string error_message = 2; - * - *
-             * if something like compression is not supported, erorr_message will tell about it.
-             * 
- */ - public com.google.protobuf.ByteString getErrorMessageBytes() { - java.lang.Object ref = errorMessage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - errorMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string error_message = 2; - * - *
-             * if something like compression is not supported, erorr_message will tell about it.
-             * 
- */ - public Builder setErrorMessage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - errorMessage_ = value; - onChanged(); - return this; - } - - /** - * optional string error_message = 2; - * - *
-             * if something like compression is not supported, erorr_message will tell about it.
-             * 
- */ - public Builder clearErrorMessage() { - bitField0_ = (bitField0_ & ~0x00000002); - errorMessage_ = getDefaultInstance().getErrorMessage(); - onChanged(); - return this; - } - - /** - * optional string error_message = 2; - * - *
-             * if something like compression is not supported, erorr_message will tell about it.
-             * 
- */ - public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - errorMessage_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Ack) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + errorCode_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + errorMessage_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } - static { - defaultInstance = new Ack(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Ack getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Ack build() { + com.alibaba.otter.canal.protocol.CanalPacket.Ack result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Ack) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Ack buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Ack result = new com.alibaba.otter.canal.protocol.CanalPacket.Ack(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.errorCode_ = errorCode_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.errorMessage_ = errorMessage_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Ack) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Ack)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Ack other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance()) return this; + if (other.hasErrorCode()) { + setErrorCode(other.getErrorCode()); + } + if (other.hasErrorMessage()) { + bitField0_ |= 0x00000002; + errorMessage_ = other.errorMessage_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Ack parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Ack) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int errorCode_ ; + /** + * optional int32 error_code = 1 [default = 0]; + */ + public boolean hasErrorCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 error_code = 1 [default = 0]; + */ + public int getErrorCode() { + return errorCode_; + } + /** + * optional int32 error_code = 1 [default = 0]; + */ + public Builder setErrorCode(int value) { + bitField0_ |= 0x00000001; + errorCode_ = value; + onChanged(); + return this; + } + /** + * optional int32 error_code = 1 [default = 0]; + */ + public Builder clearErrorCode() { + bitField0_ = (bitField0_ & ~0x00000001); + errorCode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + /** + *
+       * if something like compression is not supported, erorr_message will tell about it.
+       * 
+ * + * optional string error_message = 2; + */ + public boolean hasErrorMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + *
+       * if something like compression is not supported, erorr_message will tell about it.
+       * 
+ * + * optional string error_message = 2; + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + errorMessage_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * if something like compression is not supported, erorr_message will tell about it.
+       * 
+ * + * optional string error_message = 2; + */ + public com.google.protobuf.ByteString + getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * if something like compression is not supported, erorr_message will tell about it.
+       * 
+ * + * optional string error_message = 2; + */ + public Builder setErrorMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + errorMessage_ = value; + onChanged(); + return this; + } + /** + *
+       * if something like compression is not supported, erorr_message will tell about it.
+       * 
+ * + * optional string error_message = 2; + */ + public Builder clearErrorMessage() { + bitField0_ = (bitField0_ & ~0x00000002); + errorMessage_ = getDefaultInstance().getErrorMessage(); + onChanged(); + return this; + } + /** + *
+       * if something like compression is not supported, erorr_message will tell about it.
+       * 
+ * + * optional string error_message = 2; + */ + public Builder setErrorMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + errorMessage_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Ack) } - public interface ClientAckOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientAck) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString getClientIdBytes(); - - /** - * optional int64 batch_id = 3; - */ - boolean hasBatchId(); - - /** - * optional int64 batch_id = 3; - */ - long getBatchId(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Ack) + private static final com.alibaba.otter.canal.protocol.CanalPacket.Ack DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.Ack(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Ack parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Ack(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Ack getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ClientAckOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientAck) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString + getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + * optional int64 batch_id = 3; + */ + boolean hasBatchId(); + /** + * optional int64 batch_id = 3; + */ + long getBatchId(); + } + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAck} + */ + public static final class ClientAck extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientAck) + ClientAckOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClientAck.newBuilder() to construct. + private ClientAck(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClientAck() { + destination_ = ""; + clientId_ = ""; + batchId_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClientAck( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 24: { + bitField0_ |= 0x00000004; + batchId_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private volatile java.lang.Object destination_; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object clientId_; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BATCH_ID_FIELD_NUMBER = 3; + private long batchId_; + /** + * optional int64 batch_id = 3; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 batch_id = 3; + */ + public long getBatchId() { + return batchId_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(3, batchId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, batchId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAck)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck other = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) obj; + + boolean result = true; + result = result && (hasDestination() == other.hasDestination()); + if (hasDestination()) { + result = result && getDestination() + .equals(other.getDestination()); + } + result = result && (hasClientId() == other.hasClientId()); + if (hasClientId()) { + result = result && getClientId() + .equals(other.getClientId()); + } + result = result && (hasBatchId() == other.hasBatchId()); + if (hasBatchId()) { + result = result && (getBatchId() + == other.getBatchId()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDestination()) { + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + } + if (hasClientId()) { + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + } + if (hasBatchId()) { + hash = (37 * hash) + BATCH_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBatchId()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAck} */ - public static final class ClientAck extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientAck) - ClientAckOrBuilder { - - // Use ClientAck.newBuilder() to construct. - private ClientAck(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private ClientAck(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final ClientAck defaultInstance; - - public static ClientAck getDefaultInstance() { - return defaultInstance; - } - - public ClientAck getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ClientAck(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; - } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; - } - case 24: { - bitField0_ |= 0x00000004; - batchId_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public ClientAck parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClientAck(input, - extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BATCH_ID_FIELD_NUMBER = 3; - private long batchId_; - - /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int64 batch_id = 3; - */ - public long getBatchId() { - return batchId_; - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - batchId_ = 0L; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt64(3, batchId_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, batchId_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAck} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.ClientAck) com.alibaba.otter.canal.protocol.CanalPacket.ClientAckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - batchId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck build() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAck(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.batchId_ = batchId_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasBatchId()) { - setBatchId(other.getBatchId()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object destination_ = ""; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string destination = 1; - */ - public Builder setDestination(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string client_id = 2; - */ - public Builder setClientId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private long batchId_; - - /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int64 batch_id = 3; - */ - public long getBatchId() { - return batchId_; - } - - /** - * optional int64 batch_id = 3; - */ - public Builder setBatchId(long value) { - bitField0_ |= 0x00000004; - batchId_ = value; - onChanged(); - return this; - } - - /** - * optional int64 batch_id = 3; - */ - public Builder clearBatchId() { - bitField0_ = (bitField0_ & ~0x00000004); - batchId_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientAck) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + batchId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } - static { - defaultInstance = new ClientAck(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck build() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientAck) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAck(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.batchId_ = batchId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientAck)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasBatchId()) { + setBatchId(other.getBatchId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object destination_ = ""; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string destination = 1; + */ + public Builder setDestination( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string client_id = 2; + */ + public Builder setClientId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private long batchId_ ; + /** + * optional int64 batch_id = 3; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 batch_id = 3; + */ + public long getBatchId() { + return batchId_; + } + /** + * optional int64 batch_id = 3; + */ + public Builder setBatchId(long value) { + bitField0_ |= 0x00000004; + batchId_ = value; + onChanged(); + return this; + } + /** + * optional int64 batch_id = 3; + */ + public Builder clearBatchId() { + bitField0_ = (bitField0_ & ~0x00000004); + batchId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientAck) } - public interface SubOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Sub) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString getClientIdBytes(); - - /** - * optional string filter = 7; - */ - boolean hasFilter(); - - /** - * optional string filter = 7; - */ - java.lang.String getFilter(); - - /** - * optional string filter = 7; - */ - com.google.protobuf.ByteString getFilterBytes(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientAck) + private static final com.alibaba.otter.canal.protocol.CanalPacket.ClientAck DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAck(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientAck parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientAck(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Sub) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString + getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + * optional string filter = 7; + */ + boolean hasFilter(); + /** + * optional string filter = 7; + */ + java.lang.String getFilter(); + /** + * optional string filter = 7; + */ + com.google.protobuf.ByteString + getFilterBytes(); + } + /** + *
+   * subscription
+   * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Sub} + */ + public static final class Sub extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Sub) + SubOrBuilder { + private static final long serialVersionUID = 0L; + // Use Sub.newBuilder() to construct. + private Sub(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Sub() { + destination_ = ""; + clientId_ = ""; + filter_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Sub( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 58: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + filter_ = bs; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private volatile java.lang.Object destination_; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object clientId_; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 7; + private volatile java.lang.Object filter_; + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } + } + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.Sub)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.Sub other = (com.alibaba.otter.canal.protocol.CanalPacket.Sub) obj; + + boolean result = true; + result = result && (hasDestination() == other.hasDestination()); + if (hasDestination()) { + result = result && getDestination() + .equals(other.getDestination()); + } + result = result && (hasClientId() == other.hasClientId()); + if (hasClientId()) { + result = result && getClientId() + .equals(other.getClientId()); + } + result = result && (hasFilter() == other.hasFilter()); + if (hasFilter()) { + result = result && getFilter() + .equals(other.getFilter()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDestination()) { + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + } + if (hasClientId()) { + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + } + if (hasFilter()) { + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Sub prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Sub} - * *
      * subscription
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Sub} */ - public static final class Sub extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Sub) - SubOrBuilder { - - // Use Sub.newBuilder() to construct. - private Sub(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private Sub(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final Sub defaultInstance; - - public static Sub getDefaultInstance() { - return defaultInstance; - } - - public Sub getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Sub(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; - } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; - } - case 58: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - filter_ = bs; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, - com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public Sub parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Sub(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 7; - private java.lang.Object filter_; - - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } - } - - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - filter_ = ""; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(7, getFilterBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, getFilterBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Sub prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Sub} - * - *
-         * subscription
-         * 
- */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Sub) com.alibaba.otter.canal.protocol.CanalPacket.SubOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, - com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Sub.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.Sub.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Sub getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Sub build() { - com.alibaba.otter.canal.protocol.CanalPacket.Sub result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Sub buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Sub result = new com.alibaba.otter.canal.protocol.CanalPacket.Sub(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.filter_ = filter_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Sub) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Sub) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Sub other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasFilter()) { - bitField0_ |= 0x00000004; - filter_ = other.filter_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Sub parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Sub) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object destination_ = ""; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string destination = 1; - */ - public Builder setDestination(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string client_id = 2; - */ - public Builder setClientId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string filter = 7; - */ - public Builder setFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - filter_ = value; - onChanged(); - return this; - } - - /** - * optional string filter = 7; - */ - public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000004); - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - - /** - * optional string filter = 7; - */ - public Builder setFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - filter_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Sub) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + filter_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } - static { - defaultInstance = new Sub(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Sub getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Sub build() { + com.alibaba.otter.canal.protocol.CanalPacket.Sub result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Sub) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Sub buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Sub result = new com.alibaba.otter.canal.protocol.CanalPacket.Sub(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.filter_ = filter_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Sub) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Sub)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Sub other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasFilter()) { + bitField0_ |= 0x00000004; + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Sub parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Sub) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object destination_ = ""; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string destination = 1; + */ + public Builder setDestination( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string client_id = 2; + */ + public Builder setClientId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string filter = 7; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + filter_ = value; + onChanged(); + return this; + } + /** + * optional string filter = 7; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000004); + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * optional string filter = 7; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + filter_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Sub) } - public interface UnsubOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Unsub) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString getClientIdBytes(); - - /** - * optional string filter = 7; - */ - boolean hasFilter(); - - /** - * optional string filter = 7; - */ - java.lang.String getFilter(); - - /** - * optional string filter = 7; - */ - com.google.protobuf.ByteString getFilterBytes(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Sub) + private static final com.alibaba.otter.canal.protocol.CanalPacket.Sub DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.Sub(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sub parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Sub(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Sub getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UnsubOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Unsub) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString + getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + * optional string filter = 7; + */ + boolean hasFilter(); + /** + * optional string filter = 7; + */ + java.lang.String getFilter(); + /** + * optional string filter = 7; + */ + com.google.protobuf.ByteString + getFilterBytes(); + } + /** + *
+   * Unsubscription
+   * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Unsub} + */ + public static final class Unsub extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Unsub) + UnsubOrBuilder { + private static final long serialVersionUID = 0L; + // Use Unsub.newBuilder() to construct. + private Unsub(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Unsub() { + destination_ = ""; + clientId_ = ""; + filter_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Unsub( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 58: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + filter_ = bs; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private volatile java.lang.Object destination_; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object clientId_; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 7; + private volatile java.lang.Object filter_; + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } + } + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.Unsub)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.Unsub other = (com.alibaba.otter.canal.protocol.CanalPacket.Unsub) obj; + + boolean result = true; + result = result && (hasDestination() == other.hasDestination()); + if (hasDestination()) { + result = result && getDestination() + .equals(other.getDestination()); + } + result = result && (hasClientId() == other.hasClientId()); + if (hasClientId()) { + result = result && getClientId() + .equals(other.getClientId()); + } + result = result && (hasFilter() == other.hasFilter()); + if (hasFilter()) { + result = result && getFilter() + .equals(other.getFilter()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDestination()) { + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + } + if (hasClientId()) { + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + } + if (hasFilter()) { + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Unsub prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Unsub} - * *
      * Unsubscription
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Unsub} */ - public static final class Unsub extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Unsub) - UnsubOrBuilder { - - // Use Unsub.newBuilder() to construct. - private Unsub(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private Unsub(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final Unsub defaultInstance; - - public static Unsub getDefaultInstance() { - return defaultInstance; - } - - public Unsub getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Unsub(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; - } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; - } - case 58: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - filter_ = bs; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, - com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public Unsub parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Unsub(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 7; - private java.lang.Object filter_; - - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } - } - - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - filter_ = ""; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(7, getFilterBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, getFilterBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Unsub prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Unsub} - * - *
-         * Unsubscription
-         * 
- */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Unsub) com.alibaba.otter.canal.protocol.CanalPacket.UnsubOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, - com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Unsub.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.Unsub.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Unsub getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Unsub build() { - com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Unsub buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = new com.alibaba.otter.canal.protocol.CanalPacket.Unsub(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.filter_ = filter_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Unsub) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Unsub) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Unsub other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasFilter()) { - bitField0_ |= 0x00000004; - filter_ = other.filter_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Unsub parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Unsub) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object destination_ = ""; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string destination = 1; - */ - public Builder setDestination(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string client_id = 2; - */ - public Builder setClientId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string filter = 7; - */ - public Builder setFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - filter_ = value; - onChanged(); - return this; - } - - /** - * optional string filter = 7; - */ - public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000004); - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - - /** - * optional string filter = 7; - */ - public Builder setFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - filter_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Unsub) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + filter_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } - static { - defaultInstance = new Unsub(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Unsub getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Unsub build() { + com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Unsub) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Unsub buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = new com.alibaba.otter.canal.protocol.CanalPacket.Unsub(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.filter_ = filter_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Unsub) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Unsub)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Unsub other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasFilter()) { + bitField0_ |= 0x00000004; + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Unsub parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Unsub) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object destination_ = ""; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string destination = 1; + */ + public Builder setDestination( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string client_id = 2; + */ + public Builder setClientId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string filter = 7; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + filter_ = value; + onChanged(); + return this; + } + /** + * optional string filter = 7; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000004); + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * optional string filter = 7; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + filter_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Unsub) } - public interface GetOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Get) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString getClientIdBytes(); - - /** - * optional int32 fetch_size = 3; - */ - boolean hasFetchSize(); - - /** - * optional int32 fetch_size = 3; - */ - int getFetchSize(); - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
-         * 默认-1时代表不控制
-         * 
- */ - boolean hasTimeout(); - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
-         * 默认-1时代表不控制
-         * 
- */ - long getTimeout(); - - /** - * optional int32 unit = 5 [default = 2]; - * - *
-         * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-         * 
- */ - boolean hasUnit(); - - /** - * optional int32 unit = 5 [default = 2]; - * - *
-         * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-         * 
- */ - int getUnit(); - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
-         * 是否自动ack
-         * 
- */ - boolean hasAutoAck(); - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
-         * 是否自动ack
-         * 
- */ - boolean getAutoAck(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Unsub) + private static final com.alibaba.otter.canal.protocol.CanalPacket.Unsub DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.Unsub(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Unsub parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Unsub(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Unsub getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Get) + com.google.protobuf.MessageOrBuilder { + /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Get} - * - *
-     * PullRequest
-     * 
+ * optional string destination = 1; */ - public static final class Get extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Get) - GetOrBuilder { + boolean hasDestination(); + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString + getDestinationBytes(); - // Use Get.newBuilder() to construct. - private Get(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString + getClientIdBytes(); - private Get(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } + /** + * optional int32 fetch_size = 3; + */ + boolean hasFetchSize(); + /** + * optional int32 fetch_size = 3; + */ + int getFetchSize(); - private static final Get defaultInstance; + /** + *
+     * 默认-1时代表不控制
+     * 
+ * + * optional int64 timeout = 4 [default = -1]; + */ + boolean hasTimeout(); + /** + *
+     * 默认-1时代表不控制
+     * 
+ * + * optional int64 timeout = 4 [default = -1]; + */ + long getTimeout(); - public static Get getDefaultInstance() { - return defaultInstance; - } + /** + *
+     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+     * 
+ * + * optional int32 unit = 5 [default = 2]; + */ + boolean hasUnit(); + /** + *
+     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+     * 
+ * + * optional int32 unit = 5 [default = 2]; + */ + int getUnit(); - public Get getDefaultInstanceForType() { - return defaultInstance; - } + /** + *
+     * 是否自动ack
+     * 
+ * + * optional bool auto_ack = 6 [default = false]; + */ + boolean hasAutoAck(); + /** + *
+     * 是否自动ack
+     * 
+ * + * optional bool auto_ack = 6 [default = false]; + */ + boolean getAutoAck(); + } + /** + *
+   *  PullRequest
+   * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Get} + */ + public static final class Get extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Get) + GetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Get.newBuilder() to construct. + private Get(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Get() { + destination_ = ""; + clientId_ = ""; + fetchSize_ = 0; + timeout_ = -1L; + unit_ = 2; + autoAck_ = false; + } - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Get(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; - } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; - } - case 24: { - bitField0_ |= 0x00000004; - fetchSize_ = input.readInt32(); - break; - } - case 32: { - bitField0_ |= 0x00000008; - timeout_ = input.readInt64(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - unit_ = input.readInt32(); - break; - } - case 48: { - bitField0_ |= 0x00000020; - autoAck_ = input.readBool(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Get( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Get.class, - com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public Get parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Get(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + case 24: { + bitField0_ |= 0x00000004; + fetchSize_ = input.readInt32(); + break; } - } - - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; + case 32: { + bitField0_ |= 0x00000008; + timeout_ = input.readInt64(); + break; } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + case 40: { + bitField0_ |= 0x00000010; + unit_ = input.readInt32(); + break; } - } - - public static final int FETCH_SIZE_FIELD_NUMBER = 3; - private int fetchSize_; - - /** - * optional int32 fetch_size = 3; - */ - public boolean hasFetchSize() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int32 fetch_size = 3; - */ - public int getFetchSize() { - return fetchSize_; - } - - public static final int TIMEOUT_FIELD_NUMBER = 4; - private long timeout_; - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
-         * 默认-1时代表不控制
-         * 
- */ - public boolean hasTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
-         * 默认-1时代表不控制
-         * 
- */ - public long getTimeout() { - return timeout_; - } - - public static final int UNIT_FIELD_NUMBER = 5; - private int unit_; - - /** - * optional int32 unit = 5 [default = 2]; - * - *
-         * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-         * 
- */ - public boolean hasUnit() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - - /** - * optional int32 unit = 5 [default = 2]; - * - *
-         * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-         * 
- */ - public int getUnit() { - return unit_; - } - - public static final int AUTO_ACK_FIELD_NUMBER = 6; - private boolean autoAck_; - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
-         * 是否自动ack
-         * 
- */ - public boolean hasAutoAck() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
-         * 是否自动ack
-         * 
- */ - public boolean getAutoAck() { - return autoAck_; - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - fetchSize_ = 0; - timeout_ = -1L; - unit_ = 2; - autoAck_ = false; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); + case 48: { + bitField0_ |= 0x00000020; + autoAck_ = input.readBool(); + break; } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, fetchSize_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt64(4, timeout_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(5, unit_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBool(6, autoAck_); - } - getUnknownFields().writeTo(output); + } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; + } - private int memoizedSerializedSize = -1; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Get.class, com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class); + } - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, fetchSize_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, timeout_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, unit_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, autoAck_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private volatile java.lang.Object destination_; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; } + return s; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object clientId_; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; } + return s; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + public static final int FETCH_SIZE_FIELD_NUMBER = 3; + private int fetchSize_; + /** + * optional int32 fetch_size = 3; + */ + public boolean hasFetchSize() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 fetch_size = 3; + */ + public int getFetchSize() { + return fetchSize_; + } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + public static final int TIMEOUT_FIELD_NUMBER = 4; + private long timeout_; + /** + *
+     * 默认-1时代表不控制
+     * 
+ * + * optional int64 timeout = 4 [default = -1]; + */ + public boolean hasTimeout() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+     * 默认-1时代表不控制
+     * 
+ * + * optional int64 timeout = 4 [default = -1]; + */ + public long getTimeout() { + return timeout_; + } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + public static final int UNIT_FIELD_NUMBER = 5; + private int unit_; + /** + *
+     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+     * 
+ * + * optional int32 unit = 5 [default = 2]; + */ + public boolean hasUnit() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+     * 
+ * + * optional int32 unit = 5 [default = 2]; + */ + public int getUnit() { + return unit_; + } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + public static final int AUTO_ACK_FIELD_NUMBER = 6; + private boolean autoAck_; + /** + *
+     * 是否自动ack
+     * 
+ * + * optional bool auto_ack = 6 [default = false]; + */ + public boolean hasAutoAck() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+     * 是否自动ack
+     * 
+ * + * optional bool auto_ack = 6 [default = false]; + */ + public boolean getAutoAck() { + return autoAck_; + } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } + memoizedIsInitialized = 1; + return true; + } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, fetchSize_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt64(4, timeout_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, unit_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBool(6, autoAck_); + } + unknownFields.writeTo(output); + } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, fetchSize_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, timeout_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, unit_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, autoAck_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.Get)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.Get other = (com.alibaba.otter.canal.protocol.CanalPacket.Get) obj; - public static Builder newBuilder() { - return Builder.create(); - } + boolean result = true; + result = result && (hasDestination() == other.hasDestination()); + if (hasDestination()) { + result = result && getDestination() + .equals(other.getDestination()); + } + result = result && (hasClientId() == other.hasClientId()); + if (hasClientId()) { + result = result && getClientId() + .equals(other.getClientId()); + } + result = result && (hasFetchSize() == other.hasFetchSize()); + if (hasFetchSize()) { + result = result && (getFetchSize() + == other.getFetchSize()); + } + result = result && (hasTimeout() == other.hasTimeout()); + if (hasTimeout()) { + result = result && (getTimeout() + == other.getTimeout()); + } + result = result && (hasUnit() == other.hasUnit()); + if (hasUnit()) { + result = result && (getUnit() + == other.getUnit()); + } + result = result && (hasAutoAck() == other.hasAutoAck()); + if (hasAutoAck()) { + result = result && (getAutoAck() + == other.getAutoAck()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } - public Builder newBuilderForType() { - return newBuilder(); - } + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDestination()) { + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + } + if (hasClientId()) { + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + } + if (hasFetchSize()) { + hash = (37 * hash) + FETCH_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getFetchSize(); + } + if (hasTimeout()) { + hash = (37 * hash) + TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimeout()); + } + if (hasUnit()) { + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit(); + } + if (hasAutoAck()) { + hash = (37 * hash) + AUTO_ACK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAutoAck()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Get prototype) { - return newBuilder().mergeFrom(prototype); - } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } - public Builder toBuilder() { - return newBuilder(this); - } + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Get prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Get} - * - *
-         * PullRequest
-         * 
- */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     *  PullRequest
+     * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Get} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Get) com.alibaba.otter.canal.protocol.CanalPacket.GetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Get.class, com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Get.class, - com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Get.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.Get.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - fetchSize_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - timeout_ = -1L; - bitField0_ = (bitField0_ & ~0x00000008); - unit_ = 2; - bitField0_ = (bitField0_ & ~0x00000010); - autoAck_ = false; - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Get getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Get build() { - com.alibaba.otter.canal.protocol.CanalPacket.Get result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Get buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Get result = new com.alibaba.otter.canal.protocol.CanalPacket.Get(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.fetchSize_ = fetchSize_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.timeout_ = timeout_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.unit_ = unit_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.autoAck_ = autoAck_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Get) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Get) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Get other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasFetchSize()) { - setFetchSize(other.getFetchSize()); - } - if (other.hasTimeout()) { - setTimeout(other.getTimeout()); - } - if (other.hasUnit()) { - setUnit(other.getUnit()); - } - if (other.hasAutoAck()) { - setAutoAck(other.getAutoAck()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Get parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Get) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object destination_ = ""; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string destination = 1; - */ - public Builder setDestination(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string client_id = 2; - */ - public Builder setClientId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private int fetchSize_; - - /** - * optional int32 fetch_size = 3; - */ - public boolean hasFetchSize() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int32 fetch_size = 3; - */ - public int getFetchSize() { - return fetchSize_; - } - - /** - * optional int32 fetch_size = 3; - */ - public Builder setFetchSize(int value) { - bitField0_ |= 0x00000004; - fetchSize_ = value; - onChanged(); - return this; - } - - /** - * optional int32 fetch_size = 3; - */ - public Builder clearFetchSize() { - bitField0_ = (bitField0_ & ~0x00000004); - fetchSize_ = 0; - onChanged(); - return this; - } - - private long timeout_ = -1L; - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
-             * 默认-1时代表不控制
-             * 
- */ - public boolean hasTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
-             * 默认-1时代表不控制
-             * 
- */ - public long getTimeout() { - return timeout_; - } - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
-             * 默认-1时代表不控制
-             * 
- */ - public Builder setTimeout(long value) { - bitField0_ |= 0x00000008; - timeout_ = value; - onChanged(); - return this; - } - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
-             * 默认-1时代表不控制
-             * 
- */ - public Builder clearTimeout() { - bitField0_ = (bitField0_ & ~0x00000008); - timeout_ = -1L; - onChanged(); - return this; - } - - private int unit_ = 2; - - /** - * optional int32 unit = 5 [default = 2]; - * - *
-             * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-             * 
- */ - public boolean hasUnit() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - - /** - * optional int32 unit = 5 [default = 2]; - * - *
-             * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-             * 
- */ - public int getUnit() { - return unit_; - } - - /** - * optional int32 unit = 5 [default = 2]; - * - *
-             * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-             * 
- */ - public Builder setUnit(int value) { - bitField0_ |= 0x00000010; - unit_ = value; - onChanged(); - return this; - } - - /** - * optional int32 unit = 5 [default = 2]; - * - *
-             * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-             * 
- */ - public Builder clearUnit() { - bitField0_ = (bitField0_ & ~0x00000010); - unit_ = 2; - onChanged(); - return this; - } - - private boolean autoAck_; - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
-             * 是否自动ack
-             * 
- */ - public boolean hasAutoAck() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
-             * 是否自动ack
-             * 
- */ - public boolean getAutoAck() { - return autoAck_; - } - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
-             * 是否自动ack
-             * 
- */ - public Builder setAutoAck(boolean value) { - bitField0_ |= 0x00000020; - autoAck_ = value; - onChanged(); - return this; - } - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
-             * 是否自动ack
-             * 
- */ - public Builder clearAutoAck() { - bitField0_ = (bitField0_ & ~0x00000020); - autoAck_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Get) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + fetchSize_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + timeout_ = -1L; + bitField0_ = (bitField0_ & ~0x00000008); + unit_ = 2; + bitField0_ = (bitField0_ & ~0x00000010); + autoAck_ = false; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } - static { - defaultInstance = new Get(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Get getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Get build() { + com.alibaba.otter.canal.protocol.CanalPacket.Get result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Get) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Get buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Get result = new com.alibaba.otter.canal.protocol.CanalPacket.Get(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.fetchSize_ = fetchSize_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.timeout_ = timeout_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.unit_ = unit_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.autoAck_ = autoAck_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Get) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Get)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Get other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasFetchSize()) { + setFetchSize(other.getFetchSize()); + } + if (other.hasTimeout()) { + setTimeout(other.getTimeout()); + } + if (other.hasUnit()) { + setUnit(other.getUnit()); + } + if (other.hasAutoAck()) { + setAutoAck(other.getAutoAck()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Get parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Get) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object destination_ = ""; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string destination = 1; + */ + public Builder setDestination( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string client_id = 2; + */ + public Builder setClientId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private int fetchSize_ ; + /** + * optional int32 fetch_size = 3; + */ + public boolean hasFetchSize() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 fetch_size = 3; + */ + public int getFetchSize() { + return fetchSize_; + } + /** + * optional int32 fetch_size = 3; + */ + public Builder setFetchSize(int value) { + bitField0_ |= 0x00000004; + fetchSize_ = value; + onChanged(); + return this; + } + /** + * optional int32 fetch_size = 3; + */ + public Builder clearFetchSize() { + bitField0_ = (bitField0_ & ~0x00000004); + fetchSize_ = 0; + onChanged(); + return this; + } + + private long timeout_ = -1L; + /** + *
+       * 默认-1时代表不控制
+       * 
+ * + * optional int64 timeout = 4 [default = -1]; + */ + public boolean hasTimeout() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + *
+       * 默认-1时代表不控制
+       * 
+ * + * optional int64 timeout = 4 [default = -1]; + */ + public long getTimeout() { + return timeout_; + } + /** + *
+       * 默认-1时代表不控制
+       * 
+ * + * optional int64 timeout = 4 [default = -1]; + */ + public Builder setTimeout(long value) { + bitField0_ |= 0x00000008; + timeout_ = value; + onChanged(); + return this; + } + /** + *
+       * 默认-1时代表不控制
+       * 
+ * + * optional int64 timeout = 4 [default = -1]; + */ + public Builder clearTimeout() { + bitField0_ = (bitField0_ & ~0x00000008); + timeout_ = -1L; + onChanged(); + return this; + } + + private int unit_ = 2; + /** + *
+       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+       * 
+ * + * optional int32 unit = 5 [default = 2]; + */ + public boolean hasUnit() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + *
+       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+       * 
+ * + * optional int32 unit = 5 [default = 2]; + */ + public int getUnit() { + return unit_; + } + /** + *
+       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+       * 
+ * + * optional int32 unit = 5 [default = 2]; + */ + public Builder setUnit(int value) { + bitField0_ |= 0x00000010; + unit_ = value; + onChanged(); + return this; + } + /** + *
+       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+       * 
+ * + * optional int32 unit = 5 [default = 2]; + */ + public Builder clearUnit() { + bitField0_ = (bitField0_ & ~0x00000010); + unit_ = 2; + onChanged(); + return this; + } + + private boolean autoAck_ ; + /** + *
+       * 是否自动ack
+       * 
+ * + * optional bool auto_ack = 6 [default = false]; + */ + public boolean hasAutoAck() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + *
+       * 是否自动ack
+       * 
+ * + * optional bool auto_ack = 6 [default = false]; + */ + public boolean getAutoAck() { + return autoAck_; + } + /** + *
+       * 是否自动ack
+       * 
+ * + * optional bool auto_ack = 6 [default = false]; + */ + public Builder setAutoAck(boolean value) { + bitField0_ |= 0x00000020; + autoAck_ = value; + onChanged(); + return this; + } + /** + *
+       * 是否自动ack
+       * 
+ * + * optional bool auto_ack = 6 [default = false]; + */ + public Builder clearAutoAck() { + bitField0_ = (bitField0_ & ~0x00000020); + autoAck_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Get) } - public interface MessagesOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Messages) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 batch_id = 1; - */ - boolean hasBatchId(); - - /** - * optional int64 batch_id = 1; - */ - long getBatchId(); - - /** - * repeated bytes messages = 2; - */ - java.util.List getMessagesList(); - - /** - * repeated bytes messages = 2; - */ - int getMessagesCount(); - - /** - * repeated bytes messages = 2; - */ - com.google.protobuf.ByteString getMessages(int index); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Get) + private static final com.alibaba.otter.canal.protocol.CanalPacket.Get DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.Get(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.Get getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Get parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Get(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Get getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MessagesOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Messages) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 batch_id = 1; + */ + boolean hasBatchId(); + /** + * optional int64 batch_id = 1; + */ + long getBatchId(); + + /** + * repeated bytes messages = 2; + */ + java.util.List getMessagesList(); + /** + * repeated bytes messages = 2; + */ + int getMessagesCount(); + /** + * repeated bytes messages = 2; + */ + com.google.protobuf.ByteString getMessages(int index); + } + /** + *
+   * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Messages} + */ + public static final class Messages extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Messages) + MessagesOrBuilder { + private static final long serialVersionUID = 0L; + // Use Messages.newBuilder() to construct. + private Messages(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Messages() { + batchId_ = 0L; + messages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Messages( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + batchId_ = input.readInt64(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + messages_.add(input.readBytes()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Messages.class, com.alibaba.otter.canal.protocol.CanalPacket.Messages.Builder.class); + } + + private int bitField0_; + public static final int BATCH_ID_FIELD_NUMBER = 1; + private long batchId_; + /** + * optional int64 batch_id = 1; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 batch_id = 1; + */ + public long getBatchId() { + return batchId_; + } + + public static final int MESSAGES_FIELD_NUMBER = 2; + private java.util.List messages_; + /** + * repeated bytes messages = 2; + */ + public java.util.List + getMessagesList() { + return messages_; + } + /** + * repeated bytes messages = 2; + */ + public int getMessagesCount() { + return messages_.size(); + } + /** + * repeated bytes messages = 2; + */ + public com.google.protobuf.ByteString getMessages(int index) { + return messages_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, batchId_); + } + for (int i = 0; i < messages_.size(); i++) { + output.writeBytes(2, messages_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, batchId_); + } + { + int dataSize = 0; + for (int i = 0; i < messages_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(messages_.get(i)); + } + size += dataSize; + size += 1 * getMessagesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.Messages)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.Messages other = (com.alibaba.otter.canal.protocol.CanalPacket.Messages) obj; + + boolean result = true; + result = result && (hasBatchId() == other.hasBatchId()); + if (hasBatchId()) { + result = result && (getBatchId() + == other.getBatchId()); + } + result = result && getMessagesList() + .equals(other.getMessagesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBatchId()) { + hash = (37 * hash) + BATCH_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBatchId()); + } + if (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Messages prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Messages} - * *
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Messages} */ - public static final class Messages extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Messages) - MessagesOrBuilder { - - // Use Messages.newBuilder() to construct. - private Messages(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private Messages(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final Messages defaultInstance; - - public static Messages getDefaultInstance() { - return defaultInstance; - } - - public Messages getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Messages(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - batchId_ = input.readInt64(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - messages_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - messages_.add(input.readBytes()); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - messages_ = java.util.Collections.unmodifiableList(messages_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Messages.class, - com.alibaba.otter.canal.protocol.CanalPacket.Messages.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public Messages parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Messages(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int BATCH_ID_FIELD_NUMBER = 1; - private long batchId_; - - /** - * optional int64 batch_id = 1; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional int64 batch_id = 1; - */ - public long getBatchId() { - return batchId_; - } - - public static final int MESSAGES_FIELD_NUMBER = 2; - private java.util.List messages_; - - /** - * repeated bytes messages = 2; - */ - public java.util.List getMessagesList() { - return messages_; - } - - /** - * repeated bytes messages = 2; - */ - public int getMessagesCount() { - return messages_.size(); - } - - /** - * repeated bytes messages = 2; - */ - public com.google.protobuf.ByteString getMessages(int index) { - return messages_.get(index); - } - - private void initFields() { - batchId_ = 0L; - messages_ = java.util.Collections.emptyList(); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, batchId_); - } - for (int i = 0; i < messages_.size(); i++) { - output.writeBytes(2, messages_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, batchId_); - } - { - int dataSize = 0; - for (int i = 0; i < messages_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(messages_.get(i)); - } - size += dataSize; - size += 1 * getMessagesList().size(); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Messages prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Messages} - * - *
-         * 
- */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Messages) com.alibaba.otter.canal.protocol.CanalPacket.MessagesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Messages.class, com.alibaba.otter.canal.protocol.CanalPacket.Messages.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Messages.class, - com.alibaba.otter.canal.protocol.CanalPacket.Messages.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Messages.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.Messages.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - batchId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - messages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Messages getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Messages build() { - com.alibaba.otter.canal.protocol.CanalPacket.Messages result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Messages buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Messages result = new com.alibaba.otter.canal.protocol.CanalPacket.Messages(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.batchId_ = batchId_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - messages_ = java.util.Collections.unmodifiableList(messages_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.messages_ = messages_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Messages) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Messages) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Messages other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance()) return this; - if (other.hasBatchId()) { - setBatchId(other.getBatchId()); - } - if (!other.messages_.isEmpty()) { - if (messages_.isEmpty()) { - messages_ = other.messages_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureMessagesIsMutable(); - messages_.addAll(other.messages_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Messages parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Messages) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private long batchId_; - - /** - * optional int64 batch_id = 1; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional int64 batch_id = 1; - */ - public long getBatchId() { - return batchId_; - } - - /** - * optional int64 batch_id = 1; - */ - public Builder setBatchId(long value) { - bitField0_ |= 0x00000001; - batchId_ = value; - onChanged(); - return this; - } - - /** - * optional int64 batch_id = 1; - */ - public Builder clearBatchId() { - bitField0_ = (bitField0_ & ~0x00000001); - batchId_ = 0L; - onChanged(); - return this; - } - - private java.util.List messages_ = java.util.Collections.emptyList(); - - private void ensureMessagesIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - messages_ = new java.util.ArrayList(messages_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated bytes messages = 2; - */ - public java.util.List getMessagesList() { - return java.util.Collections.unmodifiableList(messages_); - } - - /** - * repeated bytes messages = 2; - */ - public int getMessagesCount() { - return messages_.size(); - } - - /** - * repeated bytes messages = 2; - */ - public com.google.protobuf.ByteString getMessages(int index) { - return messages_.get(index); - } - - /** - * repeated bytes messages = 2; - */ - public Builder setMessages(int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.set(index, value); - onChanged(); - return this; - } - - /** - * repeated bytes messages = 2; - */ - public Builder addMessages(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.add(value); - onChanged(); - return this; - } - - /** - * repeated bytes messages = 2; - */ - public Builder addAllMessages(java.lang.Iterable values) { - ensureMessagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); - onChanged(); - return this; - } - - /** - * repeated bytes messages = 2; - */ - public Builder clearMessages() { - messages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Messages) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + batchId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } - static { - defaultInstance = new Messages(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Messages getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Messages build() { + com.alibaba.otter.canal.protocol.CanalPacket.Messages result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Messages) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Messages buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Messages result = new com.alibaba.otter.canal.protocol.CanalPacket.Messages(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.batchId_ = batchId_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.messages_ = messages_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Messages) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Messages)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Messages other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance()) return this; + if (other.hasBatchId()) { + setBatchId(other.getBatchId()); + } + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Messages parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Messages) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long batchId_ ; + /** + * optional int64 batch_id = 1; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 batch_id = 1; + */ + public long getBatchId() { + return batchId_; + } + /** + * optional int64 batch_id = 1; + */ + public Builder setBatchId(long value) { + bitField0_ |= 0x00000001; + batchId_ = value; + onChanged(); + return this; + } + /** + * optional int64 batch_id = 1; + */ + public Builder clearBatchId() { + bitField0_ = (bitField0_ & ~0x00000001); + batchId_ = 0L; + onChanged(); + return this; + } + + private java.util.List messages_ = java.util.Collections.emptyList(); + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = new java.util.ArrayList(messages_); + bitField0_ |= 0x00000002; + } + } + /** + * repeated bytes messages = 2; + */ + public java.util.List + getMessagesList() { + return java.util.Collections.unmodifiableList(messages_); + } + /** + * repeated bytes messages = 2; + */ + public int getMessagesCount() { + return messages_.size(); + } + /** + * repeated bytes messages = 2; + */ + public com.google.protobuf.ByteString getMessages(int index) { + return messages_.get(index); + } + /** + * repeated bytes messages = 2; + */ + public Builder setMessages( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + return this; + } + /** + * repeated bytes messages = 2; + */ + public Builder addMessages(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + return this; + } + /** + * repeated bytes messages = 2; + */ + public Builder addAllMessages( + java.lang.Iterable values) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, messages_); + onChanged(); + return this; + } + /** + * repeated bytes messages = 2; + */ + public Builder clearMessages() { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Messages) } - public interface DumpOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Dump) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string journal = 1; - */ - boolean hasJournal(); - - /** - * optional string journal = 1; - */ - java.lang.String getJournal(); - - /** - * optional string journal = 1; - */ - com.google.protobuf.ByteString getJournalBytes(); - - /** - * optional int64 position = 2; - */ - boolean hasPosition(); - - /** - * optional int64 position = 2; - */ - long getPosition(); - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - boolean hasTimestamp(); - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - long getTimestamp(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Messages) + private static final com.alibaba.otter.canal.protocol.CanalPacket.Messages DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.Messages(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Messages parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Messages(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Messages getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DumpOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Dump) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string journal = 1; + */ + boolean hasJournal(); + /** + * optional string journal = 1; + */ + java.lang.String getJournal(); + /** + * optional string journal = 1; + */ + com.google.protobuf.ByteString + getJournalBytes(); + + /** + * optional int64 position = 2; + */ + boolean hasPosition(); + /** + * optional int64 position = 2; + */ + long getPosition(); + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + boolean hasTimestamp(); + /** + * optional int64 timestamp = 3 [default = 0]; + */ + long getTimestamp(); + } + /** + *
+   * TBD when new packets are required
+   * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Dump} + */ + public static final class Dump extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Dump) + DumpOrBuilder { + private static final long serialVersionUID = 0L; + // Use Dump.newBuilder() to construct. + private Dump(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Dump() { + journal_ = ""; + position_ = 0L; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Dump( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + journal_ = bs; + break; + } + case 16: { + bitField0_ |= 0x00000002; + position_ = input.readInt64(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + timestamp_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class); + } + + private int bitField0_; + public static final int JOURNAL_FIELD_NUMBER = 1; + private volatile java.lang.Object journal_; + /** + * optional string journal = 1; + */ + public boolean hasJournal() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string journal = 1; + */ + public java.lang.String getJournal() { + java.lang.Object ref = journal_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + journal_ = s; + } + return s; + } + } + /** + * optional string journal = 1; + */ + public com.google.protobuf.ByteString + getJournalBytes() { + java.lang.Object ref = journal_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + journal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POSITION_FIELD_NUMBER = 2; + private long position_; + /** + * optional int64 position = 2; + */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int64 position = 2; + */ + public long getPosition() { + return position_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private long timestamp_; + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, journal_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, position_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(3, timestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, journal_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, position_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, timestamp_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.Dump)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.Dump other = (com.alibaba.otter.canal.protocol.CanalPacket.Dump) obj; + + boolean result = true; + result = result && (hasJournal() == other.hasJournal()); + if (hasJournal()) { + result = result && getJournal() + .equals(other.getJournal()); + } + result = result && (hasPosition() == other.hasPosition()); + if (hasPosition()) { + result = result && (getPosition() + == other.getPosition()); + } + result = result && (hasTimestamp() == other.hasTimestamp()); + if (hasTimestamp()) { + result = result && (getTimestamp() + == other.getTimestamp()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasJournal()) { + hash = (37 * hash) + JOURNAL_FIELD_NUMBER; + hash = (53 * hash) + getJournal().hashCode(); + } + if (hasPosition()) { + hash = (37 * hash) + POSITION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPosition()); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Dump prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Dump} - * *
      * TBD when new packets are required
      * 
+ * + * Protobuf type {@code com.alibaba.otter.canal.protocol.Dump} */ - public static final class Dump extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Dump) - DumpOrBuilder { - - // Use Dump.newBuilder() to construct. - private Dump(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private Dump(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final Dump defaultInstance; - - public static Dump getDefaultInstance() { - return defaultInstance; - } - - public Dump getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Dump(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - journal_ = bs; - break; - } - case 16: { - bitField0_ |= 0x00000002; - position_ = input.readInt64(); - break; - } - case 24: { - bitField0_ |= 0x00000004; - timestamp_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, - com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public Dump parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Dump(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int JOURNAL_FIELD_NUMBER = 1; - private java.lang.Object journal_; - - /** - * optional string journal = 1; - */ - public boolean hasJournal() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string journal = 1; - */ - public java.lang.String getJournal() { - java.lang.Object ref = journal_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - journal_ = s; - } - return s; - } - } - - /** - * optional string journal = 1; - */ - public com.google.protobuf.ByteString getJournalBytes() { - java.lang.Object ref = journal_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - journal_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int POSITION_FIELD_NUMBER = 2; - private long position_; - - /** - * optional int64 position = 2; - */ - public boolean hasPosition() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional int64 position = 2; - */ - public long getPosition() { - return position_; - } - - public static final int TIMESTAMP_FIELD_NUMBER = 3; - private long timestamp_; - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public boolean hasTimestamp() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public long getTimestamp() { - return timestamp_; - } - - private void initFields() { - journal_ = ""; - position_ = 0L; - timestamp_ = 0L; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getJournalBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt64(2, position_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt64(3, timestamp_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getJournalBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, position_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, timestamp_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Dump prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Dump} - * - *
-         * TBD when new packets are required
-         * 
- */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Dump) com.alibaba.otter.canal.protocol.CanalPacket.DumpOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, - com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Dump.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.Dump.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - journal_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - position_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - timestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Dump getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Dump build() { - com.alibaba.otter.canal.protocol.CanalPacket.Dump result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Dump buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Dump result = new com.alibaba.otter.canal.protocol.CanalPacket.Dump(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.journal_ = journal_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.position_ = position_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.timestamp_ = timestamp_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Dump) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Dump) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Dump other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance()) return this; - if (other.hasJournal()) { - bitField0_ |= 0x00000001; - journal_ = other.journal_; - onChanged(); - } - if (other.hasPosition()) { - setPosition(other.getPosition()); - } - if (other.hasTimestamp()) { - setTimestamp(other.getTimestamp()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Dump parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Dump) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object journal_ = ""; - - /** - * optional string journal = 1; - */ - public boolean hasJournal() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string journal = 1; - */ - public java.lang.String getJournal() { - java.lang.Object ref = journal_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - journal_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string journal = 1; - */ - public com.google.protobuf.ByteString getJournalBytes() { - java.lang.Object ref = journal_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - journal_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string journal = 1; - */ - public Builder setJournal(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - journal_ = value; - onChanged(); - return this; - } - - /** - * optional string journal = 1; - */ - public Builder clearJournal() { - bitField0_ = (bitField0_ & ~0x00000001); - journal_ = getDefaultInstance().getJournal(); - onChanged(); - return this; - } - - /** - * optional string journal = 1; - */ - public Builder setJournalBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - journal_ = value; - onChanged(); - return this; - } - - private long position_; - - /** - * optional int64 position = 2; - */ - public boolean hasPosition() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional int64 position = 2; - */ - public long getPosition() { - return position_; - } - - /** - * optional int64 position = 2; - */ - public Builder setPosition(long value) { - bitField0_ |= 0x00000002; - position_ = value; - onChanged(); - return this; - } - - /** - * optional int64 position = 2; - */ - public Builder clearPosition() { - bitField0_ = (bitField0_ & ~0x00000002); - position_ = 0L; - onChanged(); - return this; - } - - private long timestamp_; - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public boolean hasTimestamp() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public long getTimestamp() { - return timestamp_; - } - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public Builder setTimestamp(long value) { - bitField0_ |= 0x00000004; - timestamp_ = value; - onChanged(); - return this; - } - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public Builder clearTimestamp() { - bitField0_ = (bitField0_ & ~0x00000004); - timestamp_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Dump) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + journal_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + position_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + timestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } - static { - defaultInstance = new Dump(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Dump getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Dump build() { + com.alibaba.otter.canal.protocol.CanalPacket.Dump result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Dump) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Dump buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Dump result = new com.alibaba.otter.canal.protocol.CanalPacket.Dump(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.journal_ = journal_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.position_ = position_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.timestamp_ = timestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Dump) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Dump)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Dump other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance()) return this; + if (other.hasJournal()) { + bitField0_ |= 0x00000001; + journal_ = other.journal_; + onChanged(); + } + if (other.hasPosition()) { + setPosition(other.getPosition()); + } + if (other.hasTimestamp()) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Dump parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Dump) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object journal_ = ""; + /** + * optional string journal = 1; + */ + public boolean hasJournal() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string journal = 1; + */ + public java.lang.String getJournal() { + java.lang.Object ref = journal_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + journal_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string journal = 1; + */ + public com.google.protobuf.ByteString + getJournalBytes() { + java.lang.Object ref = journal_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + journal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string journal = 1; + */ + public Builder setJournal( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + journal_ = value; + onChanged(); + return this; + } + /** + * optional string journal = 1; + */ + public Builder clearJournal() { + bitField0_ = (bitField0_ & ~0x00000001); + journal_ = getDefaultInstance().getJournal(); + onChanged(); + return this; + } + /** + * optional string journal = 1; + */ + public Builder setJournalBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + journal_ = value; + onChanged(); + return this; + } + + private long position_ ; + /** + * optional int64 position = 2; + */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int64 position = 2; + */ + public long getPosition() { + return position_; + } + /** + * optional int64 position = 2; + */ + public Builder setPosition(long value) { + bitField0_ |= 0x00000002; + position_ = value; + onChanged(); + return this; + } + /** + * optional int64 position = 2; + */ + public Builder clearPosition() { + bitField0_ = (bitField0_ & ~0x00000002); + position_ = 0L; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public Builder setTimestamp(long value) { + bitField0_ |= 0x00000004; + timestamp_ = value; + onChanged(); + return this; + } + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + timestamp_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Dump) } - public interface ClientRollbackOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientRollback) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString getClientIdBytes(); - - /** - * optional int64 batch_id = 3; - */ - boolean hasBatchId(); - - /** - * optional int64 batch_id = 3; - */ - long getBatchId(); + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Dump) + private static final com.alibaba.otter.canal.protocol.CanalPacket.Dump DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.Dump(); } + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Dump parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Dump(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.Dump getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ClientRollbackOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientRollback) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString + getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString + getClientIdBytes(); + + /** + * optional int64 batch_id = 3; + */ + boolean hasBatchId(); + /** + * optional int64 batch_id = 3; + */ + long getBatchId(); + } + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientRollback} + */ + public static final class ClientRollback extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientRollback) + ClientRollbackOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClientRollback.newBuilder() to construct. + private ClientRollback(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClientRollback() { + destination_ = ""; + clientId_ = ""; + batchId_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClientRollback( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 24: { + bitField0_ |= 0x00000004; + batchId_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class); + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private volatile java.lang.Object destination_; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object clientId_; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BATCH_ID_FIELD_NUMBER = 3; + private long batchId_; + /** + * optional int64 batch_id = 3; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 batch_id = 3; + */ + public long getBatchId() { + return batchId_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(3, batchId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, batchId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback)) { + return super.equals(obj); + } + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback other = (com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) obj; + + boolean result = true; + result = result && (hasDestination() == other.hasDestination()); + if (hasDestination()) { + result = result && getDestination() + .equals(other.getDestination()); + } + result = result && (hasClientId() == other.hasClientId()); + if (hasClientId()) { + result = result && getClientId() + .equals(other.getClientId()); + } + result = result && (hasBatchId() == other.hasBatchId()); + if (hasBatchId()) { + result = result && (getBatchId() + == other.getBatchId()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDestination()) { + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + } + if (hasClientId()) { + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + } + if (hasBatchId()) { + hash = (37 * hash) + BATCH_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBatchId()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientRollback} */ - public static final class ClientRollback extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientRollback) - ClientRollbackOrBuilder { - - // Use ClientRollback.newBuilder() to construct. - private ClientRollback(com.google.protobuf.GeneratedMessage.Builder builder){ - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private ClientRollback(boolean noInit){ - this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - - private static final ClientRollback defaultInstance; - - public static ClientRollback getDefaultInstance() { - return defaultInstance; - } - - public ClientRollback getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ClientRollback(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException{ - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; - } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; - } - case 24: { - bitField0_ |= 0x00000004; - batchId_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - - public ClientRollback parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClientRollback(input, - extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BATCH_ID_FIELD_NUMBER = 3; - private long batchId_; - - /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int64 batch_id = 3; - */ - public long getBatchId() { - return batchId_; - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - batchId_ = 0L; - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt64(3, batchId_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, batchId_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - - @java.lang.Override - protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { - return Builder.create(); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return newBuilder(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientRollback} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.ClientRollback) com.alibaba.otter.canal.protocol.CanalPacket.ClientRollbackOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class); + } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class); - } + // Construct using com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - // Construct using - // com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.newBuilder() - private Builder(){ - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - batchId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback build() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.batchId_ = batchId_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasBatchId()) { - setBatchId(other.getBatchId()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object destination_ = ""; - - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string destination = 1; - */ - public Builder setDestination(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * optional string client_id = 2; - */ - public Builder setClientId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private long batchId_; - - /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional int64 batch_id = 3; - */ - public long getBatchId() { - return batchId_; - } - - /** - * optional int64 batch_id = 3; - */ - public Builder setBatchId(long value) { - bitField0_ |= 0x00000004; - batchId_ = value; - onChanged(); - return this; - } - - /** - * optional int64 batch_id = 3; - */ - public Builder clearBatchId() { - bitField0_ = (bitField0_ & ~0x00000004); - batchId_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientRollback) + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } + } + @java.lang.Override + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + batchId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } - static { - defaultInstance = new ClientRollback(true); - defaultInstance.initFields(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance(); + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback build() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientRollback) + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.batchId_ = batchId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasBatchId()) { + setBatchId(other.getBatchId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object destination_ = ""; + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString + getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string destination = 1; + */ + public Builder setDestination( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString + getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string client_id = 2; + */ + public Builder setClientId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private long batchId_ ; + /** + * optional int64 batch_id = 3; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 batch_id = 3; + */ + public long getBatchId() { + return batchId_; + } + /** + * optional int64 batch_id = 3; + */ + public Builder setBatchId(long value) { + bitField0_ |= 0x00000004; + batchId_ = value; + onChanged(); + return this; + } + /** + * optional int64 batch_id = 3; + */ + public Builder clearBatchId() { + bitField0_ = (bitField0_ & ~0x00000004); + batchId_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientRollback) } - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; - private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientRollback) + private static final com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback DEFAULT_INSTANCE; static { - java.lang.String[] descriptorData = { - "\n\023CanalProtocol.proto\022 com.alibaba.otter" - + ".canal.protocol\"\312\001\n\006Packet\022\030\n\014magic_numb" - + "er\030\001 \001(\005:\00217\022\022\n\007version\030\002 \001(\005:\0011\022:\n\004type" - + "\030\003 \001(\0162,.com.alibaba.otter.canal.protoco" - + "l.PacketType\022H\n\013compression\030\004 \001(\0162-.com." - + "alibaba.otter.canal.protocol.Compression" - + ":\004NONE\022\014\n\004body\030\005 \001(\014\"<\n\tHeartBeat\022\026\n\016sen" - + "d_timestamp\030\001 \001(\003\022\027\n\017start_timestamp\030\002 \001" - + "(\003\"\217\001\n\tHandshake\022$\n\026communication_encodi" - + "ng\030\001 \001(\t:\004utf8\022\r\n\005seeds\030\002 \001(\014\022M\n\026support", - "ed_compressions\030\003 \003(\0162-.com.alibaba.otte" - + "r.canal.protocol.Compression\"\274\001\n\nClientA" - + "uth\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\014\022" - + "\033\n\020net_read_timeout\030\003 \001(\005:\0010\022\034\n\021net_writ" - + "e_timeout\030\004 \001(\005:\0010\022\023\n\013destination\030\005 \001(\t\022" - + "\021\n\tclient_id\030\006 \001(\t\022\016\n\006filter\030\007 \001(\t\022\027\n\017st" - + "art_timestamp\030\010 \001(\003\"3\n\003Ack\022\025\n\nerror_code" - + "\030\001 \001(\005:\0010\022\025\n\rerror_message\030\002 \001(\t\"E\n\tClie" - + "ntAck\022\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030" - + "\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003\"=\n\003Sub\022\023\n\013destin", - "ation\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022\016\n\006filter" - + "\030\007 \001(\t\"?\n\005Unsub\022\023\n\013destination\030\001 \001(\t\022\021\n\t" - + "client_id\030\002 \001(\t\022\016\n\006filter\030\007 \001(\t\"\200\001\n\003Get\022" - + "\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022" - + "\022\n\nfetch_size\030\003 \001(\005\022\023\n\007timeout\030\004 \001(\003:\002-1" - + "\022\017\n\004unit\030\005 \001(\005:\0012\022\027\n\010auto_ack\030\006 \001(\010:\005fal" - + "se\".\n\010Messages\022\020\n\010batch_id\030\001 \001(\003\022\020\n\010mess" - + "ages\030\002 \003(\014\"?\n\004Dump\022\017\n\007journal\030\001 \001(\t\022\020\n\010p" - + "osition\030\002 \001(\003\022\024\n\ttimestamp\030\003 \001(\003:\0010\"J\n\016C" - + "lientRollback\022\023\n\013destination\030\001 \001(\t\022\021\n\tcl", - "ient_id\030\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003*4\n\013Compr" - + "ession\022\010\n\004NONE\020\001\022\010\n\004ZLIB\020\002\022\010\n\004GZIP\020\003\022\007\n\003" - + "LZF\020\004*\305\001\n\nPacketType\022\r\n\tHANDSHAKE\020\001\022\030\n\024C" - + "LIENTAUTHENTICATION\020\002\022\007\n\003ACK\020\003\022\020\n\014SUBSCR" - + "IPTION\020\004\022\022\n\016UNSUBSCRIPTION\020\005\022\007\n\003GET\020\006\022\014\n" - + "\010MESSAGES\020\007\022\r\n\tCLIENTACK\020\010\022\014\n\010SHUTDOWN\020\t" - + "\022\010\n\004DUMP\020\n\022\r\n\tHEARTBEAT\020\013\022\022\n\016CLIENTROLLB" - + "ACK\020\014B1\n com.alibaba.otter.canal.protoco" + "lB\013CanalPacketH\001" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - - public com.google.protobuf.ExtensionRegistry assignDescriptors(com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] {}, - assigner); - internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor, - new java.lang.String[] { "MagicNumber", "Version", "Type", "Compression", "Body", }); - internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor = getDescriptor().getMessageTypes() - .get(1); - internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor, - new java.lang.String[] { "SendTimestamp", "StartTimestamp", }); - internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor = getDescriptor().getMessageTypes() - .get(2); - internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor, - new java.lang.String[] { "CommunicationEncoding", "Seeds", "SupportedCompressions", }); - internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor = getDescriptor().getMessageTypes() - .get(3); - internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor, - new java.lang.String[] { "Username", "Password", "NetReadTimeout", "NetWriteTimeout", "Destination", - "ClientId", "Filter", "StartTimestamp", }); - internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor = getDescriptor().getMessageTypes().get(4); - internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor, - new java.lang.String[] { "ErrorCode", "ErrorMessage", }); - internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor = getDescriptor().getMessageTypes() - .get(5); - internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor, - new java.lang.String[] { "Destination", "ClientId", "BatchId", }); - internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor = getDescriptor().getMessageTypes().get(6); - internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor, - new java.lang.String[] { "Destination", "ClientId", "Filter", }); - internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor = getDescriptor().getMessageTypes().get(7); - internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor, - new java.lang.String[] { "Destination", "ClientId", "Filter", }); - internal_static_com_alibaba_otter_canal_protocol_Get_descriptor = getDescriptor().getMessageTypes().get(8); - internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Get_descriptor, - new java.lang.String[] { "Destination", "ClientId", "FetchSize", "Timeout", "Unit", "AutoAck", }); - internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor = getDescriptor().getMessageTypes().get(9); - internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor, - new java.lang.String[] { "BatchId", "Messages", }); - internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor = getDescriptor().getMessageTypes().get(10); - internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor, - new java.lang.String[] { "Journal", "Position", "Timestamp", }); - internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor = getDescriptor().getMessageTypes() - .get(11); - internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor, - new java.lang.String[] { "Destination", "ClientId", "BatchId", }); + DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback(); } - // @@protoc_insertion_point(outer_class_scope) + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientRollback parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientRollback(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\023CanalProtocol.proto\022 com.alibaba.otter" + + ".canal.protocol\"\312\001\n\006Packet\022\030\n\014magic_numb" + + "er\030\001 \001(\005:\00217\022\022\n\007version\030\002 \001(\005:\0011\022:\n\004type" + + "\030\003 \001(\0162,.com.alibaba.otter.canal.protoco" + + "l.PacketType\022H\n\013compression\030\004 \001(\0162-.com." + + "alibaba.otter.canal.protocol.Compression" + + ":\004NONE\022\014\n\004body\030\005 \001(\014\"<\n\tHeartBeat\022\026\n\016sen" + + "d_timestamp\030\001 \001(\003\022\027\n\017start_timestamp\030\002 \001" + + "(\003\"\217\001\n\tHandshake\022$\n\026communication_encodi" + + "ng\030\001 \001(\t:\004utf8\022\r\n\005seeds\030\002 \001(\014\022M\n\026support" + + "ed_compressions\030\003 \003(\0162-.com.alibaba.otte" + + "r.canal.protocol.Compression\"\274\001\n\nClientA" + + "uth\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\014\022" + + "\033\n\020net_read_timeout\030\003 \001(\005:\0010\022\034\n\021net_writ" + + "e_timeout\030\004 \001(\005:\0010\022\023\n\013destination\030\005 \001(\t\022" + + "\021\n\tclient_id\030\006 \001(\t\022\016\n\006filter\030\007 \001(\t\022\027\n\017st" + + "art_timestamp\030\010 \001(\003\"3\n\003Ack\022\025\n\nerror_code" + + "\030\001 \001(\005:\0010\022\025\n\rerror_message\030\002 \001(\t\"E\n\tClie" + + "ntAck\022\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030" + + "\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003\"=\n\003Sub\022\023\n\013destin" + + "ation\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022\016\n\006filter" + + "\030\007 \001(\t\"?\n\005Unsub\022\023\n\013destination\030\001 \001(\t\022\021\n\t" + + "client_id\030\002 \001(\t\022\016\n\006filter\030\007 \001(\t\"\200\001\n\003Get\022" + + "\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022" + + "\022\n\nfetch_size\030\003 \001(\005\022\023\n\007timeout\030\004 \001(\003:\002-1" + + "\022\017\n\004unit\030\005 \001(\005:\0012\022\027\n\010auto_ack\030\006 \001(\010:\005fal" + + "se\".\n\010Messages\022\020\n\010batch_id\030\001 \001(\003\022\020\n\010mess" + + "ages\030\002 \003(\014\"?\n\004Dump\022\017\n\007journal\030\001 \001(\t\022\020\n\010p" + + "osition\030\002 \001(\003\022\024\n\ttimestamp\030\003 \001(\003:\0010\"J\n\016C" + + "lientRollback\022\023\n\013destination\030\001 \001(\t\022\021\n\tcl" + + "ient_id\030\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003*4\n\013Compr" + + "ession\022\010\n\004NONE\020\001\022\010\n\004ZLIB\020\002\022\010\n\004GZIP\020\003\022\007\n\003" + + "LZF\020\004*\305\001\n\nPacketType\022\r\n\tHANDSHAKE\020\001\022\030\n\024C" + + "LIENTAUTHENTICATION\020\002\022\007\n\003ACK\020\003\022\020\n\014SUBSCR" + + "IPTION\020\004\022\022\n\016UNSUBSCRIPTION\020\005\022\007\n\003GET\020\006\022\014\n" + + "\010MESSAGES\020\007\022\r\n\tCLIENTACK\020\010\022\014\n\010SHUTDOWN\020\t" + + "\022\010\n\004DUMP\020\n\022\r\n\tHEARTBEAT\020\013\022\022\n\016CLIENTROLLB" + + "ACK\020\014B1\n com.alibaba.otter.canal.protoco" + + "lB\013CanalPacketH\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor, + new java.lang.String[] { "MagicNumber", "Version", "Type", "Compression", "Body", }); + internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor, + new java.lang.String[] { "SendTimestamp", "StartTimestamp", }); + internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor, + new java.lang.String[] { "CommunicationEncoding", "Seeds", "SupportedCompressions", }); + internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor, + new java.lang.String[] { "Username", "Password", "NetReadTimeout", "NetWriteTimeout", "Destination", "ClientId", "Filter", "StartTimestamp", }); + internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor, + new java.lang.String[] { "ErrorCode", "ErrorMessage", }); + internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor, + new java.lang.String[] { "Destination", "ClientId", "BatchId", }); + internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor, + new java.lang.String[] { "Destination", "ClientId", "Filter", }); + internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor, + new java.lang.String[] { "Destination", "ClientId", "Filter", }); + internal_static_com_alibaba_otter_canal_protocol_Get_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_Get_descriptor, + new java.lang.String[] { "Destination", "ClientId", "FetchSize", "Timeout", "Unit", "AutoAck", }); + internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor, + new java.lang.String[] { "BatchId", "Messages", }); + internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor, + new java.lang.String[] { "Journal", "Position", "Timestamp", }); + internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor, + new java.lang.String[] { "Destination", "ClientId", "BatchId", }); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalProtocol.proto b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalProtocol.proto index 80f03439..9de91150 100644 --- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalProtocol.proto +++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalProtocol.proto @@ -1,3 +1,4 @@ +syntax = "proto2"; package com.alibaba.otter.canal.protocol; option java_package = "com.alibaba.otter.canal.protocol"; diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/EntryProtocol.proto b/protocol/src/main/java/com/alibaba/otter/canal/protocol/EntryProtocol.proto index 526db41f..c755921d 100644 --- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/EntryProtocol.proto +++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/EntryProtocol.proto @@ -1,3 +1,4 @@ +syntax = "proto2"; package com.alibaba.otter.canal.protocol; option java_package = "com.alibaba.otter.canal.protocol"; diff --git a/server/src/main/java/com/alibaba/otter/canal/server/netty/listener/ChannelFutureAggregator.java b/server/src/main/java/com/alibaba/otter/canal/server/netty/listener/ChannelFutureAggregator.java index 923001d1..e4793640 100644 --- a/server/src/main/java/com/alibaba/otter/canal/server/netty/listener/ChannelFutureAggregator.java +++ b/server/src/main/java/com/alibaba/otter/canal/server/netty/listener/ChannelFutureAggregator.java @@ -2,7 +2,7 @@ package com.alibaba.otter.canal.server.netty.listener; import com.alibaba.otter.canal.protocol.CanalPacket; import com.google.common.base.Preconditions; -import com.google.protobuf.GeneratedMessage; +import com.google.protobuf.GeneratedMessageV3; import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.ChannelFutureListener; @@ -16,19 +16,19 @@ public class ChannelFutureAggregator implements ChannelFutureListener { private ClientRequestResult result; - public ChannelFutureAggregator(String destination, GeneratedMessage request, CanalPacket.PacketType type, int amount, long latency, boolean empty) { + public ChannelFutureAggregator(String destination, GeneratedMessageV3 request, CanalPacket.PacketType type, int amount, long latency, boolean empty) { this(destination, request, type, amount, latency, empty, (short) 0); } - public ChannelFutureAggregator(String destination, GeneratedMessage request, CanalPacket.PacketType type, int amount, long latency) { + public ChannelFutureAggregator(String destination, GeneratedMessageV3 request, CanalPacket.PacketType type, int amount, long latency) { this(destination, request, type, amount, latency, false, (short) 0); } - public ChannelFutureAggregator(String destination, GeneratedMessage request, CanalPacket.PacketType type, int amount, long latency, short errorCode) { + public ChannelFutureAggregator(String destination, GeneratedMessageV3 request, CanalPacket.PacketType type, int amount, long latency, short errorCode) { this(destination, request, type, amount, latency, false, errorCode); } - private ChannelFutureAggregator(String destination, GeneratedMessage request, CanalPacket.PacketType type, int amount, long latency, boolean empty, short errorCode) { + private ChannelFutureAggregator(String destination, GeneratedMessageV3 request, CanalPacket.PacketType type, int amount, long latency, boolean empty, short errorCode) { this.result = new ClientRequestResult.Builder() .destination(destination) .type(type) @@ -56,7 +56,7 @@ public class ChannelFutureAggregator implements ChannelFutureListener { private String destination; private CanalPacket.PacketType type; - private GeneratedMessage request; + private GeneratedMessageV3 request; private int amount; private long latency; private short errorCode; @@ -81,7 +81,7 @@ public class ChannelFutureAggregator implements ChannelFutureListener { private String destination; private CanalPacket.PacketType type; - private GeneratedMessage request; + private GeneratedMessageV3 request; private int amount; private long latency; private short errorCode; @@ -98,7 +98,7 @@ public class ChannelFutureAggregator implements ChannelFutureListener { return this; } - Builder request(GeneratedMessage request) { + Builder request(GeneratedMessageV3 request) { this.request = request; return this; } @@ -153,7 +153,7 @@ public class ChannelFutureAggregator implements ChannelFutureListener { return type; } - public GeneratedMessage getRequest() { + public GeneratedMessageV3 getRequest() { return request; } From e450c3f83fb6dabba3197214dc32ea29c7809f23 Mon Sep 17 00:00:00 2001 From: mcy Date: Tue, 11 Sep 2018 11:35:47 +0800 Subject: [PATCH 18/42] =?UTF-8?q?fix=20#912=20=E9=80=9A=E8=BF=87maven?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=B0=86guava=E4=BF=AE=E6=94=B9=E5=8C=85?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=89=93=E5=8C=85=E8=BF=9Bcanal.client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loader/CanalAdapterKafkaWorker.java | 2 +- client/pom.xml | 157 +++++++++++++++++- 2 files changed, 156 insertions(+), 3 deletions(-) diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java index 5cf86611..4a7bd7a3 100644 --- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java +++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java @@ -33,7 +33,7 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker { this.topic = topic; this.canalDestination = topic; connector = KafkaCanalConnectors.newKafkaConnector(zkServers, bootstrapServers, topic, null, groupId); - // connector.setSessionTimeout(5L, TimeUnit.MINUTES); + connector.setSessionTimeout(5L, TimeUnit.MINUTES); // super.initSwitcher(topic); } diff --git a/client/pom.xml b/client/pom.xml index 2e48f9c5..02b0f66a 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -15,7 +15,93 @@ com.alibaba.otter canal.protocol ${project.version} + true + + + com.google.protobuf + protobuf-java + + + + + io.netty + netty-all + + + + org.apache.zookeeper + zookeeper + + + com.101tec + zkclient + + + + commons-io + commons-io + + + commons-lang + commons-lang + + + commons-codec + commons-codec + + + com.alibaba + fastjson + + + com.google.guava + guava + + + + ch.qos.logback + logback-core + + + ch.qos.logback + logback-classic + + + org.slf4j + jcl-over-slf4j + + + org.slf4j + slf4j-api + + + org.springframework + spring-core + + + org.springframework + spring-aop + + + org.springframework + spring-context + + + org.springframework + spring-jdbc + + + org.springframework + spring-orm + + + org.springframework + spring-test + ${spring_version} + test + + org.apache.kafka @@ -28,9 +114,76 @@ junit junit + test - + + + + + org.apache.maven.plugins + maven-shade-plugin + 2.4.1 + + false + + + org.apache.zookeeper:zookeeper + com.101tec:zkclient + commons-io:commons-io + commons-lang:commons-lang + commons-codec:commons-codec + com.alibaba:fastjson + ch.qos.logback:logback-core + ch.qos.logback:logback-classic + org.slf4j:jcl-over-slf4j + org.slf4j:slf4j-api + org.springframework:* + org.jboss.netty:netty + commons-logging:commons-logging + aopalliance:aopalliance + com.google.protobuf:protobuf-java + io.netty:* + junit:junit + + + + + + package + + shade + + + + + com.google.guava + com.alibaba.google.guava + + + org.joda + com.alibaba.google.joda + + + com.google.common + com.alibaba.google.common + + + com.google.thirdparty + com.alibaba.google.thirdparty + + + + + + + + + + + + dev @@ -98,7 +251,7 @@ ${project.build.directory}/apidocs true scm:git:git@github.com:alibaba/canal.git - gh-pages + gh-pages From 8ae8f526a6e6b10896864ef56216c58886c23889 Mon Sep 17 00:00:00 2001 From: machey Date: Tue, 11 Sep 2018 22:47:53 +0800 Subject: [PATCH 19/42] =?UTF-8?q?fix=20#904:=20=E7=A9=BA=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=97=B6sleep=201s=E9=98=B2=E6=AD=A2=E5=BE=AA=E7=8E=AFget?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=87=E5=BF=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/alibaba/otter/canal/kafka/CanalKafkaStarter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java index 717a4525..0632417c 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java @@ -147,6 +147,12 @@ public class CanalKafkaStarter implements CanalServerStarter { server.rollback(clientIdentity, batchId); } }); // 发送message到topic + } else { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + // ignore + } } } catch (Exception e) { From a6798c61df15741bc5ae4d46e93718db445bbcc1 Mon Sep 17 00:00:00 2001 From: mcy Date: Wed, 12 Sep 2018 09:03:43 +0800 Subject: [PATCH 20/42] =?UTF-8?q?=E7=A9=BA=E6=95=B0=E6=8D=AEsleep=20100ms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java index 0632417c..5b73bf3b 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java +++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java @@ -149,7 +149,7 @@ public class CanalKafkaStarter implements CanalServerStarter { }); // 发送message到topic } else { try { - Thread.sleep(1000); + Thread.sleep(100); } catch (InterruptedException e) { // ignore } From ca61be5f5ad0cb73e42c5c4fb2b3c4278ad4e352 Mon Sep 17 00:00:00 2001 From: WithLin Date: Thu, 13 Sep 2018 18:36:36 +0800 Subject: [PATCH 21/42] fix upgrade proto2 to proto3 --- .../client/impl/SimpleCanalConnector.java | 2 +- .../client/running/ClientRunningTest.java | 188 +- .../otter/canal/protocol/CanalEntry.java | 4068 ++++++--------- .../otter/canal/protocol/CanalPacket.java | 4574 ++++++++--------- .../otter/canal/protocol/CanalProtocol.proto | 125 +- .../otter/canal/protocol/EntryProtocol.proto | 191 +- .../server/CanalServerWithNettyTest.java | 4 +- 7 files changed, 4125 insertions(+), 5027 deletions(-) diff --git a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java index 0f29794d..b7951912 100644 --- a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java +++ b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java @@ -159,7 +159,7 @@ public class SimpleCanalConnector implements CanalConnector { } // Handshake handshake = Handshake.parseFrom(p.getBody()); - supportedCompressions.addAll(handshake.getSupportedCompressionsList()); + supportedCompressions.add(handshake.getSupportedCompressions()); // ClientAuth ca = ClientAuth.newBuilder() .setUsername(username != null ? username : "") diff --git a/client/src/test/java/com/alibaba/otter/canal/client/running/ClientRunningTest.java b/client/src/test/java/com/alibaba/otter/canal/client/running/ClientRunningTest.java index cbdfd0ea..40755671 100644 --- a/client/src/test/java/com/alibaba/otter/canal/client/running/ClientRunningTest.java +++ b/client/src/test/java/com/alibaba/otter/canal/client/running/ClientRunningTest.java @@ -20,117 +20,117 @@ import com.alibaba.otter.canal.common.zookeeper.ZookeeperPathUtils; public class ClientRunningTest extends AbstractZkTest { - private ZkClientx zkclientx = new ZkClientx(cluster1 + ";" + cluster2); - private short clientId = 1001; + private ZkClientx zkclientx = new ZkClientx(cluster1 + ";" + cluster2); + private short clientId = 1001; - @Before - public void setUp() { - String path = ZookeeperPathUtils.getDestinationPath(destination); - zkclientx.deleteRecursive(path); + @Before + public void setUp() { + String path = ZookeeperPathUtils.getDestinationPath(destination); + zkclientx.deleteRecursive(path); - zkclientx.createPersistent(ZookeeperPathUtils.getClientIdNodePath(this.destination, clientId), true); - } + zkclientx.createPersistent(ZookeeperPathUtils.getClientIdNodePath(this.destination, clientId), true); + } - @After - public void tearDown() { - String path = ZookeeperPathUtils.getDestinationPath(destination); - zkclientx.deleteRecursive(path); - } + @After + public void tearDown() { + String path = ZookeeperPathUtils.getDestinationPath(destination); + zkclientx.deleteRecursive(path); + } - @Test - public void testOneServer() { - final CountDownLatch countLatch = new CountDownLatch(2); - ClientRunningMonitor runningMonitor = buildClientRunning(countLatch, clientId, 2088); - runningMonitor.start(); - sleep(2000L); - runningMonitor.stop(); - sleep(2000L); + @Test + public void testOneServer() { + final CountDownLatch countLatch = new CountDownLatch(2); + ClientRunningMonitor runningMonitor = buildClientRunning(countLatch, clientId, 2088); + runningMonitor.start(); + sleep(2000L); + runningMonitor.stop(); + sleep(2000L); - if (countLatch.getCount() != 0) { - Assert.fail(); - } - } + if (countLatch.getCount() != 0) { + Assert.fail(); + } + } - @Test - public void testMultiServer() { - final CountDownLatch countLatch = new CountDownLatch(30); - final ClientRunningMonitor runningMonitor1 = buildClientRunning(countLatch, clientId, 2088); - final ClientRunningMonitor runningMonitor2 = buildClientRunning(countLatch, clientId, 2089); - final ClientRunningMonitor runningMonitor3 = buildClientRunning(countLatch, clientId, 2090); - final ExecutorService executor = Executors.newFixedThreadPool(3); - executor.submit(new Runnable() { + @Test + public void testMultiServer() { + final CountDownLatch countLatch = new CountDownLatch(30); + final ClientRunningMonitor runningMonitor1 = buildClientRunning(countLatch, clientId, 2088); + final ClientRunningMonitor runningMonitor2 = buildClientRunning(countLatch, clientId, 2089); + final ClientRunningMonitor runningMonitor3 = buildClientRunning(countLatch, clientId, 2090); + final ExecutorService executor = Executors.newFixedThreadPool(3); + executor.submit(new Runnable() { - public void run() { - for (int i = 0; i < 10; i++) { - if (!runningMonitor1.isStart()) { - runningMonitor1.start(); - } - sleep(2000L + RandomUtils.nextInt(500)); - runningMonitor1.stop(); - sleep(2000L + RandomUtils.nextInt(500)); - } - } + public void run() { + for (int i = 0; i < 10; i++) { + if (!runningMonitor1.isStart()) { + runningMonitor1.start(); + } + sleep(2000L + RandomUtils.nextInt(500)); + runningMonitor1.stop(); + sleep(2000L + RandomUtils.nextInt(500)); + } + } - }); + }); - executor.submit(new Runnable() { + executor.submit(new Runnable() { - public void run() { - for (int i = 0; i < 10; i++) { - if (!runningMonitor2.isStart()) { - runningMonitor2.start(); - } - sleep(2000L + RandomUtils.nextInt(500)); - runningMonitor2.stop(); - sleep(2000L + RandomUtils.nextInt(500)); - } - } + public void run() { + for (int i = 0; i < 10; i++) { + if (!runningMonitor2.isStart()) { + runningMonitor2.start(); + } + sleep(2000L + RandomUtils.nextInt(500)); + runningMonitor2.stop(); + sleep(2000L + RandomUtils.nextInt(500)); + } + } - }); + }); - executor.submit(new Runnable() { + executor.submit(new Runnable() { - public void run() { - for (int i = 0; i < 10; i++) { - if (!runningMonitor3.isStart()) { - runningMonitor3.start(); - } - sleep(2000L + RandomUtils.nextInt(500)); - runningMonitor3.stop(); - sleep(2000L + RandomUtils.nextInt(500)); - } - } + public void run() { + for (int i = 0; i < 10; i++) { + if (!runningMonitor3.isStart()) { + runningMonitor3.start(); + } + sleep(2000L + RandomUtils.nextInt(500)); + runningMonitor3.stop(); + sleep(2000L + RandomUtils.nextInt(500)); + } + } - }); + }); - sleep(30000L); - } + sleep(30000L); + } - private ClientRunningMonitor buildClientRunning(final CountDownLatch countLatch, final short clientId, - final int port) { - ClientRunningData clientData = new ClientRunningData(); - clientData.setClientId(clientId); - clientData.setAddress(AddressUtils.getHostIp()); + private ClientRunningMonitor buildClientRunning(final CountDownLatch countLatch, final short clientId, + final int port) { + ClientRunningData clientData = new ClientRunningData(); + clientData.setClientId(clientId); + clientData.setAddress(AddressUtils.getHostIp()); - ClientRunningMonitor runningMonitor = new ClientRunningMonitor(); - runningMonitor.setDestination(destination); - runningMonitor.setZkClient(zkclientx); - runningMonitor.setClientData(clientData); - runningMonitor.setListener(new ClientRunningListener() { + ClientRunningMonitor runningMonitor = new ClientRunningMonitor(); + runningMonitor.setDestination(destination); + runningMonitor.setZkClient(zkclientx); + runningMonitor.setClientData(clientData); + runningMonitor.setListener(new ClientRunningListener() { - public InetSocketAddress processActiveEnter() { - System.out.println(String.format("clientId:%s port:%s has start", clientId, port)); - countLatch.countDown(); - return new InetSocketAddress(AddressUtils.getHostIp(), port); - } + public InetSocketAddress processActiveEnter() { + System.out.println(String.format("clientId:%s port:%s has start", clientId, port)); + countLatch.countDown(); + return new InetSocketAddress(AddressUtils.getHostIp(), port); + } - public void processActiveExit() { - countLatch.countDown(); - System.out.println(String.format("clientId:%s port:%s has stop", clientId, port)); - } + public void processActiveExit() { + countLatch.countDown(); + System.out.println(String.format("clientId:%s port:%s has stop", clientId, port)); + } - }); - runningMonitor.setDelayTime(1); - return runningMonitor; - } -} + }); + runningMonitor.setDelayTime(1); + return runningMonitor; + } +} \ No newline at end of file diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalEntry.java b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalEntry.java index 8807b1fd..997f76c5 100644 --- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalEntry.java +++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalEntry.java @@ -22,7 +22,11 @@ public final class CanalEntry { * Protobuf enum {@code com.alibaba.otter.canal.protocol.EntryType} */ public enum EntryType - implements com.google.protobuf.ProtocolMessageEnum { + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ENTRYTYPECOMPATIBLEPROTO2 = 0; + */ + ENTRYTYPECOMPATIBLEPROTO2(0), /** * TRANSACTIONBEGIN = 1; */ @@ -47,8 +51,13 @@ public final class CanalEntry { * GTIDLOG = 5; */ GTIDLOG(5), + UNRECOGNIZED(-1), ; + /** + * ENTRYTYPECOMPATIBLEPROTO2 = 0; + */ + public static final int ENTRYTYPECOMPATIBLEPROTO2_VALUE = 0; /** * TRANSACTIONBEGIN = 1; */ @@ -76,6 +85,10 @@ public final class CanalEntry { public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } return value; } @@ -89,6 +102,7 @@ public final class CanalEntry { public static EntryType forNumber(int value) { switch (value) { + case 0: return ENTRYTYPECOMPATIBLEPROTO2; case 1: return TRANSACTIONBEGIN; case 2: return ROWDATA; case 3: return TRANSACTIONEND; @@ -99,37 +113,40 @@ public final class CanalEntry { } public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { + internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< - EntryType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public EntryType findValueByNumber(int number) { - return EntryType.forNumber(number); - } - }; + EntryType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public EntryType findValueByNumber(int number) { + return EntryType.forNumber(number); + } + }; public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { + getValueDescriptor() { return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { + getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { + getDescriptor() { return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(0); } private static final EntryType[] VALUES = values(); public static EntryType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; } return VALUES[desc.getIndex()]; } @@ -152,6 +169,10 @@ public final class CanalEntry { */ public enum EventType implements com.google.protobuf.ProtocolMessageEnum { + /** + * EVENTTYPECOMPATIBLEPROTO2 = 0; + */ + EVENTTYPECOMPATIBLEPROTO2(0), /** * INSERT = 1; */ @@ -224,8 +245,13 @@ public final class CanalEntry { * MHEARTBEAT = 15; */ MHEARTBEAT(15), + UNRECOGNIZED(-1), ; + /** + * EVENTTYPECOMPATIBLEPROTO2 = 0; + */ + public static final int EVENTTYPECOMPATIBLEPROTO2_VALUE = 0; /** * INSERT = 1; */ @@ -301,6 +327,10 @@ public final class CanalEntry { public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } return value; } @@ -314,6 +344,7 @@ public final class CanalEntry { public static EventType forNumber(int value) { switch (value) { + case 0: return EVENTTYPECOMPATIBLEPROTO2; case 1: return INSERT; case 2: return UPDATE; case 3: return DELETE; @@ -366,6 +397,9 @@ public final class CanalEntry { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } return VALUES[desc.getIndex()]; } @@ -387,6 +421,10 @@ public final class CanalEntry { */ public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * TYPECOMPATIBLEPROTO2 = 0; + */ + TYPECOMPATIBLEPROTO2(0), /** * ORACLE = 1; */ @@ -399,8 +437,13 @@ public final class CanalEntry { * PGSQL = 3; */ PGSQL(3), + UNRECOGNIZED(-1), ; + /** + * TYPECOMPATIBLEPROTO2 = 0; + */ + public static final int TYPECOMPATIBLEPROTO2_VALUE = 0; /** * ORACLE = 1; */ @@ -416,6 +459,10 @@ public final class CanalEntry { public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } return value; } @@ -429,6 +476,7 @@ public final class CanalEntry { public static Type forNumber(int value) { switch (value) { + case 0: return TYPECOMPATIBLEPROTO2; case 1: return ORACLE; case 2: return MYSQL; case 3: return PGSQL; @@ -469,6 +517,9 @@ public final class CanalEntry { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } return VALUES[desc.getIndex()]; } @@ -490,7 +541,7 @@ public final class CanalEntry { **协议头部信息* *
* - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ boolean hasHeader(); /** @@ -498,7 +549,7 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader(); /** @@ -506,24 +557,16 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder(); /** - *
-     **打散后的事件类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; */ - boolean hasEntryType(); + int getEntryTypeValue(); /** - *
-     **打散后的事件类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; */ com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType(); @@ -532,17 +575,11 @@ public final class CanalEntry { **传输的二进制数组* * * - * optional bytes storeValue = 3; - */ - boolean hasStoreValue(); - /** - *
-     **传输的二进制数组*
-     * 
- * - * optional bytes storeValue = 3; + * bytes storeValue = 3; */ com.google.protobuf.ByteString getStoreValue(); + + public com.alibaba.otter.canal.protocol.CanalEntry.Entry.EntryTypePresentCase getEntryTypePresentCase(); } /** *
@@ -564,7 +601,6 @@ public final class CanalEntry {
       super(builder);
     }
     private Entry() {
-      entryType_ = 2;
       storeValue_ = com.google.protobuf.ByteString.EMPTY;
     }
 
@@ -594,36 +630,30 @@ public final class CanalEntry {
               break;
             case 10: {
               com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder subBuilder = null;
-              if (((bitField0_ & 0x00000001) == 0x00000001)) {
+              if (header_ != null) {
                 subBuilder = header_.toBuilder();
               }
-              header_ = input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Header.PARSER, extensionRegistry);
+              header_ = input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Header.parser(), extensionRegistry);
               if (subBuilder != null) {
                 subBuilder.mergeFrom(header_);
                 header_ = subBuilder.buildPartial();
               }
-              bitField0_ |= 0x00000001;
+
               break;
             }
             case 16: {
               int rawValue = input.readEnum();
-                @SuppressWarnings("deprecation")
-              com.alibaba.otter.canal.protocol.CanalEntry.EntryType value = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf(rawValue);
-              if (value == null) {
-                unknownFields.mergeVarintField(2, rawValue);
-              } else {
-                bitField0_ |= 0x00000002;
-                entryType_ = rawValue;
-              }
+              entryTypePresentCase_ = 2;
+              entryTypePresent_ = rawValue;
               break;
             }
             case 26: {
-              bitField0_ |= 0x00000004;
+
               storeValue_ = input.readBytes();
               break;
             }
             default: {
-              if (!parseUnknownField(
+              if (!parseUnknownFieldProto3(
                   input, unknownFields, extensionRegistry, tag)) {
                 done = true;
               }
@@ -654,7 +684,42 @@ public final class CanalEntry {
               com.alibaba.otter.canal.protocol.CanalEntry.Entry.class, com.alibaba.otter.canal.protocol.CanalEntry.Entry.Builder.class);
     }
 
-    private int bitField0_;
+    private int entryTypePresentCase_ = 0;
+    private java.lang.Object entryTypePresent_;
+    public enum EntryTypePresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      ENTRYTYPE(2),
+      ENTRYTYPEPRESENT_NOT_SET(0);
+      private final int value;
+      private EntryTypePresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static EntryTypePresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static EntryTypePresentCase forNumber(int value) {
+        switch (value) {
+          case 2: return ENTRYTYPE;
+          case 0: return ENTRYTYPEPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public EntryTypePresentCase
+    getEntryTypePresentCase() {
+      return EntryTypePresentCase.forNumber(
+          entryTypePresentCase_);
+    }
+
     public static final int HEADER_FIELD_NUMBER = 1;
     private com.alibaba.otter.canal.protocol.CanalEntry.Header header_;
     /**
@@ -662,17 +727,17 @@ public final class CanalEntry {
      **协议头部信息*
      * 
* - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public boolean hasHeader() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return header_ != null; } /** *
      **协议头部信息*
      * 
* - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader() { return header_ == null ? com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance() : header_; @@ -682,35 +747,33 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder() { - return header_ == null ? com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance() : header_; + return getHeader(); } public static final int ENTRYTYPE_FIELD_NUMBER = 2; - private int entryType_; /** - *
-     **打散后的事件类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; */ - public boolean hasEntryType() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public int getEntryTypeValue() { + if (entryTypePresentCase_ == 2) { + return (java.lang.Integer) entryTypePresent_; + } + return EntryType.ROWDATA_VALUE; } /** - *
-     **打散后的事件类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; */ public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalEntry.EntryType result = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf(entryType_); - return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA : result; + if (entryTypePresentCase_ == 2) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EntryType result = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf( + (java.lang.Integer) entryTypePresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EntryType.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalEntry.EntryType.TRANSACTIONBEGIN; } public static final int STOREVALUE_FIELD_NUMBER = 3; @@ -720,17 +783,7 @@ public final class CanalEntry { **传输的二进制数组* * * - * optional bytes storeValue = 3; - */ - public boolean hasStoreValue() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-     **传输的二进制数组*
-     * 
- * - * optional bytes storeValue = 3; + * bytes storeValue = 3; */ public com.google.protobuf.ByteString getStoreValue() { return storeValue_; @@ -750,13 +803,13 @@ public final class CanalEntry { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (header_ != null) { output.writeMessage(1, getHeader()); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, entryType_); + if (entryTypePresentCase_ == 2) { + output.writeEnum(2, ((java.lang.Integer) entryTypePresent_)); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (!storeValue_.isEmpty()) { output.writeBytes(3, storeValue_); } unknownFields.writeTo(output); @@ -768,15 +821,15 @@ public final class CanalEntry { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (header_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getHeader()); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (entryTypePresentCase_ == 2) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, entryType_); + .computeEnumSize(2, ((java.lang.Integer) entryTypePresent_)); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (!storeValue_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, storeValue_); } @@ -801,14 +854,18 @@ public final class CanalEntry { result = result && getHeader() .equals(other.getHeader()); } - result = result && (hasEntryType() == other.hasEntryType()); - if (hasEntryType()) { - result = result && entryType_ == other.entryType_; - } - result = result && (hasStoreValue() == other.hasStoreValue()); - if (hasStoreValue()) { - result = result && getStoreValue() - .equals(other.getStoreValue()); + result = result && getStoreValue() + .equals(other.getStoreValue()); + result = result && getEntryTypePresentCase().equals( + other.getEntryTypePresentCase()); + if (!result) return false; + switch (entryTypePresentCase_) { + case 2: + result = result && getEntryTypeValue() + == other.getEntryTypeValue(); + break; + case 0: + default: } result = result && unknownFields.equals(other.unknownFields); return result; @@ -825,13 +882,15 @@ public final class CanalEntry { hash = (37 * hash) + HEADER_FIELD_NUMBER; hash = (53 * hash) + getHeader().hashCode(); } - if (hasEntryType()) { - hash = (37 * hash) + ENTRYTYPE_FIELD_NUMBER; - hash = (53 * hash) + entryType_; - } - if (hasStoreValue()) { - hash = (37 * hash) + STOREVALUE_FIELD_NUMBER; - hash = (53 * hash) + getStoreValue().hashCode(); + hash = (37 * hash) + STOREVALUE_FIELD_NUMBER; + hash = (53 * hash) + getStoreValue().hashCode(); + switch (entryTypePresentCase_) { + case 2: + hash = (37 * hash) + ENTRYTYPE_FIELD_NUMBER; + hash = (53 * hash) + getEntryTypeValue(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -968,7 +1027,6 @@ public final class CanalEntry { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getHeaderFieldBuilder(); } } @java.lang.Override @@ -977,13 +1035,13 @@ public final class CanalEntry { if (headerBuilder_ == null) { header_ = null; } else { - headerBuilder_.clear(); + header_ = null; + headerBuilder_ = null; } - bitField0_ = (bitField0_ & ~0x00000001); - entryType_ = 2; - bitField0_ = (bitField0_ & ~0x00000002); storeValue_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + + entryTypePresentCase_ = 0; + entryTypePresent_ = null; return this; } @@ -1010,25 +1068,16 @@ public final class CanalEntry { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalEntry.Entry buildPartial() { com.alibaba.otter.canal.protocol.CanalEntry.Entry result = new com.alibaba.otter.canal.protocol.CanalEntry.Entry(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } if (headerBuilder_ == null) { result.header_ = header_; } else { result.header_ = headerBuilder_.build(); } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.entryType_ = entryType_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; + if (entryTypePresentCase_ == 2) { + result.entryTypePresent_ = entryTypePresent_; } result.storeValue_ = storeValue_; - result.bitField0_ = to_bitField0_; + result.entryTypePresentCase_ = entryTypePresentCase_; onBuilt(); return result; } @@ -1080,12 +1129,18 @@ public final class CanalEntry { if (other.hasHeader()) { mergeHeader(other.getHeader()); } - if (other.hasEntryType()) { - setEntryType(other.getEntryType()); - } - if (other.hasStoreValue()) { + if (other.getStoreValue() != com.google.protobuf.ByteString.EMPTY) { setStoreValue(other.getStoreValue()); } + switch (other.getEntryTypePresentCase()) { + case ENTRYTYPE: { + setEntryTypeValue(other.getEntryTypeValue()); + break; + } + case ENTRYTYPEPRESENT_NOT_SET: { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1114,7 +1169,21 @@ public final class CanalEntry { } return this; } - private int bitField0_; + private int entryTypePresentCase_ = 0; + private java.lang.Object entryTypePresent_; + public EntryTypePresentCase + getEntryTypePresentCase() { + return EntryTypePresentCase.forNumber( + entryTypePresentCase_); + } + + public Builder clearEntryTypePresent() { + entryTypePresentCase_ = 0; + entryTypePresent_ = null; + onChanged(); + return this; + } + private com.alibaba.otter.canal.protocol.CanalEntry.Header header_ = null; private com.google.protobuf.SingleFieldBuilderV3< @@ -1124,17 +1193,17 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public boolean hasHeader() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return headerBuilder_ != null || header_ != null; } /** *
        **协议头部信息*
        * 
* - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader() { if (headerBuilder_ == null) { @@ -1148,7 +1217,7 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public Builder setHeader(com.alibaba.otter.canal.protocol.CanalEntry.Header value) { if (headerBuilder_ == null) { @@ -1160,7 +1229,7 @@ public final class CanalEntry { } else { headerBuilder_.setMessage(value); } - bitField0_ |= 0x00000001; + return this; } /** @@ -1168,7 +1237,7 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public Builder setHeader( com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder builderForValue) { @@ -1178,7 +1247,7 @@ public final class CanalEntry { } else { headerBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000001; + return this; } /** @@ -1186,13 +1255,11 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public Builder mergeHeader(com.alibaba.otter.canal.protocol.CanalEntry.Header value) { if (headerBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - header_ != null && - header_ != com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance()) { + if (header_ != null) { header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder(header_).mergeFrom(value).buildPartial(); } else { @@ -1202,7 +1269,7 @@ public final class CanalEntry { } else { headerBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000001; + return this; } /** @@ -1210,16 +1277,17 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public Builder clearHeader() { if (headerBuilder_ == null) { header_ = null; onChanged(); } else { - headerBuilder_.clear(); + header_ = null; + headerBuilder_ = null; } - bitField0_ = (bitField0_ & ~0x00000001); + return this; } /** @@ -1227,10 +1295,10 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder getHeaderBuilder() { - bitField0_ |= 0x00000001; + onChanged(); return getHeaderFieldBuilder().getBuilder(); } @@ -1239,7 +1307,7 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ public com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder() { if (headerBuilder_ != null) { @@ -1254,7 +1322,7 @@ public final class CanalEntry { **协议头部信息* * * - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * .com.alibaba.otter.canal.protocol.Header header = 1; */ private com.google.protobuf.SingleFieldBuilderV3< com.alibaba.otter.canal.protocol.CanalEntry.Header, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder, com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder> @@ -1270,56 +1338,57 @@ public final class CanalEntry { return headerBuilder_; } - private int entryType_ = 2; /** - *
-       **打散后的事件类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; */ - public boolean hasEntryType() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public int getEntryTypeValue() { + if (entryTypePresentCase_ == 2) { + return ((java.lang.Integer) entryTypePresent_).intValue(); + } + return 0; } /** - *
-       **打散后的事件类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; + */ + public Builder setEntryTypeValue(int value) { + entryTypePresentCase_ = 2; + entryTypePresent_ = value; + onChanged(); + return this; + } + /** + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; */ public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalEntry.EntryType result = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf(entryType_); - return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA : result; + if (entryTypePresentCase_ == 2) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EntryType result = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf( + (java.lang.Integer) entryTypePresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EntryType.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalEntry.EntryType.TRANSACTIONBEGIN; } /** - *
-       **打散后的事件类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; */ public Builder setEntryType(com.alibaba.otter.canal.protocol.CanalEntry.EntryType value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; - entryType_ = value.getNumber(); + entryTypePresentCase_ = 2; + entryTypePresent_ = value.getNumber(); onChanged(); return this; } /** - *
-       **打散后的事件类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; */ public Builder clearEntryType() { - bitField0_ = (bitField0_ & ~0x00000002); - entryType_ = 2; - onChanged(); + if (entryTypePresentCase_ == 2) { + entryTypePresentCase_ = 0; + entryTypePresent_ = null; + onChanged(); + } return this; } @@ -1329,17 +1398,7 @@ public final class CanalEntry { **传输的二进制数组* * * - * optional bytes storeValue = 3; - */ - public boolean hasStoreValue() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-       **传输的二进制数组*
-       * 
- * - * optional bytes storeValue = 3; + * bytes storeValue = 3; */ public com.google.protobuf.ByteString getStoreValue() { return storeValue_; @@ -1349,13 +1408,13 @@ public final class CanalEntry { **传输的二进制数组* * * - * optional bytes storeValue = 3; + * bytes storeValue = 3; */ public Builder setStoreValue(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + storeValue_ = value; onChanged(); return this; @@ -1365,10 +1424,10 @@ public final class CanalEntry { **传输的二进制数组* * * - * optional bytes storeValue = 3; + * bytes storeValue = 3; */ public Builder clearStoreValue() { - bitField0_ = (bitField0_ & ~0x00000004); + storeValue_ = getDefaultInstance().getStoreValue(); onChanged(); return this; @@ -1376,7 +1435,7 @@ public final class CanalEntry { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -1399,7 +1458,7 @@ public final class CanalEntry { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Entry parsePartialFrom( @@ -1431,19 +1490,7 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - *
-     **协议的版本号*
-     * 
- * - * optional int32 version = 1 [default = 1]; - */ - boolean hasVersion(); - /** - *
-     **协议的版本号*
-     * 
- * - * optional int32 version = 1 [default = 1]; + * int32 version = 1; */ int getVersion(); @@ -1452,15 +1499,7 @@ public final class CanalEntry { **binlog/redolog 文件名* * * - * optional string logfileName = 2; - */ - boolean hasLogfileName(); - /** - *
-     **binlog/redolog 文件名*
-     * 
- * - * optional string logfileName = 2; + * string logfileName = 2; */ java.lang.String getLogfileName(); /** @@ -1468,7 +1507,7 @@ public final class CanalEntry { **binlog/redolog 文件名* * * - * optional string logfileName = 2; + * string logfileName = 2; */ com.google.protobuf.ByteString getLogfileNameBytes(); @@ -1478,15 +1517,7 @@ public final class CanalEntry { **binlog/redolog 文件的偏移位置* * * - * optional int64 logfileOffset = 3; - */ - boolean hasLogfileOffset(); - /** - *
-     **binlog/redolog 文件的偏移位置*
-     * 
- * - * optional int64 logfileOffset = 3; + * int64 logfileOffset = 3; */ long getLogfileOffset(); @@ -1495,15 +1526,7 @@ public final class CanalEntry { **服务端serverId* * * - * optional int64 serverId = 4; - */ - boolean hasServerId(); - /** - *
-     **服务端serverId*
-     * 
- * - * optional int64 serverId = 4; + * int64 serverId = 4; */ long getServerId(); @@ -1512,15 +1535,7 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; - */ - boolean hasServerenCode(); - /** - *
-     ** 变更数据的编码 *
-     * 
- * - * optional string serverenCode = 5; + * string serverenCode = 5; */ java.lang.String getServerenCode(); /** @@ -1528,7 +1543,7 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; + * string serverenCode = 5; */ com.google.protobuf.ByteString getServerenCodeBytes(); @@ -1538,32 +1553,16 @@ public final class CanalEntry { **变更数据的执行时间 * * * - * optional int64 executeTime = 6; - */ - boolean hasExecuteTime(); - /** - *
-     **变更数据的执行时间 *
-     * 
- * - * optional int64 executeTime = 6; + * int64 executeTime = 6; */ long getExecuteTime(); /** - *
-     ** 变更数据的来源*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; */ - boolean hasSourceType(); + int getSourceTypeValue(); /** - *
-     ** 变更数据的来源*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; */ com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType(); @@ -1572,15 +1571,7 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; - */ - boolean hasSchemaName(); - /** - *
-     ** 变更数据的schemaname*
-     * 
- * - * optional string schemaName = 8; + * string schemaName = 8; */ java.lang.String getSchemaName(); /** @@ -1588,7 +1579,7 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; + * string schemaName = 8; */ com.google.protobuf.ByteString getSchemaNameBytes(); @@ -1598,15 +1589,7 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; - */ - boolean hasTableName(); - /** - *
-     **变更数据的tablename*
-     * 
- * - * optional string tableName = 9; + * string tableName = 9; */ java.lang.String getTableName(); /** @@ -1614,7 +1597,7 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; + * string tableName = 9; */ com.google.protobuf.ByteString getTableNameBytes(); @@ -1624,32 +1607,16 @@ public final class CanalEntry { **每个event的长度* * * - * optional int64 eventLength = 10; - */ - boolean hasEventLength(); - /** - *
-     **每个event的长度*
-     * 
- * - * optional int64 eventLength = 10; + * int64 eventLength = 10; */ long getEventLength(); /** - *
-     **数据变更类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; */ - boolean hasEventType(); + int getEventTypeValue(); /** - *
-     **数据变更类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; */ com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); @@ -1702,15 +1669,7 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; - */ - boolean hasGtid(); - /** - *
-     **当前事务的gitd*
-     * 
- * - * optional string gtid = 13; + * string gtid = 13; */ java.lang.String getGtid(); /** @@ -1718,10 +1677,16 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; + * string gtid = 13; */ com.google.protobuf.ByteString getGtidBytes(); + + public com.alibaba.otter.canal.protocol.CanalEntry.Header.VersionPresentCase getVersionPresentCase(); + + public com.alibaba.otter.canal.protocol.CanalEntry.Header.SourceTypePresentCase getSourceTypePresentCase(); + + public com.alibaba.otter.canal.protocol.CanalEntry.Header.EventTypePresentCase getEventTypePresentCase(); } /** *
@@ -1740,17 +1705,14 @@ public final class CanalEntry {
       super(builder);
     }
     private Header() {
-      version_ = 1;
       logfileName_ = "";
       logfileOffset_ = 0L;
       serverId_ = 0L;
       serverenCode_ = "";
       executeTime_ = 0L;
-      sourceType_ = 2;
       schemaName_ = "";
       tableName_ = "";
       eventLength_ = 0L;
-      eventType_ = 2;
       props_ = java.util.Collections.emptyList();
       gtid_ = "";
     }
@@ -1780,76 +1742,64 @@ public final class CanalEntry {
               done = true;
               break;
             case 8: {
-              bitField0_ |= 0x00000001;
-              version_ = input.readInt32();
+              versionPresentCase_ = 1;
+              versionPresent_ = input.readInt32();
               break;
             }
             case 18: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000002;
-              logfileName_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              logfileName_ = s;
               break;
             }
             case 24: {
-              bitField0_ |= 0x00000004;
+
               logfileOffset_ = input.readInt64();
               break;
             }
             case 32: {
-              bitField0_ |= 0x00000008;
+
               serverId_ = input.readInt64();
               break;
             }
             case 42: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000010;
-              serverenCode_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              serverenCode_ = s;
               break;
             }
             case 48: {
-              bitField0_ |= 0x00000020;
+
               executeTime_ = input.readInt64();
               break;
             }
             case 56: {
               int rawValue = input.readEnum();
-                @SuppressWarnings("deprecation")
-              com.alibaba.otter.canal.protocol.CanalEntry.Type value = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf(rawValue);
-              if (value == null) {
-                unknownFields.mergeVarintField(7, rawValue);
-              } else {
-                bitField0_ |= 0x00000040;
-                sourceType_ = rawValue;
-              }
+              sourceTypePresentCase_ = 7;
+              sourceTypePresent_ = rawValue;
               break;
             }
             case 66: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000080;
-              schemaName_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              schemaName_ = s;
               break;
             }
             case 74: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000100;
-              tableName_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              tableName_ = s;
               break;
             }
             case 80: {
-              bitField0_ |= 0x00000200;
+
               eventLength_ = input.readInt64();
               break;
             }
             case 88: {
               int rawValue = input.readEnum();
-                @SuppressWarnings("deprecation")
-              com.alibaba.otter.canal.protocol.CanalEntry.EventType value = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(rawValue);
-              if (value == null) {
-                unknownFields.mergeVarintField(11, rawValue);
-              } else {
-                bitField0_ |= 0x00000400;
-                eventType_ = rawValue;
-              }
+              eventTypePresentCase_ = 11;
+              eventTypePresent_ = rawValue;
               break;
             }
             case 98: {
@@ -1858,17 +1808,17 @@ public final class CanalEntry {
                 mutable_bitField0_ |= 0x00000800;
               }
               props_.add(
-                  input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry));
+                  input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry));
               break;
             }
             case 106: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000800;
-              gtid_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              gtid_ = s;
               break;
             }
             default: {
-              if (!parseUnknownField(
+              if (!parseUnknownFieldProto3(
                   input, unknownFields, extensionRegistry, tag)) {
                 done = true;
               }
@@ -1903,27 +1853,123 @@ public final class CanalEntry {
     }
 
     private int bitField0_;
-    public static final int VERSION_FIELD_NUMBER = 1;
-    private int version_;
-    /**
-     * 
-     **协议的版本号*
-     * 
- * - * optional int32 version = 1 [default = 1]; - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000001) == 0x00000001); + private int versionPresentCase_ = 0; + private java.lang.Object versionPresent_; + public enum VersionPresentCase + implements com.google.protobuf.Internal.EnumLite { + VERSION(1), + VERSIONPRESENT_NOT_SET(0); + private final int value; + private VersionPresentCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VersionPresentCase valueOf(int value) { + return forNumber(value); + } + + public static VersionPresentCase forNumber(int value) { + switch (value) { + case 1: return VERSION; + case 0: return VERSIONPRESENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public VersionPresentCase + getVersionPresentCase() { + return VersionPresentCase.forNumber( + versionPresentCase_); } + + private int sourceTypePresentCase_ = 0; + private java.lang.Object sourceTypePresent_; + public enum SourceTypePresentCase + implements com.google.protobuf.Internal.EnumLite { + SOURCETYPE(7), + SOURCETYPEPRESENT_NOT_SET(0); + private final int value; + private SourceTypePresentCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceTypePresentCase valueOf(int value) { + return forNumber(value); + } + + public static SourceTypePresentCase forNumber(int value) { + switch (value) { + case 7: return SOURCETYPE; + case 0: return SOURCETYPEPRESENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public SourceTypePresentCase + getSourceTypePresentCase() { + return SourceTypePresentCase.forNumber( + sourceTypePresentCase_); + } + + private int eventTypePresentCase_ = 0; + private java.lang.Object eventTypePresent_; + public enum EventTypePresentCase + implements com.google.protobuf.Internal.EnumLite { + EVENTTYPE(11), + EVENTTYPEPRESENT_NOT_SET(0); + private final int value; + private EventTypePresentCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EventTypePresentCase valueOf(int value) { + return forNumber(value); + } + + public static EventTypePresentCase forNumber(int value) { + switch (value) { + case 11: return EVENTTYPE; + case 0: return EVENTTYPEPRESENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public EventTypePresentCase + getEventTypePresentCase() { + return EventTypePresentCase.forNumber( + eventTypePresentCase_); + } + + public static final int VERSION_FIELD_NUMBER = 1; /** - *
-     **协议的版本号*
-     * 
- * - * optional int32 version = 1 [default = 1]; + * int32 version = 1; */ public int getVersion() { - return version_; + if (versionPresentCase_ == 1) { + return (java.lang.Integer) versionPresent_; + } + return 1; } public static final int LOGFILENAME_FIELD_NUMBER = 2; @@ -1933,17 +1979,7 @@ public final class CanalEntry { **binlog/redolog 文件名* *
* - * optional string logfileName = 2; - */ - public boolean hasLogfileName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-     **binlog/redolog 文件名*
-     * 
- * - * optional string logfileName = 2; + * string logfileName = 2; */ public java.lang.String getLogfileName() { java.lang.Object ref = logfileName_; @@ -1953,9 +1989,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - logfileName_ = s; - } + logfileName_ = s; return s; } } @@ -1964,7 +1998,7 @@ public final class CanalEntry { **binlog/redolog 文件名* * * - * optional string logfileName = 2; + * string logfileName = 2; */ public com.google.protobuf.ByteString getLogfileNameBytes() { @@ -1987,17 +2021,7 @@ public final class CanalEntry { **binlog/redolog 文件的偏移位置* * * - * optional int64 logfileOffset = 3; - */ - public boolean hasLogfileOffset() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-     **binlog/redolog 文件的偏移位置*
-     * 
- * - * optional int64 logfileOffset = 3; + * int64 logfileOffset = 3; */ public long getLogfileOffset() { return logfileOffset_; @@ -2010,17 +2034,7 @@ public final class CanalEntry { **服务端serverId* * * - * optional int64 serverId = 4; - */ - public boolean hasServerId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-     **服务端serverId*
-     * 
- * - * optional int64 serverId = 4; + * int64 serverId = 4; */ public long getServerId() { return serverId_; @@ -2033,17 +2047,7 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; - */ - public boolean hasServerenCode() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - *
-     ** 变更数据的编码 *
-     * 
- * - * optional string serverenCode = 5; + * string serverenCode = 5; */ public java.lang.String getServerenCode() { java.lang.Object ref = serverenCode_; @@ -2053,9 +2057,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - serverenCode_ = s; - } + serverenCode_ = s; return s; } } @@ -2064,7 +2066,7 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; + * string serverenCode = 5; */ public com.google.protobuf.ByteString getServerenCodeBytes() { @@ -2087,45 +2089,33 @@ public final class CanalEntry { **变更数据的执行时间 * * * - * optional int64 executeTime = 6; - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - *
-     **变更数据的执行时间 *
-     * 
- * - * optional int64 executeTime = 6; + * int64 executeTime = 6; */ public long getExecuteTime() { return executeTime_; } public static final int SOURCETYPE_FIELD_NUMBER = 7; - private int sourceType_; /** - *
-     ** 变更数据的来源*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; */ - public boolean hasSourceType() { - return ((bitField0_ & 0x00000040) == 0x00000040); + public int getSourceTypeValue() { + if (sourceTypePresentCase_ == 7) { + return (java.lang.Integer) sourceTypePresent_; + } + return 0; } /** - *
-     ** 变更数据的来源*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; */ public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalEntry.Type result = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf(sourceType_); - return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL : result; + if (sourceTypePresentCase_ == 7) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.Type result = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf( + (java.lang.Integer) sourceTypePresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.Type.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalEntry.Type.TYPECOMPATIBLEPROTO2; } public static final int SCHEMANAME_FIELD_NUMBER = 8; @@ -2135,17 +2125,7 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; - */ - public boolean hasSchemaName() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - *
-     ** 变更数据的schemaname*
-     * 
- * - * optional string schemaName = 8; + * string schemaName = 8; */ public java.lang.String getSchemaName() { java.lang.Object ref = schemaName_; @@ -2155,9 +2135,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - schemaName_ = s; - } + schemaName_ = s; return s; } } @@ -2166,7 +2144,7 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; + * string schemaName = 8; */ public com.google.protobuf.ByteString getSchemaNameBytes() { @@ -2189,17 +2167,7 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; - */ - public boolean hasTableName() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - *
-     **变更数据的tablename*
-     * 
- * - * optional string tableName = 9; + * string tableName = 9; */ public java.lang.String getTableName() { java.lang.Object ref = tableName_; @@ -2209,9 +2177,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - tableName_ = s; - } + tableName_ = s; return s; } } @@ -2220,7 +2186,7 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; + * string tableName = 9; */ public com.google.protobuf.ByteString getTableNameBytes() { @@ -2243,45 +2209,33 @@ public final class CanalEntry { **每个event的长度* * * - * optional int64 eventLength = 10; - */ - public boolean hasEventLength() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - *
-     **每个event的长度*
-     * 
- * - * optional int64 eventLength = 10; + * int64 eventLength = 10; */ public long getEventLength() { return eventLength_; } public static final int EVENTTYPE_FIELD_NUMBER = 11; - private int eventType_; /** - *
-     **数据变更类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; */ - public boolean hasEventType() { - return ((bitField0_ & 0x00000400) == 0x00000400); + public int getEventTypeValue() { + if (eventTypePresentCase_ == 11) { + return (java.lang.Integer) eventTypePresent_; + } + return 0; } /** - *
-     **数据变更类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; */ public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(eventType_); - return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE : result; + if (eventTypePresentCase_ == 11) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf( + (java.lang.Integer) eventTypePresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalEntry.EventType.EVENTTYPECOMPATIBLEPROTO2; } public static final int PROPS_FIELD_NUMBER = 12; @@ -2346,17 +2300,7 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; - */ - public boolean hasGtid() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - /** - *
-     **当前事务的gitd*
-     * 
- * - * optional string gtid = 13; + * string gtid = 13; */ public java.lang.String getGtid() { java.lang.Object ref = gtid_; @@ -2366,9 +2310,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - gtid_ = s; - } + gtid_ = s; return s; } } @@ -2377,7 +2319,7 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; + * string gtid = 13; */ public com.google.protobuf.ByteString getGtidBytes() { @@ -2407,43 +2349,44 @@ public final class CanalEntry { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, version_); + if (versionPresentCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) versionPresent_)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getLogfileNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, logfileName_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (logfileOffset_ != 0L) { output.writeInt64(3, logfileOffset_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (serverId_ != 0L) { output.writeInt64(4, serverId_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (!getServerenCodeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serverenCode_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (executeTime_ != 0L) { output.writeInt64(6, executeTime_); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeEnum(7, sourceType_); + if (sourceTypePresentCase_ == 7) { + output.writeEnum(7, ((java.lang.Integer) sourceTypePresent_)); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (!getSchemaNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 8, schemaName_); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (!getTableNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 9, tableName_); } - if (((bitField0_ & 0x00000200) == 0x00000200)) { + if (eventLength_ != 0L) { output.writeInt64(10, eventLength_); } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - output.writeEnum(11, eventType_); + if (eventTypePresentCase_ == 11) { + output.writeEnum(11, ((java.lang.Integer) eventTypePresent_)); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(12, props_.get(i)); } - if (((bitField0_ & 0x00000800) == 0x00000800)) { + if (!getGtidBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 13, gtid_); } unknownFields.writeTo(output); @@ -2455,51 +2398,52 @@ public final class CanalEntry { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (versionPresentCase_ == 1) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, version_); + .computeInt32Size( + 1, (int)((java.lang.Integer) versionPresent_)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getLogfileNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, logfileName_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (logfileOffset_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, logfileOffset_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (serverId_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(4, serverId_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (!getServerenCodeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serverenCode_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (executeTime_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(6, executeTime_); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (sourceTypePresentCase_ == 7) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, sourceType_); + .computeEnumSize(7, ((java.lang.Integer) sourceTypePresent_)); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (!getSchemaNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, schemaName_); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (!getTableNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, tableName_); } - if (((bitField0_ & 0x00000200) == 0x00000200)) { + if (eventLength_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(10, eventLength_); } - if (((bitField0_ & 0x00000400) == 0x00000400)) { + if (eventTypePresentCase_ == 11) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(11, eventType_); + .computeEnumSize(11, ((java.lang.Integer) eventTypePresent_)); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(12, props_.get(i)); } - if (((bitField0_ & 0x00000800) == 0x00000800)) { + if (!getGtidBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, gtid_); } size += unknownFields.getSerializedSize(); @@ -2518,65 +2462,58 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.Header other = (com.alibaba.otter.canal.protocol.CanalEntry.Header) obj; boolean result = true; - result = result && (hasVersion() == other.hasVersion()); - if (hasVersion()) { - result = result && (getVersion() - == other.getVersion()); - } - result = result && (hasLogfileName() == other.hasLogfileName()); - if (hasLogfileName()) { - result = result && getLogfileName() - .equals(other.getLogfileName()); - } - result = result && (hasLogfileOffset() == other.hasLogfileOffset()); - if (hasLogfileOffset()) { - result = result && (getLogfileOffset() - == other.getLogfileOffset()); - } - result = result && (hasServerId() == other.hasServerId()); - if (hasServerId()) { - result = result && (getServerId() - == other.getServerId()); - } - result = result && (hasServerenCode() == other.hasServerenCode()); - if (hasServerenCode()) { - result = result && getServerenCode() - .equals(other.getServerenCode()); - } - result = result && (hasExecuteTime() == other.hasExecuteTime()); - if (hasExecuteTime()) { - result = result && (getExecuteTime() - == other.getExecuteTime()); - } - result = result && (hasSourceType() == other.hasSourceType()); - if (hasSourceType()) { - result = result && sourceType_ == other.sourceType_; - } - result = result && (hasSchemaName() == other.hasSchemaName()); - if (hasSchemaName()) { - result = result && getSchemaName() - .equals(other.getSchemaName()); - } - result = result && (hasTableName() == other.hasTableName()); - if (hasTableName()) { - result = result && getTableName() - .equals(other.getTableName()); - } - result = result && (hasEventLength() == other.hasEventLength()); - if (hasEventLength()) { - result = result && (getEventLength() - == other.getEventLength()); - } - result = result && (hasEventType() == other.hasEventType()); - if (hasEventType()) { - result = result && eventType_ == other.eventType_; - } + result = result && getLogfileName() + .equals(other.getLogfileName()); + result = result && (getLogfileOffset() + == other.getLogfileOffset()); + result = result && (getServerId() + == other.getServerId()); + result = result && getServerenCode() + .equals(other.getServerenCode()); + result = result && (getExecuteTime() + == other.getExecuteTime()); + result = result && getSchemaName() + .equals(other.getSchemaName()); + result = result && getTableName() + .equals(other.getTableName()); + result = result && (getEventLength() + == other.getEventLength()); result = result && getPropsList() .equals(other.getPropsList()); - result = result && (hasGtid() == other.hasGtid()); - if (hasGtid()) { - result = result && getGtid() - .equals(other.getGtid()); + result = result && getGtid() + .equals(other.getGtid()); + result = result && getVersionPresentCase().equals( + other.getVersionPresentCase()); + if (!result) return false; + switch (versionPresentCase_) { + case 1: + result = result && (getVersion() + == other.getVersion()); + break; + case 0: + default: + } + result = result && getSourceTypePresentCase().equals( + other.getSourceTypePresentCase()); + if (!result) return false; + switch (sourceTypePresentCase_) { + case 7: + result = result && getSourceTypeValue() + == other.getSourceTypeValue(); + break; + case 0: + default: + } + result = result && getEventTypePresentCase().equals( + other.getEventTypePresentCase()); + if (!result) return false; + switch (eventTypePresentCase_) { + case 11: + result = result && getEventTypeValue() + == other.getEventTypeValue(); + break; + case 0: + default: } result = result && unknownFields.equals(other.unknownFields); return result; @@ -2589,61 +2526,55 @@ public final class CanalEntry { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasVersion()) { - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion(); - } - if (hasLogfileName()) { - hash = (37 * hash) + LOGFILENAME_FIELD_NUMBER; - hash = (53 * hash) + getLogfileName().hashCode(); - } - if (hasLogfileOffset()) { - hash = (37 * hash) + LOGFILEOFFSET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLogfileOffset()); - } - if (hasServerId()) { - hash = (37 * hash) + SERVERID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getServerId()); - } - if (hasServerenCode()) { - hash = (37 * hash) + SERVERENCODE_FIELD_NUMBER; - hash = (53 * hash) + getServerenCode().hashCode(); - } - if (hasExecuteTime()) { - hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getExecuteTime()); - } - if (hasSourceType()) { - hash = (37 * hash) + SOURCETYPE_FIELD_NUMBER; - hash = (53 * hash) + sourceType_; - } - if (hasSchemaName()) { - hash = (37 * hash) + SCHEMANAME_FIELD_NUMBER; - hash = (53 * hash) + getSchemaName().hashCode(); - } - if (hasTableName()) { - hash = (37 * hash) + TABLENAME_FIELD_NUMBER; - hash = (53 * hash) + getTableName().hashCode(); - } - if (hasEventLength()) { - hash = (37 * hash) + EVENTLENGTH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getEventLength()); - } - if (hasEventType()) { - hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER; - hash = (53 * hash) + eventType_; - } + hash = (37 * hash) + LOGFILENAME_FIELD_NUMBER; + hash = (53 * hash) + getLogfileName().hashCode(); + hash = (37 * hash) + LOGFILEOFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLogfileOffset()); + hash = (37 * hash) + SERVERID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getServerId()); + hash = (37 * hash) + SERVERENCODE_FIELD_NUMBER; + hash = (53 * hash) + getServerenCode().hashCode(); + hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExecuteTime()); + hash = (37 * hash) + SCHEMANAME_FIELD_NUMBER; + hash = (53 * hash) + getSchemaName().hashCode(); + hash = (37 * hash) + TABLENAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + EVENTLENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getEventLength()); if (getPropsCount() > 0) { hash = (37 * hash) + PROPS_FIELD_NUMBER; hash = (53 * hash) + getPropsList().hashCode(); } - if (hasGtid()) { - hash = (37 * hash) + GTID_FIELD_NUMBER; - hash = (53 * hash) + getGtid().hashCode(); + hash = (37 * hash) + GTID_FIELD_NUMBER; + hash = (53 * hash) + getGtid().hashCode(); + switch (versionPresentCase_) { + case 1: + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + break; + case 0: + default: + } + switch (sourceTypePresentCase_) { + case 7: + hash = (37 * hash) + SOURCETYPE_FIELD_NUMBER; + hash = (53 * hash) + getSourceTypeValue(); + break; + case 0: + default: + } + switch (eventTypePresentCase_) { + case 11: + hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventTypeValue(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -2783,28 +2714,22 @@ public final class CanalEntry { @java.lang.Override public Builder clear() { super.clear(); - version_ = 1; - bitField0_ = (bitField0_ & ~0x00000001); logfileName_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + logfileOffset_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); + serverId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); + serverenCode_ = ""; - bitField0_ = (bitField0_ & ~0x00000010); + executeTime_ = 0L; - bitField0_ = (bitField0_ & ~0x00000020); - sourceType_ = 2; - bitField0_ = (bitField0_ & ~0x00000040); + schemaName_ = ""; - bitField0_ = (bitField0_ & ~0x00000080); + tableName_ = ""; - bitField0_ = (bitField0_ & ~0x00000100); + eventLength_ = 0L; - bitField0_ = (bitField0_ & ~0x00000200); - eventType_ = 2; - bitField0_ = (bitField0_ & ~0x00000400); + if (propsBuilder_ == null) { props_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000800); @@ -2812,7 +2737,13 @@ public final class CanalEntry { propsBuilder_.clear(); } gtid_ = ""; - bitField0_ = (bitField0_ & ~0x00001000); + + versionPresentCase_ = 0; + versionPresent_ = null; + sourceTypePresentCase_ = 0; + sourceTypePresent_ = null; + eventTypePresentCase_ = 0; + eventTypePresent_ = null; return this; } @@ -2841,50 +2772,23 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.Header result = new com.alibaba.otter.canal.protocol.CanalEntry.Header(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.version_ = version_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; + if (versionPresentCase_ == 1) { + result.versionPresent_ = versionPresent_; } result.logfileName_ = logfileName_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } result.logfileOffset_ = logfileOffset_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } result.serverId_ = serverId_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } result.serverenCode_ = serverenCode_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } result.executeTime_ = executeTime_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - result.sourceType_ = sourceType_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; + if (sourceTypePresentCase_ == 7) { + result.sourceTypePresent_ = sourceTypePresent_; } result.schemaName_ = schemaName_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { - to_bitField0_ |= 0x00000100; - } result.tableName_ = tableName_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000200; - } result.eventLength_ = eventLength_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000400; + if (eventTypePresentCase_ == 11) { + result.eventTypePresent_ = eventTypePresent_; } - result.eventType_ = eventType_; if (propsBuilder_ == null) { if (((bitField0_ & 0x00000800) == 0x00000800)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -2894,11 +2798,11 @@ public final class CanalEntry { } else { result.props_ = propsBuilder_.build(); } - if (((from_bitField0_ & 0x00001000) == 0x00001000)) { - to_bitField0_ |= 0x00000800; - } result.gtid_ = gtid_; result.bitField0_ = to_bitField0_; + result.versionPresentCase_ = versionPresentCase_; + result.sourceTypePresentCase_ = sourceTypePresentCase_; + result.eventTypePresentCase_ = eventTypePresentCase_; onBuilt(); return result; } @@ -2947,47 +2851,34 @@ public final class CanalEntry { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.Header other) { if (other == com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance()) return this; - if (other.hasVersion()) { - setVersion(other.getVersion()); - } - if (other.hasLogfileName()) { - bitField0_ |= 0x00000002; + if (!other.getLogfileName().isEmpty()) { logfileName_ = other.logfileName_; onChanged(); } - if (other.hasLogfileOffset()) { + if (other.getLogfileOffset() != 0L) { setLogfileOffset(other.getLogfileOffset()); } - if (other.hasServerId()) { + if (other.getServerId() != 0L) { setServerId(other.getServerId()); } - if (other.hasServerenCode()) { - bitField0_ |= 0x00000010; + if (!other.getServerenCode().isEmpty()) { serverenCode_ = other.serverenCode_; onChanged(); } - if (other.hasExecuteTime()) { + if (other.getExecuteTime() != 0L) { setExecuteTime(other.getExecuteTime()); } - if (other.hasSourceType()) { - setSourceType(other.getSourceType()); - } - if (other.hasSchemaName()) { - bitField0_ |= 0x00000080; + if (!other.getSchemaName().isEmpty()) { schemaName_ = other.schemaName_; onChanged(); } - if (other.hasTableName()) { - bitField0_ |= 0x00000100; + if (!other.getTableName().isEmpty()) { tableName_ = other.tableName_; onChanged(); } - if (other.hasEventLength()) { + if (other.getEventLength() != 0L) { setEventLength(other.getEventLength()); } - if (other.hasEventType()) { - setEventType(other.getEventType()); - } if (propsBuilder_ == null) { if (!other.props_.isEmpty()) { if (props_.isEmpty()) { @@ -3014,11 +2905,37 @@ public final class CanalEntry { } } } - if (other.hasGtid()) { - bitField0_ |= 0x00001000; + if (!other.getGtid().isEmpty()) { gtid_ = other.gtid_; onChanged(); } + switch (other.getVersionPresentCase()) { + case VERSION: { + setVersion(other.getVersion()); + break; + } + case VERSIONPRESENT_NOT_SET: { + break; + } + } + switch (other.getSourceTypePresentCase()) { + case SOURCETYPE: { + setSourceTypeValue(other.getSourceTypeValue()); + break; + } + case SOURCETYPEPRESENT_NOT_SET: { + break; + } + } + switch (other.getEventTypePresentCase()) { + case EVENTTYPE: { + setEventTypeValue(other.getEventTypeValue()); + break; + } + case EVENTTYPEPRESENT_NOT_SET: { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -3047,53 +2964,80 @@ public final class CanalEntry { } return this; } + private int versionPresentCase_ = 0; + private java.lang.Object versionPresent_; + public VersionPresentCase + getVersionPresentCase() { + return VersionPresentCase.forNumber( + versionPresentCase_); + } + + public Builder clearVersionPresent() { + versionPresentCase_ = 0; + versionPresent_ = null; + onChanged(); + return this; + } + + private int sourceTypePresentCase_ = 0; + private java.lang.Object sourceTypePresent_; + public SourceTypePresentCase + getSourceTypePresentCase() { + return SourceTypePresentCase.forNumber( + sourceTypePresentCase_); + } + + public Builder clearSourceTypePresent() { + sourceTypePresentCase_ = 0; + sourceTypePresent_ = null; + onChanged(); + return this; + } + + private int eventTypePresentCase_ = 0; + private java.lang.Object eventTypePresent_; + public EventTypePresentCase + getEventTypePresentCase() { + return EventTypePresentCase.forNumber( + eventTypePresentCase_); + } + + public Builder clearEventTypePresent() { + eventTypePresentCase_ = 0; + eventTypePresent_ = null; + onChanged(); + return this; + } + private int bitField0_; - private int version_ = 1; /** - *
-       **协议的版本号*
-       * 
- * - * optional int32 version = 1 [default = 1]; - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-       **协议的版本号*
-       * 
- * - * optional int32 version = 1 [default = 1]; + * int32 version = 1; */ public int getVersion() { - return version_; + if (versionPresentCase_ == 1) { + return (java.lang.Integer) versionPresent_; + } + return 0; } /** - *
-       **协议的版本号*
-       * 
- * - * optional int32 version = 1 [default = 1]; + * int32 version = 1; */ public Builder setVersion(int value) { - bitField0_ |= 0x00000001; - version_ = value; + versionPresentCase_ = 1; + versionPresent_ = value; onChanged(); return this; } /** - *
-       **协议的版本号*
-       * 
- * - * optional int32 version = 1 [default = 1]; + * int32 version = 1; */ public Builder clearVersion() { - bitField0_ = (bitField0_ & ~0x00000001); - version_ = 1; - onChanged(); + if (versionPresentCase_ == 1) { + versionPresentCase_ = 0; + versionPresent_ = null; + onChanged(); + } return this; } @@ -3103,17 +3047,7 @@ public final class CanalEntry { **binlog/redolog 文件名* * * - * optional string logfileName = 2; - */ - public boolean hasLogfileName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-       **binlog/redolog 文件名*
-       * 
- * - * optional string logfileName = 2; + * string logfileName = 2; */ public java.lang.String getLogfileName() { java.lang.Object ref = logfileName_; @@ -3121,9 +3055,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - logfileName_ = s; - } + logfileName_ = s; return s; } else { return (java.lang.String) ref; @@ -3134,7 +3066,7 @@ public final class CanalEntry { **binlog/redolog 文件名* * * - * optional string logfileName = 2; + * string logfileName = 2; */ public com.google.protobuf.ByteString getLogfileNameBytes() { @@ -3154,14 +3086,14 @@ public final class CanalEntry { **binlog/redolog 文件名* * * - * optional string logfileName = 2; + * string logfileName = 2; */ public Builder setLogfileName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + logfileName_ = value; onChanged(); return this; @@ -3171,10 +3103,10 @@ public final class CanalEntry { **binlog/redolog 文件名* * * - * optional string logfileName = 2; + * string logfileName = 2; */ public Builder clearLogfileName() { - bitField0_ = (bitField0_ & ~0x00000002); + logfileName_ = getDefaultInstance().getLogfileName(); onChanged(); return this; @@ -3184,14 +3116,15 @@ public final class CanalEntry { **binlog/redolog 文件名* * * - * optional string logfileName = 2; + * string logfileName = 2; */ public Builder setLogfileNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + logfileName_ = value; onChanged(); return this; @@ -3203,17 +3136,7 @@ public final class CanalEntry { **binlog/redolog 文件的偏移位置* * * - * optional int64 logfileOffset = 3; - */ - public boolean hasLogfileOffset() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-       **binlog/redolog 文件的偏移位置*
-       * 
- * - * optional int64 logfileOffset = 3; + * int64 logfileOffset = 3; */ public long getLogfileOffset() { return logfileOffset_; @@ -3223,10 +3146,10 @@ public final class CanalEntry { **binlog/redolog 文件的偏移位置* * * - * optional int64 logfileOffset = 3; + * int64 logfileOffset = 3; */ public Builder setLogfileOffset(long value) { - bitField0_ |= 0x00000004; + logfileOffset_ = value; onChanged(); return this; @@ -3236,10 +3159,10 @@ public final class CanalEntry { **binlog/redolog 文件的偏移位置* * * - * optional int64 logfileOffset = 3; + * int64 logfileOffset = 3; */ public Builder clearLogfileOffset() { - bitField0_ = (bitField0_ & ~0x00000004); + logfileOffset_ = 0L; onChanged(); return this; @@ -3251,17 +3174,7 @@ public final class CanalEntry { **服务端serverId* * * - * optional int64 serverId = 4; - */ - public boolean hasServerId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-       **服务端serverId*
-       * 
- * - * optional int64 serverId = 4; + * int64 serverId = 4; */ public long getServerId() { return serverId_; @@ -3271,10 +3184,10 @@ public final class CanalEntry { **服务端serverId* * * - * optional int64 serverId = 4; + * int64 serverId = 4; */ public Builder setServerId(long value) { - bitField0_ |= 0x00000008; + serverId_ = value; onChanged(); return this; @@ -3284,10 +3197,10 @@ public final class CanalEntry { **服务端serverId* * * - * optional int64 serverId = 4; + * int64 serverId = 4; */ public Builder clearServerId() { - bitField0_ = (bitField0_ & ~0x00000008); + serverId_ = 0L; onChanged(); return this; @@ -3299,17 +3212,7 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; - */ - public boolean hasServerenCode() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - *
-       ** 变更数据的编码 *
-       * 
- * - * optional string serverenCode = 5; + * string serverenCode = 5; */ public java.lang.String getServerenCode() { java.lang.Object ref = serverenCode_; @@ -3317,9 +3220,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - serverenCode_ = s; - } + serverenCode_ = s; return s; } else { return (java.lang.String) ref; @@ -3330,7 +3231,7 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; + * string serverenCode = 5; */ public com.google.protobuf.ByteString getServerenCodeBytes() { @@ -3350,14 +3251,14 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; + * string serverenCode = 5; */ public Builder setServerenCode( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + serverenCode_ = value; onChanged(); return this; @@ -3367,10 +3268,10 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; + * string serverenCode = 5; */ public Builder clearServerenCode() { - bitField0_ = (bitField0_ & ~0x00000010); + serverenCode_ = getDefaultInstance().getServerenCode(); onChanged(); return this; @@ -3380,14 +3281,15 @@ public final class CanalEntry { ** 变更数据的编码 * * * - * optional string serverenCode = 5; + * string serverenCode = 5; */ public Builder setServerenCodeBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + checkByteStringIsUtf8(value); + serverenCode_ = value; onChanged(); return this; @@ -3399,17 +3301,7 @@ public final class CanalEntry { **变更数据的执行时间 * * * - * optional int64 executeTime = 6; - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - *
-       **变更数据的执行时间 *
-       * 
- * - * optional int64 executeTime = 6; + * int64 executeTime = 6; */ public long getExecuteTime() { return executeTime_; @@ -3419,10 +3311,10 @@ public final class CanalEntry { **变更数据的执行时间 * * * - * optional int64 executeTime = 6; + * int64 executeTime = 6; */ public Builder setExecuteTime(long value) { - bitField0_ |= 0x00000020; + executeTime_ = value; onChanged(); return this; @@ -3432,65 +3324,66 @@ public final class CanalEntry { **变更数据的执行时间 * * * - * optional int64 executeTime = 6; + * int64 executeTime = 6; */ public Builder clearExecuteTime() { - bitField0_ = (bitField0_ & ~0x00000020); + executeTime_ = 0L; onChanged(); return this; } - private int sourceType_ = 2; /** - *
-       ** 变更数据的来源*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; */ - public boolean hasSourceType() { - return ((bitField0_ & 0x00000040) == 0x00000040); + public int getSourceTypeValue() { + if (sourceTypePresentCase_ == 7) { + return ((java.lang.Integer) sourceTypePresent_).intValue(); + } + return Type.MYSQL_VALUE; } /** - *
-       ** 变更数据的来源*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + */ + public Builder setSourceTypeValue(int value) { + sourceTypePresentCase_ = 7; + sourceTypePresent_ = value; + onChanged(); + return this; + } + /** + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; */ public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalEntry.Type result = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf(sourceType_); - return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL : result; + if (sourceTypePresentCase_ == 7) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.Type result = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf( + (java.lang.Integer) sourceTypePresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.Type.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalEntry.Type.TYPECOMPATIBLEPROTO2; } /** - *
-       ** 变更数据的来源*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; */ public Builder setSourceType(com.alibaba.otter.canal.protocol.CanalEntry.Type value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000040; - sourceType_ = value.getNumber(); + sourceTypePresentCase_ = 7; + sourceTypePresent_ = value.getNumber(); onChanged(); return this; } /** - *
-       ** 变更数据的来源*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * .com.alibaba.otter.canal.protocol.Type sourceType = 7; */ public Builder clearSourceType() { - bitField0_ = (bitField0_ & ~0x00000040); - sourceType_ = 2; - onChanged(); + if (sourceTypePresentCase_ == 7) { + sourceTypePresentCase_ = 0; + sourceTypePresent_ = null; + onChanged(); + } return this; } @@ -3500,17 +3393,7 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; - */ - public boolean hasSchemaName() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - *
-       ** 变更数据的schemaname*
-       * 
- * - * optional string schemaName = 8; + * string schemaName = 8; */ public java.lang.String getSchemaName() { java.lang.Object ref = schemaName_; @@ -3518,9 +3401,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - schemaName_ = s; - } + schemaName_ = s; return s; } else { return (java.lang.String) ref; @@ -3531,7 +3412,7 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; + * string schemaName = 8; */ public com.google.protobuf.ByteString getSchemaNameBytes() { @@ -3551,14 +3432,14 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; + * string schemaName = 8; */ public Builder setSchemaName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000080; + schemaName_ = value; onChanged(); return this; @@ -3568,10 +3449,10 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; + * string schemaName = 8; */ public Builder clearSchemaName() { - bitField0_ = (bitField0_ & ~0x00000080); + schemaName_ = getDefaultInstance().getSchemaName(); onChanged(); return this; @@ -3581,14 +3462,15 @@ public final class CanalEntry { ** 变更数据的schemaname* * * - * optional string schemaName = 8; + * string schemaName = 8; */ public Builder setSchemaNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000080; + checkByteStringIsUtf8(value); + schemaName_ = value; onChanged(); return this; @@ -3600,17 +3482,7 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; - */ - public boolean hasTableName() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - *
-       **变更数据的tablename*
-       * 
- * - * optional string tableName = 9; + * string tableName = 9; */ public java.lang.String getTableName() { java.lang.Object ref = tableName_; @@ -3618,9 +3490,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - tableName_ = s; - } + tableName_ = s; return s; } else { return (java.lang.String) ref; @@ -3631,7 +3501,7 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; + * string tableName = 9; */ public com.google.protobuf.ByteString getTableNameBytes() { @@ -3651,14 +3521,14 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; + * string tableName = 9; */ public Builder setTableName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000100; + tableName_ = value; onChanged(); return this; @@ -3668,10 +3538,10 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; + * string tableName = 9; */ public Builder clearTableName() { - bitField0_ = (bitField0_ & ~0x00000100); + tableName_ = getDefaultInstance().getTableName(); onChanged(); return this; @@ -3681,14 +3551,15 @@ public final class CanalEntry { **变更数据的tablename* * * - * optional string tableName = 9; + * string tableName = 9; */ public Builder setTableNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000100; + checkByteStringIsUtf8(value); + tableName_ = value; onChanged(); return this; @@ -3700,17 +3571,7 @@ public final class CanalEntry { **每个event的长度* * * - * optional int64 eventLength = 10; - */ - public boolean hasEventLength() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - *
-       **每个event的长度*
-       * 
- * - * optional int64 eventLength = 10; + * int64 eventLength = 10; */ public long getEventLength() { return eventLength_; @@ -3720,10 +3581,10 @@ public final class CanalEntry { **每个event的长度* * * - * optional int64 eventLength = 10; + * int64 eventLength = 10; */ public Builder setEventLength(long value) { - bitField0_ |= 0x00000200; + eventLength_ = value; onChanged(); return this; @@ -3733,65 +3594,66 @@ public final class CanalEntry { **每个event的长度* * * - * optional int64 eventLength = 10; + * int64 eventLength = 10; */ public Builder clearEventLength() { - bitField0_ = (bitField0_ & ~0x00000200); + eventLength_ = 0L; onChanged(); return this; } - private int eventType_ = 2; /** - *
-       **数据变更类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; */ - public boolean hasEventType() { - return ((bitField0_ & 0x00000400) == 0x00000400); + public int getEventTypeValue() { + if (eventTypePresentCase_ == 11) { + return ((java.lang.Integer) eventTypePresent_).intValue(); + } + return EventType.UPDATE_VALUE; } /** - *
-       **数据变更类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + */ + public Builder setEventTypeValue(int value) { + eventTypePresentCase_ = 11; + eventTypePresent_ = value; + onChanged(); + return this; + } + /** + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; */ public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(eventType_); - return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE : result; + if (eventTypePresentCase_ == 11) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf( + (java.lang.Integer) eventTypePresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalEntry.EventType.EVENTTYPECOMPATIBLEPROTO2; } /** - *
-       **数据变更类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; */ public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000400; - eventType_ = value.getNumber(); + eventTypePresentCase_ = 11; + eventTypePresent_ = value.getNumber(); onChanged(); return this; } /** - *
-       **数据变更类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 11; */ public Builder clearEventType() { - bitField0_ = (bitField0_ & ~0x00000400); - eventType_ = 2; - onChanged(); + if (eventTypePresentCase_ == 11) { + eventTypePresentCase_ = 0; + eventTypePresent_ = null; + onChanged(); + } return this; } @@ -4113,17 +3975,7 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; - */ - public boolean hasGtid() { - return ((bitField0_ & 0x00001000) == 0x00001000); - } - /** - *
-       **当前事务的gitd*
-       * 
- * - * optional string gtid = 13; + * string gtid = 13; */ public java.lang.String getGtid() { java.lang.Object ref = gtid_; @@ -4131,9 +3983,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - gtid_ = s; - } + gtid_ = s; return s; } else { return (java.lang.String) ref; @@ -4144,7 +3994,7 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; + * string gtid = 13; */ public com.google.protobuf.ByteString getGtidBytes() { @@ -4164,14 +4014,14 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; + * string gtid = 13; */ public Builder setGtid( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00001000; + gtid_ = value; onChanged(); return this; @@ -4181,10 +4031,10 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; + * string gtid = 13; */ public Builder clearGtid() { - bitField0_ = (bitField0_ & ~0x00001000); + gtid_ = getDefaultInstance().getGtid(); onChanged(); return this; @@ -4194,14 +4044,15 @@ public final class CanalEntry { **当前事务的gitd* * * - * optional string gtid = 13; + * string gtid = 13; */ public Builder setGtidBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00001000; + checkByteStringIsUtf8(value); + gtid_ = value; onChanged(); return this; @@ -4209,7 +4060,7 @@ public final class CanalEntry { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -4232,7 +4083,7 @@ public final class CanalEntry { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser
+ private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser
() { @java.lang.Override public Header parsePartialFrom( @@ -4268,15 +4119,7 @@ public final class CanalEntry { **字段下标* * * - * optional int32 index = 1; - */ - boolean hasIndex(); - /** - *
-     **字段下标*
-     * 
- * - * optional int32 index = 1; + * int32 index = 1; */ int getIndex(); @@ -4285,15 +4128,7 @@ public final class CanalEntry { **字段java中类型* * * - * optional int32 sqlType = 2; - */ - boolean hasSqlType(); - /** - *
-     **字段java中类型*
-     * 
- * - * optional int32 sqlType = 2; + * int32 sqlType = 2; */ int getSqlType(); @@ -4302,15 +4137,7 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; - */ - boolean hasName(); - /** - *
-     **字段名称(忽略大小写),在mysql中是没有的*
-     * 
- * - * optional string name = 3; + * string name = 3; */ java.lang.String getName(); /** @@ -4318,7 +4145,7 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; + * string name = 3; */ com.google.protobuf.ByteString getNameBytes(); @@ -4328,15 +4155,7 @@ public final class CanalEntry { **是否是主键* * * - * optional bool isKey = 4; - */ - boolean hasIsKey(); - /** - *
-     **是否是主键*
-     * 
- * - * optional bool isKey = 4; + * bool isKey = 4; */ boolean getIsKey(); @@ -4345,32 +4164,12 @@ public final class CanalEntry { **如果EventType=UPDATE,用于标识这个字段值是否有修改* * * - * optional bool updated = 5; - */ - boolean hasUpdated(); - /** - *
-     **如果EventType=UPDATE,用于标识这个字段值是否有修改*
-     * 
- * - * optional bool updated = 5; + * bool updated = 5; */ boolean getUpdated(); /** - *
-     ** 标识是否为空  *
-     * 
- * - * optional bool isNull = 6 [default = false]; - */ - boolean hasIsNull(); - /** - *
-     ** 标识是否为空  *
-     * 
- * - * optional bool isNull = 6 [default = false]; + * bool isNull = 6; */ boolean getIsNull(); @@ -4423,15 +4222,7 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; - */ - boolean hasValue(); - /** - *
-     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
-     * 
- * - * optional string value = 8; + * string value = 8; */ java.lang.String getValue(); /** @@ -4439,7 +4230,7 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; + * string value = 8; */ com.google.protobuf.ByteString getValueBytes(); @@ -4449,15 +4240,7 @@ public final class CanalEntry { ** 对应数据对象原始长度 * * * - * optional int32 length = 9; - */ - boolean hasLength(); - /** - *
-     ** 对应数据对象原始长度 *
-     * 
- * - * optional int32 length = 9; + * int32 length = 9; */ int getLength(); @@ -4466,15 +4249,7 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; - */ - boolean hasMysqlType(); - /** - *
-     **字段mysql类型*
-     * 
- * - * optional string mysqlType = 10; + * string mysqlType = 10; */ java.lang.String getMysqlType(); /** @@ -4482,10 +4257,12 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; + * string mysqlType = 10; */ com.google.protobuf.ByteString getMysqlTypeBytes(); + + public com.alibaba.otter.canal.protocol.CanalEntry.Column.IsNullPresentCase getIsNullPresentCase(); } /** *
@@ -4509,7 +4286,6 @@ public final class CanalEntry {
       name_ = "";
       isKey_ = false;
       updated_ = false;
-      isNull_ = false;
       props_ = java.util.Collections.emptyList();
       value_ = "";
       length_ = 0;
@@ -4541,34 +4317,34 @@ public final class CanalEntry {
               done = true;
               break;
             case 8: {
-              bitField0_ |= 0x00000001;
+
               index_ = input.readInt32();
               break;
             }
             case 16: {
-              bitField0_ |= 0x00000002;
+
               sqlType_ = input.readInt32();
               break;
             }
             case 26: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000004;
-              name_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              name_ = s;
               break;
             }
             case 32: {
-              bitField0_ |= 0x00000008;
+
               isKey_ = input.readBool();
               break;
             }
             case 40: {
-              bitField0_ |= 0x00000010;
+
               updated_ = input.readBool();
               break;
             }
             case 48: {
-              bitField0_ |= 0x00000020;
-              isNull_ = input.readBool();
+              isNullPresentCase_ = 6;
+              isNullPresent_ = input.readBool();
               break;
             }
             case 58: {
@@ -4577,28 +4353,28 @@ public final class CanalEntry {
                 mutable_bitField0_ |= 0x00000040;
               }
               props_.add(
-                  input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry));
+                  input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry));
               break;
             }
             case 66: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000040;
-              value_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              value_ = s;
               break;
             }
             case 72: {
-              bitField0_ |= 0x00000080;
+
               length_ = input.readInt32();
               break;
             }
             case 82: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000100;
-              mysqlType_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              mysqlType_ = s;
               break;
             }
             default: {
-              if (!parseUnknownField(
+              if (!parseUnknownFieldProto3(
                   input, unknownFields, extensionRegistry, tag)) {
                 done = true;
               }
@@ -4633,6 +4409,42 @@ public final class CanalEntry {
     }
 
     private int bitField0_;
+    private int isNullPresentCase_ = 0;
+    private java.lang.Object isNullPresent_;
+    public enum IsNullPresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      ISNULL(6),
+      ISNULLPRESENT_NOT_SET(0);
+      private final int value;
+      private IsNullPresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static IsNullPresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static IsNullPresentCase forNumber(int value) {
+        switch (value) {
+          case 6: return ISNULL;
+          case 0: return ISNULLPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public IsNullPresentCase
+    getIsNullPresentCase() {
+      return IsNullPresentCase.forNumber(
+          isNullPresentCase_);
+    }
+
     public static final int INDEX_FIELD_NUMBER = 1;
     private int index_;
     /**
@@ -4640,17 +4452,7 @@ public final class CanalEntry {
      **字段下标*
      * 
* - * optional int32 index = 1; - */ - public boolean hasIndex() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-     **字段下标*
-     * 
- * - * optional int32 index = 1; + * int32 index = 1; */ public int getIndex() { return index_; @@ -4663,17 +4465,7 @@ public final class CanalEntry { **字段java中类型* * * - * optional int32 sqlType = 2; - */ - public boolean hasSqlType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-     **字段java中类型*
-     * 
- * - * optional int32 sqlType = 2; + * int32 sqlType = 2; */ public int getSqlType() { return sqlType_; @@ -4686,17 +4478,7 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-     **字段名称(忽略大小写),在mysql中是没有的*
-     * 
- * - * optional string name = 3; + * string name = 3; */ public java.lang.String getName() { java.lang.Object ref = name_; @@ -4706,9 +4488,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } + name_ = s; return s; } } @@ -4717,7 +4497,7 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; + * string name = 3; */ public com.google.protobuf.ByteString getNameBytes() { @@ -4740,17 +4520,7 @@ public final class CanalEntry { **是否是主键* * * - * optional bool isKey = 4; - */ - public boolean hasIsKey() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-     **是否是主键*
-     * 
- * - * optional bool isKey = 4; + * bool isKey = 4; */ public boolean getIsKey() { return isKey_; @@ -4763,43 +4533,21 @@ public final class CanalEntry { **如果EventType=UPDATE,用于标识这个字段值是否有修改* * * - * optional bool updated = 5; - */ - public boolean hasUpdated() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - *
-     **如果EventType=UPDATE,用于标识这个字段值是否有修改*
-     * 
- * - * optional bool updated = 5; + * bool updated = 5; */ public boolean getUpdated() { return updated_; } public static final int ISNULL_FIELD_NUMBER = 6; - private boolean isNull_; /** - *
-     ** 标识是否为空  *
-     * 
- * - * optional bool isNull = 6 [default = false]; - */ - public boolean hasIsNull() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - *
-     ** 标识是否为空  *
-     * 
- * - * optional bool isNull = 6 [default = false]; + * bool isNull = 6; */ public boolean getIsNull() { - return isNull_; + if (isNullPresentCase_ == 6) { + return (java.lang.Boolean) isNullPresent_; + } + return false; } public static final int PROPS_FIELD_NUMBER = 7; @@ -4864,17 +4612,7 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - *
-     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
-     * 
- * - * optional string value = 8; + * string value = 8; */ public java.lang.String getValue() { java.lang.Object ref = value_; @@ -4884,9 +4622,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - value_ = s; - } + value_ = s; return s; } } @@ -4895,7 +4631,7 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; + * string value = 8; */ public com.google.protobuf.ByteString getValueBytes() { @@ -4918,17 +4654,7 @@ public final class CanalEntry { ** 对应数据对象原始长度 * * * - * optional int32 length = 9; - */ - public boolean hasLength() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - *
-     ** 对应数据对象原始长度 *
-     * 
- * - * optional int32 length = 9; + * int32 length = 9; */ public int getLength() { return length_; @@ -4941,17 +4667,7 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; - */ - public boolean hasMysqlType() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - *
-     **字段mysql类型*
-     * 
- * - * optional string mysqlType = 10; + * string mysqlType = 10; */ public java.lang.String getMysqlType() { java.lang.Object ref = mysqlType_; @@ -4961,9 +4677,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - mysqlType_ = s; - } + mysqlType_ = s; return s; } } @@ -4972,7 +4686,7 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; + * string mysqlType = 10; */ public com.google.protobuf.ByteString getMysqlTypeBytes() { @@ -5002,34 +4716,35 @@ public final class CanalEntry { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (index_ != 0) { output.writeInt32(1, index_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (sqlType_ != 0) { output.writeInt32(2, sqlType_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (isKey_ != false) { output.writeBool(4, isKey_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (updated_ != false) { output.writeBool(5, updated_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBool(6, isNull_); + if (isNullPresentCase_ == 6) { + output.writeBool( + 6, (boolean)((java.lang.Boolean) isNullPresent_)); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(7, props_.get(i)); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (!getValueBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 8, value_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (length_ != 0) { output.writeInt32(9, length_); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (!getMysqlTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 10, mysqlType_); } unknownFields.writeTo(output); @@ -5041,41 +4756,42 @@ public final class CanalEntry { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (index_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, index_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (sqlType_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, sqlType_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (isKey_ != false) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(4, isKey_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (updated_ != false) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(5, updated_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (isNullPresentCase_ == 6) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, isNull_); + .computeBoolSize( + 6, (boolean)((java.lang.Boolean) isNullPresent_)); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, props_.get(i)); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (!getValueBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, value_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (length_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(9, length_); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (!getMysqlTypeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, mysqlType_); } size += unknownFields.getSerializedSize(); @@ -5094,52 +4810,34 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.Column other = (com.alibaba.otter.canal.protocol.CanalEntry.Column) obj; boolean result = true; - result = result && (hasIndex() == other.hasIndex()); - if (hasIndex()) { - result = result && (getIndex() - == other.getIndex()); - } - result = result && (hasSqlType() == other.hasSqlType()); - if (hasSqlType()) { - result = result && (getSqlType() - == other.getSqlType()); - } - result = result && (hasName() == other.hasName()); - if (hasName()) { - result = result && getName() - .equals(other.getName()); - } - result = result && (hasIsKey() == other.hasIsKey()); - if (hasIsKey()) { - result = result && (getIsKey() - == other.getIsKey()); - } - result = result && (hasUpdated() == other.hasUpdated()); - if (hasUpdated()) { - result = result && (getUpdated() - == other.getUpdated()); - } - result = result && (hasIsNull() == other.hasIsNull()); - if (hasIsNull()) { - result = result && (getIsNull() - == other.getIsNull()); - } + result = result && (getIndex() + == other.getIndex()); + result = result && (getSqlType() + == other.getSqlType()); + result = result && getName() + .equals(other.getName()); + result = result && (getIsKey() + == other.getIsKey()); + result = result && (getUpdated() + == other.getUpdated()); result = result && getPropsList() .equals(other.getPropsList()); - result = result && (hasValue() == other.hasValue()); - if (hasValue()) { - result = result && getValue() - .equals(other.getValue()); - } - result = result && (hasLength() == other.hasLength()); - if (hasLength()) { - result = result && (getLength() - == other.getLength()); - } - result = result && (hasMysqlType() == other.hasMysqlType()); - if (hasMysqlType()) { - result = result && getMysqlType() - .equals(other.getMysqlType()); + result = result && getValue() + .equals(other.getValue()); + result = result && (getLength() + == other.getLength()); + result = result && getMysqlType() + .equals(other.getMysqlType()); + result = result && getIsNullPresentCase().equals( + other.getIsNullPresentCase()); + if (!result) return false; + switch (isNullPresentCase_) { + case 6: + result = result && (getIsNull() + == other.getIsNull()); + break; + case 0: + default: } result = result && unknownFields.equals(other.unknownFields); return result; @@ -5152,48 +4850,36 @@ public final class CanalEntry { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasIndex()) { - hash = (37 * hash) + INDEX_FIELD_NUMBER; - hash = (53 * hash) + getIndex(); - } - if (hasSqlType()) { - hash = (37 * hash) + SQLTYPE_FIELD_NUMBER; - hash = (53 * hash) + getSqlType(); - } - if (hasName()) { - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - } - if (hasIsKey()) { - hash = (37 * hash) + ISKEY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsKey()); - } - if (hasUpdated()) { - hash = (37 * hash) + UPDATED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUpdated()); - } - if (hasIsNull()) { - hash = (37 * hash) + ISNULL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsNull()); - } + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + hash = (37 * hash) + SQLTYPE_FIELD_NUMBER; + hash = (53 * hash) + getSqlType(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ISKEY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsKey()); + hash = (37 * hash) + UPDATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUpdated()); if (getPropsCount() > 0) { hash = (37 * hash) + PROPS_FIELD_NUMBER; hash = (53 * hash) + getPropsList().hashCode(); } - if (hasValue()) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - } - if (hasLength()) { - hash = (37 * hash) + LENGTH_FIELD_NUMBER; - hash = (53 * hash) + getLength(); - } - if (hasMysqlType()) { - hash = (37 * hash) + MYSQLTYPE_FIELD_NUMBER; - hash = (53 * hash) + getMysqlType().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getLength(); + hash = (37 * hash) + MYSQLTYPE_FIELD_NUMBER; + hash = (53 * hash) + getMysqlType().hashCode(); + switch (isNullPresentCase_) { + case 6: + hash = (37 * hash) + ISNULL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsNull()); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -5334,17 +5020,15 @@ public final class CanalEntry { public Builder clear() { super.clear(); index_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); + sqlType_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); + name_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); + isKey_ = false; - bitField0_ = (bitField0_ & ~0x00000008); + updated_ = false; - bitField0_ = (bitField0_ & ~0x00000010); - isNull_ = false; - bitField0_ = (bitField0_ & ~0x00000020); + if (propsBuilder_ == null) { props_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000040); @@ -5352,11 +5036,13 @@ public final class CanalEntry { propsBuilder_.clear(); } value_ = ""; - bitField0_ = (bitField0_ & ~0x00000080); + length_ = 0; - bitField0_ = (bitField0_ & ~0x00000100); + mysqlType_ = ""; - bitField0_ = (bitField0_ & ~0x00000200); + + isNullPresentCase_ = 0; + isNullPresent_ = null; return this; } @@ -5385,30 +5071,14 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.Column result = new com.alibaba.otter.canal.protocol.CanalEntry.Column(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.index_ = index_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.sqlType_ = sqlType_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } result.name_ = name_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } result.isKey_ = isKey_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } result.updated_ = updated_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; + if (isNullPresentCase_ == 6) { + result.isNullPresent_ = isNullPresent_; } - result.isNull_ = isNull_; if (propsBuilder_ == null) { if (((bitField0_ & 0x00000040) == 0x00000040)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -5418,19 +5088,11 @@ public final class CanalEntry { } else { result.props_ = propsBuilder_.build(); } - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000040; - } result.value_ = value_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { - to_bitField0_ |= 0x00000080; - } result.length_ = length_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000100; - } result.mysqlType_ = mysqlType_; result.bitField0_ = to_bitField0_; + result.isNullPresentCase_ = isNullPresentCase_; onBuilt(); return result; } @@ -5479,26 +5141,22 @@ public final class CanalEntry { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.Column other) { if (other == com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()) return this; - if (other.hasIndex()) { + if (other.getIndex() != 0) { setIndex(other.getIndex()); } - if (other.hasSqlType()) { + if (other.getSqlType() != 0) { setSqlType(other.getSqlType()); } - if (other.hasName()) { - bitField0_ |= 0x00000004; + if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } - if (other.hasIsKey()) { + if (other.getIsKey() != false) { setIsKey(other.getIsKey()); } - if (other.hasUpdated()) { + if (other.getUpdated() != false) { setUpdated(other.getUpdated()); } - if (other.hasIsNull()) { - setIsNull(other.getIsNull()); - } if (propsBuilder_ == null) { if (!other.props_.isEmpty()) { if (props_.isEmpty()) { @@ -5525,19 +5183,26 @@ public final class CanalEntry { } } } - if (other.hasValue()) { - bitField0_ |= 0x00000080; + if (!other.getValue().isEmpty()) { value_ = other.value_; onChanged(); } - if (other.hasLength()) { + if (other.getLength() != 0) { setLength(other.getLength()); } - if (other.hasMysqlType()) { - bitField0_ |= 0x00000200; + if (!other.getMysqlType().isEmpty()) { mysqlType_ = other.mysqlType_; onChanged(); } + switch (other.getIsNullPresentCase()) { + case ISNULL: { + setIsNull(other.getIsNull()); + break; + } + case ISNULLPRESENT_NOT_SET: { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -5566,6 +5231,21 @@ public final class CanalEntry { } return this; } + private int isNullPresentCase_ = 0; + private java.lang.Object isNullPresent_; + public IsNullPresentCase + getIsNullPresentCase() { + return IsNullPresentCase.forNumber( + isNullPresentCase_); + } + + public Builder clearIsNullPresent() { + isNullPresentCase_ = 0; + isNullPresent_ = null; + onChanged(); + return this; + } + private int bitField0_; private int index_ ; @@ -5574,17 +5254,7 @@ public final class CanalEntry { **字段下标* * * - * optional int32 index = 1; - */ - public boolean hasIndex() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-       **字段下标*
-       * 
- * - * optional int32 index = 1; + * int32 index = 1; */ public int getIndex() { return index_; @@ -5594,10 +5264,10 @@ public final class CanalEntry { **字段下标* * * - * optional int32 index = 1; + * int32 index = 1; */ public Builder setIndex(int value) { - bitField0_ |= 0x00000001; + index_ = value; onChanged(); return this; @@ -5607,10 +5277,10 @@ public final class CanalEntry { **字段下标* * * - * optional int32 index = 1; + * int32 index = 1; */ public Builder clearIndex() { - bitField0_ = (bitField0_ & ~0x00000001); + index_ = 0; onChanged(); return this; @@ -5622,17 +5292,7 @@ public final class CanalEntry { **字段java中类型* * * - * optional int32 sqlType = 2; - */ - public boolean hasSqlType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-       **字段java中类型*
-       * 
- * - * optional int32 sqlType = 2; + * int32 sqlType = 2; */ public int getSqlType() { return sqlType_; @@ -5642,10 +5302,10 @@ public final class CanalEntry { **字段java中类型* * * - * optional int32 sqlType = 2; + * int32 sqlType = 2; */ public Builder setSqlType(int value) { - bitField0_ |= 0x00000002; + sqlType_ = value; onChanged(); return this; @@ -5655,10 +5315,10 @@ public final class CanalEntry { **字段java中类型* * * - * optional int32 sqlType = 2; + * int32 sqlType = 2; */ public Builder clearSqlType() { - bitField0_ = (bitField0_ & ~0x00000002); + sqlType_ = 0; onChanged(); return this; @@ -5670,17 +5330,7 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-       **字段名称(忽略大小写),在mysql中是没有的*
-       * 
- * - * optional string name = 3; + * string name = 3; */ public java.lang.String getName() { java.lang.Object ref = name_; @@ -5688,9 +5338,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } + name_ = s; return s; } else { return (java.lang.String) ref; @@ -5701,7 +5349,7 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; + * string name = 3; */ public com.google.protobuf.ByteString getNameBytes() { @@ -5721,14 +5369,14 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; + * string name = 3; */ public Builder setName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + name_ = value; onChanged(); return this; @@ -5738,10 +5386,10 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; + * string name = 3; */ public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000004); + name_ = getDefaultInstance().getName(); onChanged(); return this; @@ -5751,14 +5399,15 @@ public final class CanalEntry { **字段名称(忽略大小写),在mysql中是没有的* * * - * optional string name = 3; + * string name = 3; */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + checkByteStringIsUtf8(value); + name_ = value; onChanged(); return this; @@ -5770,17 +5419,7 @@ public final class CanalEntry { **是否是主键* * * - * optional bool isKey = 4; - */ - public boolean hasIsKey() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-       **是否是主键*
-       * 
- * - * optional bool isKey = 4; + * bool isKey = 4; */ public boolean getIsKey() { return isKey_; @@ -5790,10 +5429,10 @@ public final class CanalEntry { **是否是主键* * * - * optional bool isKey = 4; + * bool isKey = 4; */ public Builder setIsKey(boolean value) { - bitField0_ |= 0x00000008; + isKey_ = value; onChanged(); return this; @@ -5803,10 +5442,10 @@ public final class CanalEntry { **是否是主键* * * - * optional bool isKey = 4; + * bool isKey = 4; */ public Builder clearIsKey() { - bitField0_ = (bitField0_ & ~0x00000008); + isKey_ = false; onChanged(); return this; @@ -5818,17 +5457,7 @@ public final class CanalEntry { **如果EventType=UPDATE,用于标识这个字段值是否有修改* * * - * optional bool updated = 5; - */ - public boolean hasUpdated() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - *
-       **如果EventType=UPDATE,用于标识这个字段值是否有修改*
-       * 
- * - * optional bool updated = 5; + * bool updated = 5; */ public boolean getUpdated() { return updated_; @@ -5838,10 +5467,10 @@ public final class CanalEntry { **如果EventType=UPDATE,用于标识这个字段值是否有修改* * * - * optional bool updated = 5; + * bool updated = 5; */ public Builder setUpdated(boolean value) { - bitField0_ |= 0x00000010; + updated_ = value; onChanged(); return this; @@ -5851,60 +5480,42 @@ public final class CanalEntry { **如果EventType=UPDATE,用于标识这个字段值是否有修改* * * - * optional bool updated = 5; + * bool updated = 5; */ public Builder clearUpdated() { - bitField0_ = (bitField0_ & ~0x00000010); + updated_ = false; onChanged(); return this; } - private boolean isNull_ ; /** - *
-       ** 标识是否为空  *
-       * 
- * - * optional bool isNull = 6 [default = false]; - */ - public boolean hasIsNull() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - *
-       ** 标识是否为空  *
-       * 
- * - * optional bool isNull = 6 [default = false]; + * bool isNull = 6; */ public boolean getIsNull() { - return isNull_; + if (isNullPresentCase_ == 6) { + return (java.lang.Boolean) isNullPresent_; + } + return false; } /** - *
-       ** 标识是否为空  *
-       * 
- * - * optional bool isNull = 6 [default = false]; + * bool isNull = 6; */ public Builder setIsNull(boolean value) { - bitField0_ |= 0x00000020; - isNull_ = value; + isNullPresentCase_ = 6; + isNullPresent_ = value; onChanged(); return this; } /** - *
-       ** 标识是否为空  *
-       * 
- * - * optional bool isNull = 6 [default = false]; + * bool isNull = 6; */ public Builder clearIsNull() { - bitField0_ = (bitField0_ & ~0x00000020); - isNull_ = false; - onChanged(); + if (isNullPresentCase_ == 6) { + isNullPresentCase_ = 0; + isNullPresent_ = null; + onChanged(); + } return this; } @@ -6226,17 +5837,7 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - *
-       ** 字段值,timestamp,Datetime是一个时间格式的文本 *
-       * 
- * - * optional string value = 8; + * string value = 8; */ public java.lang.String getValue() { java.lang.Object ref = value_; @@ -6244,9 +5845,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - value_ = s; - } + value_ = s; return s; } else { return (java.lang.String) ref; @@ -6257,7 +5856,7 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; + * string value = 8; */ public com.google.protobuf.ByteString getValueBytes() { @@ -6277,14 +5876,14 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; + * string value = 8; */ public Builder setValue( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000080; + value_ = value; onChanged(); return this; @@ -6294,10 +5893,10 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; + * string value = 8; */ public Builder clearValue() { - bitField0_ = (bitField0_ & ~0x00000080); + value_ = getDefaultInstance().getValue(); onChanged(); return this; @@ -6307,14 +5906,15 @@ public final class CanalEntry { ** 字段值,timestamp,Datetime是一个时间格式的文本 * * * - * optional string value = 8; + * string value = 8; */ public Builder setValueBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000080; + checkByteStringIsUtf8(value); + value_ = value; onChanged(); return this; @@ -6326,17 +5926,7 @@ public final class CanalEntry { ** 对应数据对象原始长度 * * * - * optional int32 length = 9; - */ - public boolean hasLength() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - *
-       ** 对应数据对象原始长度 *
-       * 
- * - * optional int32 length = 9; + * int32 length = 9; */ public int getLength() { return length_; @@ -6346,10 +5936,10 @@ public final class CanalEntry { ** 对应数据对象原始长度 * * * - * optional int32 length = 9; + * int32 length = 9; */ public Builder setLength(int value) { - bitField0_ |= 0x00000100; + length_ = value; onChanged(); return this; @@ -6359,10 +5949,10 @@ public final class CanalEntry { ** 对应数据对象原始长度 * * * - * optional int32 length = 9; + * int32 length = 9; */ public Builder clearLength() { - bitField0_ = (bitField0_ & ~0x00000100); + length_ = 0; onChanged(); return this; @@ -6374,17 +5964,7 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; - */ - public boolean hasMysqlType() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - *
-       **字段mysql类型*
-       * 
- * - * optional string mysqlType = 10; + * string mysqlType = 10; */ public java.lang.String getMysqlType() { java.lang.Object ref = mysqlType_; @@ -6392,9 +5972,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - mysqlType_ = s; - } + mysqlType_ = s; return s; } else { return (java.lang.String) ref; @@ -6405,7 +5983,7 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; + * string mysqlType = 10; */ public com.google.protobuf.ByteString getMysqlTypeBytes() { @@ -6425,14 +6003,14 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; + * string mysqlType = 10; */ public Builder setMysqlType( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000200; + mysqlType_ = value; onChanged(); return this; @@ -6442,10 +6020,10 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; + * string mysqlType = 10; */ public Builder clearMysqlType() { - bitField0_ = (bitField0_ & ~0x00000200); + mysqlType_ = getDefaultInstance().getMysqlType(); onChanged(); return this; @@ -6455,14 +6033,15 @@ public final class CanalEntry { **字段mysql类型* * * - * optional string mysqlType = 10; + * string mysqlType = 10; */ public Builder setMysqlTypeBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000200; + checkByteStringIsUtf8(value); + mysqlType_ = value; onChanged(); return this; @@ -6470,7 +6049,7 @@ public final class CanalEntry { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -6493,7 +6072,7 @@ public final class CanalEntry { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Column parsePartialFrom( @@ -6704,7 +6283,7 @@ public final class CanalEntry { mutable_bitField0_ |= 0x00000001; } beforeColumns_.add( - input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.PARSER, extensionRegistry)); + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.parser(), extensionRegistry)); break; } case 18: { @@ -6713,7 +6292,7 @@ public final class CanalEntry { mutable_bitField0_ |= 0x00000002; } afterColumns_.add( - input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.PARSER, extensionRegistry)); + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.parser(), extensionRegistry)); break; } case 26: { @@ -6722,11 +6301,11 @@ public final class CanalEntry { mutable_bitField0_ |= 0x00000004; } props_.add( - input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -8322,7 +7901,7 @@ public final class CanalEntry { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -8345,7 +7924,7 @@ public final class CanalEntry { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public RowData parsePartialFrom( @@ -8381,49 +7960,21 @@ public final class CanalEntry { **tableId,由数据库产生* * * - * optional int64 tableId = 1; - */ - boolean hasTableId(); - /** - *
-     **tableId,由数据库产生*
-     * 
- * - * optional int64 tableId = 1; + * int64 tableId = 1; */ long getTableId(); /** - *
-     **数据变更类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; */ - boolean hasEventType(); + int getEventTypeValue(); /** - *
-     **数据变更类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; */ com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); /** - *
-     ** 标识是否是ddl语句  *
-     * 
- * - * optional bool isDdl = 10 [default = false]; - */ - boolean hasIsDdl(); - /** - *
-     ** 标识是否是ddl语句  *
-     * 
- * - * optional bool isDdl = 10 [default = false]; + * bool isDdl = 10; */ boolean getIsDdl(); @@ -8432,15 +7983,7 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; - */ - boolean hasSql(); - /** - *
-     ** ddl/query的sql语句  *
-     * 
- * - * optional string sql = 11; + * string sql = 11; */ java.lang.String getSql(); /** @@ -8448,7 +7991,7 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; + * string sql = 11; */ com.google.protobuf.ByteString getSqlBytes(); @@ -8546,15 +8089,7 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; - */ - boolean hasDdlSchemaName(); - /** - *
-     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
-     * 
- * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ java.lang.String getDdlSchemaName(); /** @@ -8562,10 +8097,14 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ com.google.protobuf.ByteString getDdlSchemaNameBytes(); + + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange.EventTypePresentCase getEventTypePresentCase(); + + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange.IsDdlPresentCase getIsDdlPresentCase(); } /** *
@@ -8585,8 +8124,6 @@ public final class CanalEntry {
     }
     private RowChange() {
       tableId_ = 0L;
-      eventType_ = 2;
-      isDdl_ = false;
       sql_ = "";
       rowDatas_ = java.util.Collections.emptyList();
       props_ = java.util.Collections.emptyList();
@@ -8618,31 +8155,25 @@ public final class CanalEntry {
               done = true;
               break;
             case 8: {
-              bitField0_ |= 0x00000001;
+
               tableId_ = input.readInt64();
               break;
             }
             case 16: {
               int rawValue = input.readEnum();
-                @SuppressWarnings("deprecation")
-              com.alibaba.otter.canal.protocol.CanalEntry.EventType value = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(rawValue);
-              if (value == null) {
-                unknownFields.mergeVarintField(2, rawValue);
-              } else {
-                bitField0_ |= 0x00000002;
-                eventType_ = rawValue;
-              }
+              eventTypePresentCase_ = 2;
+              eventTypePresent_ = rawValue;
               break;
             }
             case 80: {
-              bitField0_ |= 0x00000004;
-              isDdl_ = input.readBool();
+              isDdlPresentCase_ = 10;
+              isDdlPresent_ = input.readBool();
               break;
             }
             case 90: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000008;
-              sql_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              sql_ = s;
               break;
             }
             case 98: {
@@ -8651,7 +8182,7 @@ public final class CanalEntry {
                 mutable_bitField0_ |= 0x00000010;
               }
               rowDatas_.add(
-                  input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.RowData.PARSER, extensionRegistry));
+                  input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.RowData.parser(), extensionRegistry));
               break;
             }
             case 106: {
@@ -8660,17 +8191,17 @@ public final class CanalEntry {
                 mutable_bitField0_ |= 0x00000020;
               }
               props_.add(
-                  input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry));
+                  input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry));
               break;
             }
             case 114: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000010;
-              ddlSchemaName_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              ddlSchemaName_ = s;
               break;
             }
             default: {
-              if (!parseUnknownField(
+              if (!parseUnknownFieldProto3(
                   input, unknownFields, extensionRegistry, tag)) {
                 done = true;
               }
@@ -8708,6 +8239,78 @@ public final class CanalEntry {
     }
 
     private int bitField0_;
+    private int eventTypePresentCase_ = 0;
+    private java.lang.Object eventTypePresent_;
+    public enum EventTypePresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      EVENTTYPE(2),
+      EVENTTYPEPRESENT_NOT_SET(0);
+      private final int value;
+      private EventTypePresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static EventTypePresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static EventTypePresentCase forNumber(int value) {
+        switch (value) {
+          case 2: return EVENTTYPE;
+          case 0: return EVENTTYPEPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public EventTypePresentCase
+    getEventTypePresentCase() {
+      return EventTypePresentCase.forNumber(
+          eventTypePresentCase_);
+    }
+
+    private int isDdlPresentCase_ = 0;
+    private java.lang.Object isDdlPresent_;
+    public enum IsDdlPresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      ISDDL(10),
+      ISDDLPRESENT_NOT_SET(0);
+      private final int value;
+      private IsDdlPresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static IsDdlPresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static IsDdlPresentCase forNumber(int value) {
+        switch (value) {
+          case 10: return ISDDL;
+          case 0: return ISDDLPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public IsDdlPresentCase
+    getIsDdlPresentCase() {
+      return IsDdlPresentCase.forNumber(
+          isDdlPresentCase_);
+    }
+
     public static final int TABLEID_FIELD_NUMBER = 1;
     private long tableId_;
     /**
@@ -8715,68 +8318,44 @@ public final class CanalEntry {
      **tableId,由数据库产生*
      * 
* - * optional int64 tableId = 1; - */ - public boolean hasTableId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-     **tableId,由数据库产生*
-     * 
- * - * optional int64 tableId = 1; + * int64 tableId = 1; */ public long getTableId() { return tableId_; } public static final int EVENTTYPE_FIELD_NUMBER = 2; - private int eventType_; /** - *
-     **数据变更类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; */ - public boolean hasEventType() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public int getEventTypeValue() { + if (eventTypePresentCase_ == 2) { + return (java.lang.Integer) eventTypePresent_; + } + return 0; } /** - *
-     **数据变更类型*
-     * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; */ public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(eventType_); - return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE : result; + if (eventTypePresentCase_ == 2) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf( + (java.lang.Integer) eventTypePresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UNRECOGNIZED : result; + } + return EventType.UPDATE; } public static final int ISDDL_FIELD_NUMBER = 10; - private boolean isDdl_; /** - *
-     ** 标识是否是ddl语句  *
-     * 
- * - * optional bool isDdl = 10 [default = false]; - */ - public boolean hasIsDdl() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-     ** 标识是否是ddl语句  *
-     * 
- * - * optional bool isDdl = 10 [default = false]; + * bool isDdl = 10; */ public boolean getIsDdl() { - return isDdl_; + if (isDdlPresentCase_ == 10) { + return (java.lang.Boolean) isDdlPresent_; + } + return false; } public static final int SQL_FIELD_NUMBER = 11; @@ -8786,17 +8365,7 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; - */ - public boolean hasSql() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-     ** ddl/query的sql语句  *
-     * 
- * - * optional string sql = 11; + * string sql = 11; */ public java.lang.String getSql() { java.lang.Object ref = sql_; @@ -8806,9 +8375,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - sql_ = s; - } + sql_ = s; return s; } } @@ -8817,7 +8384,7 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; + * string sql = 11; */ public com.google.protobuf.ByteString getSqlBytes() { @@ -8950,17 +8517,7 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; - */ - public boolean hasDdlSchemaName() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - *
-     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
-     * 
- * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ public java.lang.String getDdlSchemaName() { java.lang.Object ref = ddlSchemaName_; @@ -8970,9 +8527,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - ddlSchemaName_ = s; - } + ddlSchemaName_ = s; return s; } } @@ -8981,7 +8536,7 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ public com.google.protobuf.ByteString getDdlSchemaNameBytes() { @@ -9011,16 +8566,17 @@ public final class CanalEntry { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (tableId_ != 0L) { output.writeInt64(1, tableId_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, eventType_); + if (eventTypePresentCase_ == 2) { + output.writeEnum(2, ((java.lang.Integer) eventTypePresent_)); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBool(10, isDdl_); + if (isDdlPresentCase_ == 10) { + output.writeBool( + 10, (boolean)((java.lang.Boolean) isDdlPresent_)); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (!getSqlBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 11, sql_); } for (int i = 0; i < rowDatas_.size(); i++) { @@ -9029,7 +8585,7 @@ public final class CanalEntry { for (int i = 0; i < props_.size(); i++) { output.writeMessage(13, props_.get(i)); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (!getDdlSchemaNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 14, ddlSchemaName_); } unknownFields.writeTo(output); @@ -9041,19 +8597,20 @@ public final class CanalEntry { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (tableId_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, tableId_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (eventTypePresentCase_ == 2) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, eventType_); + .computeEnumSize(2, ((java.lang.Integer) eventTypePresent_)); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (isDdlPresentCase_ == 10) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(10, isDdl_); + .computeBoolSize( + 10, (boolean)((java.lang.Boolean) isDdlPresent_)); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (!getSqlBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, sql_); } for (int i = 0; i < rowDatas_.size(); i++) { @@ -9064,7 +8621,7 @@ public final class CanalEntry { size += com.google.protobuf.CodedOutputStream .computeMessageSize(13, props_.get(i)); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (!getDdlSchemaNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, ddlSchemaName_); } size += unknownFields.getSerializedSize(); @@ -9083,33 +8640,37 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.RowChange other = (com.alibaba.otter.canal.protocol.CanalEntry.RowChange) obj; boolean result = true; - result = result && (hasTableId() == other.hasTableId()); - if (hasTableId()) { - result = result && (getTableId() - == other.getTableId()); - } - result = result && (hasEventType() == other.hasEventType()); - if (hasEventType()) { - result = result && eventType_ == other.eventType_; - } - result = result && (hasIsDdl() == other.hasIsDdl()); - if (hasIsDdl()) { - result = result && (getIsDdl() - == other.getIsDdl()); - } - result = result && (hasSql() == other.hasSql()); - if (hasSql()) { - result = result && getSql() - .equals(other.getSql()); - } + result = result && (getTableId() + == other.getTableId()); + result = result && getSql() + .equals(other.getSql()); result = result && getRowDatasList() .equals(other.getRowDatasList()); result = result && getPropsList() .equals(other.getPropsList()); - result = result && (hasDdlSchemaName() == other.hasDdlSchemaName()); - if (hasDdlSchemaName()) { - result = result && getDdlSchemaName() - .equals(other.getDdlSchemaName()); + result = result && getDdlSchemaName() + .equals(other.getDdlSchemaName()); + result = result && getEventTypePresentCase().equals( + other.getEventTypePresentCase()); + if (!result) return false; + switch (eventTypePresentCase_) { + case 2: + result = result && getEventTypeValue() + == other.getEventTypeValue(); + break; + case 0: + default: + } + result = result && getIsDdlPresentCase().equals( + other.getIsDdlPresentCase()); + if (!result) return false; + switch (isDdlPresentCase_) { + case 10: + result = result && (getIsDdl() + == other.getIsDdl()); + break; + case 0: + default: } result = result && unknownFields.equals(other.unknownFields); return result; @@ -9122,24 +8683,11 @@ public final class CanalEntry { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasTableId()) { - hash = (37 * hash) + TABLEID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTableId()); - } - if (hasEventType()) { - hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER; - hash = (53 * hash) + eventType_; - } - if (hasIsDdl()) { - hash = (37 * hash) + ISDDL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsDdl()); - } - if (hasSql()) { - hash = (37 * hash) + SQL_FIELD_NUMBER; - hash = (53 * hash) + getSql().hashCode(); - } + hash = (37 * hash) + TABLEID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTableId()); + hash = (37 * hash) + SQL_FIELD_NUMBER; + hash = (53 * hash) + getSql().hashCode(); if (getRowDatasCount() > 0) { hash = (37 * hash) + ROWDATAS_FIELD_NUMBER; hash = (53 * hash) + getRowDatasList().hashCode(); @@ -9148,9 +8696,24 @@ public final class CanalEntry { hash = (37 * hash) + PROPS_FIELD_NUMBER; hash = (53 * hash) + getPropsList().hashCode(); } - if (hasDdlSchemaName()) { - hash = (37 * hash) + DDLSCHEMANAME_FIELD_NUMBER; - hash = (53 * hash) + getDdlSchemaName().hashCode(); + hash = (37 * hash) + DDLSCHEMANAME_FIELD_NUMBER; + hash = (53 * hash) + getDdlSchemaName().hashCode(); + switch (eventTypePresentCase_) { + case 2: + hash = (37 * hash) + EVENTTYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventTypeValue(); + break; + case 0: + default: + } + switch (isDdlPresentCase_) { + case 10: + hash = (37 * hash) + ISDDL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsDdl()); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -9292,13 +8855,9 @@ public final class CanalEntry { public Builder clear() { super.clear(); tableId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - eventType_ = 2; - bitField0_ = (bitField0_ & ~0x00000002); - isDdl_ = false; - bitField0_ = (bitField0_ & ~0x00000004); + sql_ = ""; - bitField0_ = (bitField0_ & ~0x00000008); + if (rowDatasBuilder_ == null) { rowDatas_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); @@ -9312,7 +8871,11 @@ public final class CanalEntry { propsBuilder_.clear(); } ddlSchemaName_ = ""; - bitField0_ = (bitField0_ & ~0x00000040); + + eventTypePresentCase_ = 0; + eventTypePresent_ = null; + isDdlPresentCase_ = 0; + isDdlPresent_ = null; return this; } @@ -9341,20 +8904,12 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.RowChange result = new com.alibaba.otter.canal.protocol.CanalEntry.RowChange(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.tableId_ = tableId_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; + if (eventTypePresentCase_ == 2) { + result.eventTypePresent_ = eventTypePresent_; } - result.eventType_ = eventType_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.isDdl_ = isDdl_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; + if (isDdlPresentCase_ == 10) { + result.isDdlPresent_ = isDdlPresent_; } result.sql_ = sql_; if (rowDatasBuilder_ == null) { @@ -9375,11 +8930,10 @@ public final class CanalEntry { } else { result.props_ = propsBuilder_.build(); } - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000010; - } result.ddlSchemaName_ = ddlSchemaName_; result.bitField0_ = to_bitField0_; + result.eventTypePresentCase_ = eventTypePresentCase_; + result.isDdlPresentCase_ = isDdlPresentCase_; onBuilt(); return result; } @@ -9428,17 +8982,10 @@ public final class CanalEntry { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.RowChange other) { if (other == com.alibaba.otter.canal.protocol.CanalEntry.RowChange.getDefaultInstance()) return this; - if (other.hasTableId()) { + if (other.getTableId() != 0L) { setTableId(other.getTableId()); } - if (other.hasEventType()) { - setEventType(other.getEventType()); - } - if (other.hasIsDdl()) { - setIsDdl(other.getIsDdl()); - } - if (other.hasSql()) { - bitField0_ |= 0x00000008; + if (!other.getSql().isEmpty()) { sql_ = other.sql_; onChanged(); } @@ -9494,11 +9041,28 @@ public final class CanalEntry { } } } - if (other.hasDdlSchemaName()) { - bitField0_ |= 0x00000040; + if (!other.getDdlSchemaName().isEmpty()) { ddlSchemaName_ = other.ddlSchemaName_; onChanged(); } + switch (other.getEventTypePresentCase()) { + case EVENTTYPE: { + setEventTypeValue(other.getEventTypeValue()); + break; + } + case EVENTTYPEPRESENT_NOT_SET: { + break; + } + } + switch (other.getIsDdlPresentCase()) { + case ISDDL: { + setIsDdl(other.getIsDdl()); + break; + } + case ISDDLPRESENT_NOT_SET: { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -9527,6 +9091,36 @@ public final class CanalEntry { } return this; } + private int eventTypePresentCase_ = 0; + private java.lang.Object eventTypePresent_; + public EventTypePresentCase + getEventTypePresentCase() { + return EventTypePresentCase.forNumber( + eventTypePresentCase_); + } + + public Builder clearEventTypePresent() { + eventTypePresentCase_ = 0; + eventTypePresent_ = null; + onChanged(); + return this; + } + + private int isDdlPresentCase_ = 0; + private java.lang.Object isDdlPresent_; + public IsDdlPresentCase + getIsDdlPresentCase() { + return IsDdlPresentCase.forNumber( + isDdlPresentCase_); + } + + public Builder clearIsDdlPresent() { + isDdlPresentCase_ = 0; + isDdlPresent_ = null; + onChanged(); + return this; + } + private int bitField0_; private long tableId_ ; @@ -9535,17 +9129,7 @@ public final class CanalEntry { **tableId,由数据库产生* * * - * optional int64 tableId = 1; - */ - public boolean hasTableId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-       **tableId,由数据库产生*
-       * 
- * - * optional int64 tableId = 1; + * int64 tableId = 1; */ public long getTableId() { return tableId_; @@ -9555,10 +9139,10 @@ public final class CanalEntry { **tableId,由数据库产生* * * - * optional int64 tableId = 1; + * int64 tableId = 1; */ public Builder setTableId(long value) { - bitField0_ |= 0x00000001; + tableId_ = value; onChanged(); return this; @@ -9568,113 +9152,96 @@ public final class CanalEntry { **tableId,由数据库产生* * * - * optional int64 tableId = 1; + * int64 tableId = 1; */ public Builder clearTableId() { - bitField0_ = (bitField0_ & ~0x00000001); + tableId_ = 0L; onChanged(); return this; } - private int eventType_ = 2; /** - *
-       **数据变更类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; */ - public boolean hasEventType() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public int getEventTypeValue() { + if (eventTypePresentCase_ == 2) { + return ((java.lang.Integer) eventTypePresent_).intValue(); + } + return 0; } /** - *
-       **数据变更类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + */ + public Builder setEventTypeValue(int value) { + eventTypePresentCase_ = 2; + eventTypePresent_ = value; + onChanged(); + return this; + } + /** + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; */ public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(eventType_); - return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE : result; + if (eventTypePresentCase_ == 2) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalEntry.EventType result = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf( + (java.lang.Integer) eventTypePresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalEntry.EventType.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalEntry.EventType.EVENTTYPECOMPATIBLEPROTO2; } /** - *
-       **数据变更类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; */ public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; - eventType_ = value.getNumber(); + eventTypePresentCase_ = 2; + eventTypePresent_ = value.getNumber(); onChanged(); return this; } /** - *
-       **数据变更类型*
-       * 
- * - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * .com.alibaba.otter.canal.protocol.EventType eventType = 2; */ public Builder clearEventType() { - bitField0_ = (bitField0_ & ~0x00000002); - eventType_ = 2; - onChanged(); + if (eventTypePresentCase_ == 2) { + eventTypePresentCase_ = 0; + eventTypePresent_ = null; + onChanged(); + } return this; } - private boolean isDdl_ ; /** - *
-       ** 标识是否是ddl语句  *
-       * 
- * - * optional bool isDdl = 10 [default = false]; - */ - public boolean hasIsDdl() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-       ** 标识是否是ddl语句  *
-       * 
- * - * optional bool isDdl = 10 [default = false]; + * bool isDdl = 10; */ public boolean getIsDdl() { - return isDdl_; + if (isDdlPresentCase_ == 10) { + return (java.lang.Boolean) isDdlPresent_; + } + return false; } /** - *
-       ** 标识是否是ddl语句  *
-       * 
- * - * optional bool isDdl = 10 [default = false]; + * bool isDdl = 10; */ public Builder setIsDdl(boolean value) { - bitField0_ |= 0x00000004; - isDdl_ = value; + isDdlPresentCase_ = 10; + isDdlPresent_ = value; onChanged(); return this; } /** - *
-       ** 标识是否是ddl语句  *
-       * 
- * - * optional bool isDdl = 10 [default = false]; + * bool isDdl = 10; */ public Builder clearIsDdl() { - bitField0_ = (bitField0_ & ~0x00000004); - isDdl_ = false; - onChanged(); + if (isDdlPresentCase_ == 10) { + isDdlPresentCase_ = 0; + isDdlPresent_ = null; + onChanged(); + } return this; } @@ -9684,17 +9251,7 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; - */ - public boolean hasSql() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-       ** ddl/query的sql语句  *
-       * 
- * - * optional string sql = 11; + * string sql = 11; */ public java.lang.String getSql() { java.lang.Object ref = sql_; @@ -9702,9 +9259,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - sql_ = s; - } + sql_ = s; return s; } else { return (java.lang.String) ref; @@ -9715,7 +9270,7 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; + * string sql = 11; */ public com.google.protobuf.ByteString getSqlBytes() { @@ -9735,14 +9290,14 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; + * string sql = 11; */ public Builder setSql( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; + sql_ = value; onChanged(); return this; @@ -9752,10 +9307,10 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; + * string sql = 11; */ public Builder clearSql() { - bitField0_ = (bitField0_ & ~0x00000008); + sql_ = getDefaultInstance().getSql(); onChanged(); return this; @@ -9765,14 +9320,15 @@ public final class CanalEntry { ** ddl/query的sql语句 * * * - * optional string sql = 11; + * string sql = 11; */ public Builder setSqlBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; + checkByteStringIsUtf8(value); + sql_ = value; onChanged(); return this; @@ -10408,17 +9964,7 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; - */ - public boolean hasDdlSchemaName() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - *
-       ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
-       * 
- * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ public java.lang.String getDdlSchemaName() { java.lang.Object ref = ddlSchemaName_; @@ -10426,9 +9972,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - ddlSchemaName_ = s; - } + ddlSchemaName_ = s; return s; } else { return (java.lang.String) ref; @@ -10439,7 +9983,7 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ public com.google.protobuf.ByteString getDdlSchemaNameBytes() { @@ -10459,14 +10003,14 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ public Builder setDdlSchemaName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000040; + ddlSchemaName_ = value; onChanged(); return this; @@ -10476,10 +10020,10 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ public Builder clearDdlSchemaName() { - bitField0_ = (bitField0_ & ~0x00000040); + ddlSchemaName_ = getDefaultInstance().getDdlSchemaName(); onChanged(); return this; @@ -10489,14 +10033,15 @@ public final class CanalEntry { ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName * * * - * optional string ddlSchemaName = 14; + * string ddlSchemaName = 14; */ public Builder setDdlSchemaNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000040; + checkByteStringIsUtf8(value); + ddlSchemaName_ = value; onChanged(); return this; @@ -10504,7 +10049,7 @@ public final class CanalEntry { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -10527,7 +10072,7 @@ public final class CanalEntry { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public RowChange parsePartialFrom( @@ -10563,15 +10108,7 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; - */ - boolean hasExecuteTime(); - /** - *
-     **已废弃,请使用header里的executeTime*
-     * 
- * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ long getExecuteTime(); @@ -10580,15 +10117,7 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; - */ - boolean hasTransactionId(); - /** - *
-     **已废弃,Begin里不提供事务id*
-     * 
- * - * optional string transactionId = 2; + * string transactionId = 2; */ java.lang.String getTransactionId(); /** @@ -10596,7 +10125,7 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; + * string transactionId = 2; */ com.google.protobuf.ByteString getTransactionIdBytes(); @@ -10650,15 +10179,7 @@ public final class CanalEntry { **执行的thread Id* * * - * optional int64 threadId = 4; - */ - boolean hasThreadId(); - /** - *
-     **执行的thread Id*
-     * 
- * - * optional int64 threadId = 4; + * int64 threadId = 4; */ long getThreadId(); } @@ -10710,14 +10231,14 @@ public final class CanalEntry { done = true; break; case 8: { - bitField0_ |= 0x00000001; + executeTime_ = input.readInt64(); break; } case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - transactionId_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + transactionId_ = s; break; } case 26: { @@ -10726,16 +10247,16 @@ public final class CanalEntry { mutable_bitField0_ |= 0x00000004; } props_.add( - input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); break; } case 32: { - bitField0_ |= 0x00000004; + threadId_ = input.readInt64(); break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -10777,17 +10298,7 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-     **已废弃,请使用header里的executeTime*
-     * 
- * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ public long getExecuteTime() { return executeTime_; @@ -10800,17 +10311,7 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; - */ - public boolean hasTransactionId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-     **已废弃,Begin里不提供事务id*
-     * 
- * - * optional string transactionId = 2; + * string transactionId = 2; */ public java.lang.String getTransactionId() { java.lang.Object ref = transactionId_; @@ -10820,9 +10321,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - transactionId_ = s; - } + transactionId_ = s; return s; } } @@ -10831,7 +10330,7 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { @@ -10909,17 +10408,7 @@ public final class CanalEntry { **执行的thread Id* * * - * optional int64 threadId = 4; - */ - public boolean hasThreadId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-     **执行的thread Id*
-     * 
- * - * optional int64 threadId = 4; + * int64 threadId = 4; */ public long getThreadId() { return threadId_; @@ -10939,16 +10428,16 @@ public final class CanalEntry { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (executeTime_ != 0L) { output.writeInt64(1, executeTime_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getTransactionIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, transactionId_); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(3, props_.get(i)); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (threadId_ != 0L) { output.writeInt64(4, threadId_); } unknownFields.writeTo(output); @@ -10960,18 +10449,18 @@ public final class CanalEntry { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (executeTime_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, executeTime_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getTransactionIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, transactionId_); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, props_.get(i)); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (threadId_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(4, threadId_); } @@ -10991,23 +10480,14 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin other = (com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin) obj; boolean result = true; - result = result && (hasExecuteTime() == other.hasExecuteTime()); - if (hasExecuteTime()) { - result = result && (getExecuteTime() - == other.getExecuteTime()); - } - result = result && (hasTransactionId() == other.hasTransactionId()); - if (hasTransactionId()) { - result = result && getTransactionId() - .equals(other.getTransactionId()); - } + result = result && (getExecuteTime() + == other.getExecuteTime()); + result = result && getTransactionId() + .equals(other.getTransactionId()); result = result && getPropsList() .equals(other.getPropsList()); - result = result && (hasThreadId() == other.hasThreadId()); - if (hasThreadId()) { - result = result && (getThreadId() - == other.getThreadId()); - } + result = result && (getThreadId() + == other.getThreadId()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -11019,24 +10499,18 @@ public final class CanalEntry { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasExecuteTime()) { - hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getExecuteTime()); - } - if (hasTransactionId()) { - hash = (37 * hash) + TRANSACTIONID_FIELD_NUMBER; - hash = (53 * hash) + getTransactionId().hashCode(); - } + hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExecuteTime()); + hash = (37 * hash) + TRANSACTIONID_FIELD_NUMBER; + hash = (53 * hash) + getTransactionId().hashCode(); if (getPropsCount() > 0) { hash = (37 * hash) + PROPS_FIELD_NUMBER; hash = (53 * hash) + getPropsList().hashCode(); } - if (hasThreadId()) { - hash = (37 * hash) + THREADID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getThreadId()); - } + hash = (37 * hash) + THREADID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getThreadId()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -11176,9 +10650,9 @@ public final class CanalEntry { public Builder clear() { super.clear(); executeTime_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); + transactionId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + if (propsBuilder_ == null) { props_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); @@ -11186,7 +10660,7 @@ public final class CanalEntry { propsBuilder_.clear(); } threadId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); + return this; } @@ -11215,13 +10689,7 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin result = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.executeTime_ = executeTime_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.transactionId_ = transactionId_; if (propsBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { @@ -11232,9 +10700,6 @@ public final class CanalEntry { } else { result.props_ = propsBuilder_.build(); } - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000004; - } result.threadId_ = threadId_; result.bitField0_ = to_bitField0_; onBuilt(); @@ -11285,11 +10750,10 @@ public final class CanalEntry { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin other) { if (other == com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.getDefaultInstance()) return this; - if (other.hasExecuteTime()) { + if (other.getExecuteTime() != 0L) { setExecuteTime(other.getExecuteTime()); } - if (other.hasTransactionId()) { - bitField0_ |= 0x00000002; + if (!other.getTransactionId().isEmpty()) { transactionId_ = other.transactionId_; onChanged(); } @@ -11319,7 +10783,7 @@ public final class CanalEntry { } } } - if (other.hasThreadId()) { + if (other.getThreadId() != 0L) { setThreadId(other.getThreadId()); } this.mergeUnknownFields(other.unknownFields); @@ -11358,17 +10822,7 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-       **已废弃,请使用header里的executeTime*
-       * 
- * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ public long getExecuteTime() { return executeTime_; @@ -11378,10 +10832,10 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ public Builder setExecuteTime(long value) { - bitField0_ |= 0x00000001; + executeTime_ = value; onChanged(); return this; @@ -11391,10 +10845,10 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ public Builder clearExecuteTime() { - bitField0_ = (bitField0_ & ~0x00000001); + executeTime_ = 0L; onChanged(); return this; @@ -11406,17 +10860,7 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; - */ - public boolean hasTransactionId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-       **已废弃,Begin里不提供事务id*
-       * 
- * - * optional string transactionId = 2; + * string transactionId = 2; */ public java.lang.String getTransactionId() { java.lang.Object ref = transactionId_; @@ -11424,9 +10868,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - transactionId_ = s; - } + transactionId_ = s; return s; } else { return (java.lang.String) ref; @@ -11437,7 +10879,7 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { @@ -11457,14 +10899,14 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public Builder setTransactionId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + transactionId_ = value; onChanged(); return this; @@ -11474,10 +10916,10 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public Builder clearTransactionId() { - bitField0_ = (bitField0_ & ~0x00000002); + transactionId_ = getDefaultInstance().getTransactionId(); onChanged(); return this; @@ -11487,14 +10929,15 @@ public final class CanalEntry { **已废弃,Begin里不提供事务id* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public Builder setTransactionIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + transactionId_ = value; onChanged(); return this; @@ -11818,17 +11261,7 @@ public final class CanalEntry { **执行的thread Id* * * - * optional int64 threadId = 4; - */ - public boolean hasThreadId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-       **执行的thread Id*
-       * 
- * - * optional int64 threadId = 4; + * int64 threadId = 4; */ public long getThreadId() { return threadId_; @@ -11838,10 +11271,10 @@ public final class CanalEntry { **执行的thread Id* * * - * optional int64 threadId = 4; + * int64 threadId = 4; */ public Builder setThreadId(long value) { - bitField0_ |= 0x00000008; + threadId_ = value; onChanged(); return this; @@ -11851,10 +11284,10 @@ public final class CanalEntry { **执行的thread Id* * * - * optional int64 threadId = 4; + * int64 threadId = 4; */ public Builder clearThreadId() { - bitField0_ = (bitField0_ & ~0x00000008); + threadId_ = 0L; onChanged(); return this; @@ -11862,7 +11295,7 @@ public final class CanalEntry { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -11885,7 +11318,7 @@ public final class CanalEntry { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public TransactionBegin parsePartialFrom( @@ -11921,15 +11354,7 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; - */ - boolean hasExecuteTime(); - /** - *
-     **已废弃,请使用header里的executeTime*
-     * 
- * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ long getExecuteTime(); @@ -11938,15 +11363,7 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; - */ - boolean hasTransactionId(); - /** - *
-     **事务号*
-     * 
- * - * optional string transactionId = 2; + * string transactionId = 2; */ java.lang.String getTransactionId(); /** @@ -11954,7 +11371,7 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; + * string transactionId = 2; */ com.google.protobuf.ByteString getTransactionIdBytes(); @@ -12050,14 +11467,14 @@ public final class CanalEntry { done = true; break; case 8: { - bitField0_ |= 0x00000001; + executeTime_ = input.readInt64(); break; } case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - transactionId_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + transactionId_ = s; break; } case 26: { @@ -12066,11 +11483,11 @@ public final class CanalEntry { mutable_bitField0_ |= 0x00000004; } props_.add( - input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); + input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -12112,17 +11529,7 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-     **已废弃,请使用header里的executeTime*
-     * 
- * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ public long getExecuteTime() { return executeTime_; @@ -12135,17 +11542,7 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; - */ - public boolean hasTransactionId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-     **事务号*
-     * 
- * - * optional string transactionId = 2; + * string transactionId = 2; */ public java.lang.String getTransactionId() { java.lang.Object ref = transactionId_; @@ -12155,9 +11552,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - transactionId_ = s; - } + transactionId_ = s; return s; } } @@ -12166,7 +11561,7 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { @@ -12251,10 +11646,10 @@ public final class CanalEntry { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (executeTime_ != 0L) { output.writeInt64(1, executeTime_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getTransactionIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, transactionId_); } for (int i = 0; i < props_.size(); i++) { @@ -12269,11 +11664,11 @@ public final class CanalEntry { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (executeTime_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, executeTime_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getTransactionIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, transactionId_); } for (int i = 0; i < props_.size(); i++) { @@ -12296,16 +11691,10 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd other = (com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd) obj; boolean result = true; - result = result && (hasExecuteTime() == other.hasExecuteTime()); - if (hasExecuteTime()) { - result = result && (getExecuteTime() - == other.getExecuteTime()); - } - result = result && (hasTransactionId() == other.hasTransactionId()); - if (hasTransactionId()) { - result = result && getTransactionId() - .equals(other.getTransactionId()); - } + result = result && (getExecuteTime() + == other.getExecuteTime()); + result = result && getTransactionId() + .equals(other.getTransactionId()); result = result && getPropsList() .equals(other.getPropsList()); result = result && unknownFields.equals(other.unknownFields); @@ -12319,15 +11708,11 @@ public final class CanalEntry { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasExecuteTime()) { - hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getExecuteTime()); - } - if (hasTransactionId()) { - hash = (37 * hash) + TRANSACTIONID_FIELD_NUMBER; - hash = (53 * hash) + getTransactionId().hashCode(); - } + hash = (37 * hash) + EXECUTETIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getExecuteTime()); + hash = (37 * hash) + TRANSACTIONID_FIELD_NUMBER; + hash = (53 * hash) + getTransactionId().hashCode(); if (getPropsCount() > 0) { hash = (37 * hash) + PROPS_FIELD_NUMBER; hash = (53 * hash) + getPropsList().hashCode(); @@ -12471,9 +11856,9 @@ public final class CanalEntry { public Builder clear() { super.clear(); executeTime_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); + transactionId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + if (propsBuilder_ == null) { props_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); @@ -12508,13 +11893,7 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd result = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.executeTime_ = executeTime_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.transactionId_ = transactionId_; if (propsBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { @@ -12574,11 +11953,10 @@ public final class CanalEntry { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd other) { if (other == com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.getDefaultInstance()) return this; - if (other.hasExecuteTime()) { + if (other.getExecuteTime() != 0L) { setExecuteTime(other.getExecuteTime()); } - if (other.hasTransactionId()) { - bitField0_ |= 0x00000002; + if (!other.getTransactionId().isEmpty()) { transactionId_ = other.transactionId_; onChanged(); } @@ -12644,17 +12022,7 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - *
-       **已废弃,请使用header里的executeTime*
-       * 
- * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ public long getExecuteTime() { return executeTime_; @@ -12664,10 +12032,10 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ public Builder setExecuteTime(long value) { - bitField0_ |= 0x00000001; + executeTime_ = value; onChanged(); return this; @@ -12677,10 +12045,10 @@ public final class CanalEntry { **已废弃,请使用header里的executeTime* * * - * optional int64 executeTime = 1; + * int64 executeTime = 1; */ public Builder clearExecuteTime() { - bitField0_ = (bitField0_ & ~0x00000001); + executeTime_ = 0L; onChanged(); return this; @@ -12692,17 +12060,7 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; - */ - public boolean hasTransactionId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-       **事务号*
-       * 
- * - * optional string transactionId = 2; + * string transactionId = 2; */ public java.lang.String getTransactionId() { java.lang.Object ref = transactionId_; @@ -12710,9 +12068,7 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - transactionId_ = s; - } + transactionId_ = s; return s; } else { return (java.lang.String) ref; @@ -12723,7 +12079,7 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { @@ -12743,14 +12099,14 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public Builder setTransactionId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + transactionId_ = value; onChanged(); return this; @@ -12760,10 +12116,10 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public Builder clearTransactionId() { - bitField0_ = (bitField0_ & ~0x00000002); + transactionId_ = getDefaultInstance().getTransactionId(); onChanged(); return this; @@ -12773,14 +12129,15 @@ public final class CanalEntry { **事务号* * * - * optional string transactionId = 2; + * string transactionId = 2; */ public Builder setTransactionIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + transactionId_ = value; onChanged(); return this; @@ -13100,7 +12457,7 @@ public final class CanalEntry { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -13123,7 +12480,7 @@ public final class CanalEntry { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public TransactionEnd parsePartialFrom( @@ -13155,29 +12512,21 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * optional string key = 1; - */ - boolean hasKey(); - /** - * optional string key = 1; + * string key = 1; */ java.lang.String getKey(); /** - * optional string key = 1; + * string key = 1; */ com.google.protobuf.ByteString getKeyBytes(); /** - * optional string value = 2; - */ - boolean hasValue(); - /** - * optional string value = 2; + * string value = 2; */ java.lang.String getValue(); /** - * optional string value = 2; + * string value = 2; */ com.google.protobuf.ByteString getValueBytes(); @@ -13228,19 +12577,19 @@ public final class CanalEntry { done = true; break; case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - key_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; break; } case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - value_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -13271,17 +12620,10 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.Pair.class, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder.class); } - private int bitField0_; public static final int KEY_FIELD_NUMBER = 1; private volatile java.lang.Object key_; /** - * optional string key = 1; - */ - public boolean hasKey() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string key = 1; + * string key = 1; */ public java.lang.String getKey() { java.lang.Object ref = key_; @@ -13291,14 +12633,12 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - key_ = s; - } + key_ = s; return s; } } /** - * optional string key = 1; + * string key = 1; */ public com.google.protobuf.ByteString getKeyBytes() { @@ -13317,13 +12657,7 @@ public final class CanalEntry { public static final int VALUE_FIELD_NUMBER = 2; private volatile java.lang.Object value_; /** - * optional string value = 2; - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string value = 2; + * string value = 2; */ public java.lang.String getValue() { java.lang.Object ref = value_; @@ -13333,14 +12667,12 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - value_ = s; - } + value_ = s; return s; } } /** - * optional string value = 2; + * string value = 2; */ public com.google.protobuf.ByteString getValueBytes() { @@ -13370,10 +12702,10 @@ public final class CanalEntry { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getKeyBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getValueBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); } unknownFields.writeTo(output); @@ -13385,10 +12717,10 @@ public final class CanalEntry { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getKeyBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getValueBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); } size += unknownFields.getSerializedSize(); @@ -13407,16 +12739,10 @@ public final class CanalEntry { com.alibaba.otter.canal.protocol.CanalEntry.Pair other = (com.alibaba.otter.canal.protocol.CanalEntry.Pair) obj; boolean result = true; - result = result && (hasKey() == other.hasKey()); - if (hasKey()) { - result = result && getKey() - .equals(other.getKey()); - } - result = result && (hasValue() == other.hasValue()); - if (hasValue()) { - result = result && getValue() - .equals(other.getValue()); - } + result = result && getKey() + .equals(other.getKey()); + result = result && getValue() + .equals(other.getValue()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -13428,14 +12754,10 @@ public final class CanalEntry { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasKey()) { - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - } - if (hasValue()) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - } + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -13574,9 +12896,9 @@ public final class CanalEntry { public Builder clear() { super.clear(); key_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); + value_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + return this; } @@ -13603,17 +12925,8 @@ public final class CanalEntry { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalEntry.Pair buildPartial() { com.alibaba.otter.canal.protocol.CanalEntry.Pair result = new com.alibaba.otter.canal.protocol.CanalEntry.Pair(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.key_ = key_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.value_ = value_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -13662,13 +12975,11 @@ public final class CanalEntry { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.Pair other) { if (other == com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()) return this; - if (other.hasKey()) { - bitField0_ |= 0x00000001; + if (!other.getKey().isEmpty()) { key_ = other.key_; onChanged(); } - if (other.hasValue()) { - bitField0_ |= 0x00000002; + if (!other.getValue().isEmpty()) { value_ = other.value_; onChanged(); } @@ -13700,17 +13011,10 @@ public final class CanalEntry { } return this; } - private int bitField0_; private java.lang.Object key_ = ""; /** - * optional string key = 1; - */ - public boolean hasKey() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string key = 1; + * string key = 1; */ public java.lang.String getKey() { java.lang.Object ref = key_; @@ -13718,16 +13022,14 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - key_ = s; - } + key_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string key = 1; + * string key = 1; */ public com.google.protobuf.ByteString getKeyBytes() { @@ -13743,36 +13045,37 @@ public final class CanalEntry { } } /** - * optional string key = 1; + * string key = 1; */ public Builder setKey( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + key_ = value; onChanged(); return this; } /** - * optional string key = 1; + * string key = 1; */ public Builder clearKey() { - bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); onChanged(); return this; } /** - * optional string key = 1; + * string key = 1; */ public Builder setKeyBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + checkByteStringIsUtf8(value); + key_ = value; onChanged(); return this; @@ -13780,13 +13083,7 @@ public final class CanalEntry { private java.lang.Object value_ = ""; /** - * optional string value = 2; - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string value = 2; + * string value = 2; */ public java.lang.String getValue() { java.lang.Object ref = value_; @@ -13794,16 +13091,14 @@ public final class CanalEntry { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - value_ = s; - } + value_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string value = 2; + * string value = 2; */ public com.google.protobuf.ByteString getValueBytes() { @@ -13819,36 +13114,37 @@ public final class CanalEntry { } } /** - * optional string value = 2; + * string value = 2; */ public Builder setValue( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + value_ = value; onChanged(); return this; } /** - * optional string value = 2; + * string value = 2; */ public Builder clearValue() { - bitField0_ = (bitField0_ & ~0x00000002); + value_ = getDefaultInstance().getValue(); onChanged(); return this; } /** - * optional string value = 2; + * string value = 2; */ public Builder setValueBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + value_ = value; onChanged(); return this; @@ -13856,7 +13152,7 @@ public final class CanalEntry { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -13879,7 +13175,7 @@ public final class CanalEntry { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Pair parsePartialFrom( @@ -13956,55 +13252,59 @@ public final class CanalEntry { static { java.lang.String[] descriptorData = { "\n\023EntryProtocol.proto\022 com.alibaba.otter" + - ".canal.protocol\"\236\001\n\005Entry\0228\n\006header\030\001 \001(" + + ".canal.protocol\"\254\001\n\005Entry\0228\n\006header\030\001 \001(" + "\0132(.com.alibaba.otter.canal.protocol.Hea" + - "der\022G\n\tentryType\030\002 \001(\0162+.com.alibaba.ott" + - "er.canal.protocol.EntryType:\007ROWDATA\022\022\n\n" + - "storeValue\030\003 \001(\014\"\221\003\n\006Header\022\022\n\007version\030\001" + - " \001(\005:\0011\022\023\n\013logfileName\030\002 \001(\t\022\025\n\rlogfileO" + - "ffset\030\003 \001(\003\022\020\n\010serverId\030\004 \001(\003\022\024\n\014servere" + - "nCode\030\005 \001(\t\022\023\n\013executeTime\030\006 \001(\003\022A\n\nsour" + - "ceType\030\007 \001(\0162&.com.alibaba.otter.canal.p" + - "rotocol.Type:\005MYSQL\022\022\n\nschemaName\030\010 \001(\t\022" + - "\021\n\ttableName\030\t \001(\t\022\023\n\013eventLength\030\n \001(\003\022" + - "F\n\teventType\030\013 \001(\0162+.com.alibaba.otter.c" + - "anal.protocol.EventType:\006UPDATE\0225\n\005props" + - "\030\014 \003(\0132&.com.alibaba.otter.canal.protoco" + - "l.Pair\022\014\n\004gtid\030\r \001(\t\"\326\001\n\006Column\022\r\n\005index" + - "\030\001 \001(\005\022\017\n\007sqlType\030\002 \001(\005\022\014\n\004name\030\003 \001(\t\022\r\n" + - "\005isKey\030\004 \001(\010\022\017\n\007updated\030\005 \001(\010\022\025\n\006isNull\030" + - "\006 \001(\010:\005false\0225\n\005props\030\007 \003(\0132&.com.alibab" + - "a.otter.canal.protocol.Pair\022\r\n\005value\030\010 \001" + - "(\t\022\016\n\006length\030\t \001(\005\022\021\n\tmysqlType\030\n \001(\t\"\301\001" + - "\n\007RowData\022?\n\rbeforeColumns\030\001 \003(\0132(.com.a" + - "libaba.otter.canal.protocol.Column\022>\n\014af" + - "terColumns\030\002 \003(\0132(.com.alibaba.otter.can" + - "al.protocol.Column\0225\n\005props\030\003 \003(\0132&.com." + - "alibaba.otter.canal.protocol.Pair\"\222\002\n\tRo" + - "wChange\022\017\n\007tableId\030\001 \001(\003\022F\n\teventType\030\002 " + - "\001(\0162+.com.alibaba.otter.canal.protocol.E" + - "ventType:\006UPDATE\022\024\n\005isDdl\030\n \001(\010:\005false\022\013" + - "\n\003sql\030\013 \001(\t\022;\n\010rowDatas\030\014 \003(\0132).com.alib" + - "aba.otter.canal.protocol.RowData\0225\n\005prop" + - "s\030\r \003(\0132&.com.alibaba.otter.canal.protoc" + - "ol.Pair\022\025\n\rddlSchemaName\030\016 \001(\t\"\207\001\n\020Trans" + - "actionBegin\022\023\n\013executeTime\030\001 \001(\003\022\025\n\rtran" + - "sactionId\030\002 \001(\t\0225\n\005props\030\003 \003(\0132&.com.ali" + - "baba.otter.canal.protocol.Pair\022\020\n\010thread" + - "Id\030\004 \001(\003\"s\n\016TransactionEnd\022\023\n\013executeTim" + - "e\030\001 \001(\003\022\025\n\rtransactionId\030\002 \001(\t\0225\n\005props\030" + - "\003 \003(\0132&.com.alibaba.otter.canal.protocol" + - ".Pair\"\"\n\004Pair\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(" + - "\t*^\n\tEntryType\022\024\n\020TRANSACTIONBEGIN\020\001\022\013\n\007" + - "ROWDATA\020\002\022\022\n\016TRANSACTIONEND\020\003\022\r\n\tHEARTBE" + - "AT\020\004\022\013\n\007GTIDLOG\020\005*\306\001\n\tEventType\022\n\n\006INSER" + - "T\020\001\022\n\n\006UPDATE\020\002\022\n\n\006DELETE\020\003\022\n\n\006CREATE\020\004\022" + - "\t\n\005ALTER\020\005\022\t\n\005ERASE\020\006\022\t\n\005QUERY\020\007\022\014\n\010TRUN" + - "CATE\020\010\022\n\n\006RENAME\020\t\022\n\n\006CINDEX\020\n\022\n\n\006DINDEX" + - "\020\013\022\010\n\004GTID\020\014\022\014\n\010XACOMMIT\020\r\022\016\n\nXAROLLBACK" + - "\020\016\022\016\n\nMHEARTBEAT\020\017*(\n\004Type\022\n\n\006ORACLE\020\001\022\t" + - "\n\005MYSQL\020\002\022\t\n\005PGSQL\020\003B0\n com.alibaba.otte" + - "r.canal.protocolB\nCanalEntryH\001" + "der\022@\n\tentryType\030\002 \001(\0162+.com.alibaba.ott" + + "er.canal.protocol.EntryTypeH\000\022\022\n\nstoreVa" + + "lue\030\003 \001(\014B\023\n\021entryType_present\"\303\003\n\006Heade" + + "r\022\021\n\007version\030\001 \001(\005H\000\022\023\n\013logfileName\030\002 \001(" + + "\t\022\025\n\rlogfileOffset\030\003 \001(\003\022\020\n\010serverId\030\004 \001" + + "(\003\022\024\n\014serverenCode\030\005 \001(\t\022\023\n\013executeTime\030" + + "\006 \001(\003\022<\n\nsourceType\030\007 \001(\0162&.com.alibaba." + + "otter.canal.protocol.TypeH\001\022\022\n\nschemaNam" + + "e\030\010 \001(\t\022\021\n\ttableName\030\t \001(\t\022\023\n\013eventLengt" + + "h\030\n \001(\003\022@\n\teventType\030\013 \001(\0162+.com.alibaba" + + ".otter.canal.protocol.EventTypeH\002\0225\n\005pro" + + "ps\030\014 \003(\0132&.com.alibaba.otter.canal.proto" + + "col.Pair\022\014\n\004gtid\030\r \001(\tB\021\n\017version_presen" + + "tB\024\n\022sourceType_presentB\023\n\021eventType_pre" + + "sent\"\343\001\n\006Column\022\r\n\005index\030\001 \001(\005\022\017\n\007sqlTyp" + + "e\030\002 \001(\005\022\014\n\004name\030\003 \001(\t\022\r\n\005isKey\030\004 \001(\010\022\017\n\007" + + "updated\030\005 \001(\010\022\020\n\006isNull\030\006 \001(\010H\000\0225\n\005props" + + "\030\007 \003(\0132&.com.alibaba.otter.canal.protoco" + + "l.Pair\022\r\n\005value\030\010 \001(\t\022\016\n\006length\030\t \001(\005\022\021\n" + + "\tmysqlType\030\n \001(\tB\020\n\016isNull_present\"\301\001\n\007R" + + "owData\022?\n\rbeforeColumns\030\001 \003(\0132(.com.alib" + + "aba.otter.canal.protocol.Column\022>\n\014after" + + "Columns\030\002 \003(\0132(.com.alibaba.otter.canal." + + "protocol.Column\0225\n\005props\030\003 \003(\0132&.com.ali" + + "baba.otter.canal.protocol.Pair\"\255\002\n\tRowCh" + + "ange\022\017\n\007tableId\030\001 \001(\003\022@\n\teventType\030\002 \001(\016" + + "2+.com.alibaba.otter.canal.protocol.Even" + + "tTypeH\000\022\017\n\005isDdl\030\n \001(\010H\001\022\013\n\003sql\030\013 \001(\t\022;\n" + + "\010rowDatas\030\014 \003(\0132).com.alibaba.otter.cana" + + "l.protocol.RowData\0225\n\005props\030\r \003(\0132&.com." + + "alibaba.otter.canal.protocol.Pair\022\025\n\rddl" + + "SchemaName\030\016 \001(\tB\023\n\021eventType_presentB\017\n" + + "\risDdl_present\"\207\001\n\020TransactionBegin\022\023\n\013e" + + "xecuteTime\030\001 \001(\003\022\025\n\rtransactionId\030\002 \001(\t\022" + + "5\n\005props\030\003 \003(\0132&.com.alibaba.otter.canal" + + ".protocol.Pair\022\020\n\010threadId\030\004 \001(\003\"s\n\016Tran" + + "sactionEnd\022\023\n\013executeTime\030\001 \001(\003\022\025\n\rtrans" + + "actionId\030\002 \001(\t\0225\n\005props\030\003 \003(\0132&.com.alib" + + "aba.otter.canal.protocol.Pair\"\"\n\004Pair\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t*^\n\tEntryType\022\024" + + "\n\020TRANSACTIONBEGIN\020\000\022\013\n\007ROWDATA\020\001\022\022\n\016TRA" + + "NSACTIONEND\020\002\022\r\n\tHEARTBEAT\020\003\022\013\n\007GTIDLOG\020" + + "\004*\345\001\n\tEventType\022\035\n\031EVENTTYPECOMPATIBLEPR" + + "OTO2\020\000\022\n\n\006INSERT\020\001\022\n\n\006UPDATE\020\002\022\n\n\006DELETE" + + "\020\003\022\n\n\006CREATE\020\004\022\t\n\005ALTER\020\005\022\t\n\005ERASE\020\006\022\t\n\005" + + "QUERY\020\007\022\014\n\010TRUNCATE\020\010\022\n\n\006RENAME\020\t\022\n\n\006CIN" + + "DEX\020\n\022\n\n\006DINDEX\020\013\022\010\n\004GTID\020\014\022\014\n\010XACOMMIT\020" + + "\r\022\016\n\nXAROLLBACK\020\016\022\016\n\nMHEARTBEAT\020\017*B\n\004Typ" + + "e\022\030\n\024TYPECOMPATIBLEPROTO2\020\000\022\n\n\006ORACLE\020\001\022" + + "\t\n\005MYSQL\020\002\022\t\n\005PGSQL\020\003B0\n com.alibaba.ott" + + "er.canal.protocolB\nCanalEntryH\001b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -14023,19 +13323,19 @@ public final class CanalEntry { internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor, - new java.lang.String[] { "Header", "EntryType", "StoreValue", }); + new java.lang.String[] { "Header", "EntryType", "StoreValue", "EntryTypePresent", }); internal_static_com_alibaba_otter_canal_protocol_Header_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Header_descriptor, - new java.lang.String[] { "Version", "LogfileName", "LogfileOffset", "ServerId", "ServerenCode", "ExecuteTime", "SourceType", "SchemaName", "TableName", "EventLength", "EventType", "Props", "Gtid", }); + new java.lang.String[] { "Version", "LogfileName", "LogfileOffset", "ServerId", "ServerenCode", "ExecuteTime", "SourceType", "SchemaName", "TableName", "EventLength", "EventType", "Props", "Gtid", "VersionPresent", "SourceTypePresent", "EventTypePresent", }); internal_static_com_alibaba_otter_canal_protocol_Column_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Column_descriptor, - new java.lang.String[] { "Index", "SqlType", "Name", "IsKey", "Updated", "IsNull", "Props", "Value", "Length", "MysqlType", }); + new java.lang.String[] { "Index", "SqlType", "Name", "IsKey", "Updated", "IsNull", "Props", "Value", "Length", "MysqlType", "IsNullPresent", }); internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable = new @@ -14047,7 +13347,7 @@ public final class CanalEntry { internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor, - new java.lang.String[] { "TableId", "EventType", "IsDdl", "Sql", "RowDatas", "Props", "DdlSchemaName", }); + new java.lang.String[] { "TableId", "EventType", "IsDdl", "Sql", "RowDatas", "Props", "DdlSchemaName", "EventTypePresent", "IsDdlPresent", }); internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable = new diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java index 9c912af7..1e7e4e53 100644 --- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java +++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java @@ -19,6 +19,10 @@ public final class CanalPacket { */ public enum Compression implements com.google.protobuf.ProtocolMessageEnum { + /** + * COMPRESSIONCOMPATIBLEPROTO2 = 0; + */ + COMPRESSIONCOMPATIBLEPROTO2(0), /** * NONE = 1; */ @@ -35,8 +39,13 @@ public final class CanalPacket { * LZF = 4; */ LZF(4), + UNRECOGNIZED(-1), ; + /** + * COMPRESSIONCOMPATIBLEPROTO2 = 0; + */ + public static final int COMPRESSIONCOMPATIBLEPROTO2_VALUE = 0; /** * NONE = 1; */ @@ -56,6 +65,10 @@ public final class CanalPacket { public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } return value; } @@ -69,6 +82,7 @@ public final class CanalPacket { public static Compression forNumber(int value) { switch (value) { + case 0: return COMPRESSIONCOMPATIBLEPROTO2; case 1: return NONE; case 2: return ZLIB; case 3: return GZIP; @@ -110,6 +124,9 @@ public final class CanalPacket { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } return VALUES[desc.getIndex()]; } @@ -127,6 +144,14 @@ public final class CanalPacket { */ public enum PacketType implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     *compatible
+     * 
+ * + * PACKAGETYPECOMPATIBLEPROTO2 = 0; + */ + PACKAGETYPECOMPATIBLEPROTO2(0), /** * HANDSHAKE = 1; */ @@ -183,8 +208,17 @@ public final class CanalPacket { * CLIENTROLLBACK = 12; */ CLIENTROLLBACK(12), + UNRECOGNIZED(-1), ; + /** + *
+     *compatible
+     * 
+ * + * PACKAGETYPECOMPATIBLEPROTO2 = 0; + */ + public static final int PACKAGETYPECOMPATIBLEPROTO2_VALUE = 0; /** * HANDSHAKE = 1; */ @@ -244,6 +278,10 @@ public final class CanalPacket { public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } return value; } @@ -257,6 +295,7 @@ public final class CanalPacket { public static PacketType forNumber(int value) { switch (value) { + case 0: return PACKAGETYPECOMPATIBLEPROTO2; case 1: return HANDSHAKE; case 2: return CLIENTAUTHENTICATION; case 3: return ACK; @@ -306,6 +345,9 @@ public final class CanalPacket { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } return VALUES[desc.getIndex()]; } @@ -323,49 +365,43 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional int32 magic_number = 1 [default = 17]; - */ - boolean hasMagicNumber(); - /** - * optional int32 magic_number = 1 [default = 17]; + * int32 magic_number = 1; */ int getMagicNumber(); /** - * optional int32 version = 2 [default = 1]; - */ - boolean hasVersion(); - /** - * optional int32 version = 2 [default = 1]; + * int32 version = 2; */ int getVersion(); /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + * .com.alibaba.otter.canal.protocol.PacketType type = 3; */ - boolean hasType(); + int getTypeValue(); /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + * .com.alibaba.otter.canal.protocol.PacketType type = 3; */ com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType(); /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + * .com.alibaba.otter.canal.protocol.Compression compression = 4; */ - boolean hasCompression(); + int getCompressionValue(); /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + * .com.alibaba.otter.canal.protocol.Compression compression = 4; */ com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression(); /** - * optional bytes body = 5; - */ - boolean hasBody(); - /** - * optional bytes body = 5; + * bytes body = 5; */ com.google.protobuf.ByteString getBody(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Packet.MagicNumberPresentCase getMagicNumberPresentCase(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Packet.VersionPresentCase getVersionPresentCase(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Packet.CompressionPresentCase getCompressionPresentCase(); } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Packet} @@ -380,10 +416,7 @@ public final class CanalPacket { super(builder); } private Packet() { - magicNumber_ = 17; - version_ = 1; - type_ = 1; - compression_ = 1; + type_ = 0; body_ = com.google.protobuf.ByteString.EMPTY; } @@ -412,46 +445,34 @@ public final class CanalPacket { done = true; break; case 8: { - bitField0_ |= 0x00000001; - magicNumber_ = input.readInt32(); + magicNumberPresentCase_ = 1; + magicNumberPresent_ = input.readInt32(); break; } case 16: { - bitField0_ |= 0x00000002; - version_ = input.readInt32(); + versionPresentCase_ = 2; + versionPresent_ = input.readInt32(); break; } case 24: { int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalPacket.PacketType value = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - bitField0_ |= 0x00000004; - type_ = rawValue; - } + + type_ = rawValue; break; } case 32: { int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(4, rawValue); - } else { - bitField0_ |= 0x00000008; - compression_ = rawValue; - } + compressionPresentCase_ = 4; + compressionPresent_ = rawValue; break; } case 42: { - bitField0_ |= 0x00000010; + body_ = input.readBytes(); break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -482,81 +503,180 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); } - private int bitField0_; - public static final int MAGIC_NUMBER_FIELD_NUMBER = 1; - private int magicNumber_; - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public boolean hasMagicNumber() { - return ((bitField0_ & 0x00000001) == 0x00000001); + private int magicNumberPresentCase_ = 0; + private java.lang.Object magicNumberPresent_; + public enum MagicNumberPresentCase + implements com.google.protobuf.Internal.EnumLite { + MAGIC_NUMBER(1), + MAGICNUMBERPRESENT_NOT_SET(0); + private final int value; + private MagicNumberPresentCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MagicNumberPresentCase valueOf(int value) { + return forNumber(value); + } + + public static MagicNumberPresentCase forNumber(int value) { + switch (value) { + case 1: return MAGIC_NUMBER; + case 0: return MAGICNUMBERPRESENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public MagicNumberPresentCase + getMagicNumberPresentCase() { + return MagicNumberPresentCase.forNumber( + magicNumberPresentCase_); } + + private int versionPresentCase_ = 0; + private java.lang.Object versionPresent_; + public enum VersionPresentCase + implements com.google.protobuf.Internal.EnumLite { + VERSION(2), + VERSIONPRESENT_NOT_SET(0); + private final int value; + private VersionPresentCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VersionPresentCase valueOf(int value) { + return forNumber(value); + } + + public static VersionPresentCase forNumber(int value) { + switch (value) { + case 2: return VERSION; + case 0: return VERSIONPRESENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public VersionPresentCase + getVersionPresentCase() { + return VersionPresentCase.forNumber( + versionPresentCase_); + } + + private int compressionPresentCase_ = 0; + private java.lang.Object compressionPresent_; + public enum CompressionPresentCase + implements com.google.protobuf.Internal.EnumLite { + COMPRESSION(4), + COMPRESSIONPRESENT_NOT_SET(0); + private final int value; + private CompressionPresentCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CompressionPresentCase valueOf(int value) { + return forNumber(value); + } + + public static CompressionPresentCase forNumber(int value) { + switch (value) { + case 4: return COMPRESSION; + case 0: return COMPRESSIONPRESENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public CompressionPresentCase + getCompressionPresentCase() { + return CompressionPresentCase.forNumber( + compressionPresentCase_); + } + + public static final int MAGIC_NUMBER_FIELD_NUMBER = 1; /** - * optional int32 magic_number = 1 [default = 17]; + * int32 magic_number = 1; */ public int getMagicNumber() { - return magicNumber_; + if (magicNumberPresentCase_ == 1) { + return (java.lang.Integer) magicNumberPresent_; + } + return 0; } public static final int VERSION_FIELD_NUMBER = 2; - private int version_; /** - * optional int32 version = 2 [default = 1]; - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 version = 2 [default = 1]; + * int32 version = 2; */ public int getVersion() { - return version_; + if (versionPresentCase_ == 2) { + return (java.lang.Integer) versionPresent_; + } + return 1; } public static final int TYPE_FIELD_NUMBER = 3; private int type_; /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + * .com.alibaba.otter.canal.protocol.PacketType type = 3; */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); + public int getTypeValue() { + return type_; } /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + * .com.alibaba.otter.canal.protocol.PacketType type = 3; */ public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { @SuppressWarnings("deprecation") com.alibaba.otter.canal.protocol.CanalPacket.PacketType result = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(type_); - return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE : result; + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.PacketType.UNRECOGNIZED : result; } public static final int COMPRESSION_FIELD_NUMBER = 4; - private int compression_; /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + * .com.alibaba.otter.canal.protocol.Compression compression = 4; */ - public boolean hasCompression() { - return ((bitField0_ & 0x00000008) == 0x00000008); + public int getCompressionValue() { + if (compressionPresentCase_ == 4) { + return (java.lang.Integer) compressionPresent_; + } + return Compression.NONE_VALUE; } /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + * .com.alibaba.otter.canal.protocol.Compression compression = 4; */ public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(compression_); - return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE : result; + if (compressionPresentCase_ == 4) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf( + (java.lang.Integer) compressionPresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalPacket.Compression.COMPRESSIONCOMPATIBLEPROTO2; } public static final int BODY_FIELD_NUMBER = 5; private com.google.protobuf.ByteString body_; /** - * optional bytes body = 5; - */ - public boolean hasBody() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional bytes body = 5; + * bytes body = 5; */ public com.google.protobuf.ByteString getBody() { return body_; @@ -576,19 +696,21 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, magicNumber_); + if (magicNumberPresentCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) magicNumberPresent_)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, version_); + if (versionPresentCase_ == 2) { + output.writeInt32( + 2, (int)((java.lang.Integer) versionPresent_)); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (type_ != com.alibaba.otter.canal.protocol.CanalPacket.PacketType.PACKAGETYPECOMPATIBLEPROTO2.getNumber()) { output.writeEnum(3, type_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeEnum(4, compression_); + if (compressionPresentCase_ == 4) { + output.writeEnum(4, ((java.lang.Integer) compressionPresent_)); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (!body_.isEmpty()) { output.writeBytes(5, body_); } unknownFields.writeTo(output); @@ -600,23 +722,25 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (magicNumberPresentCase_ == 1) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, magicNumber_); + .computeInt32Size( + 1, (int)((java.lang.Integer) magicNumberPresent_)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (versionPresentCase_ == 2) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, version_); + .computeInt32Size( + 2, (int)((java.lang.Integer) versionPresent_)); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (type_ != com.alibaba.otter.canal.protocol.CanalPacket.PacketType.PACKAGETYPECOMPATIBLEPROTO2.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(3, type_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (compressionPresentCase_ == 4) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, compression_); + .computeEnumSize(4, ((java.lang.Integer) compressionPresent_)); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (!body_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, body_); } @@ -636,28 +760,41 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Packet other = (com.alibaba.otter.canal.protocol.CanalPacket.Packet) obj; boolean result = true; - result = result && (hasMagicNumber() == other.hasMagicNumber()); - if (hasMagicNumber()) { - result = result && (getMagicNumber() - == other.getMagicNumber()); + result = result && type_ == other.type_; + result = result && getBody() + .equals(other.getBody()); + result = result && getMagicNumberPresentCase().equals( + other.getMagicNumberPresentCase()); + if (!result) return false; + switch (magicNumberPresentCase_) { + case 1: + result = result && (getMagicNumber() + == other.getMagicNumber()); + break; + case 0: + default: } - result = result && (hasVersion() == other.hasVersion()); - if (hasVersion()) { - result = result && (getVersion() - == other.getVersion()); + result = result && getVersionPresentCase().equals( + other.getVersionPresentCase()); + if (!result) return false; + switch (versionPresentCase_) { + case 2: + result = result && (getVersion() + == other.getVersion()); + break; + case 0: + default: } - result = result && (hasType() == other.hasType()); - if (hasType()) { - result = result && type_ == other.type_; - } - result = result && (hasCompression() == other.hasCompression()); - if (hasCompression()) { - result = result && compression_ == other.compression_; - } - result = result && (hasBody() == other.hasBody()); - if (hasBody()) { - result = result && getBody() - .equals(other.getBody()); + result = result && getCompressionPresentCase().equals( + other.getCompressionPresentCase()); + if (!result) return false; + switch (compressionPresentCase_) { + case 4: + result = result && getCompressionValue() + == other.getCompressionValue(); + break; + case 0: + default: } result = result && unknownFields.equals(other.unknownFields); return result; @@ -670,25 +807,33 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMagicNumber()) { - hash = (37 * hash) + MAGIC_NUMBER_FIELD_NUMBER; - hash = (53 * hash) + getMagicNumber(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + switch (magicNumberPresentCase_) { + case 1: + hash = (37 * hash) + MAGIC_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getMagicNumber(); + break; + case 0: + default: } - if (hasVersion()) { - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion(); + switch (versionPresentCase_) { + case 2: + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + break; + case 0: + default: } - if (hasType()) { - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - } - if (hasCompression()) { - hash = (37 * hash) + COMPRESSION_FIELD_NUMBER; - hash = (53 * hash) + compression_; - } - if (hasBody()) { - hash = (37 * hash) + BODY_FIELD_NUMBER; - hash = (53 * hash) + getBody().hashCode(); + switch (compressionPresentCase_) { + case 4: + hash = (37 * hash) + COMPRESSION_FIELD_NUMBER; + hash = (53 * hash) + getCompressionValue(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -823,16 +968,16 @@ public final class CanalPacket { @java.lang.Override public Builder clear() { super.clear(); - magicNumber_ = 17; - bitField0_ = (bitField0_ & ~0x00000001); - version_ = 1; - bitField0_ = (bitField0_ & ~0x00000002); - type_ = 1; - bitField0_ = (bitField0_ & ~0x00000004); - compression_ = 1; - bitField0_ = (bitField0_ & ~0x00000008); + type_ = 0; + body_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000010); + + magicNumberPresentCase_ = 0; + magicNumberPresent_ = null; + versionPresentCase_ = 0; + versionPresent_ = null; + compressionPresentCase_ = 0; + compressionPresent_ = null; return this; } @@ -859,29 +1004,20 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.Packet buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.Packet result = new com.alibaba.otter.canal.protocol.CanalPacket.Packet(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; + if (magicNumberPresentCase_ == 1) { + result.magicNumberPresent_ = magicNumberPresent_; } - result.magicNumber_ = magicNumber_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.version_ = version_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; + if (versionPresentCase_ == 2) { + result.versionPresent_ = versionPresent_; } result.type_ = type_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.compression_ = compression_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; + if (compressionPresentCase_ == 4) { + result.compressionPresent_ = compressionPresent_; } result.body_ = body_; - result.bitField0_ = to_bitField0_; + result.magicNumberPresentCase_ = magicNumberPresentCase_; + result.versionPresentCase_ = versionPresentCase_; + result.compressionPresentCase_ = compressionPresentCase_; onBuilt(); return result; } @@ -930,21 +1066,39 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Packet other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance()) return this; - if (other.hasMagicNumber()) { - setMagicNumber(other.getMagicNumber()); + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); } - if (other.hasVersion()) { - setVersion(other.getVersion()); - } - if (other.hasType()) { - setType(other.getType()); - } - if (other.hasCompression()) { - setCompression(other.getCompression()); - } - if (other.hasBody()) { + if (other.getBody() != com.google.protobuf.ByteString.EMPTY) { setBody(other.getBody()); } + switch (other.getMagicNumberPresentCase()) { + case MAGIC_NUMBER: { + setMagicNumber(other.getMagicNumber()); + break; + } + case MAGICNUMBERPRESENT_NOT_SET: { + break; + } + } + switch (other.getVersionPresentCase()) { + case VERSION: { + setVersion(other.getVersion()); + break; + } + case VERSIONPRESENT_NOT_SET: { + break; + } + } + switch (other.getCompressionPresentCase()) { + case COMPRESSION: { + setCompressionValue(other.getCompressionValue()); + break; + } + case COMPRESSIONPRESENT_NOT_SET: { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -973,176 +1127,235 @@ public final class CanalPacket { } return this; } - private int bitField0_; - - private int magicNumber_ = 17; - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public boolean hasMagicNumber() { - return ((bitField0_ & 0x00000001) == 0x00000001); + private int magicNumberPresentCase_ = 0; + private java.lang.Object magicNumberPresent_; + public MagicNumberPresentCase + getMagicNumberPresentCase() { + return MagicNumberPresentCase.forNumber( + magicNumberPresentCase_); } + + public Builder clearMagicNumberPresent() { + magicNumberPresentCase_ = 0; + magicNumberPresent_ = null; + onChanged(); + return this; + } + + private int versionPresentCase_ = 0; + private java.lang.Object versionPresent_; + public VersionPresentCase + getVersionPresentCase() { + return VersionPresentCase.forNumber( + versionPresentCase_); + } + + public Builder clearVersionPresent() { + versionPresentCase_ = 0; + versionPresent_ = null; + onChanged(); + return this; + } + + private int compressionPresentCase_ = 0; + private java.lang.Object compressionPresent_; + public CompressionPresentCase + getCompressionPresentCase() { + return CompressionPresentCase.forNumber( + compressionPresentCase_); + } + + public Builder clearCompressionPresent() { + compressionPresentCase_ = 0; + compressionPresent_ = null; + onChanged(); + return this; + } + + /** - * optional int32 magic_number = 1 [default = 17]; + * int32 magic_number = 1; */ public int getMagicNumber() { - return magicNumber_; + if (magicNumberPresentCase_ == 1) { + return (java.lang.Integer) magicNumberPresent_; + } + return 17; } /** - * optional int32 magic_number = 1 [default = 17]; + * int32 magic_number = 1; */ public Builder setMagicNumber(int value) { - bitField0_ |= 0x00000001; - magicNumber_ = value; + magicNumberPresentCase_ = 1; + magicNumberPresent_ = value; onChanged(); return this; } /** - * optional int32 magic_number = 1 [default = 17]; + * int32 magic_number = 1; */ public Builder clearMagicNumber() { - bitField0_ = (bitField0_ & ~0x00000001); - magicNumber_ = 17; - onChanged(); + if (magicNumberPresentCase_ == 1) { + magicNumberPresentCase_ = 0; + magicNumberPresent_ = null; + onChanged(); + } return this; } - private int version_ = 1; /** - * optional int32 version = 2 [default = 1]; - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 version = 2 [default = 1]; + * int32 version = 2; */ public int getVersion() { - return version_; + if (versionPresentCase_ == 2) { + return (java.lang.Integer) versionPresent_; + } + return 0; } /** - * optional int32 version = 2 [default = 1]; + * int32 version = 2; */ public Builder setVersion(int value) { - bitField0_ |= 0x00000002; - version_ = value; + versionPresentCase_ = 2; + versionPresent_ = value; onChanged(); return this; } /** - * optional int32 version = 2 [default = 1]; + * int32 version = 2; */ public Builder clearVersion() { - bitField0_ = (bitField0_ & ~0x00000002); - version_ = 1; - onChanged(); + if (versionPresentCase_ == 2) { + versionPresentCase_ = 0; + versionPresent_ = null; + onChanged(); + } return this; } - private int type_ = 1; + private int type_ = 0; /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + * .com.alibaba.otter.canal.protocol.PacketType type = 3; */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); + public int getTypeValue() { + return type_; } /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + * .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + * .com.alibaba.otter.canal.protocol.PacketType type = 3; */ public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { @SuppressWarnings("deprecation") com.alibaba.otter.canal.protocol.CanalPacket.PacketType result = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(type_); - return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE : result; + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.PacketType.UNRECOGNIZED : result; } /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + * .com.alibaba.otter.canal.protocol.PacketType type = 3; */ public Builder setType(com.alibaba.otter.canal.protocol.CanalPacket.PacketType value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + type_ = value.getNumber(); onChanged(); return this; } /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + * .com.alibaba.otter.canal.protocol.PacketType type = 3; */ public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000004); - type_ = 1; + + type_ = 0; onChanged(); return this; } - private int compression_ = 1; /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + * .com.alibaba.otter.canal.protocol.Compression compression = 4; */ - public boolean hasCompression() { - return ((bitField0_ & 0x00000008) == 0x00000008); + public int getCompressionValue() { + if (compressionPresentCase_ == 4) { + return ((java.lang.Integer) compressionPresent_).intValue(); + } + return 0; } /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + * .com.alibaba.otter.canal.protocol.Compression compression = 4; + */ + public Builder setCompressionValue(int value) { + compressionPresentCase_ = 4; + compressionPresent_ = value; + onChanged(); + return this; + } + /** + * .com.alibaba.otter.canal.protocol.Compression compression = 4; */ public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(compression_); - return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE : result; + if (compressionPresentCase_ == 4) { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf( + (java.lang.Integer) compressionPresent_); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.UNRECOGNIZED : result; + } + return com.alibaba.otter.canal.protocol.CanalPacket.Compression.COMPRESSIONCOMPATIBLEPROTO2; } /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + * .com.alibaba.otter.canal.protocol.Compression compression = 4; */ public Builder setCompression(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; - compression_ = value.getNumber(); + compressionPresentCase_ = 4; + compressionPresent_ = value.getNumber(); onChanged(); return this; } /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + * .com.alibaba.otter.canal.protocol.Compression compression = 4; */ public Builder clearCompression() { - bitField0_ = (bitField0_ & ~0x00000008); - compression_ = 1; - onChanged(); + if (compressionPresentCase_ == 4) { + compressionPresentCase_ = 0; + compressionPresent_ = null; + onChanged(); + } return this; } private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; /** - * optional bytes body = 5; - */ - public boolean hasBody() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional bytes body = 5; + * bytes body = 5; */ public com.google.protobuf.ByteString getBody() { return body_; } /** - * optional bytes body = 5; + * bytes body = 5; */ public Builder setBody(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + body_ = value; onChanged(); return this; } /** - * optional bytes body = 5; + * bytes body = 5; */ public Builder clearBody() { - bitField0_ = (bitField0_ & ~0x00000010); + body_ = getDefaultInstance().getBody(); onChanged(); return this; @@ -1150,7 +1363,7 @@ public final class CanalPacket { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -1173,7 +1386,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Packet parsePartialFrom( @@ -1205,20 +1418,12 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional int64 send_timestamp = 1; - */ - boolean hasSendTimestamp(); - /** - * optional int64 send_timestamp = 1; + * int64 send_timestamp = 1; */ long getSendTimestamp(); /** - * optional int64 start_timestamp = 2; - */ - boolean hasStartTimestamp(); - /** - * optional int64 start_timestamp = 2; + * int64 start_timestamp = 2; */ long getStartTimestamp(); } @@ -1264,17 +1469,17 @@ public final class CanalPacket { done = true; break; case 8: { - bitField0_ |= 0x00000001; + sendTimestamp_ = input.readInt64(); break; } case 16: { - bitField0_ |= 0x00000002; + startTimestamp_ = input.readInt64(); break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -1305,17 +1510,10 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); } - private int bitField0_; public static final int SEND_TIMESTAMP_FIELD_NUMBER = 1; private long sendTimestamp_; /** - * optional int64 send_timestamp = 1; - */ - public boolean hasSendTimestamp() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 send_timestamp = 1; + * int64 send_timestamp = 1; */ public long getSendTimestamp() { return sendTimestamp_; @@ -1324,13 +1522,7 @@ public final class CanalPacket { public static final int START_TIMESTAMP_FIELD_NUMBER = 2; private long startTimestamp_; /** - * optional int64 start_timestamp = 2; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int64 start_timestamp = 2; + * int64 start_timestamp = 2; */ public long getStartTimestamp() { return startTimestamp_; @@ -1350,10 +1542,10 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (sendTimestamp_ != 0L) { output.writeInt64(1, sendTimestamp_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (startTimestamp_ != 0L) { output.writeInt64(2, startTimestamp_); } unknownFields.writeTo(output); @@ -1365,11 +1557,11 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (sendTimestamp_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, sendTimestamp_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (startTimestamp_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(2, startTimestamp_); } @@ -1389,16 +1581,10 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat other = (com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) obj; boolean result = true; - result = result && (hasSendTimestamp() == other.hasSendTimestamp()); - if (hasSendTimestamp()) { - result = result && (getSendTimestamp() - == other.getSendTimestamp()); - } - result = result && (hasStartTimestamp() == other.hasStartTimestamp()); - if (hasStartTimestamp()) { - result = result && (getStartTimestamp() - == other.getStartTimestamp()); - } + result = result && (getSendTimestamp() + == other.getSendTimestamp()); + result = result && (getStartTimestamp() + == other.getStartTimestamp()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -1410,16 +1596,12 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSendTimestamp()) { - hash = (37 * hash) + SEND_TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSendTimestamp()); - } - if (hasStartTimestamp()) { - hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStartTimestamp()); - } + hash = (37 * hash) + SEND_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSendTimestamp()); + hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStartTimestamp()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1554,9 +1736,9 @@ public final class CanalPacket { public Builder clear() { super.clear(); sendTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); + startTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); + return this; } @@ -1583,17 +1765,8 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = new com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.sendTimestamp_ = sendTimestamp_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.startTimestamp_ = startTimestamp_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -1642,10 +1815,10 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance()) return this; - if (other.hasSendTimestamp()) { + if (other.getSendTimestamp() != 0L) { setSendTimestamp(other.getSendTimestamp()); } - if (other.hasStartTimestamp()) { + if (other.getStartTimestamp() != 0L) { setStartTimestamp(other.getStartTimestamp()); } this.mergeUnknownFields(other.unknownFields); @@ -1676,35 +1849,28 @@ public final class CanalPacket { } return this; } - private int bitField0_; private long sendTimestamp_ ; /** - * optional int64 send_timestamp = 1; - */ - public boolean hasSendTimestamp() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 send_timestamp = 1; + * int64 send_timestamp = 1; */ public long getSendTimestamp() { return sendTimestamp_; } /** - * optional int64 send_timestamp = 1; + * int64 send_timestamp = 1; */ public Builder setSendTimestamp(long value) { - bitField0_ |= 0x00000001; + sendTimestamp_ = value; onChanged(); return this; } /** - * optional int64 send_timestamp = 1; + * int64 send_timestamp = 1; */ public Builder clearSendTimestamp() { - bitField0_ = (bitField0_ & ~0x00000001); + sendTimestamp_ = 0L; onChanged(); return this; @@ -1712,31 +1878,25 @@ public final class CanalPacket { private long startTimestamp_ ; /** - * optional int64 start_timestamp = 2; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int64 start_timestamp = 2; + * int64 start_timestamp = 2; */ public long getStartTimestamp() { return startTimestamp_; } /** - * optional int64 start_timestamp = 2; + * int64 start_timestamp = 2; */ public Builder setStartTimestamp(long value) { - bitField0_ |= 0x00000002; + startTimestamp_ = value; onChanged(); return this; } /** - * optional int64 start_timestamp = 2; + * int64 start_timestamp = 2; */ public Builder clearStartTimestamp() { - bitField0_ = (bitField0_ & ~0x00000002); + startTimestamp_ = 0L; onChanged(); return this; @@ -1744,7 +1904,7 @@ public final class CanalPacket { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -1767,7 +1927,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public HeartBeat parsePartialFrom( @@ -1799,40 +1959,30 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - boolean hasCommunicationEncoding(); - /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ java.lang.String getCommunicationEncoding(); /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ com.google.protobuf.ByteString getCommunicationEncodingBytes(); /** - * optional bytes seeds = 2; - */ - boolean hasSeeds(); - /** - * optional bytes seeds = 2; + * bytes seeds = 2; */ com.google.protobuf.ByteString getSeeds(); /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; */ - java.util.List getSupportedCompressionsList(); + int getSupportedCompressionsValue(); /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; */ - int getSupportedCompressionsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index); + com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Handshake.CommunicationEncodingPresentCase getCommunicationEncodingPresentCase(); } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Handshake} @@ -1847,9 +1997,8 @@ public final class CanalPacket { super(builder); } private Handshake() { - communicationEncoding_ = "utf8"; seeds_ = com.google.protobuf.ByteString.EMPTY; - supportedCompressions_ = java.util.Collections.emptyList(); + supportedCompressions_ = 0; } @java.lang.Override @@ -1877,53 +2026,24 @@ public final class CanalPacket { done = true; break; case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - communicationEncoding_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + communicationEncodingPresentCase_ = 1; + communicationEncodingPresent_ = s; break; } case 18: { - bitField0_ |= 0x00000002; + seeds_ = input.readBytes(); break; } case 24: { int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - supportedCompressions_.add(rawValue); - } - break; - } - case 26: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while(input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - supportedCompressions_.add(rawValue); - } - } - input.popLimit(oldLimit); + + supportedCompressions_ = rawValue; break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -1937,9 +2057,6 @@ public final class CanalPacket { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -1957,43 +2074,79 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); } - private int bitField0_; - public static final int COMMUNICATION_ENCODING_FIELD_NUMBER = 1; - private volatile java.lang.Object communicationEncoding_; - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public boolean hasCommunicationEncoding() { - return ((bitField0_ & 0x00000001) == 0x00000001); + private int communicationEncodingPresentCase_ = 0; + private java.lang.Object communicationEncodingPresent_; + public enum CommunicationEncodingPresentCase + implements com.google.protobuf.Internal.EnumLite { + COMMUNICATION_ENCODING(1), + COMMUNICATIONENCODINGPRESENT_NOT_SET(0); + private final int value; + private CommunicationEncodingPresentCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CommunicationEncodingPresentCase valueOf(int value) { + return forNumber(value); + } + + public static CommunicationEncodingPresentCase forNumber(int value) { + switch (value) { + case 1: return COMMUNICATION_ENCODING; + case 0: return COMMUNICATIONENCODINGPRESENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public CommunicationEncodingPresentCase + getCommunicationEncodingPresentCase() { + return CommunicationEncodingPresentCase.forNumber( + communicationEncodingPresentCase_); } + + public static final int COMMUNICATION_ENCODING_FIELD_NUMBER = 1; /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ public java.lang.String getCommunicationEncoding() { - java.lang.Object ref = communicationEncoding_; + java.lang.Object ref = ""; + if (communicationEncodingPresentCase_ == 1) { + ref = communicationEncodingPresent_; + } if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - communicationEncoding_ = s; + if (communicationEncodingPresentCase_ == 1) { + communicationEncodingPresent_ = s; } return s; } } /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ public com.google.protobuf.ByteString getCommunicationEncodingBytes() { - java.lang.Object ref = communicationEncoding_; + java.lang.Object ref = ""; + if (communicationEncodingPresentCase_ == 1) { + ref = communicationEncodingPresent_; + } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - communicationEncoding_ = b; + if (communicationEncodingPresentCase_ == 1) { + communicationEncodingPresent_ = b; + } return b; } else { return (com.google.protobuf.ByteString) ref; @@ -2003,48 +2156,27 @@ public final class CanalPacket { public static final int SEEDS_FIELD_NUMBER = 2; private com.google.protobuf.ByteString seeds_; /** - * optional bytes seeds = 2; - */ - public boolean hasSeeds() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional bytes seeds = 2; + * bytes seeds = 2; */ public com.google.protobuf.ByteString getSeeds() { return seeds_; } public static final int SUPPORTED_COMPRESSIONS_FIELD_NUMBER = 3; - private java.util.List supportedCompressions_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, com.alibaba.otter.canal.protocol.CanalPacket.Compression> supportedCompressions_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, com.alibaba.otter.canal.protocol.CanalPacket.Compression>() { - public com.alibaba.otter.canal.protocol.CanalPacket.Compression convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") - com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(from); - return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE : result; - } - }; + private int supportedCompressions_; /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; */ - public java.util.List getSupportedCompressionsList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, com.alibaba.otter.canal.protocol.CanalPacket.Compression>(supportedCompressions_, supportedCompressions_converter_); + public int getSupportedCompressionsValue() { + return supportedCompressions_; } /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; */ - public int getSupportedCompressionsCount() { - return supportedCompressions_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { - return supportedCompressions_converter_.convert(supportedCompressions_.get(index)); + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(supportedCompressions_); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.UNRECOGNIZED : result; } private byte memoizedIsInitialized = -1; @@ -2061,14 +2193,14 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, communicationEncoding_); + if (communicationEncodingPresentCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, communicationEncodingPresent_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!seeds_.isEmpty()) { output.writeBytes(2, seeds_); } - for (int i = 0; i < supportedCompressions_.size(); i++) { - output.writeEnum(3, supportedCompressions_.get(i)); + if (supportedCompressions_ != com.alibaba.otter.canal.protocol.CanalPacket.Compression.COMPRESSIONCOMPATIBLEPROTO2.getNumber()) { + output.writeEnum(3, supportedCompressions_); } unknownFields.writeTo(output); } @@ -2079,21 +2211,16 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, communicationEncoding_); + if (communicationEncodingPresentCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, communicationEncodingPresent_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!seeds_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, seeds_); } - { - int dataSize = 0; - for (int i = 0; i < supportedCompressions_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeEnumSizeNoTag(supportedCompressions_.get(i)); - } - size += dataSize; - size += 1 * supportedCompressions_.size(); + if (supportedCompressions_ != com.alibaba.otter.canal.protocol.CanalPacket.Compression.COMPRESSIONCOMPATIBLEPROTO2.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, supportedCompressions_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -2111,17 +2238,20 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Handshake other = (com.alibaba.otter.canal.protocol.CanalPacket.Handshake) obj; boolean result = true; - result = result && (hasCommunicationEncoding() == other.hasCommunicationEncoding()); - if (hasCommunicationEncoding()) { - result = result && getCommunicationEncoding() - .equals(other.getCommunicationEncoding()); + result = result && getSeeds() + .equals(other.getSeeds()); + result = result && supportedCompressions_ == other.supportedCompressions_; + result = result && getCommunicationEncodingPresentCase().equals( + other.getCommunicationEncodingPresentCase()); + if (!result) return false; + switch (communicationEncodingPresentCase_) { + case 1: + result = result && getCommunicationEncoding() + .equals(other.getCommunicationEncoding()); + break; + case 0: + default: } - result = result && (hasSeeds() == other.hasSeeds()); - if (hasSeeds()) { - result = result && getSeeds() - .equals(other.getSeeds()); - } - result = result && supportedCompressions_.equals(other.supportedCompressions_); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -2133,17 +2263,17 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasCommunicationEncoding()) { - hash = (37 * hash) + COMMUNICATION_ENCODING_FIELD_NUMBER; - hash = (53 * hash) + getCommunicationEncoding().hashCode(); - } - if (hasSeeds()) { - hash = (37 * hash) + SEEDS_FIELD_NUMBER; - hash = (53 * hash) + getSeeds().hashCode(); - } - if (getSupportedCompressionsCount() > 0) { - hash = (37 * hash) + SUPPORTED_COMPRESSIONS_FIELD_NUMBER; - hash = (53 * hash) + supportedCompressions_.hashCode(); + hash = (37 * hash) + SEEDS_FIELD_NUMBER; + hash = (53 * hash) + getSeeds().hashCode(); + hash = (37 * hash) + SUPPORTED_COMPRESSIONS_FIELD_NUMBER; + hash = (53 * hash) + supportedCompressions_; + switch (communicationEncodingPresentCase_) { + case 1: + hash = (37 * hash) + COMMUNICATION_ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getCommunicationEncoding().hashCode(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -2278,12 +2408,12 @@ public final class CanalPacket { @java.lang.Override public Builder clear() { super.clear(); - communicationEncoding_ = "utf8"; - bitField0_ = (bitField0_ & ~0x00000001); seeds_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - supportedCompressions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + + supportedCompressions_ = 0; + + communicationEncodingPresentCase_ = 0; + communicationEncodingPresent_ = null; return this; } @@ -2310,22 +2440,12 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.Handshake buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = new com.alibaba.otter.canal.protocol.CanalPacket.Handshake(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.communicationEncoding_ = communicationEncoding_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; + if (communicationEncodingPresentCase_ == 1) { + result.communicationEncodingPresent_ = communicationEncodingPresent_; } result.seeds_ = seeds_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); - bitField0_ = (bitField0_ & ~0x00000004); - } result.supportedCompressions_ = supportedCompressions_; - result.bitField0_ = to_bitField0_; + result.communicationEncodingPresentCase_ = communicationEncodingPresentCase_; onBuilt(); return result; } @@ -2374,23 +2494,22 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Handshake other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance()) return this; - if (other.hasCommunicationEncoding()) { - bitField0_ |= 0x00000001; - communicationEncoding_ = other.communicationEncoding_; - onChanged(); - } - if (other.hasSeeds()) { + if (other.getSeeds() != com.google.protobuf.ByteString.EMPTY) { setSeeds(other.getSeeds()); } - if (!other.supportedCompressions_.isEmpty()) { - if (supportedCompressions_.isEmpty()) { - supportedCompressions_ = other.supportedCompressions_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.addAll(other.supportedCompressions_); + if (other.supportedCompressions_ != 0) { + setSupportedCompressionsValue(other.getSupportedCompressionsValue()); + } + switch (other.getCommunicationEncodingPresentCase()) { + case COMMUNICATION_ENCODING: { + communicationEncodingPresentCase_ = 1; + communicationEncodingPresent_ = other.communicationEncodingPresent_; + onChanged(); + break; + } + case COMMUNICATIONENCODINGPRESENT_NOT_SET: { + break; } - onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -2420,26 +2539,36 @@ public final class CanalPacket { } return this; } - private int bitField0_; - - private java.lang.Object communicationEncoding_ = "utf8"; - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public boolean hasCommunicationEncoding() { - return ((bitField0_ & 0x00000001) == 0x00000001); + private int communicationEncodingPresentCase_ = 0; + private java.lang.Object communicationEncodingPresent_; + public CommunicationEncodingPresentCase + getCommunicationEncodingPresentCase() { + return CommunicationEncodingPresentCase.forNumber( + communicationEncodingPresentCase_); } + + public Builder clearCommunicationEncodingPresent() { + communicationEncodingPresentCase_ = 0; + communicationEncodingPresent_ = null; + onChanged(); + return this; + } + + /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ public java.lang.String getCommunicationEncoding() { - java.lang.Object ref = communicationEncoding_; + java.lang.Object ref = ""; + if (communicationEncodingPresentCase_ == 1) { + ref = communicationEncodingPresent_; + } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - communicationEncoding_ = s; + if (communicationEncodingPresentCase_ == 1) { + communicationEncodingPresent_ = s; } return s; } else { @@ -2447,169 +2576,142 @@ public final class CanalPacket { } } /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ public com.google.protobuf.ByteString getCommunicationEncodingBytes() { - java.lang.Object ref = communicationEncoding_; + java.lang.Object ref = ""; + if (communicationEncodingPresentCase_ == 1) { + ref = communicationEncodingPresent_; + } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - communicationEncoding_ = b; + if (communicationEncodingPresentCase_ == 1) { + communicationEncodingPresent_ = b; + } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ public Builder setCommunicationEncoding( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; - communicationEncoding_ = value; + communicationEncodingPresentCase_ = 1; + communicationEncodingPresent_ = value; onChanged(); return this; } /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ public Builder clearCommunicationEncoding() { - bitField0_ = (bitField0_ & ~0x00000001); - communicationEncoding_ = getDefaultInstance().getCommunicationEncoding(); - onChanged(); + if (communicationEncodingPresentCase_ == 1) { + communicationEncodingPresentCase_ = 0; + communicationEncodingPresent_ = null; + onChanged(); + } return this; } /** - * optional string communication_encoding = 1 [default = "utf8"]; + * string communication_encoding = 1; */ public Builder setCommunicationEncodingBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; - communicationEncoding_ = value; + checkByteStringIsUtf8(value); + communicationEncodingPresentCase_ = 1; + communicationEncodingPresent_ = value; onChanged(); return this; } private com.google.protobuf.ByteString seeds_ = com.google.protobuf.ByteString.EMPTY; /** - * optional bytes seeds = 2; - */ - public boolean hasSeeds() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional bytes seeds = 2; + * bytes seeds = 2; */ public com.google.protobuf.ByteString getSeeds() { return seeds_; } /** - * optional bytes seeds = 2; + * bytes seeds = 2; */ public Builder setSeeds(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + seeds_ = value; onChanged(); return this; } /** - * optional bytes seeds = 2; + * bytes seeds = 2; */ public Builder clearSeeds() { - bitField0_ = (bitField0_ & ~0x00000002); + seeds_ = getDefaultInstance().getSeeds(); onChanged(); return this; } - private java.util.List supportedCompressions_ = - java.util.Collections.emptyList(); - private void ensureSupportedCompressionsIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(supportedCompressions_); - bitField0_ |= 0x00000004; - } + private int supportedCompressions_ = 0; + /** + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public int getSupportedCompressionsValue() { + return supportedCompressions_; } /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; */ - public java.util.List getSupportedCompressionsList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, com.alibaba.otter.canal.protocol.CanalPacket.Compression>(supportedCompressions_, supportedCompressions_converter_); + public Builder setSupportedCompressionsValue(int value) { + supportedCompressions_ = value; + onChanged(); + return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; */ - public int getSupportedCompressionsCount() { - return supportedCompressions_.size(); + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions() { + @SuppressWarnings("deprecation") + com.alibaba.otter.canal.protocol.CanalPacket.Compression result = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(supportedCompressions_); + return result == null ? com.alibaba.otter.canal.protocol.CanalPacket.Compression.UNRECOGNIZED : result; } /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { - return supportedCompressions_converter_.convert(supportedCompressions_.get(index)); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder setSupportedCompressions( - int index, com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { + public Builder setSupportedCompressions(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { if (value == null) { throw new NullPointerException(); } - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.set(index, value.getNumber()); + + supportedCompressions_ = value.getNumber(); onChanged(); return this; } /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder addSupportedCompressions(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.add(value.getNumber()); - onChanged(); - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder addAllSupportedCompressions( - java.lang.Iterable values) { - ensureSupportedCompressionsIsMutable(); - for (com.alibaba.otter.canal.protocol.CanalPacket.Compression value : values) { - supportedCompressions_.add(value.getNumber()); - } - onChanged(); - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + * .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; */ public Builder clearSupportedCompressions() { - supportedCompressions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + + supportedCompressions_ = 0; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -2632,7 +2734,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Handshake parsePartialFrom( @@ -2664,15 +2766,11 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional string username = 1; - */ - boolean hasUsername(); - /** - * optional string username = 1; + * string username = 1; */ java.lang.String getUsername(); /** - * optional string username = 1; + * string username = 1; */ com.google.protobuf.ByteString getUsernameBytes(); @@ -2682,15 +2780,7 @@ public final class CanalPacket { * hashed password with seeds from Handshake message * * - * optional bytes password = 2; - */ - boolean hasPassword(); - /** - *
-     * hashed password with seeds from Handshake message
-     * 
- * - * optional bytes password = 2; + * bytes password = 2; */ com.google.protobuf.ByteString getPassword(); @@ -2699,15 +2789,7 @@ public final class CanalPacket { * in seconds * * - * optional int32 net_read_timeout = 3 [default = 0]; - */ - boolean hasNetReadTimeout(); - /** - *
-     * in seconds
-     * 
- * - * optional int32 net_read_timeout = 3 [default = 0]; + * int32 net_read_timeout = 3; */ int getNetReadTimeout(); @@ -2716,68 +2798,48 @@ public final class CanalPacket { * in seconds * * - * optional int32 net_write_timeout = 4 [default = 0]; - */ - boolean hasNetWriteTimeout(); - /** - *
-     * in seconds
-     * 
- * - * optional int32 net_write_timeout = 4 [default = 0]; + * int32 net_write_timeout = 4; */ int getNetWriteTimeout(); /** - * optional string destination = 5; - */ - boolean hasDestination(); - /** - * optional string destination = 5; + * string destination = 5; */ java.lang.String getDestination(); /** - * optional string destination = 5; + * string destination = 5; */ com.google.protobuf.ByteString getDestinationBytes(); /** - * optional string client_id = 6; - */ - boolean hasClientId(); - /** - * optional string client_id = 6; + * string client_id = 6; */ java.lang.String getClientId(); /** - * optional string client_id = 6; + * string client_id = 6; */ com.google.protobuf.ByteString getClientIdBytes(); /** - * optional string filter = 7; - */ - boolean hasFilter(); - /** - * optional string filter = 7; + * string filter = 7; */ java.lang.String getFilter(); /** - * optional string filter = 7; + * string filter = 7; */ com.google.protobuf.ByteString getFilterBytes(); /** - * optional int64 start_timestamp = 8; - */ - boolean hasStartTimestamp(); - /** - * optional int64 start_timestamp = 8; + * int64 start_timestamp = 8; */ long getStartTimestamp(); + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.NetReadTimeoutPresentCase getNetReadTimeoutPresentCase(); + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.NetWriteTimeoutPresentCase getNetWriteTimeoutPresentCase(); } /** *
@@ -2798,8 +2860,6 @@ public final class CanalPacket {
     private ClientAuth() {
       username_ = "";
       password_ = com.google.protobuf.ByteString.EMPTY;
-      netReadTimeout_ = 0;
-      netWriteTimeout_ = 0;
       destination_ = "";
       clientId_ = "";
       filter_ = "";
@@ -2831,51 +2891,51 @@ public final class CanalPacket {
               done = true;
               break;
             case 10: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000001;
-              username_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              username_ = s;
               break;
             }
             case 18: {
-              bitField0_ |= 0x00000002;
+
               password_ = input.readBytes();
               break;
             }
             case 24: {
-              bitField0_ |= 0x00000004;
-              netReadTimeout_ = input.readInt32();
+              netReadTimeoutPresentCase_ = 3;
+              netReadTimeoutPresent_ = input.readInt32();
               break;
             }
             case 32: {
-              bitField0_ |= 0x00000008;
-              netWriteTimeout_ = input.readInt32();
+              netWriteTimeoutPresentCase_ = 4;
+              netWriteTimeoutPresent_ = input.readInt32();
               break;
             }
             case 42: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000010;
-              destination_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              destination_ = s;
               break;
             }
             case 50: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000020;
-              clientId_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              clientId_ = s;
               break;
             }
             case 58: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000040;
-              filter_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              filter_ = s;
               break;
             }
             case 64: {
-              bitField0_ |= 0x00000080;
+
               startTimestamp_ = input.readInt64();
               break;
             }
             default: {
-              if (!parseUnknownField(
+              if (!parseUnknownFieldProto3(
                   input, unknownFields, extensionRegistry, tag)) {
                 done = true;
               }
@@ -2906,17 +2966,82 @@ public final class CanalPacket {
               com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class);
     }
 
-    private int bitField0_;
+    private int netReadTimeoutPresentCase_ = 0;
+    private java.lang.Object netReadTimeoutPresent_;
+    public enum NetReadTimeoutPresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      NET_READ_TIMEOUT(3),
+      NETREADTIMEOUTPRESENT_NOT_SET(0);
+      private final int value;
+      private NetReadTimeoutPresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static NetReadTimeoutPresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static NetReadTimeoutPresentCase forNumber(int value) {
+        switch (value) {
+          case 3: return NET_READ_TIMEOUT;
+          case 0: return NETREADTIMEOUTPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public NetReadTimeoutPresentCase
+    getNetReadTimeoutPresentCase() {
+      return NetReadTimeoutPresentCase.forNumber(
+          netReadTimeoutPresentCase_);
+    }
+
+    private int netWriteTimeoutPresentCase_ = 0;
+    private java.lang.Object netWriteTimeoutPresent_;
+    public enum NetWriteTimeoutPresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      NET_WRITE_TIMEOUT(4),
+      NETWRITETIMEOUTPRESENT_NOT_SET(0);
+      private final int value;
+      private NetWriteTimeoutPresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static NetWriteTimeoutPresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static NetWriteTimeoutPresentCase forNumber(int value) {
+        switch (value) {
+          case 4: return NET_WRITE_TIMEOUT;
+          case 0: return NETWRITETIMEOUTPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public NetWriteTimeoutPresentCase
+    getNetWriteTimeoutPresentCase() {
+      return NetWriteTimeoutPresentCase.forNumber(
+          netWriteTimeoutPresentCase_);
+    }
+
     public static final int USERNAME_FIELD_NUMBER = 1;
     private volatile java.lang.Object username_;
     /**
-     * optional string username = 1;
-     */
-    public boolean hasUsername() {
-      return ((bitField0_ & 0x00000001) == 0x00000001);
-    }
-    /**
-     * optional string username = 1;
+     * string username = 1;
      */
     public java.lang.String getUsername() {
       java.lang.Object ref = username_;
@@ -2926,14 +3051,12 @@ public final class CanalPacket {
         com.google.protobuf.ByteString bs = 
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          username_ = s;
-        }
+        username_ = s;
         return s;
       }
     }
     /**
-     * optional string username = 1;
+     * string username = 1;
      */
     public com.google.protobuf.ByteString
         getUsernameBytes() {
@@ -2956,78 +3079,46 @@ public final class CanalPacket {
      * hashed password with seeds from Handshake message
      * 
* - * optional bytes password = 2; - */ - public boolean hasPassword() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-     * hashed password with seeds from Handshake message
-     * 
- * - * optional bytes password = 2; + * bytes password = 2; */ public com.google.protobuf.ByteString getPassword() { return password_; } public static final int NET_READ_TIMEOUT_FIELD_NUMBER = 3; - private int netReadTimeout_; /** *
      * in seconds
      * 
* - * optional int32 net_read_timeout = 3 [default = 0]; - */ - public boolean hasNetReadTimeout() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-     * in seconds
-     * 
- * - * optional int32 net_read_timeout = 3 [default = 0]; + * int32 net_read_timeout = 3; */ public int getNetReadTimeout() { - return netReadTimeout_; + if (netReadTimeoutPresentCase_ == 3) { + return (java.lang.Integer) netReadTimeoutPresent_; + } + return 0; } public static final int NET_WRITE_TIMEOUT_FIELD_NUMBER = 4; - private int netWriteTimeout_; /** *
      * in seconds
      * 
* - * optional int32 net_write_timeout = 4 [default = 0]; - */ - public boolean hasNetWriteTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-     * in seconds
-     * 
- * - * optional int32 net_write_timeout = 4 [default = 0]; + * int32 net_write_timeout = 4; */ public int getNetWriteTimeout() { - return netWriteTimeout_; + if (netWriteTimeoutPresentCase_ == 4) { + return (java.lang.Integer) netWriteTimeoutPresent_; + } + return 0; } public static final int DESTINATION_FIELD_NUMBER = 5; private volatile java.lang.Object destination_; /** - * optional string destination = 5; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string destination = 5; + * string destination = 5; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -3037,14 +3128,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } } /** - * optional string destination = 5; + * string destination = 5; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -3063,13 +3152,7 @@ public final class CanalPacket { public static final int CLIENT_ID_FIELD_NUMBER = 6; private volatile java.lang.Object clientId_; /** - * optional string client_id = 6; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional string client_id = 6; + * string client_id = 6; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -3079,14 +3162,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } } /** - * optional string client_id = 6; + * string client_id = 6; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -3105,13 +3186,7 @@ public final class CanalPacket { public static final int FILTER_FIELD_NUMBER = 7; private volatile java.lang.Object filter_; /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional string filter = 7; + * string filter = 7; */ public java.lang.String getFilter() { java.lang.Object ref = filter_; @@ -3121,14 +3196,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } + filter_ = s; return s; } } /** - * optional string filter = 7; + * string filter = 7; */ public com.google.protobuf.ByteString getFilterBytes() { @@ -3147,13 +3220,7 @@ public final class CanalPacket { public static final int START_TIMESTAMP_FIELD_NUMBER = 8; private long startTimestamp_; /** - * optional int64 start_timestamp = 8; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int64 start_timestamp = 8; + * int64 start_timestamp = 8; */ public long getStartTimestamp() { return startTimestamp_; @@ -3173,28 +3240,30 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getUsernameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!password_.isEmpty()) { output.writeBytes(2, password_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, netReadTimeout_); + if (netReadTimeoutPresentCase_ == 3) { + output.writeInt32( + 3, (int)((java.lang.Integer) netReadTimeoutPresent_)); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(4, netWriteTimeout_); + if (netWriteTimeoutPresentCase_ == 4) { + output.writeInt32( + 4, (int)((java.lang.Integer) netWriteTimeoutPresent_)); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (!getDestinationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, destination_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (!getClientIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, clientId_); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (!getFilterBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (startTimestamp_ != 0L) { output.writeInt64(8, startTimestamp_); } unknownFields.writeTo(output); @@ -3206,31 +3275,33 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getUsernameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!password_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, password_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (netReadTimeoutPresentCase_ == 3) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, netReadTimeout_); + .computeInt32Size( + 3, (int)((java.lang.Integer) netReadTimeoutPresent_)); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (netWriteTimeoutPresentCase_ == 4) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, netWriteTimeout_); + .computeInt32Size( + 4, (int)((java.lang.Integer) netWriteTimeoutPresent_)); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (!getDestinationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, destination_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (!getClientIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, clientId_); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (!getFilterBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (startTimestamp_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(8, startTimestamp_); } @@ -3250,45 +3321,39 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth other = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) obj; boolean result = true; - result = result && (hasUsername() == other.hasUsername()); - if (hasUsername()) { - result = result && getUsername() - .equals(other.getUsername()); + result = result && getUsername() + .equals(other.getUsername()); + result = result && getPassword() + .equals(other.getPassword()); + result = result && getDestination() + .equals(other.getDestination()); + result = result && getClientId() + .equals(other.getClientId()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getStartTimestamp() + == other.getStartTimestamp()); + result = result && getNetReadTimeoutPresentCase().equals( + other.getNetReadTimeoutPresentCase()); + if (!result) return false; + switch (netReadTimeoutPresentCase_) { + case 3: + result = result && (getNetReadTimeout() + == other.getNetReadTimeout()); + break; + case 0: + default: } - result = result && (hasPassword() == other.hasPassword()); - if (hasPassword()) { - result = result && getPassword() - .equals(other.getPassword()); - } - result = result && (hasNetReadTimeout() == other.hasNetReadTimeout()); - if (hasNetReadTimeout()) { - result = result && (getNetReadTimeout() - == other.getNetReadTimeout()); - } - result = result && (hasNetWriteTimeout() == other.hasNetWriteTimeout()); - if (hasNetWriteTimeout()) { - result = result && (getNetWriteTimeout() - == other.getNetWriteTimeout()); - } - result = result && (hasDestination() == other.hasDestination()); - if (hasDestination()) { - result = result && getDestination() - .equals(other.getDestination()); - } - result = result && (hasClientId() == other.hasClientId()); - if (hasClientId()) { - result = result && getClientId() - .equals(other.getClientId()); - } - result = result && (hasFilter() == other.hasFilter()); - if (hasFilter()) { - result = result && getFilter() - .equals(other.getFilter()); - } - result = result && (hasStartTimestamp() == other.hasStartTimestamp()); - if (hasStartTimestamp()) { - result = result && (getStartTimestamp() - == other.getStartTimestamp()); + result = result && getNetWriteTimeoutPresentCase().equals( + other.getNetWriteTimeoutPresentCase()); + if (!result) return false; + switch (netWriteTimeoutPresentCase_) { + case 4: + result = result && (getNetWriteTimeout() + == other.getNetWriteTimeout()); + break; + case 0: + default: } result = result && unknownFields.equals(other.unknownFields); return result; @@ -3301,38 +3366,34 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasUsername()) { - hash = (37 * hash) + USERNAME_FIELD_NUMBER; - hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStartTimestamp()); + switch (netReadTimeoutPresentCase_) { + case 3: + hash = (37 * hash) + NET_READ_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getNetReadTimeout(); + break; + case 0: + default: } - if (hasPassword()) { - hash = (37 * hash) + PASSWORD_FIELD_NUMBER; - hash = (53 * hash) + getPassword().hashCode(); - } - if (hasNetReadTimeout()) { - hash = (37 * hash) + NET_READ_TIMEOUT_FIELD_NUMBER; - hash = (53 * hash) + getNetReadTimeout(); - } - if (hasNetWriteTimeout()) { - hash = (37 * hash) + NET_WRITE_TIMEOUT_FIELD_NUMBER; - hash = (53 * hash) + getNetWriteTimeout(); - } - if (hasDestination()) { - hash = (37 * hash) + DESTINATION_FIELD_NUMBER; - hash = (53 * hash) + getDestination().hashCode(); - } - if (hasClientId()) { - hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); - } - if (hasFilter()) { - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - } - if (hasStartTimestamp()) { - hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStartTimestamp()); + switch (netWriteTimeoutPresentCase_) { + case 4: + hash = (37 * hash) + NET_WRITE_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getNetWriteTimeout(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -3472,21 +3533,21 @@ public final class CanalPacket { public Builder clear() { super.clear(); username_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); + password_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - netReadTimeout_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - netWriteTimeout_ = 0; - bitField0_ = (bitField0_ & ~0x00000008); + destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000010); + clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000020); + filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000040); + startTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000080); + + netReadTimeoutPresentCase_ = 0; + netReadTimeoutPresent_ = null; + netWriteTimeoutPresentCase_ = 0; + netWriteTimeoutPresent_ = null; return this; } @@ -3513,41 +3574,20 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.username_ = username_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.password_ = password_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; + if (netReadTimeoutPresentCase_ == 3) { + result.netReadTimeoutPresent_ = netReadTimeoutPresent_; } - result.netReadTimeout_ = netReadTimeout_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.netWriteTimeout_ = netWriteTimeout_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; + if (netWriteTimeoutPresentCase_ == 4) { + result.netWriteTimeoutPresent_ = netWriteTimeoutPresent_; } result.destination_ = destination_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } result.filter_ = filter_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; - } result.startTimestamp_ = startTimestamp_; - result.bitField0_ = to_bitField0_; + result.netReadTimeoutPresentCase_ = netReadTimeoutPresentCase_; + result.netWriteTimeoutPresentCase_ = netWriteTimeoutPresentCase_; onBuilt(); return result; } @@ -3596,38 +3636,46 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance()) return this; - if (other.hasUsername()) { - bitField0_ |= 0x00000001; + if (!other.getUsername().isEmpty()) { username_ = other.username_; onChanged(); } - if (other.hasPassword()) { + if (other.getPassword() != com.google.protobuf.ByteString.EMPTY) { setPassword(other.getPassword()); } - if (other.hasNetReadTimeout()) { - setNetReadTimeout(other.getNetReadTimeout()); - } - if (other.hasNetWriteTimeout()) { - setNetWriteTimeout(other.getNetWriteTimeout()); - } - if (other.hasDestination()) { - bitField0_ |= 0x00000010; + if (!other.getDestination().isEmpty()) { destination_ = other.destination_; onChanged(); } - if (other.hasClientId()) { - bitField0_ |= 0x00000020; + if (!other.getClientId().isEmpty()) { clientId_ = other.clientId_; onChanged(); } - if (other.hasFilter()) { - bitField0_ |= 0x00000040; + if (!other.getFilter().isEmpty()) { filter_ = other.filter_; onChanged(); } - if (other.hasStartTimestamp()) { + if (other.getStartTimestamp() != 0L) { setStartTimestamp(other.getStartTimestamp()); } + switch (other.getNetReadTimeoutPresentCase()) { + case NET_READ_TIMEOUT: { + setNetReadTimeout(other.getNetReadTimeout()); + break; + } + case NETREADTIMEOUTPRESENT_NOT_SET: { + break; + } + } + switch (other.getNetWriteTimeoutPresentCase()) { + case NET_WRITE_TIMEOUT: { + setNetWriteTimeout(other.getNetWriteTimeout()); + break; + } + case NETWRITETIMEOUTPRESENT_NOT_SET: { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -3656,17 +3704,40 @@ public final class CanalPacket { } return this; } - private int bitField0_; + private int netReadTimeoutPresentCase_ = 0; + private java.lang.Object netReadTimeoutPresent_; + public NetReadTimeoutPresentCase + getNetReadTimeoutPresentCase() { + return NetReadTimeoutPresentCase.forNumber( + netReadTimeoutPresentCase_); + } + + public Builder clearNetReadTimeoutPresent() { + netReadTimeoutPresentCase_ = 0; + netReadTimeoutPresent_ = null; + onChanged(); + return this; + } + + private int netWriteTimeoutPresentCase_ = 0; + private java.lang.Object netWriteTimeoutPresent_; + public NetWriteTimeoutPresentCase + getNetWriteTimeoutPresentCase() { + return NetWriteTimeoutPresentCase.forNumber( + netWriteTimeoutPresentCase_); + } + + public Builder clearNetWriteTimeoutPresent() { + netWriteTimeoutPresentCase_ = 0; + netWriteTimeoutPresent_ = null; + onChanged(); + return this; + } + private java.lang.Object username_ = ""; /** - * optional string username = 1; - */ - public boolean hasUsername() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string username = 1; + * string username = 1; */ public java.lang.String getUsername() { java.lang.Object ref = username_; @@ -3674,16 +3745,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - username_ = s; - } + username_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string username = 1; + * string username = 1; */ public com.google.protobuf.ByteString getUsernameBytes() { @@ -3699,36 +3768,37 @@ public final class CanalPacket { } } /** - * optional string username = 1; + * string username = 1; */ public Builder setUsername( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + username_ = value; onChanged(); return this; } /** - * optional string username = 1; + * string username = 1; */ public Builder clearUsername() { - bitField0_ = (bitField0_ & ~0x00000001); + username_ = getDefaultInstance().getUsername(); onChanged(); return this; } /** - * optional string username = 1; + * string username = 1; */ public Builder setUsernameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + checkByteStringIsUtf8(value); + username_ = value; onChanged(); return this; @@ -3740,17 +3810,7 @@ public final class CanalPacket { * hashed password with seeds from Handshake message * * - * optional bytes password = 2; - */ - public boolean hasPassword() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-       * hashed password with seeds from Handshake message
-       * 
- * - * optional bytes password = 2; + * bytes password = 2; */ public com.google.protobuf.ByteString getPassword() { return password_; @@ -3760,13 +3820,13 @@ public final class CanalPacket { * hashed password with seeds from Handshake message * * - * optional bytes password = 2; + * bytes password = 2; */ public Builder setPassword(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + password_ = value; onChanged(); return this; @@ -3776,46 +3836,38 @@ public final class CanalPacket { * hashed password with seeds from Handshake message * * - * optional bytes password = 2; + * bytes password = 2; */ public Builder clearPassword() { - bitField0_ = (bitField0_ & ~0x00000002); + password_ = getDefaultInstance().getPassword(); onChanged(); return this; } - private int netReadTimeout_ ; /** *
        * in seconds
        * 
* - * optional int32 net_read_timeout = 3 [default = 0]; - */ - public boolean hasNetReadTimeout() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - *
-       * in seconds
-       * 
- * - * optional int32 net_read_timeout = 3 [default = 0]; + * int32 net_read_timeout = 3; */ public int getNetReadTimeout() { - return netReadTimeout_; + if (netReadTimeoutPresentCase_ == 3) { + return (java.lang.Integer) netReadTimeoutPresent_; + } + return 0; } /** *
        * in seconds
        * 
* - * optional int32 net_read_timeout = 3 [default = 0]; + * int32 net_read_timeout = 3; */ public Builder setNetReadTimeout(int value) { - bitField0_ |= 0x00000004; - netReadTimeout_ = value; + netReadTimeoutPresentCase_ = 3; + netReadTimeoutPresent_ = value; onChanged(); return this; } @@ -3824,46 +3876,40 @@ public final class CanalPacket { * in seconds * * - * optional int32 net_read_timeout = 3 [default = 0]; + * int32 net_read_timeout = 3; */ public Builder clearNetReadTimeout() { - bitField0_ = (bitField0_ & ~0x00000004); - netReadTimeout_ = 0; - onChanged(); + if (netReadTimeoutPresentCase_ == 3) { + netReadTimeoutPresentCase_ = 0; + netReadTimeoutPresent_ = null; + onChanged(); + } return this; } - private int netWriteTimeout_ ; /** *
        * in seconds
        * 
* - * optional int32 net_write_timeout = 4 [default = 0]; - */ - public boolean hasNetWriteTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-       * in seconds
-       * 
- * - * optional int32 net_write_timeout = 4 [default = 0]; + * int32 net_write_timeout = 4; */ public int getNetWriteTimeout() { - return netWriteTimeout_; + if (netWriteTimeoutPresentCase_ == 4) { + return (java.lang.Integer) netWriteTimeoutPresent_; + } + return 0; } /** *
        * in seconds
        * 
* - * optional int32 net_write_timeout = 4 [default = 0]; + * int32 net_write_timeout = 4; */ public Builder setNetWriteTimeout(int value) { - bitField0_ |= 0x00000008; - netWriteTimeout_ = value; + netWriteTimeoutPresentCase_ = 4; + netWriteTimeoutPresent_ = value; onChanged(); return this; } @@ -3872,24 +3918,20 @@ public final class CanalPacket { * in seconds * * - * optional int32 net_write_timeout = 4 [default = 0]; + * int32 net_write_timeout = 4; */ public Builder clearNetWriteTimeout() { - bitField0_ = (bitField0_ & ~0x00000008); - netWriteTimeout_ = 0; - onChanged(); + if (netWriteTimeoutPresentCase_ == 4) { + netWriteTimeoutPresentCase_ = 0; + netWriteTimeoutPresent_ = null; + onChanged(); + } return this; } private java.lang.Object destination_ = ""; /** - * optional string destination = 5; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string destination = 5; + * string destination = 5; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -3897,16 +3939,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string destination = 5; + * string destination = 5; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -3922,36 +3962,37 @@ public final class CanalPacket { } } /** - * optional string destination = 5; + * string destination = 5; */ public Builder setDestination( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + destination_ = value; onChanged(); return this; } /** - * optional string destination = 5; + * string destination = 5; */ public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000010); + destination_ = getDefaultInstance().getDestination(); onChanged(); return this; } /** - * optional string destination = 5; + * string destination = 5; */ public Builder setDestinationBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + checkByteStringIsUtf8(value); + destination_ = value; onChanged(); return this; @@ -3959,13 +4000,7 @@ public final class CanalPacket { private java.lang.Object clientId_ = ""; /** - * optional string client_id = 6; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional string client_id = 6; + * string client_id = 6; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -3973,16 +4008,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string client_id = 6; + * string client_id = 6; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -3998,36 +4031,37 @@ public final class CanalPacket { } } /** - * optional string client_id = 6; + * string client_id = 6; */ public Builder setClientId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000020; + clientId_ = value; onChanged(); return this; } /** - * optional string client_id = 6; + * string client_id = 6; */ public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000020); + clientId_ = getDefaultInstance().getClientId(); onChanged(); return this; } /** - * optional string client_id = 6; + * string client_id = 6; */ public Builder setClientIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000020; + checkByteStringIsUtf8(value); + clientId_ = value; onChanged(); return this; @@ -4035,13 +4069,7 @@ public final class CanalPacket { private java.lang.Object filter_ = ""; /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional string filter = 7; + * string filter = 7; */ public java.lang.String getFilter() { java.lang.Object ref = filter_; @@ -4049,16 +4077,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } + filter_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string filter = 7; + * string filter = 7; */ public com.google.protobuf.ByteString getFilterBytes() { @@ -4074,36 +4100,37 @@ public final class CanalPacket { } } /** - * optional string filter = 7; + * string filter = 7; */ public Builder setFilter( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000040; + filter_ = value; onChanged(); return this; } /** - * optional string filter = 7; + * string filter = 7; */ public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000040); + filter_ = getDefaultInstance().getFilter(); onChanged(); return this; } /** - * optional string filter = 7; + * string filter = 7; */ public Builder setFilterBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000040; + checkByteStringIsUtf8(value); + filter_ = value; onChanged(); return this; @@ -4111,31 +4138,25 @@ public final class CanalPacket { private long startTimestamp_ ; /** - * optional int64 start_timestamp = 8; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int64 start_timestamp = 8; + * int64 start_timestamp = 8; */ public long getStartTimestamp() { return startTimestamp_; } /** - * optional int64 start_timestamp = 8; + * int64 start_timestamp = 8; */ public Builder setStartTimestamp(long value) { - bitField0_ |= 0x00000080; + startTimestamp_ = value; onChanged(); return this; } /** - * optional int64 start_timestamp = 8; + * int64 start_timestamp = 8; */ public Builder clearStartTimestamp() { - bitField0_ = (bitField0_ & ~0x00000080); + startTimestamp_ = 0L; onChanged(); return this; @@ -4143,7 +4164,7 @@ public final class CanalPacket { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -4166,7 +4187,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public ClientAuth parsePartialFrom( @@ -4198,11 +4219,7 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional int32 error_code = 1 [default = 0]; - */ - boolean hasErrorCode(); - /** - * optional int32 error_code = 1 [default = 0]; + * int32 error_code = 1; */ int getErrorCode(); @@ -4211,15 +4228,7 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; - */ - boolean hasErrorMessage(); - /** - *
-     * if something like compression is not supported, erorr_message will tell about it.
-     * 
- * - * optional string error_message = 2; + * string error_message = 2; */ java.lang.String getErrorMessage(); /** @@ -4227,10 +4236,12 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; + * string error_message = 2; */ com.google.protobuf.ByteString getErrorMessageBytes(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Ack.ErrorCodePresentCase getErrorCodePresentCase(); } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Ack} @@ -4245,7 +4256,6 @@ public final class CanalPacket { super(builder); } private Ack() { - errorCode_ = 0; errorMessage_ = ""; } @@ -4274,18 +4284,18 @@ public final class CanalPacket { done = true; break; case 8: { - bitField0_ |= 0x00000001; - errorCode_ = input.readInt32(); + errorCodePresentCase_ = 1; + errorCodePresent_ = input.readInt32(); break; } case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - errorMessage_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + errorMessage_ = s; break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -4316,20 +4326,51 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); } - private int bitField0_; - public static final int ERROR_CODE_FIELD_NUMBER = 1; - private int errorCode_; - /** - * optional int32 error_code = 1 [default = 0]; - */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000001) == 0x00000001); + private int errorCodePresentCase_ = 0; + private java.lang.Object errorCodePresent_; + public enum ErrorCodePresentCase + implements com.google.protobuf.Internal.EnumLite { + ERROR_CODE(1), + ERRORCODEPRESENT_NOT_SET(0); + private final int value; + private ErrorCodePresentCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ErrorCodePresentCase valueOf(int value) { + return forNumber(value); + } + + public static ErrorCodePresentCase forNumber(int value) { + switch (value) { + case 1: return ERROR_CODE; + case 0: return ERRORCODEPRESENT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ErrorCodePresentCase + getErrorCodePresentCase() { + return ErrorCodePresentCase.forNumber( + errorCodePresentCase_); } + + public static final int ERROR_CODE_FIELD_NUMBER = 1; /** - * optional int32 error_code = 1 [default = 0]; + * int32 error_code = 1; */ public int getErrorCode() { - return errorCode_; + if (errorCodePresentCase_ == 1) { + return (java.lang.Integer) errorCodePresent_; + } + return 0; } public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; @@ -4339,17 +4380,7 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; - */ - public boolean hasErrorMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-     * if something like compression is not supported, erorr_message will tell about it.
-     * 
- * - * optional string error_message = 2; + * string error_message = 2; */ public java.lang.String getErrorMessage() { java.lang.Object ref = errorMessage_; @@ -4359,9 +4390,7 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - errorMessage_ = s; - } + errorMessage_ = s; return s; } } @@ -4370,7 +4399,7 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; + * string error_message = 2; */ public com.google.protobuf.ByteString getErrorMessageBytes() { @@ -4400,10 +4429,11 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, errorCode_); + if (errorCodePresentCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) errorCodePresent_)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getErrorMessageBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); } unknownFields.writeTo(output); @@ -4415,11 +4445,12 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (errorCodePresentCase_ == 1) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, errorCode_); + .computeInt32Size( + 1, (int)((java.lang.Integer) errorCodePresent_)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getErrorMessageBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); } size += unknownFields.getSerializedSize(); @@ -4438,15 +4469,18 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Ack other = (com.alibaba.otter.canal.protocol.CanalPacket.Ack) obj; boolean result = true; - result = result && (hasErrorCode() == other.hasErrorCode()); - if (hasErrorCode()) { - result = result && (getErrorCode() - == other.getErrorCode()); - } - result = result && (hasErrorMessage() == other.hasErrorMessage()); - if (hasErrorMessage()) { - result = result && getErrorMessage() - .equals(other.getErrorMessage()); + result = result && getErrorMessage() + .equals(other.getErrorMessage()); + result = result && getErrorCodePresentCase().equals( + other.getErrorCodePresentCase()); + if (!result) return false; + switch (errorCodePresentCase_) { + case 1: + result = result && (getErrorCode() + == other.getErrorCode()); + break; + case 0: + default: } result = result && unknownFields.equals(other.unknownFields); return result; @@ -4459,13 +4493,15 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasErrorCode()) { - hash = (37 * hash) + ERROR_CODE_FIELD_NUMBER; - hash = (53 * hash) + getErrorCode(); - } - if (hasErrorMessage()) { - hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getErrorMessage().hashCode(); + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + switch (errorCodePresentCase_) { + case 1: + hash = (37 * hash) + ERROR_CODE_FIELD_NUMBER; + hash = (53 * hash) + getErrorCode(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -4600,10 +4636,10 @@ public final class CanalPacket { @java.lang.Override public Builder clear() { super.clear(); - errorCode_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); errorMessage_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + + errorCodePresentCase_ = 0; + errorCodePresent_ = null; return this; } @@ -4630,17 +4666,11 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.Ack buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.Ack result = new com.alibaba.otter.canal.protocol.CanalPacket.Ack(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.errorCode_ = errorCode_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; + if (errorCodePresentCase_ == 1) { + result.errorCodePresent_ = errorCodePresent_; } result.errorMessage_ = errorMessage_; - result.bitField0_ = to_bitField0_; + result.errorCodePresentCase_ = errorCodePresentCase_; onBuilt(); return result; } @@ -4689,14 +4719,19 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Ack other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance()) return this; - if (other.hasErrorCode()) { - setErrorCode(other.getErrorCode()); - } - if (other.hasErrorMessage()) { - bitField0_ |= 0x00000002; + if (!other.getErrorMessage().isEmpty()) { errorMessage_ = other.errorMessage_; onChanged(); } + switch (other.getErrorCodePresentCase()) { + case ERROR_CODE: { + setErrorCode(other.getErrorCode()); + break; + } + case ERRORCODEPRESENT_NOT_SET: { + break; + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -4725,37 +4760,49 @@ public final class CanalPacket { } return this; } - private int bitField0_; - - private int errorCode_ ; - /** - * optional int32 error_code = 1 [default = 0]; - */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000001) == 0x00000001); + private int errorCodePresentCase_ = 0; + private java.lang.Object errorCodePresent_; + public ErrorCodePresentCase + getErrorCodePresentCase() { + return ErrorCodePresentCase.forNumber( + errorCodePresentCase_); } + + public Builder clearErrorCodePresent() { + errorCodePresentCase_ = 0; + errorCodePresent_ = null; + onChanged(); + return this; + } + + /** - * optional int32 error_code = 1 [default = 0]; + * int32 error_code = 1; */ public int getErrorCode() { - return errorCode_; + if (errorCodePresentCase_ == 1) { + return (java.lang.Integer) errorCodePresent_; + } + return 0; } /** - * optional int32 error_code = 1 [default = 0]; + * int32 error_code = 1; */ public Builder setErrorCode(int value) { - bitField0_ |= 0x00000001; - errorCode_ = value; + errorCodePresentCase_ = 1; + errorCodePresent_ = value; onChanged(); return this; } /** - * optional int32 error_code = 1 [default = 0]; + * int32 error_code = 1; */ public Builder clearErrorCode() { - bitField0_ = (bitField0_ & ~0x00000001); - errorCode_ = 0; - onChanged(); + if (errorCodePresentCase_ == 1) { + errorCodePresentCase_ = 0; + errorCodePresent_ = null; + onChanged(); + } return this; } @@ -4765,17 +4812,7 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; - */ - public boolean hasErrorMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - *
-       * if something like compression is not supported, erorr_message will tell about it.
-       * 
- * - * optional string error_message = 2; + * string error_message = 2; */ public java.lang.String getErrorMessage() { java.lang.Object ref = errorMessage_; @@ -4783,9 +4820,7 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - errorMessage_ = s; - } + errorMessage_ = s; return s; } else { return (java.lang.String) ref; @@ -4796,7 +4831,7 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; + * string error_message = 2; */ public com.google.protobuf.ByteString getErrorMessageBytes() { @@ -4816,14 +4851,14 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; + * string error_message = 2; */ public Builder setErrorMessage( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + errorMessage_ = value; onChanged(); return this; @@ -4833,10 +4868,10 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; + * string error_message = 2; */ public Builder clearErrorMessage() { - bitField0_ = (bitField0_ & ~0x00000002); + errorMessage_ = getDefaultInstance().getErrorMessage(); onChanged(); return this; @@ -4846,14 +4881,15 @@ public final class CanalPacket { * if something like compression is not supported, erorr_message will tell about it. * * - * optional string error_message = 2; + * string error_message = 2; */ public Builder setErrorMessageBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + errorMessage_ = value; onChanged(); return this; @@ -4861,7 +4897,7 @@ public final class CanalPacket { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -4884,7 +4920,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Ack parsePartialFrom( @@ -4916,39 +4952,27 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; + * string destination = 1; */ java.lang.String getDestination(); /** - * optional string destination = 1; + * string destination = 1; */ com.google.protobuf.ByteString getDestinationBytes(); /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; + * string client_id = 2; */ java.lang.String getClientId(); /** - * optional string client_id = 2; + * string client_id = 2; */ com.google.protobuf.ByteString getClientIdBytes(); /** - * optional int64 batch_id = 3; - */ - boolean hasBatchId(); - /** - * optional int64 batch_id = 3; + * int64 batch_id = 3; */ long getBatchId(); } @@ -4995,24 +5019,24 @@ public final class CanalPacket { done = true; break; case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + destination_ = s; break; } case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + clientId_ = s; break; } case 24: { - bitField0_ |= 0x00000004; + batchId_ = input.readInt64(); break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -5043,17 +5067,10 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); } - private int bitField0_; public static final int DESTINATION_FIELD_NUMBER = 1; private volatile java.lang.Object destination_; /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; + * string destination = 1; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -5063,14 +5080,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } } /** - * optional string destination = 1; + * string destination = 1; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -5089,13 +5104,7 @@ public final class CanalPacket { public static final int CLIENT_ID_FIELD_NUMBER = 2; private volatile java.lang.Object clientId_; /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; + * string client_id = 2; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -5105,14 +5114,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } } /** - * optional string client_id = 2; + * string client_id = 2; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -5131,13 +5138,7 @@ public final class CanalPacket { public static final int BATCH_ID_FIELD_NUMBER = 3; private long batchId_; /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 batch_id = 3; + * int64 batch_id = 3; */ public long getBatchId() { return batchId_; @@ -5157,13 +5158,13 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getDestinationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getClientIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (batchId_ != 0L) { output.writeInt64(3, batchId_); } unknownFields.writeTo(output); @@ -5175,13 +5176,13 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getDestinationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getClientIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (batchId_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, batchId_); } @@ -5201,21 +5202,12 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.ClientAck other = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) obj; boolean result = true; - result = result && (hasDestination() == other.hasDestination()); - if (hasDestination()) { - result = result && getDestination() - .equals(other.getDestination()); - } - result = result && (hasClientId() == other.hasClientId()); - if (hasClientId()) { - result = result && getClientId() - .equals(other.getClientId()); - } - result = result && (hasBatchId() == other.hasBatchId()); - if (hasBatchId()) { - result = result && (getBatchId() - == other.getBatchId()); - } + result = result && getDestination() + .equals(other.getDestination()); + result = result && getClientId() + .equals(other.getClientId()); + result = result && (getBatchId() + == other.getBatchId()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -5227,19 +5219,13 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDestination()) { - hash = (37 * hash) + DESTINATION_FIELD_NUMBER; - hash = (53 * hash) + getDestination().hashCode(); - } - if (hasClientId()) { - hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); - } - if (hasBatchId()) { - hash = (37 * hash) + BATCH_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBatchId()); - } + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + hash = (37 * hash) + BATCH_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBatchId()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -5374,11 +5360,11 @@ public final class CanalPacket { public Builder clear() { super.clear(); destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + batchId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); + return this; } @@ -5405,21 +5391,9 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAck(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } result.batchId_ = batchId_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -5468,17 +5442,15 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; + if (!other.getDestination().isEmpty()) { destination_ = other.destination_; onChanged(); } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; + if (!other.getClientId().isEmpty()) { clientId_ = other.clientId_; onChanged(); } - if (other.hasBatchId()) { + if (other.getBatchId() != 0L) { setBatchId(other.getBatchId()); } this.mergeUnknownFields(other.unknownFields); @@ -5509,17 +5481,10 @@ public final class CanalPacket { } return this; } - private int bitField0_; private java.lang.Object destination_ = ""; /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; + * string destination = 1; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -5527,16 +5492,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string destination = 1; + * string destination = 1; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -5552,36 +5515,37 @@ public final class CanalPacket { } } /** - * optional string destination = 1; + * string destination = 1; */ public Builder setDestination( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + destination_ = value; onChanged(); return this; } /** - * optional string destination = 1; + * string destination = 1; */ public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); onChanged(); return this; } /** - * optional string destination = 1; + * string destination = 1; */ public Builder setDestinationBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + checkByteStringIsUtf8(value); + destination_ = value; onChanged(); return this; @@ -5589,13 +5553,7 @@ public final class CanalPacket { private java.lang.Object clientId_ = ""; /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; + * string client_id = 2; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -5603,16 +5561,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string client_id = 2; + * string client_id = 2; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -5628,36 +5584,37 @@ public final class CanalPacket { } } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder setClientId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + clientId_ = value; onChanged(); return this; } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); onChanged(); return this; } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder setClientIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + clientId_ = value; onChanged(); return this; @@ -5665,31 +5622,25 @@ public final class CanalPacket { private long batchId_ ; /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 batch_id = 3; + * int64 batch_id = 3; */ public long getBatchId() { return batchId_; } /** - * optional int64 batch_id = 3; + * int64 batch_id = 3; */ public Builder setBatchId(long value) { - bitField0_ |= 0x00000004; + batchId_ = value; onChanged(); return this; } /** - * optional int64 batch_id = 3; + * int64 batch_id = 3; */ public Builder clearBatchId() { - bitField0_ = (bitField0_ & ~0x00000004); + batchId_ = 0L; onChanged(); return this; @@ -5697,7 +5648,7 @@ public final class CanalPacket { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -5720,7 +5671,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public ClientAck parsePartialFrom( @@ -5752,43 +5703,31 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; + * string destination = 1; */ java.lang.String getDestination(); /** - * optional string destination = 1; + * string destination = 1; */ com.google.protobuf.ByteString getDestinationBytes(); /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; + * string client_id = 2; */ java.lang.String getClientId(); /** - * optional string client_id = 2; + * string client_id = 2; */ com.google.protobuf.ByteString getClientIdBytes(); /** - * optional string filter = 7; - */ - boolean hasFilter(); - /** - * optional string filter = 7; + * string filter = 7; */ java.lang.String getFilter(); /** - * optional string filter = 7; + * string filter = 7; */ com.google.protobuf.ByteString getFilterBytes(); @@ -5840,25 +5779,25 @@ public final class CanalPacket { done = true; break; case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + destination_ = s; break; } case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + clientId_ = s; break; } case 58: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - filter_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -5889,17 +5828,10 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); } - private int bitField0_; public static final int DESTINATION_FIELD_NUMBER = 1; private volatile java.lang.Object destination_; /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; + * string destination = 1; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -5909,14 +5841,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } } /** - * optional string destination = 1; + * string destination = 1; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -5935,13 +5865,7 @@ public final class CanalPacket { public static final int CLIENT_ID_FIELD_NUMBER = 2; private volatile java.lang.Object clientId_; /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; + * string client_id = 2; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -5951,14 +5875,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } } /** - * optional string client_id = 2; + * string client_id = 2; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -5977,13 +5899,7 @@ public final class CanalPacket { public static final int FILTER_FIELD_NUMBER = 7; private volatile java.lang.Object filter_; /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string filter = 7; + * string filter = 7; */ public java.lang.String getFilter() { java.lang.Object ref = filter_; @@ -5993,14 +5909,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } + filter_ = s; return s; } } /** - * optional string filter = 7; + * string filter = 7; */ public com.google.protobuf.ByteString getFilterBytes() { @@ -6030,13 +5944,13 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getDestinationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getClientIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (!getFilterBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); } unknownFields.writeTo(output); @@ -6048,13 +5962,13 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getDestinationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getClientIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (!getFilterBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); } size += unknownFields.getSerializedSize(); @@ -6073,21 +5987,12 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Sub other = (com.alibaba.otter.canal.protocol.CanalPacket.Sub) obj; boolean result = true; - result = result && (hasDestination() == other.hasDestination()); - if (hasDestination()) { - result = result && getDestination() - .equals(other.getDestination()); - } - result = result && (hasClientId() == other.hasClientId()); - if (hasClientId()) { - result = result && getClientId() - .equals(other.getClientId()); - } - result = result && (hasFilter() == other.hasFilter()); - if (hasFilter()) { - result = result && getFilter() - .equals(other.getFilter()); - } + result = result && getDestination() + .equals(other.getDestination()); + result = result && getClientId() + .equals(other.getClientId()); + result = result && getFilter() + .equals(other.getFilter()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -6099,18 +6004,12 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDestination()) { - hash = (37 * hash) + DESTINATION_FIELD_NUMBER; - hash = (53 * hash) + getDestination().hashCode(); - } - if (hasClientId()) { - hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); - } - if (hasFilter()) { - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - } + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -6249,11 +6148,11 @@ public final class CanalPacket { public Builder clear() { super.clear(); destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); + return this; } @@ -6280,21 +6179,9 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.Sub buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.Sub result = new com.alibaba.otter.canal.protocol.CanalPacket.Sub(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } result.filter_ = filter_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -6343,18 +6230,15 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Sub other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; + if (!other.getDestination().isEmpty()) { destination_ = other.destination_; onChanged(); } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; + if (!other.getClientId().isEmpty()) { clientId_ = other.clientId_; onChanged(); } - if (other.hasFilter()) { - bitField0_ |= 0x00000004; + if (!other.getFilter().isEmpty()) { filter_ = other.filter_; onChanged(); } @@ -6386,17 +6270,10 @@ public final class CanalPacket { } return this; } - private int bitField0_; private java.lang.Object destination_ = ""; /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; + * string destination = 1; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -6404,16 +6281,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string destination = 1; + * string destination = 1; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -6429,36 +6304,37 @@ public final class CanalPacket { } } /** - * optional string destination = 1; + * string destination = 1; */ public Builder setDestination( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + destination_ = value; onChanged(); return this; } /** - * optional string destination = 1; + * string destination = 1; */ public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); onChanged(); return this; } /** - * optional string destination = 1; + * string destination = 1; */ public Builder setDestinationBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + checkByteStringIsUtf8(value); + destination_ = value; onChanged(); return this; @@ -6466,13 +6342,7 @@ public final class CanalPacket { private java.lang.Object clientId_ = ""; /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; + * string client_id = 2; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -6480,16 +6350,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string client_id = 2; + * string client_id = 2; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -6505,36 +6373,37 @@ public final class CanalPacket { } } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder setClientId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + clientId_ = value; onChanged(); return this; } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); onChanged(); return this; } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder setClientIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + clientId_ = value; onChanged(); return this; @@ -6542,13 +6411,7 @@ public final class CanalPacket { private java.lang.Object filter_ = ""; /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string filter = 7; + * string filter = 7; */ public java.lang.String getFilter() { java.lang.Object ref = filter_; @@ -6556,16 +6419,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } + filter_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string filter = 7; + * string filter = 7; */ public com.google.protobuf.ByteString getFilterBytes() { @@ -6581,36 +6442,37 @@ public final class CanalPacket { } } /** - * optional string filter = 7; + * string filter = 7; */ public Builder setFilter( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + filter_ = value; onChanged(); return this; } /** - * optional string filter = 7; + * string filter = 7; */ public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000004); + filter_ = getDefaultInstance().getFilter(); onChanged(); return this; } /** - * optional string filter = 7; + * string filter = 7; */ public Builder setFilterBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + checkByteStringIsUtf8(value); + filter_ = value; onChanged(); return this; @@ -6618,7 +6480,7 @@ public final class CanalPacket { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -6641,7 +6503,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Sub parsePartialFrom( @@ -6673,43 +6535,31 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; + * string destination = 1; */ java.lang.String getDestination(); /** - * optional string destination = 1; + * string destination = 1; */ com.google.protobuf.ByteString getDestinationBytes(); /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; + * string client_id = 2; */ java.lang.String getClientId(); /** - * optional string client_id = 2; + * string client_id = 2; */ com.google.protobuf.ByteString getClientIdBytes(); /** - * optional string filter = 7; - */ - boolean hasFilter(); - /** - * optional string filter = 7; + * string filter = 7; */ java.lang.String getFilter(); /** - * optional string filter = 7; + * string filter = 7; */ com.google.protobuf.ByteString getFilterBytes(); @@ -6761,25 +6611,25 @@ public final class CanalPacket { done = true; break; case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + destination_ = s; break; } case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + clientId_ = s; break; } case 58: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - filter_ = bs; + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -6810,17 +6660,10 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); } - private int bitField0_; public static final int DESTINATION_FIELD_NUMBER = 1; private volatile java.lang.Object destination_; /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; + * string destination = 1; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -6830,14 +6673,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } } /** - * optional string destination = 1; + * string destination = 1; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -6856,13 +6697,7 @@ public final class CanalPacket { public static final int CLIENT_ID_FIELD_NUMBER = 2; private volatile java.lang.Object clientId_; /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; + * string client_id = 2; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -6872,14 +6707,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } } /** - * optional string client_id = 2; + * string client_id = 2; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -6898,13 +6731,7 @@ public final class CanalPacket { public static final int FILTER_FIELD_NUMBER = 7; private volatile java.lang.Object filter_; /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string filter = 7; + * string filter = 7; */ public java.lang.String getFilter() { java.lang.Object ref = filter_; @@ -6914,14 +6741,12 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } + filter_ = s; return s; } } /** - * optional string filter = 7; + * string filter = 7; */ public com.google.protobuf.ByteString getFilterBytes() { @@ -6951,13 +6776,13 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getDestinationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getClientIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (!getFilterBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); } unknownFields.writeTo(output); @@ -6969,13 +6794,13 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getDestinationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getClientIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (!getFilterBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); } size += unknownFields.getSerializedSize(); @@ -6994,21 +6819,12 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Unsub other = (com.alibaba.otter.canal.protocol.CanalPacket.Unsub) obj; boolean result = true; - result = result && (hasDestination() == other.hasDestination()); - if (hasDestination()) { - result = result && getDestination() - .equals(other.getDestination()); - } - result = result && (hasClientId() == other.hasClientId()); - if (hasClientId()) { - result = result && getClientId() - .equals(other.getClientId()); - } - result = result && (hasFilter() == other.hasFilter()); - if (hasFilter()) { - result = result && getFilter() - .equals(other.getFilter()); - } + result = result && getDestination() + .equals(other.getDestination()); + result = result && getClientId() + .equals(other.getClientId()); + result = result && getFilter() + .equals(other.getFilter()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -7020,18 +6836,12 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDestination()) { - hash = (37 * hash) + DESTINATION_FIELD_NUMBER; - hash = (53 * hash) + getDestination().hashCode(); - } - if (hasClientId()) { - hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); - } - if (hasFilter()) { - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - } + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -7170,11 +6980,11 @@ public final class CanalPacket { public Builder clear() { super.clear(); destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); + return this; } @@ -7201,21 +7011,9 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.Unsub buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = new com.alibaba.otter.canal.protocol.CanalPacket.Unsub(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } result.filter_ = filter_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -7264,18 +7062,15 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Unsub other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; + if (!other.getDestination().isEmpty()) { destination_ = other.destination_; onChanged(); } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; + if (!other.getClientId().isEmpty()) { clientId_ = other.clientId_; onChanged(); } - if (other.hasFilter()) { - bitField0_ |= 0x00000004; + if (!other.getFilter().isEmpty()) { filter_ = other.filter_; onChanged(); } @@ -7307,17 +7102,10 @@ public final class CanalPacket { } return this; } - private int bitField0_; private java.lang.Object destination_ = ""; /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; + * string destination = 1; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -7325,16 +7113,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string destination = 1; + * string destination = 1; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -7350,36 +7136,37 @@ public final class CanalPacket { } } /** - * optional string destination = 1; + * string destination = 1; */ public Builder setDestination( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + destination_ = value; onChanged(); return this; } /** - * optional string destination = 1; + * string destination = 1; */ public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); onChanged(); return this; } /** - * optional string destination = 1; + * string destination = 1; */ public Builder setDestinationBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + checkByteStringIsUtf8(value); + destination_ = value; onChanged(); return this; @@ -7387,13 +7174,7 @@ public final class CanalPacket { private java.lang.Object clientId_ = ""; /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; + * string client_id = 2; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -7401,16 +7182,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string client_id = 2; + * string client_id = 2; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -7426,36 +7205,37 @@ public final class CanalPacket { } } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder setClientId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + clientId_ = value; onChanged(); return this; } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); onChanged(); return this; } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder setClientIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + clientId_ = value; onChanged(); return this; @@ -7463,13 +7243,7 @@ public final class CanalPacket { private java.lang.Object filter_ = ""; /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string filter = 7; + * string filter = 7; */ public java.lang.String getFilter() { java.lang.Object ref = filter_; @@ -7477,16 +7251,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } + filter_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string filter = 7; + * string filter = 7; */ public com.google.protobuf.ByteString getFilterBytes() { @@ -7502,36 +7274,37 @@ public final class CanalPacket { } } /** - * optional string filter = 7; + * string filter = 7; */ public Builder setFilter( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + filter_ = value; onChanged(); return this; } /** - * optional string filter = 7; + * string filter = 7; */ public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000004); + filter_ = getDefaultInstance().getFilter(); onChanged(); return this; } /** - * optional string filter = 7; + * string filter = 7; */ public Builder setFilterBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + checkByteStringIsUtf8(value); + filter_ = value; onChanged(); return this; @@ -7539,7 +7312,7 @@ public final class CanalPacket { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -7562,7 +7335,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Unsub parsePartialFrom( @@ -7594,39 +7367,27 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; + * string destination = 1; */ java.lang.String getDestination(); /** - * optional string destination = 1; + * string destination = 1; */ com.google.protobuf.ByteString getDestinationBytes(); /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; + * string client_id = 2; */ java.lang.String getClientId(); /** - * optional string client_id = 2; + * string client_id = 2; */ com.google.protobuf.ByteString getClientIdBytes(); /** - * optional int32 fetch_size = 3; - */ - boolean hasFetchSize(); - /** - * optional int32 fetch_size = 3; + * int32 fetch_size = 3; */ int getFetchSize(); @@ -7635,15 +7396,7 @@ public final class CanalPacket { * 默认-1时代表不控制 * * - * optional int64 timeout = 4 [default = -1]; - */ - boolean hasTimeout(); - /** - *
-     * 默认-1时代表不控制
-     * 
- * - * optional int64 timeout = 4 [default = -1]; + * int64 timeout = 4; */ long getTimeout(); @@ -7652,15 +7405,7 @@ public final class CanalPacket { * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天 * * - * optional int32 unit = 5 [default = 2]; - */ - boolean hasUnit(); - /** - *
-     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-     * 
- * - * optional int32 unit = 5 [default = 2]; + * int32 unit = 5; */ int getUnit(); @@ -7669,17 +7414,15 @@ public final class CanalPacket { * 是否自动ack * * - * optional bool auto_ack = 6 [default = false]; - */ - boolean hasAutoAck(); - /** - *
-     * 是否自动ack
-     * 
- * - * optional bool auto_ack = 6 [default = false]; + * bool auto_ack = 6; */ boolean getAutoAck(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Get.TimeoutPresentCase getTimeoutPresentCase(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Get.UnitPresentCase getUnitPresentCase(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Get.AutoAckPresentCase getAutoAckPresentCase(); } /** *
@@ -7701,9 +7444,6 @@ public final class CanalPacket {
       destination_ = "";
       clientId_ = "";
       fetchSize_ = 0;
-      timeout_ = -1L;
-      unit_ = 2;
-      autoAck_ = false;
     }
 
     @java.lang.Override
@@ -7731,39 +7471,39 @@ public final class CanalPacket {
               done = true;
               break;
             case 10: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000001;
-              destination_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              destination_ = s;
               break;
             }
             case 18: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000002;
-              clientId_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              clientId_ = s;
               break;
             }
             case 24: {
-              bitField0_ |= 0x00000004;
+
               fetchSize_ = input.readInt32();
               break;
             }
             case 32: {
-              bitField0_ |= 0x00000008;
-              timeout_ = input.readInt64();
+              timeoutPresentCase_ = 4;
+              timeoutPresent_ = input.readInt64();
               break;
             }
             case 40: {
-              bitField0_ |= 0x00000010;
-              unit_ = input.readInt32();
+              unitPresentCase_ = 5;
+              unitPresent_ = input.readInt32();
               break;
             }
             case 48: {
-              bitField0_ |= 0x00000020;
-              autoAck_ = input.readBool();
+              autoAckPresentCase_ = 6;
+              autoAckPresent_ = input.readBool();
               break;
             }
             default: {
-              if (!parseUnknownField(
+              if (!parseUnknownFieldProto3(
                   input, unknownFields, extensionRegistry, tag)) {
                 done = true;
               }
@@ -7794,17 +7534,118 @@ public final class CanalPacket {
               com.alibaba.otter.canal.protocol.CanalPacket.Get.class, com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class);
     }
 
-    private int bitField0_;
+    private int timeoutPresentCase_ = 0;
+    private java.lang.Object timeoutPresent_;
+    public enum TimeoutPresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      TIMEOUT(4),
+      TIMEOUTPRESENT_NOT_SET(0);
+      private final int value;
+      private TimeoutPresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static TimeoutPresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static TimeoutPresentCase forNumber(int value) {
+        switch (value) {
+          case 4: return TIMEOUT;
+          case 0: return TIMEOUTPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public TimeoutPresentCase
+    getTimeoutPresentCase() {
+      return TimeoutPresentCase.forNumber(
+          timeoutPresentCase_);
+    }
+
+    private int unitPresentCase_ = 0;
+    private java.lang.Object unitPresent_;
+    public enum UnitPresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      UNIT(5),
+      UNITPRESENT_NOT_SET(0);
+      private final int value;
+      private UnitPresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static UnitPresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static UnitPresentCase forNumber(int value) {
+        switch (value) {
+          case 5: return UNIT;
+          case 0: return UNITPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public UnitPresentCase
+    getUnitPresentCase() {
+      return UnitPresentCase.forNumber(
+          unitPresentCase_);
+    }
+
+    private int autoAckPresentCase_ = 0;
+    private java.lang.Object autoAckPresent_;
+    public enum AutoAckPresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      AUTO_ACK(6),
+      AUTOACKPRESENT_NOT_SET(0);
+      private final int value;
+      private AutoAckPresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static AutoAckPresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static AutoAckPresentCase forNumber(int value) {
+        switch (value) {
+          case 6: return AUTO_ACK;
+          case 0: return AUTOACKPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public AutoAckPresentCase
+    getAutoAckPresentCase() {
+      return AutoAckPresentCase.forNumber(
+          autoAckPresentCase_);
+    }
+
     public static final int DESTINATION_FIELD_NUMBER = 1;
     private volatile java.lang.Object destination_;
     /**
-     * optional string destination = 1;
-     */
-    public boolean hasDestination() {
-      return ((bitField0_ & 0x00000001) == 0x00000001);
-    }
-    /**
-     * optional string destination = 1;
+     * string destination = 1;
      */
     public java.lang.String getDestination() {
       java.lang.Object ref = destination_;
@@ -7814,14 +7655,12 @@ public final class CanalPacket {
         com.google.protobuf.ByteString bs = 
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          destination_ = s;
-        }
+        destination_ = s;
         return s;
       }
     }
     /**
-     * optional string destination = 1;
+     * string destination = 1;
      */
     public com.google.protobuf.ByteString
         getDestinationBytes() {
@@ -7840,13 +7679,7 @@ public final class CanalPacket {
     public static final int CLIENT_ID_FIELD_NUMBER = 2;
     private volatile java.lang.Object clientId_;
     /**
-     * optional string client_id = 2;
-     */
-    public boolean hasClientId() {
-      return ((bitField0_ & 0x00000002) == 0x00000002);
-    }
-    /**
-     * optional string client_id = 2;
+     * string client_id = 2;
      */
     public java.lang.String getClientId() {
       java.lang.Object ref = clientId_;
@@ -7856,14 +7689,12 @@ public final class CanalPacket {
         com.google.protobuf.ByteString bs = 
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          clientId_ = s;
-        }
+        clientId_ = s;
         return s;
       }
     }
     /**
-     * optional string client_id = 2;
+     * string client_id = 2;
      */
     public com.google.protobuf.ByteString
         getClientIdBytes() {
@@ -7882,85 +7713,55 @@ public final class CanalPacket {
     public static final int FETCH_SIZE_FIELD_NUMBER = 3;
     private int fetchSize_;
     /**
-     * optional int32 fetch_size = 3;
-     */
-    public boolean hasFetchSize() {
-      return ((bitField0_ & 0x00000004) == 0x00000004);
-    }
-    /**
-     * optional int32 fetch_size = 3;
+     * int32 fetch_size = 3;
      */
     public int getFetchSize() {
       return fetchSize_;
     }
 
     public static final int TIMEOUT_FIELD_NUMBER = 4;
-    private long timeout_;
     /**
      * 
      * 默认-1时代表不控制
      * 
* - * optional int64 timeout = 4 [default = -1]; - */ - public boolean hasTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-     * 默认-1时代表不控制
-     * 
- * - * optional int64 timeout = 4 [default = -1]; + * int64 timeout = 4; */ public long getTimeout() { - return timeout_; + if (timeoutPresentCase_ == 4) { + return (java.lang.Long) timeoutPresent_; + } + return -1L; } public static final int UNIT_FIELD_NUMBER = 5; - private int unit_; /** *
      * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      * 
* - * optional int32 unit = 5 [default = 2]; - */ - public boolean hasUnit() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - *
-     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-     * 
- * - * optional int32 unit = 5 [default = 2]; + * int32 unit = 5; */ public int getUnit() { - return unit_; + if (unitPresentCase_ == 5) { + return (java.lang.Integer) unitPresent_; + } + return 2; } public static final int AUTO_ACK_FIELD_NUMBER = 6; - private boolean autoAck_; /** *
      * 是否自动ack
      * 
* - * optional bool auto_ack = 6 [default = false]; - */ - public boolean hasAutoAck() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - *
-     * 是否自动ack
-     * 
- * - * optional bool auto_ack = 6 [default = false]; + * bool auto_ack = 6; */ public boolean getAutoAck() { - return autoAck_; + if (autoAckPresentCase_ == 6) { + return (java.lang.Boolean) autoAckPresent_; + } + return false; } private byte memoizedIsInitialized = -1; @@ -7977,23 +7778,26 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getDestinationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getClientIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (fetchSize_ != 0) { output.writeInt32(3, fetchSize_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt64(4, timeout_); + if (timeoutPresentCase_ == 4) { + output.writeInt64( + 4, (long)((java.lang.Long) timeoutPresent_)); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(5, unit_); + if (unitPresentCase_ == 5) { + output.writeInt32( + 5, (int)((java.lang.Integer) unitPresent_)); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBool(6, autoAck_); + if (autoAckPresentCase_ == 6) { + output.writeBool( + 6, (boolean)((java.lang.Boolean) autoAckPresent_)); } unknownFields.writeTo(output); } @@ -8004,27 +7808,30 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (!getDestinationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (!getClientIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (fetchSize_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, fetchSize_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (timeoutPresentCase_ == 4) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, timeout_); + .computeInt64Size( + 4, (long)((java.lang.Long) timeoutPresent_)); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (unitPresentCase_ == 5) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, unit_); + .computeInt32Size( + 5, (int)((java.lang.Integer) unitPresent_)); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (autoAckPresentCase_ == 6) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, autoAck_); + .computeBoolSize( + 6, (boolean)((java.lang.Boolean) autoAckPresent_)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -8042,35 +7849,44 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Get other = (com.alibaba.otter.canal.protocol.CanalPacket.Get) obj; boolean result = true; - result = result && (hasDestination() == other.hasDestination()); - if (hasDestination()) { - result = result && getDestination() - .equals(other.getDestination()); + result = result && getDestination() + .equals(other.getDestination()); + result = result && getClientId() + .equals(other.getClientId()); + result = result && (getFetchSize() + == other.getFetchSize()); + result = result && getTimeoutPresentCase().equals( + other.getTimeoutPresentCase()); + if (!result) return false; + switch (timeoutPresentCase_) { + case 4: + result = result && (getTimeout() + == other.getTimeout()); + break; + case 0: + default: } - result = result && (hasClientId() == other.hasClientId()); - if (hasClientId()) { - result = result && getClientId() - .equals(other.getClientId()); + result = result && getUnitPresentCase().equals( + other.getUnitPresentCase()); + if (!result) return false; + switch (unitPresentCase_) { + case 5: + result = result && (getUnit() + == other.getUnit()); + break; + case 0: + default: } - result = result && (hasFetchSize() == other.hasFetchSize()); - if (hasFetchSize()) { - result = result && (getFetchSize() - == other.getFetchSize()); - } - result = result && (hasTimeout() == other.hasTimeout()); - if (hasTimeout()) { - result = result && (getTimeout() - == other.getTimeout()); - } - result = result && (hasUnit() == other.hasUnit()); - if (hasUnit()) { - result = result && (getUnit() - == other.getUnit()); - } - result = result && (hasAutoAck() == other.hasAutoAck()); - if (hasAutoAck()) { - result = result && (getAutoAck() - == other.getAutoAck()); + result = result && getAutoAckPresentCase().equals( + other.getAutoAckPresentCase()); + if (!result) return false; + switch (autoAckPresentCase_) { + case 6: + result = result && (getAutoAck() + == other.getAutoAck()); + break; + case 0: + default: } result = result && unknownFields.equals(other.unknownFields); return result; @@ -8083,31 +7899,37 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDestination()) { - hash = (37 * hash) + DESTINATION_FIELD_NUMBER; - hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getClientId().hashCode(); + hash = (37 * hash) + FETCH_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getFetchSize(); + switch (timeoutPresentCase_) { + case 4: + hash = (37 * hash) + TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimeout()); + break; + case 0: + default: } - if (hasClientId()) { - hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); + switch (unitPresentCase_) { + case 5: + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit(); + break; + case 0: + default: } - if (hasFetchSize()) { - hash = (37 * hash) + FETCH_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getFetchSize(); - } - if (hasTimeout()) { - hash = (37 * hash) + TIMEOUT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimeout()); - } - if (hasUnit()) { - hash = (37 * hash) + UNIT_FIELD_NUMBER; - hash = (53 * hash) + getUnit(); - } - if (hasAutoAck()) { - hash = (37 * hash) + AUTO_ACK_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAutoAck()); + switch (autoAckPresentCase_) { + case 6: + hash = (37 * hash) + AUTO_ACK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAutoAck()); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -8247,17 +8069,17 @@ public final class CanalPacket { public Builder clear() { super.clear(); destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); + fetchSize_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - timeout_ = -1L; - bitField0_ = (bitField0_ & ~0x00000008); - unit_ = 2; - bitField0_ = (bitField0_ & ~0x00000010); - autoAck_ = false; - bitField0_ = (bitField0_ & ~0x00000020); + + timeoutPresentCase_ = 0; + timeoutPresent_ = null; + unitPresentCase_ = 0; + unitPresent_ = null; + autoAckPresentCase_ = 0; + autoAckPresent_ = null; return this; } @@ -8284,33 +8106,21 @@ public final class CanalPacket { @java.lang.Override public com.alibaba.otter.canal.protocol.CanalPacket.Get buildPartial() { com.alibaba.otter.canal.protocol.CanalPacket.Get result = new com.alibaba.otter.canal.protocol.CanalPacket.Get(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } result.fetchSize_ = fetchSize_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; + if (timeoutPresentCase_ == 4) { + result.timeoutPresent_ = timeoutPresent_; } - result.timeout_ = timeout_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; + if (unitPresentCase_ == 5) { + result.unitPresent_ = unitPresent_; } - result.unit_ = unit_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; + if (autoAckPresentCase_ == 6) { + result.autoAckPresent_ = autoAckPresent_; } - result.autoAck_ = autoAck_; - result.bitField0_ = to_bitField0_; + result.timeoutPresentCase_ = timeoutPresentCase_; + result.unitPresentCase_ = unitPresentCase_; + result.autoAckPresentCase_ = autoAckPresentCase_; onBuilt(); return result; } @@ -8359,27 +8169,43 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Get other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; + if (!other.getDestination().isEmpty()) { destination_ = other.destination_; onChanged(); } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; + if (!other.getClientId().isEmpty()) { clientId_ = other.clientId_; onChanged(); } - if (other.hasFetchSize()) { + if (other.getFetchSize() != 0) { setFetchSize(other.getFetchSize()); } - if (other.hasTimeout()) { - setTimeout(other.getTimeout()); + switch (other.getTimeoutPresentCase()) { + case TIMEOUT: { + setTimeout(other.getTimeout()); + break; + } + case TIMEOUTPRESENT_NOT_SET: { + break; + } } - if (other.hasUnit()) { - setUnit(other.getUnit()); + switch (other.getUnitPresentCase()) { + case UNIT: { + setUnit(other.getUnit()); + break; + } + case UNITPRESENT_NOT_SET: { + break; + } } - if (other.hasAutoAck()) { - setAutoAck(other.getAutoAck()); + switch (other.getAutoAckPresentCase()) { + case AUTO_ACK: { + setAutoAck(other.getAutoAck()); + break; + } + case AUTOACKPRESENT_NOT_SET: { + break; + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -8409,17 +8235,55 @@ public final class CanalPacket { } return this; } - private int bitField0_; + private int timeoutPresentCase_ = 0; + private java.lang.Object timeoutPresent_; + public TimeoutPresentCase + getTimeoutPresentCase() { + return TimeoutPresentCase.forNumber( + timeoutPresentCase_); + } + + public Builder clearTimeoutPresent() { + timeoutPresentCase_ = 0; + timeoutPresent_ = null; + onChanged(); + return this; + } + + private int unitPresentCase_ = 0; + private java.lang.Object unitPresent_; + public UnitPresentCase + getUnitPresentCase() { + return UnitPresentCase.forNumber( + unitPresentCase_); + } + + public Builder clearUnitPresent() { + unitPresentCase_ = 0; + unitPresent_ = null; + onChanged(); + return this; + } + + private int autoAckPresentCase_ = 0; + private java.lang.Object autoAckPresent_; + public AutoAckPresentCase + getAutoAckPresentCase() { + return AutoAckPresentCase.forNumber( + autoAckPresentCase_); + } + + public Builder clearAutoAckPresent() { + autoAckPresentCase_ = 0; + autoAckPresent_ = null; + onChanged(); + return this; + } + private java.lang.Object destination_ = ""; /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; + * string destination = 1; */ public java.lang.String getDestination() { java.lang.Object ref = destination_; @@ -8427,16 +8291,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } + destination_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string destination = 1; + * string destination = 1; */ public com.google.protobuf.ByteString getDestinationBytes() { @@ -8452,36 +8314,37 @@ public final class CanalPacket { } } /** - * optional string destination = 1; + * string destination = 1; */ public Builder setDestination( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + destination_ = value; onChanged(); return this; } /** - * optional string destination = 1; + * string destination = 1; */ public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); onChanged(); return this; } /** - * optional string destination = 1; + * string destination = 1; */ public Builder setDestinationBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000001; + checkByteStringIsUtf8(value); + destination_ = value; onChanged(); return this; @@ -8489,13 +8352,7 @@ public final class CanalPacket { private java.lang.Object clientId_ = ""; /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; + * string client_id = 2; */ public java.lang.String getClientId() { java.lang.Object ref = clientId_; @@ -8503,16 +8360,14 @@ public final class CanalPacket { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } + clientId_ = s; return s; } else { return (java.lang.String) ref; } } /** - * optional string client_id = 2; + * string client_id = 2; */ public com.google.protobuf.ByteString getClientIdBytes() { @@ -8528,36 +8383,37 @@ public final class CanalPacket { } } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder setClientId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + clientId_ = value; onChanged(); return this; } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); onChanged(); return this; } /** - * optional string client_id = 2; + * string client_id = 2; */ public Builder setClientIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000002; + checkByteStringIsUtf8(value); + clientId_ = value; onChanged(); return this; @@ -8565,67 +8421,53 @@ public final class CanalPacket { private int fetchSize_ ; /** - * optional int32 fetch_size = 3; - */ - public boolean hasFetchSize() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 fetch_size = 3; + * int32 fetch_size = 3; */ public int getFetchSize() { return fetchSize_; } /** - * optional int32 fetch_size = 3; + * int32 fetch_size = 3; */ public Builder setFetchSize(int value) { - bitField0_ |= 0x00000004; + fetchSize_ = value; onChanged(); return this; } /** - * optional int32 fetch_size = 3; + * int32 fetch_size = 3; */ public Builder clearFetchSize() { - bitField0_ = (bitField0_ & ~0x00000004); + fetchSize_ = 0; onChanged(); return this; } - private long timeout_ = -1L; /** *
        * 默认-1时代表不控制
        * 
* - * optional int64 timeout = 4 [default = -1]; - */ - public boolean hasTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - *
-       * 默认-1时代表不控制
-       * 
- * - * optional int64 timeout = 4 [default = -1]; + * int64 timeout = 4; */ public long getTimeout() { - return timeout_; + if (timeoutPresentCase_ == 4) { + return (java.lang.Long) timeoutPresent_; + } + return 0L; } /** *
        * 默认-1时代表不控制
        * 
* - * optional int64 timeout = 4 [default = -1]; + * int64 timeout = 4; */ public Builder setTimeout(long value) { - bitField0_ |= 0x00000008; - timeout_ = value; + timeoutPresentCase_ = 4; + timeoutPresent_ = value; onChanged(); return this; } @@ -8634,46 +8476,40 @@ public final class CanalPacket { * 默认-1时代表不控制 *
* - * optional int64 timeout = 4 [default = -1]; + * int64 timeout = 4; */ public Builder clearTimeout() { - bitField0_ = (bitField0_ & ~0x00000008); - timeout_ = -1L; - onChanged(); + if (timeoutPresentCase_ == 4) { + timeoutPresentCase_ = 0; + timeoutPresent_ = null; + onChanged(); + } return this; } - private int unit_ = 2; /** *
        * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
        * 
* - * optional int32 unit = 5 [default = 2]; - */ - public boolean hasUnit() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - *
-       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-       * 
- * - * optional int32 unit = 5 [default = 2]; + * int32 unit = 5; */ public int getUnit() { - return unit_; + if (unitPresentCase_ == 5) { + return (java.lang.Integer) unitPresent_; + } + return 0; } /** *
        * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
        * 
* - * optional int32 unit = 5 [default = 2]; + * int32 unit = 5; */ public Builder setUnit(int value) { - bitField0_ |= 0x00000010; - unit_ = value; + unitPresentCase_ = 5; + unitPresent_ = value; onChanged(); return this; } @@ -8682,46 +8518,40 @@ public final class CanalPacket { * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天 * * - * optional int32 unit = 5 [default = 2]; + * int32 unit = 5; */ public Builder clearUnit() { - bitField0_ = (bitField0_ & ~0x00000010); - unit_ = 2; - onChanged(); + if (unitPresentCase_ == 5) { + unitPresentCase_ = 0; + unitPresent_ = null; + onChanged(); + } return this; } - private boolean autoAck_ ; /** *
        * 是否自动ack
        * 
* - * optional bool auto_ack = 6 [default = false]; - */ - public boolean hasAutoAck() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - *
-       * 是否自动ack
-       * 
- * - * optional bool auto_ack = 6 [default = false]; + * bool auto_ack = 6; */ public boolean getAutoAck() { - return autoAck_; + if (autoAckPresentCase_ == 6) { + return (java.lang.Boolean) autoAckPresent_; + } + return false; } /** *
        * 是否自动ack
        * 
* - * optional bool auto_ack = 6 [default = false]; + * bool auto_ack = 6; */ public Builder setAutoAck(boolean value) { - bitField0_ |= 0x00000020; - autoAck_ = value; + autoAckPresentCase_ = 6; + autoAckPresent_ = value; onChanged(); return this; } @@ -8730,18 +8560,20 @@ public final class CanalPacket { * 是否自动ack * * - * optional bool auto_ack = 6 [default = false]; + * bool auto_ack = 6; */ public Builder clearAutoAck() { - bitField0_ = (bitField0_ & ~0x00000020); - autoAck_ = false; - onChanged(); + if (autoAckPresentCase_ == 6) { + autoAckPresentCase_ = 0; + autoAckPresent_ = null; + onChanged(); + } return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -8764,7 +8596,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Get parsePartialFrom( @@ -8796,11 +8628,7 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional int64 batch_id = 1; - */ - boolean hasBatchId(); - /** - * optional int64 batch_id = 1; + * int64 batch_id = 1; */ long getBatchId(); @@ -8862,7 +8690,7 @@ public final class CanalPacket { done = true; break; case 8: { - bitField0_ |= 0x00000001; + batchId_ = input.readInt64(); break; } @@ -8875,7 +8703,7 @@ public final class CanalPacket { break; } default: { - if (!parseUnknownField( + if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } @@ -8913,13 +8741,7 @@ public final class CanalPacket { public static final int BATCH_ID_FIELD_NUMBER = 1; private long batchId_; /** - * optional int64 batch_id = 1; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 batch_id = 1; + * int64 batch_id = 1; */ public long getBatchId() { return batchId_; @@ -8961,7 +8783,7 @@ public final class CanalPacket { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (batchId_ != 0L) { output.writeInt64(1, batchId_); } for (int i = 0; i < messages_.size(); i++) { @@ -8976,7 +8798,7 @@ public final class CanalPacket { if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (batchId_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, batchId_); } @@ -9005,11 +8827,8 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Messages other = (com.alibaba.otter.canal.protocol.CanalPacket.Messages) obj; boolean result = true; - result = result && (hasBatchId() == other.hasBatchId()); - if (hasBatchId()) { - result = result && (getBatchId() - == other.getBatchId()); - } + result = result && (getBatchId() + == other.getBatchId()); result = result && getMessagesList() .equals(other.getMessagesList()); result = result && unknownFields.equals(other.unknownFields); @@ -9023,11 +8842,9 @@ public final class CanalPacket { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasBatchId()) { - hash = (37 * hash) + BATCH_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBatchId()); - } + hash = (37 * hash) + BATCH_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBatchId()); if (getMessagesCount() > 0) { hash = (37 * hash) + MESSAGES_FIELD_NUMBER; hash = (53 * hash) + getMessagesList().hashCode(); @@ -9169,7 +8986,7 @@ public final class CanalPacket { public Builder clear() { super.clear(); batchId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); + messages_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); return this; @@ -9200,9 +9017,6 @@ public final class CanalPacket { com.alibaba.otter.canal.protocol.CanalPacket.Messages result = new com.alibaba.otter.canal.protocol.CanalPacket.Messages(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } result.batchId_ = batchId_; if (((bitField0_ & 0x00000002) == 0x00000002)) { messages_ = java.util.Collections.unmodifiableList(messages_); @@ -9258,7 +9072,7 @@ public final class CanalPacket { public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Messages other) { if (other == com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance()) return this; - if (other.hasBatchId()) { + if (other.getBatchId() != 0L) { setBatchId(other.getBatchId()); } if (!other.messages_.isEmpty()) { @@ -9303,31 +9117,25 @@ public final class CanalPacket { private long batchId_ ; /** - * optional int64 batch_id = 1; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 batch_id = 1; + * int64 batch_id = 1; */ public long getBatchId() { return batchId_; } /** - * optional int64 batch_id = 1; + * int64 batch_id = 1; */ public Builder setBatchId(long value) { - bitField0_ |= 0x00000001; + batchId_ = value; onChanged(); return this; } /** - * optional int64 batch_id = 1; + * int64 batch_id = 1; */ public Builder clearBatchId() { - bitField0_ = (bitField0_ & ~0x00000001); + batchId_ = 0L; onChanged(); return this; @@ -9407,7 +9215,7 @@ public final class CanalPacket { @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return super.setUnknownFieldsProto3(unknownFields); } @java.lang.Override @@ -9430,7 +9238,7 @@ public final class CanalPacket { return DEFAULT_INSTANCE; } - @java.lang.Deprecated public static final com.google.protobuf.Parser + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Messages parsePartialFrom( @@ -9462,36 +9270,26 @@ public final class CanalPacket { com.google.protobuf.MessageOrBuilder { /** - * optional string journal = 1; - */ - boolean hasJournal(); - /** - * optional string journal = 1; + * string journal = 1; */ java.lang.String getJournal(); /** - * optional string journal = 1; + * string journal = 1; */ com.google.protobuf.ByteString getJournalBytes(); /** - * optional int64 position = 2; - */ - boolean hasPosition(); - /** - * optional int64 position = 2; + * int64 position = 2; */ long getPosition(); /** - * optional int64 timestamp = 3 [default = 0]; - */ - boolean hasTimestamp(); - /** - * optional int64 timestamp = 3 [default = 0]; + * int64 timestamp = 3; */ long getTimestamp(); + + public com.alibaba.otter.canal.protocol.CanalPacket.Dump.TimestampPresentCase getTimestampPresentCase(); } /** *
@@ -9512,7 +9310,6 @@ public final class CanalPacket {
     private Dump() {
       journal_ = "";
       position_ = 0L;
-      timestamp_ = 0L;
     }
 
     @java.lang.Override
@@ -9540,23 +9337,23 @@ public final class CanalPacket {
               done = true;
               break;
             case 10: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000001;
-              journal_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              journal_ = s;
               break;
             }
             case 16: {
-              bitField0_ |= 0x00000002;
+
               position_ = input.readInt64();
               break;
             }
             case 24: {
-              bitField0_ |= 0x00000004;
-              timestamp_ = input.readInt64();
+              timestampPresentCase_ = 3;
+              timestampPresent_ = input.readInt64();
               break;
             }
             default: {
-              if (!parseUnknownField(
+              if (!parseUnknownFieldProto3(
                   input, unknownFields, extensionRegistry, tag)) {
                 done = true;
               }
@@ -9587,17 +9384,46 @@ public final class CanalPacket {
               com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class);
     }
 
-    private int bitField0_;
+    private int timestampPresentCase_ = 0;
+    private java.lang.Object timestampPresent_;
+    public enum TimestampPresentCase
+        implements com.google.protobuf.Internal.EnumLite {
+      TIMESTAMP(3),
+      TIMESTAMPPRESENT_NOT_SET(0);
+      private final int value;
+      private TimestampPresentCase(int value) {
+        this.value = value;
+      }
+      /**
+       * @deprecated Use {@link #forNumber(int)} instead.
+       */
+      @java.lang.Deprecated
+      public static TimestampPresentCase valueOf(int value) {
+        return forNumber(value);
+      }
+
+      public static TimestampPresentCase forNumber(int value) {
+        switch (value) {
+          case 3: return TIMESTAMP;
+          case 0: return TIMESTAMPPRESENT_NOT_SET;
+          default: return null;
+        }
+      }
+      public int getNumber() {
+        return this.value;
+      }
+    };
+
+    public TimestampPresentCase
+    getTimestampPresentCase() {
+      return TimestampPresentCase.forNumber(
+          timestampPresentCase_);
+    }
+
     public static final int JOURNAL_FIELD_NUMBER = 1;
     private volatile java.lang.Object journal_;
     /**
-     * optional string journal = 1;
-     */
-    public boolean hasJournal() {
-      return ((bitField0_ & 0x00000001) == 0x00000001);
-    }
-    /**
-     * optional string journal = 1;
+     * string journal = 1;
      */
     public java.lang.String getJournal() {
       java.lang.Object ref = journal_;
@@ -9607,14 +9433,12 @@ public final class CanalPacket {
         com.google.protobuf.ByteString bs = 
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          journal_ = s;
-        }
+        journal_ = s;
         return s;
       }
     }
     /**
-     * optional string journal = 1;
+     * string journal = 1;
      */
     public com.google.protobuf.ByteString
         getJournalBytes() {
@@ -9633,31 +9457,21 @@ public final class CanalPacket {
     public static final int POSITION_FIELD_NUMBER = 2;
     private long position_;
     /**
-     * optional int64 position = 2;
-     */
-    public boolean hasPosition() {
-      return ((bitField0_ & 0x00000002) == 0x00000002);
-    }
-    /**
-     * optional int64 position = 2;
+     * int64 position = 2;
      */
     public long getPosition() {
       return position_;
     }
 
     public static final int TIMESTAMP_FIELD_NUMBER = 3;
-    private long timestamp_;
     /**
-     * optional int64 timestamp = 3 [default = 0];
-     */
-    public boolean hasTimestamp() {
-      return ((bitField0_ & 0x00000004) == 0x00000004);
-    }
-    /**
-     * optional int64 timestamp = 3 [default = 0];
+     * int64 timestamp = 3;
      */
     public long getTimestamp() {
-      return timestamp_;
+      if (timestampPresentCase_ == 3) {
+        return (java.lang.Long) timestampPresent_;
+      }
+      return 0L;
     }
 
     private byte memoizedIsInitialized = -1;
@@ -9674,14 +9488,15 @@ public final class CanalPacket {
     @java.lang.Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+      if (!getJournalBytes().isEmpty()) {
         com.google.protobuf.GeneratedMessageV3.writeString(output, 1, journal_);
       }
-      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+      if (position_ != 0L) {
         output.writeInt64(2, position_);
       }
-      if (((bitField0_ & 0x00000004) == 0x00000004)) {
-        output.writeInt64(3, timestamp_);
+      if (timestampPresentCase_ == 3) {
+        output.writeInt64(
+            3, (long)((java.lang.Long) timestampPresent_));
       }
       unknownFields.writeTo(output);
     }
@@ -9692,16 +9507,17 @@ public final class CanalPacket {
       if (size != -1) return size;
 
       size = 0;
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+      if (!getJournalBytes().isEmpty()) {
         size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, journal_);
       }
-      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+      if (position_ != 0L) {
         size += com.google.protobuf.CodedOutputStream
           .computeInt64Size(2, position_);
       }
-      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+      if (timestampPresentCase_ == 3) {
         size += com.google.protobuf.CodedOutputStream
-          .computeInt64Size(3, timestamp_);
+          .computeInt64Size(
+              3, (long)((java.lang.Long) timestampPresent_));
       }
       size += unknownFields.getSerializedSize();
       memoizedSize = size;
@@ -9719,20 +9535,20 @@ public final class CanalPacket {
       com.alibaba.otter.canal.protocol.CanalPacket.Dump other = (com.alibaba.otter.canal.protocol.CanalPacket.Dump) obj;
 
       boolean result = true;
-      result = result && (hasJournal() == other.hasJournal());
-      if (hasJournal()) {
-        result = result && getJournal()
-            .equals(other.getJournal());
-      }
-      result = result && (hasPosition() == other.hasPosition());
-      if (hasPosition()) {
-        result = result && (getPosition()
-            == other.getPosition());
-      }
-      result = result && (hasTimestamp() == other.hasTimestamp());
-      if (hasTimestamp()) {
-        result = result && (getTimestamp()
-            == other.getTimestamp());
+      result = result && getJournal()
+          .equals(other.getJournal());
+      result = result && (getPosition()
+          == other.getPosition());
+      result = result && getTimestampPresentCase().equals(
+          other.getTimestampPresentCase());
+      if (!result) return false;
+      switch (timestampPresentCase_) {
+        case 3:
+          result = result && (getTimestamp()
+              == other.getTimestamp());
+          break;
+        case 0:
+        default:
       }
       result = result && unknownFields.equals(other.unknownFields);
       return result;
@@ -9745,19 +9561,19 @@ public final class CanalPacket {
       }
       int hash = 41;
       hash = (19 * hash) + getDescriptor().hashCode();
-      if (hasJournal()) {
-        hash = (37 * hash) + JOURNAL_FIELD_NUMBER;
-        hash = (53 * hash) + getJournal().hashCode();
-      }
-      if (hasPosition()) {
-        hash = (37 * hash) + POSITION_FIELD_NUMBER;
-        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
-            getPosition());
-      }
-      if (hasTimestamp()) {
-        hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
-        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
-            getTimestamp());
+      hash = (37 * hash) + JOURNAL_FIELD_NUMBER;
+      hash = (53 * hash) + getJournal().hashCode();
+      hash = (37 * hash) + POSITION_FIELD_NUMBER;
+      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+          getPosition());
+      switch (timestampPresentCase_) {
+        case 3:
+          hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
+          hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+              getTimestamp());
+          break;
+        case 0:
+        default:
       }
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
@@ -9897,11 +9713,11 @@ public final class CanalPacket {
       public Builder clear() {
         super.clear();
         journal_ = "";
-        bitField0_ = (bitField0_ & ~0x00000001);
+
         position_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000002);
-        timestamp_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000004);
+
+        timestampPresentCase_ = 0;
+        timestampPresent_ = null;
         return this;
       }
 
@@ -9928,21 +9744,12 @@ public final class CanalPacket {
       @java.lang.Override
       public com.alibaba.otter.canal.protocol.CanalPacket.Dump buildPartial() {
         com.alibaba.otter.canal.protocol.CanalPacket.Dump result = new com.alibaba.otter.canal.protocol.CanalPacket.Dump(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
         result.journal_ = journal_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000002;
-        }
         result.position_ = position_;
-        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
-          to_bitField0_ |= 0x00000004;
+        if (timestampPresentCase_ == 3) {
+          result.timestampPresent_ = timestampPresent_;
         }
-        result.timestamp_ = timestamp_;
-        result.bitField0_ = to_bitField0_;
+        result.timestampPresentCase_ = timestampPresentCase_;
         onBuilt();
         return result;
       }
@@ -9991,16 +9798,21 @@ public final class CanalPacket {
 
       public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Dump other) {
         if (other == com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance()) return this;
-        if (other.hasJournal()) {
-          bitField0_ |= 0x00000001;
+        if (!other.getJournal().isEmpty()) {
           journal_ = other.journal_;
           onChanged();
         }
-        if (other.hasPosition()) {
+        if (other.getPosition() != 0L) {
           setPosition(other.getPosition());
         }
-        if (other.hasTimestamp()) {
-          setTimestamp(other.getTimestamp());
+        switch (other.getTimestampPresentCase()) {
+          case TIMESTAMP: {
+            setTimestamp(other.getTimestamp());
+            break;
+          }
+          case TIMESTAMPPRESENT_NOT_SET: {
+            break;
+          }
         }
         this.mergeUnknownFields(other.unknownFields);
         onChanged();
@@ -10030,17 +9842,25 @@ public final class CanalPacket {
         }
         return this;
       }
-      private int bitField0_;
+      private int timestampPresentCase_ = 0;
+      private java.lang.Object timestampPresent_;
+      public TimestampPresentCase
+          getTimestampPresentCase() {
+        return TimestampPresentCase.forNumber(
+            timestampPresentCase_);
+      }
+
+      public Builder clearTimestampPresent() {
+        timestampPresentCase_ = 0;
+        timestampPresent_ = null;
+        onChanged();
+        return this;
+      }
+
 
       private java.lang.Object journal_ = "";
       /**
-       * optional string journal = 1;
-       */
-      public boolean hasJournal() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
-      }
-      /**
-       * optional string journal = 1;
+       * string journal = 1;
        */
       public java.lang.String getJournal() {
         java.lang.Object ref = journal_;
@@ -10048,16 +9868,14 @@ public final class CanalPacket {
           com.google.protobuf.ByteString bs =
               (com.google.protobuf.ByteString) ref;
           java.lang.String s = bs.toStringUtf8();
-          if (bs.isValidUtf8()) {
-            journal_ = s;
-          }
+          journal_ = s;
           return s;
         } else {
           return (java.lang.String) ref;
         }
       }
       /**
-       * optional string journal = 1;
+       * string journal = 1;
        */
       public com.google.protobuf.ByteString
           getJournalBytes() {
@@ -10073,36 +9891,37 @@ public final class CanalPacket {
         }
       }
       /**
-       * optional string journal = 1;
+       * string journal = 1;
        */
       public Builder setJournal(
           java.lang.String value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000001;
+  
         journal_ = value;
         onChanged();
         return this;
       }
       /**
-       * optional string journal = 1;
+       * string journal = 1;
        */
       public Builder clearJournal() {
-        bitField0_ = (bitField0_ & ~0x00000001);
+        
         journal_ = getDefaultInstance().getJournal();
         onChanged();
         return this;
       }
       /**
-       * optional string journal = 1;
+       * string journal = 1;
        */
       public Builder setJournalBytes(
           com.google.protobuf.ByteString value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000001;
+  checkByteStringIsUtf8(value);
+        
         journal_ = value;
         onChanged();
         return this;
@@ -10110,71 +9929,63 @@ public final class CanalPacket {
 
       private long position_ ;
       /**
-       * optional int64 position = 2;
-       */
-      public boolean hasPosition() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
-      }
-      /**
-       * optional int64 position = 2;
+       * int64 position = 2;
        */
       public long getPosition() {
         return position_;
       }
       /**
-       * optional int64 position = 2;
+       * int64 position = 2;
        */
       public Builder setPosition(long value) {
-        bitField0_ |= 0x00000002;
+        
         position_ = value;
         onChanged();
         return this;
       }
       /**
-       * optional int64 position = 2;
+       * int64 position = 2;
        */
       public Builder clearPosition() {
-        bitField0_ = (bitField0_ & ~0x00000002);
+        
         position_ = 0L;
         onChanged();
         return this;
       }
 
-      private long timestamp_ ;
       /**
-       * optional int64 timestamp = 3 [default = 0];
-       */
-      public boolean hasTimestamp() {
-        return ((bitField0_ & 0x00000004) == 0x00000004);
-      }
-      /**
-       * optional int64 timestamp = 3 [default = 0];
+       * int64 timestamp = 3;
        */
       public long getTimestamp() {
-        return timestamp_;
+        if (timestampPresentCase_ == 3) {
+          return (java.lang.Long) timestampPresent_;
+        }
+        return 0L;
       }
       /**
-       * optional int64 timestamp = 3 [default = 0];
+       * int64 timestamp = 3;
        */
       public Builder setTimestamp(long value) {
-        bitField0_ |= 0x00000004;
-        timestamp_ = value;
+        timestampPresentCase_ = 3;
+        timestampPresent_ = value;
         onChanged();
         return this;
       }
       /**
-       * optional int64 timestamp = 3 [default = 0];
+       * int64 timestamp = 3;
        */
       public Builder clearTimestamp() {
-        bitField0_ = (bitField0_ & ~0x00000004);
-        timestamp_ = 0L;
-        onChanged();
+        if (timestampPresentCase_ == 3) {
+          timestampPresentCase_ = 0;
+          timestampPresent_ = null;
+          onChanged();
+        }
         return this;
       }
       @java.lang.Override
       public final Builder setUnknownFields(
           final com.google.protobuf.UnknownFieldSet unknownFields) {
-        return super.setUnknownFields(unknownFields);
+        return super.setUnknownFieldsProto3(unknownFields);
       }
 
       @java.lang.Override
@@ -10197,7 +10008,7 @@ public final class CanalPacket {
       return DEFAULT_INSTANCE;
     }
 
-    @java.lang.Deprecated public static final com.google.protobuf.Parser
+    private static final com.google.protobuf.Parser
         PARSER = new com.google.protobuf.AbstractParser() {
       @java.lang.Override
       public Dump parsePartialFrom(
@@ -10229,39 +10040,27 @@ public final class CanalPacket {
       com.google.protobuf.MessageOrBuilder {
 
     /**
-     * optional string destination = 1;
-     */
-    boolean hasDestination();
-    /**
-     * optional string destination = 1;
+     * string destination = 1;
      */
     java.lang.String getDestination();
     /**
-     * optional string destination = 1;
+     * string destination = 1;
      */
     com.google.protobuf.ByteString
         getDestinationBytes();
 
     /**
-     * optional string client_id = 2;
-     */
-    boolean hasClientId();
-    /**
-     * optional string client_id = 2;
+     * string client_id = 2;
      */
     java.lang.String getClientId();
     /**
-     * optional string client_id = 2;
+     * string client_id = 2;
      */
     com.google.protobuf.ByteString
         getClientIdBytes();
 
     /**
-     * optional int64 batch_id = 3;
-     */
-    boolean hasBatchId();
-    /**
-     * optional int64 batch_id = 3;
+     * int64 batch_id = 3;
      */
     long getBatchId();
   }
@@ -10308,24 +10107,24 @@ public final class CanalPacket {
               done = true;
               break;
             case 10: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000001;
-              destination_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              destination_ = s;
               break;
             }
             case 18: {
-              com.google.protobuf.ByteString bs = input.readBytes();
-              bitField0_ |= 0x00000002;
-              clientId_ = bs;
+              java.lang.String s = input.readStringRequireUtf8();
+
+              clientId_ = s;
               break;
             }
             case 24: {
-              bitField0_ |= 0x00000004;
+
               batchId_ = input.readInt64();
               break;
             }
             default: {
-              if (!parseUnknownField(
+              if (!parseUnknownFieldProto3(
                   input, unknownFields, extensionRegistry, tag)) {
                 done = true;
               }
@@ -10356,17 +10155,10 @@ public final class CanalPacket {
               com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class);
     }
 
-    private int bitField0_;
     public static final int DESTINATION_FIELD_NUMBER = 1;
     private volatile java.lang.Object destination_;
     /**
-     * optional string destination = 1;
-     */
-    public boolean hasDestination() {
-      return ((bitField0_ & 0x00000001) == 0x00000001);
-    }
-    /**
-     * optional string destination = 1;
+     * string destination = 1;
      */
     public java.lang.String getDestination() {
       java.lang.Object ref = destination_;
@@ -10376,14 +10168,12 @@ public final class CanalPacket {
         com.google.protobuf.ByteString bs = 
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          destination_ = s;
-        }
+        destination_ = s;
         return s;
       }
     }
     /**
-     * optional string destination = 1;
+     * string destination = 1;
      */
     public com.google.protobuf.ByteString
         getDestinationBytes() {
@@ -10402,13 +10192,7 @@ public final class CanalPacket {
     public static final int CLIENT_ID_FIELD_NUMBER = 2;
     private volatile java.lang.Object clientId_;
     /**
-     * optional string client_id = 2;
-     */
-    public boolean hasClientId() {
-      return ((bitField0_ & 0x00000002) == 0x00000002);
-    }
-    /**
-     * optional string client_id = 2;
+     * string client_id = 2;
      */
     public java.lang.String getClientId() {
       java.lang.Object ref = clientId_;
@@ -10418,14 +10202,12 @@ public final class CanalPacket {
         com.google.protobuf.ByteString bs = 
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
-        if (bs.isValidUtf8()) {
-          clientId_ = s;
-        }
+        clientId_ = s;
         return s;
       }
     }
     /**
-     * optional string client_id = 2;
+     * string client_id = 2;
      */
     public com.google.protobuf.ByteString
         getClientIdBytes() {
@@ -10444,13 +10226,7 @@ public final class CanalPacket {
     public static final int BATCH_ID_FIELD_NUMBER = 3;
     private long batchId_;
     /**
-     * optional int64 batch_id = 3;
-     */
-    public boolean hasBatchId() {
-      return ((bitField0_ & 0x00000004) == 0x00000004);
-    }
-    /**
-     * optional int64 batch_id = 3;
+     * int64 batch_id = 3;
      */
     public long getBatchId() {
       return batchId_;
@@ -10470,13 +10246,13 @@ public final class CanalPacket {
     @java.lang.Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+      if (!getDestinationBytes().isEmpty()) {
         com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_);
       }
-      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+      if (!getClientIdBytes().isEmpty()) {
         com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_);
       }
-      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+      if (batchId_ != 0L) {
         output.writeInt64(3, batchId_);
       }
       unknownFields.writeTo(output);
@@ -10488,13 +10264,13 @@ public final class CanalPacket {
       if (size != -1) return size;
 
       size = 0;
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
+      if (!getDestinationBytes().isEmpty()) {
         size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_);
       }
-      if (((bitField0_ & 0x00000002) == 0x00000002)) {
+      if (!getClientIdBytes().isEmpty()) {
         size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_);
       }
-      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+      if (batchId_ != 0L) {
         size += com.google.protobuf.CodedOutputStream
           .computeInt64Size(3, batchId_);
       }
@@ -10514,21 +10290,12 @@ public final class CanalPacket {
       com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback other = (com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) obj;
 
       boolean result = true;
-      result = result && (hasDestination() == other.hasDestination());
-      if (hasDestination()) {
-        result = result && getDestination()
-            .equals(other.getDestination());
-      }
-      result = result && (hasClientId() == other.hasClientId());
-      if (hasClientId()) {
-        result = result && getClientId()
-            .equals(other.getClientId());
-      }
-      result = result && (hasBatchId() == other.hasBatchId());
-      if (hasBatchId()) {
-        result = result && (getBatchId()
-            == other.getBatchId());
-      }
+      result = result && getDestination()
+          .equals(other.getDestination());
+      result = result && getClientId()
+          .equals(other.getClientId());
+      result = result && (getBatchId()
+          == other.getBatchId());
       result = result && unknownFields.equals(other.unknownFields);
       return result;
     }
@@ -10540,19 +10307,13 @@ public final class CanalPacket {
       }
       int hash = 41;
       hash = (19 * hash) + getDescriptor().hashCode();
-      if (hasDestination()) {
-        hash = (37 * hash) + DESTINATION_FIELD_NUMBER;
-        hash = (53 * hash) + getDestination().hashCode();
-      }
-      if (hasClientId()) {
-        hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER;
-        hash = (53 * hash) + getClientId().hashCode();
-      }
-      if (hasBatchId()) {
-        hash = (37 * hash) + BATCH_ID_FIELD_NUMBER;
-        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
-            getBatchId());
-      }
+      hash = (37 * hash) + DESTINATION_FIELD_NUMBER;
+      hash = (53 * hash) + getDestination().hashCode();
+      hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER;
+      hash = (53 * hash) + getClientId().hashCode();
+      hash = (37 * hash) + BATCH_ID_FIELD_NUMBER;
+      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+          getBatchId());
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
       return hash;
@@ -10687,11 +10448,11 @@ public final class CanalPacket {
       public Builder clear() {
         super.clear();
         destination_ = "";
-        bitField0_ = (bitField0_ & ~0x00000001);
+
         clientId_ = "";
-        bitField0_ = (bitField0_ & ~0x00000002);
+
         batchId_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000004);
+
         return this;
       }
 
@@ -10718,21 +10479,9 @@ public final class CanalPacket {
       @java.lang.Override
       public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback buildPartial() {
         com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
         result.destination_ = destination_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000002;
-        }
         result.clientId_ = clientId_;
-        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
-          to_bitField0_ |= 0x00000004;
-        }
         result.batchId_ = batchId_;
-        result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
       }
@@ -10781,17 +10530,15 @@ public final class CanalPacket {
 
       public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback other) {
         if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance()) return this;
-        if (other.hasDestination()) {
-          bitField0_ |= 0x00000001;
+        if (!other.getDestination().isEmpty()) {
           destination_ = other.destination_;
           onChanged();
         }
-        if (other.hasClientId()) {
-          bitField0_ |= 0x00000002;
+        if (!other.getClientId().isEmpty()) {
           clientId_ = other.clientId_;
           onChanged();
         }
-        if (other.hasBatchId()) {
+        if (other.getBatchId() != 0L) {
           setBatchId(other.getBatchId());
         }
         this.mergeUnknownFields(other.unknownFields);
@@ -10822,17 +10569,10 @@ public final class CanalPacket {
         }
         return this;
       }
-      private int bitField0_;
 
       private java.lang.Object destination_ = "";
       /**
-       * optional string destination = 1;
-       */
-      public boolean hasDestination() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
-      }
-      /**
-       * optional string destination = 1;
+       * string destination = 1;
        */
       public java.lang.String getDestination() {
         java.lang.Object ref = destination_;
@@ -10840,16 +10580,14 @@ public final class CanalPacket {
           com.google.protobuf.ByteString bs =
               (com.google.protobuf.ByteString) ref;
           java.lang.String s = bs.toStringUtf8();
-          if (bs.isValidUtf8()) {
-            destination_ = s;
-          }
+          destination_ = s;
           return s;
         } else {
           return (java.lang.String) ref;
         }
       }
       /**
-       * optional string destination = 1;
+       * string destination = 1;
        */
       public com.google.protobuf.ByteString
           getDestinationBytes() {
@@ -10865,36 +10603,37 @@ public final class CanalPacket {
         }
       }
       /**
-       * optional string destination = 1;
+       * string destination = 1;
        */
       public Builder setDestination(
           java.lang.String value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000001;
+  
         destination_ = value;
         onChanged();
         return this;
       }
       /**
-       * optional string destination = 1;
+       * string destination = 1;
        */
       public Builder clearDestination() {
-        bitField0_ = (bitField0_ & ~0x00000001);
+        
         destination_ = getDefaultInstance().getDestination();
         onChanged();
         return this;
       }
       /**
-       * optional string destination = 1;
+       * string destination = 1;
        */
       public Builder setDestinationBytes(
           com.google.protobuf.ByteString value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000001;
+  checkByteStringIsUtf8(value);
+        
         destination_ = value;
         onChanged();
         return this;
@@ -10902,13 +10641,7 @@ public final class CanalPacket {
 
       private java.lang.Object clientId_ = "";
       /**
-       * optional string client_id = 2;
-       */
-      public boolean hasClientId() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
-      }
-      /**
-       * optional string client_id = 2;
+       * string client_id = 2;
        */
       public java.lang.String getClientId() {
         java.lang.Object ref = clientId_;
@@ -10916,16 +10649,14 @@ public final class CanalPacket {
           com.google.protobuf.ByteString bs =
               (com.google.protobuf.ByteString) ref;
           java.lang.String s = bs.toStringUtf8();
-          if (bs.isValidUtf8()) {
-            clientId_ = s;
-          }
+          clientId_ = s;
           return s;
         } else {
           return (java.lang.String) ref;
         }
       }
       /**
-       * optional string client_id = 2;
+       * string client_id = 2;
        */
       public com.google.protobuf.ByteString
           getClientIdBytes() {
@@ -10941,36 +10672,37 @@ public final class CanalPacket {
         }
       }
       /**
-       * optional string client_id = 2;
+       * string client_id = 2;
        */
       public Builder setClientId(
           java.lang.String value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000002;
+  
         clientId_ = value;
         onChanged();
         return this;
       }
       /**
-       * optional string client_id = 2;
+       * string client_id = 2;
        */
       public Builder clearClientId() {
-        bitField0_ = (bitField0_ & ~0x00000002);
+        
         clientId_ = getDefaultInstance().getClientId();
         onChanged();
         return this;
       }
       /**
-       * optional string client_id = 2;
+       * string client_id = 2;
        */
       public Builder setClientIdBytes(
           com.google.protobuf.ByteString value) {
         if (value == null) {
     throw new NullPointerException();
   }
-  bitField0_ |= 0x00000002;
+  checkByteStringIsUtf8(value);
+        
         clientId_ = value;
         onChanged();
         return this;
@@ -10978,31 +10710,25 @@ public final class CanalPacket {
 
       private long batchId_ ;
       /**
-       * optional int64 batch_id = 3;
-       */
-      public boolean hasBatchId() {
-        return ((bitField0_ & 0x00000004) == 0x00000004);
-      }
-      /**
-       * optional int64 batch_id = 3;
+       * int64 batch_id = 3;
        */
       public long getBatchId() {
         return batchId_;
       }
       /**
-       * optional int64 batch_id = 3;
+       * int64 batch_id = 3;
        */
       public Builder setBatchId(long value) {
-        bitField0_ |= 0x00000004;
+        
         batchId_ = value;
         onChanged();
         return this;
       }
       /**
-       * optional int64 batch_id = 3;
+       * int64 batch_id = 3;
        */
       public Builder clearBatchId() {
-        bitField0_ = (bitField0_ & ~0x00000004);
+        
         batchId_ = 0L;
         onChanged();
         return this;
@@ -11010,7 +10736,7 @@ public final class CanalPacket {
       @java.lang.Override
       public final Builder setUnknownFields(
           final com.google.protobuf.UnknownFieldSet unknownFields) {
-        return super.setUnknownFields(unknownFields);
+        return super.setUnknownFieldsProto3(unknownFields);
       }
 
       @java.lang.Override
@@ -11033,7 +10759,7 @@ public final class CanalPacket {
       return DEFAULT_INSTANCE;
     }
 
-    @java.lang.Deprecated public static final com.google.protobuf.Parser
+    private static final com.google.protobuf.Parser
         PARSER = new com.google.protobuf.AbstractParser() {
       @java.lang.Override
       public ClientRollback parsePartialFrom(
@@ -11130,44 +10856,52 @@ public final class CanalPacket {
   static {
     java.lang.String[] descriptorData = {
       "\n\023CanalProtocol.proto\022 com.alibaba.otter" +
-      ".canal.protocol\"\312\001\n\006Packet\022\030\n\014magic_numb" +
-      "er\030\001 \001(\005:\00217\022\022\n\007version\030\002 \001(\005:\0011\022:\n\004type" +
-      "\030\003 \001(\0162,.com.alibaba.otter.canal.protoco" +
-      "l.PacketType\022H\n\013compression\030\004 \001(\0162-.com." +
-      "alibaba.otter.canal.protocol.Compression" +
-      ":\004NONE\022\014\n\004body\030\005 \001(\014\"<\n\tHeartBeat\022\026\n\016sen" +
-      "d_timestamp\030\001 \001(\003\022\027\n\017start_timestamp\030\002 \001" +
-      "(\003\"\217\001\n\tHandshake\022$\n\026communication_encodi" +
-      "ng\030\001 \001(\t:\004utf8\022\r\n\005seeds\030\002 \001(\014\022M\n\026support" +
-      "ed_compressions\030\003 \003(\0162-.com.alibaba.otte" +
-      "r.canal.protocol.Compression\"\274\001\n\nClientA" +
-      "uth\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\014\022" +
-      "\033\n\020net_read_timeout\030\003 \001(\005:\0010\022\034\n\021net_writ" +
-      "e_timeout\030\004 \001(\005:\0010\022\023\n\013destination\030\005 \001(\t\022" +
-      "\021\n\tclient_id\030\006 \001(\t\022\016\n\006filter\030\007 \001(\t\022\027\n\017st" +
-      "art_timestamp\030\010 \001(\003\"3\n\003Ack\022\025\n\nerror_code" +
-      "\030\001 \001(\005:\0010\022\025\n\rerror_message\030\002 \001(\t\"E\n\tClie" +
-      "ntAck\022\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030" +
-      "\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003\"=\n\003Sub\022\023\n\013destin" +
-      "ation\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022\016\n\006filter" +
-      "\030\007 \001(\t\"?\n\005Unsub\022\023\n\013destination\030\001 \001(\t\022\021\n\t" +
-      "client_id\030\002 \001(\t\022\016\n\006filter\030\007 \001(\t\"\200\001\n\003Get\022" +
-      "\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022" +
-      "\022\n\nfetch_size\030\003 \001(\005\022\023\n\007timeout\030\004 \001(\003:\002-1" +
-      "\022\017\n\004unit\030\005 \001(\005:\0012\022\027\n\010auto_ack\030\006 \001(\010:\005fal" +
-      "se\".\n\010Messages\022\020\n\010batch_id\030\001 \001(\003\022\020\n\010mess" +
-      "ages\030\002 \003(\014\"?\n\004Dump\022\017\n\007journal\030\001 \001(\t\022\020\n\010p" +
-      "osition\030\002 \001(\003\022\024\n\ttimestamp\030\003 \001(\003:\0010\"J\n\016C" +
-      "lientRollback\022\023\n\013destination\030\001 \001(\t\022\021\n\tcl" +
-      "ient_id\030\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003*4\n\013Compr" +
-      "ession\022\010\n\004NONE\020\001\022\010\n\004ZLIB\020\002\022\010\n\004GZIP\020\003\022\007\n\003" +
-      "LZF\020\004*\305\001\n\nPacketType\022\r\n\tHANDSHAKE\020\001\022\030\n\024C" +
-      "LIENTAUTHENTICATION\020\002\022\007\n\003ACK\020\003\022\020\n\014SUBSCR" +
-      "IPTION\020\004\022\022\n\016UNSUBSCRIPTION\020\005\022\007\n\003GET\020\006\022\014\n" +
-      "\010MESSAGES\020\007\022\r\n\tCLIENTACK\020\010\022\014\n\010SHUTDOWN\020\t" +
-      "\022\010\n\004DUMP\020\n\022\r\n\tHEARTBEAT\020\013\022\022\n\016CLIENTROLLB" +
-      "ACK\020\014B1\n com.alibaba.otter.canal.protoco" +
-      "lB\013CanalPacketH\001"
+      ".canal.protocol\"\205\002\n\006Packet\022\026\n\014magic_numb" +
+      "er\030\001 \001(\005H\000\022\021\n\007version\030\002 \001(\005H\001\022:\n\004type\030\003 " +
+      "\001(\0162,.com.alibaba.otter.canal.protocol.P" +
+      "acketType\022D\n\013compression\030\004 \001(\0162-.com.ali" +
+      "baba.otter.canal.protocol.CompressionH\002\022" +
+      "\014\n\004body\030\005 \001(\014B\026\n\024magic_number_presentB\021\n" +
+      "\017version_presentB\025\n\023compression_present\"" +
+      "<\n\tHeartBeat\022\026\n\016send_timestamp\030\001 \001(\003\022\027\n\017" +
+      "start_timestamp\030\002 \001(\003\"\255\001\n\tHandshake\022 \n\026c" +
+      "ommunication_encoding\030\001 \001(\tH\000\022\r\n\005seeds\030\002" +
+      " \001(\014\022M\n\026supported_compressions\030\003 \001(\0162-.c" +
+      "om.alibaba.otter.canal.protocol.Compress" +
+      "ionB \n\036communication_encoding_present\"\363\001" +
+      "\n\nClientAuth\022\020\n\010username\030\001 \001(\t\022\020\n\010passwo" +
+      "rd\030\002 \001(\014\022\032\n\020net_read_timeout\030\003 \001(\005H\000\022\033\n\021" +
+      "net_write_timeout\030\004 \001(\005H\001\022\023\n\013destination" +
+      "\030\005 \001(\t\022\021\n\tclient_id\030\006 \001(\t\022\016\n\006filter\030\007 \001(" +
+      "\t\022\027\n\017start_timestamp\030\010 \001(\003B\032\n\030net_read_t" +
+      "imeout_presentB\033\n\031net_write_timeout_pres" +
+      "ent\"H\n\003Ack\022\024\n\nerror_code\030\001 \001(\005H\000\022\025\n\rerro" +
+      "r_message\030\002 \001(\tB\024\n\022error_code_present\"E\n" +
+      "\tClientAck\022\023\n\013destination\030\001 \001(\t\022\021\n\tclien" +
+      "t_id\030\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003\"=\n\003Sub\022\023\n\013d" +
+      "estination\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022\016\n\006f" +
+      "ilter\030\007 \001(\t\"?\n\005Unsub\022\023\n\013destination\030\001 \001(" +
+      "\t\022\021\n\tclient_id\030\002 \001(\t\022\016\n\006filter\030\007 \001(\t\"\257\001\n" +
+      "\003Get\022\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030\002" +
+      " \001(\t\022\022\n\nfetch_size\030\003 \001(\005\022\021\n\007timeout\030\004 \001(" +
+      "\003H\000\022\016\n\004unit\030\005 \001(\005H\001\022\022\n\010auto_ack\030\006 \001(\010H\002B" +
+      "\021\n\017timeout_presentB\016\n\014unit_presentB\022\n\020au" +
+      "to_ack_present\".\n\010Messages\022\020\n\010batch_id\030\001" +
+      " \001(\003\022\020\n\010messages\030\002 \003(\014\"S\n\004Dump\022\017\n\007journa" +
+      "l\030\001 \001(\t\022\020\n\010position\030\002 \001(\003\022\023\n\ttimestamp\030\003" +
+      " \001(\003H\000B\023\n\021timestamp_present\"J\n\016ClientRol" +
+      "lback\022\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030" +
+      "\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003*U\n\013Compression\022\037" +
+      "\n\033COMPRESSIONCOMPATIBLEPROTO2\020\000\022\010\n\004NONE\020" +
+      "\001\022\010\n\004ZLIB\020\002\022\010\n\004GZIP\020\003\022\007\n\003LZF\020\004*\346\001\n\nPacke" +
+      "tType\022\037\n\033PACKAGETYPECOMPATIBLEPROTO2\020\000\022\r" +
+      "\n\tHANDSHAKE\020\001\022\030\n\024CLIENTAUTHENTICATION\020\002\022" +
+      "\007\n\003ACK\020\003\022\020\n\014SUBSCRIPTION\020\004\022\022\n\016UNSUBSCRIP" +
+      "TION\020\005\022\007\n\003GET\020\006\022\014\n\010MESSAGES\020\007\022\r\n\tCLIENTA" +
+      "CK\020\010\022\014\n\010SHUTDOWN\020\t\022\010\n\004DUMP\020\n\022\r\n\tHEARTBEA" +
+      "T\020\013\022\022\n\016CLIENTROLLBACK\020\014B1\n com.alibaba.o" +
+      "tter.canal.protocolB\013CanalPacketH\001b\006prot" +
+      "o3"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
         new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
@@ -11186,7 +10920,7 @@ public final class CanalPacket {
     internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor,
-        new java.lang.String[] { "MagicNumber", "Version", "Type", "Compression", "Body", });
+        new java.lang.String[] { "MagicNumber", "Version", "Type", "Compression", "Body", "MagicNumberPresent", "VersionPresent", "CompressionPresent", });
     internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor =
       getDescriptor().getMessageTypes().get(1);
     internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable = new
@@ -11198,19 +10932,19 @@ public final class CanalPacket {
     internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor,
-        new java.lang.String[] { "CommunicationEncoding", "Seeds", "SupportedCompressions", });
+        new java.lang.String[] { "CommunicationEncoding", "Seeds", "SupportedCompressions", "CommunicationEncodingPresent", });
     internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor =
       getDescriptor().getMessageTypes().get(3);
     internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor,
-        new java.lang.String[] { "Username", "Password", "NetReadTimeout", "NetWriteTimeout", "Destination", "ClientId", "Filter", "StartTimestamp", });
+        new java.lang.String[] { "Username", "Password", "NetReadTimeout", "NetWriteTimeout", "Destination", "ClientId", "Filter", "StartTimestamp", "NetReadTimeoutPresent", "NetWriteTimeoutPresent", });
     internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor =
       getDescriptor().getMessageTypes().get(4);
     internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor,
-        new java.lang.String[] { "ErrorCode", "ErrorMessage", });
+        new java.lang.String[] { "ErrorCode", "ErrorMessage", "ErrorCodePresent", });
     internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor =
       getDescriptor().getMessageTypes().get(5);
     internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable = new
@@ -11234,7 +10968,7 @@ public final class CanalPacket {
     internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_com_alibaba_otter_canal_protocol_Get_descriptor,
-        new java.lang.String[] { "Destination", "ClientId", "FetchSize", "Timeout", "Unit", "AutoAck", });
+        new java.lang.String[] { "Destination", "ClientId", "FetchSize", "Timeout", "Unit", "AutoAck", "TimeoutPresent", "UnitPresent", "AutoAckPresent", });
     internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor =
       getDescriptor().getMessageTypes().get(9);
     internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable = new
@@ -11246,7 +10980,7 @@ public final class CanalPacket {
     internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor,
-        new java.lang.String[] { "Journal", "Position", "Timestamp", });
+        new java.lang.String[] { "Journal", "Position", "Timestamp", "TimestampPresent", });
     internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor =
       getDescriptor().getMessageTypes().get(11);
     internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable = new
diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalProtocol.proto b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalProtocol.proto
index 9de91150..e4e35b6d 100644
--- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalProtocol.proto
+++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalProtocol.proto
@@ -1,4 +1,4 @@
-syntax = "proto2";
+syntax = "proto3";
 package com.alibaba.otter.canal.protocol;
 
 option java_package = "com.alibaba.otter.canal.protocol";
@@ -6,6 +6,7 @@ option java_outer_classname = "CanalPacket";
 option optimize_for = SPEED;
 
 enum Compression {
+    COMPRESSIONCOMPATIBLEPROTO2 = 0;
     NONE = 1;
     ZLIB = 2;
     GZIP = 3;
@@ -13,6 +14,8 @@ enum Compression {
 }
 
 enum PacketType {
+    //compatible
+    PACKAGETYPECOMPATIBLEPROTO2 = 0;
     HANDSHAKE = 1;
     CLIENTAUTHENTICATION = 2;
     ACK = 3;
@@ -30,86 +33,122 @@ enum PacketType {
 }
 
 message Packet {
-    optional int32 magic_number = 1 [default = 17];
-    optional int32 version = 2 [default = 1];
-    optional PacketType type = 3;
-    optional Compression compression = 4 [default = NONE];
-    optional bytes body = 5;
+     //[default = 17];
+     oneof magic_number_present {
+         int32 magic_number = 1;
+     }
+     //[default = 1];
+     oneof version_present {
+          int32 version = 2;
+     };
+     PacketType type = 3;
+     //[default = NONE];
+     oneof compression_present {
+          Compression compression = 4;
+     }
+
+     bytes body = 5;
 }
 
 message HeartBeat {
-    optional int64 send_timestamp = 1;
-    optional int64 start_timestamp = 2;
+     int64 send_timestamp = 1;
+     int64 start_timestamp = 2;
 }
 
 message Handshake {
-    optional string communication_encoding = 1 [default = "utf8"];
-    optional bytes seeds = 2;
-    repeated Compression supported_compressions = 3;
+    //  [default = "utf8"];
+    oneof communication_encoding_present {
+        string communication_encoding = 1;
+    }
+     bytes seeds = 2;
+     Compression supported_compressions = 3;
 }
 
 // client authentication
 message ClientAuth {
-    optional string username = 1;
-    optional bytes password = 2; // hashed password with seeds from Handshake message
-    optional int32 net_read_timeout = 3 [default = 0]; // in seconds
-    optional int32 net_write_timeout = 4 [default = 0]; // in seconds
-    optional string destination = 5;
-    optional string client_id = 6;
-    optional string filter = 7;
-    optional int64 start_timestamp = 8;
+    string username = 1;
+    bytes password = 2; // hashed password with seeds from Handshake message
+    // [default = 0]
+    oneof net_read_timeout_present {
+         int32 net_read_timeout = 3; // in seconds
+    }
+    // [default = 0];
+    oneof net_write_timeout_present {
+        int32 net_write_timeout = 4; // in seconds
+    }
+    string destination = 5;
+    string client_id = 6;
+    string filter = 7;
+    int64 start_timestamp = 8;
 }
 
 message Ack {
-    optional int32 error_code = 1 [default = 0];
-    optional string error_message = 2; // if something like compression is not supported, erorr_message will tell about it.
+    //[default = 0]
+    oneof error_code_present {
+        int32 error_code = 1;
+    }
+    string error_message = 2; // if something like compression is not supported, erorr_message will tell about it.
 }
 
 message ClientAck {
-    optional string destination = 1;
-    optional string client_id = 2;
-    optional int64 batch_id = 3;
+    string destination = 1;
+    string client_id = 2;
+    int64 batch_id = 3;
 }
 
 // subscription
 message Sub {
-    optional string destination = 1;
-    optional string client_id = 2;
-    optional string filter = 7;
+    string destination = 1;
+    string client_id = 2;
+    string filter = 7;
 }
 
 // Unsubscription
 message Unsub {
-    optional string destination = 1;
-    optional string client_id = 2;
-    optional string filter = 7;
+    string destination = 1;
+    string client_id = 2;
+    string filter = 7;
 }
 
 //  PullRequest
 message Get {
-    optional string destination = 1;
-    optional string client_id = 2;
-    optional int32 fetch_size = 3;
-    optional int64 timeout = 4 [default = -1]; // 默认-1时代表不控制
-    optional int32 unit = 5 [default = 2];// 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
-    optional bool auto_ack = 6 [default = false]; // 是否自动ack
+    string destination = 1;
+    string client_id = 2;
+    int32 fetch_size = 3;
+    //[default = -1]
+    oneof timeout_present {
+        int64 timeout = 4; // 默认-1时代表不控制
+    }
+    //[default = 2]
+    oneof unit_present {
+        int32 unit = 5;// 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
+    }
+    //[default = false]
+    oneof auto_ack_present {
+        bool auto_ack = 6; // 是否自动ack
+    }
+
 }
 
 //
 message Messages {
-	optional int64 batch_id = 1;
+	int64 batch_id = 1;
     repeated bytes messages = 2;
 }
 
 // TBD when new packets are required
 message Dump{
-    optional string journal = 1;
-    optional int64  position = 2;
-    optional int64 timestamp = 3 [default = 0];
+    string journal = 1;
+    int64  position = 2;
+    // [default = 0]
+    oneof timestamp_present {
+        int64 timestamp = 3;
+    }
+
 }
 
 message ClientRollback{
-    optional string destination = 1;
-    optional string client_id = 2;
-    optional int64 batch_id = 3;
+    string destination = 1;
+    string client_id = 2;
+    int64 batch_id = 3;
 }
\ No newline at end of file
diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/EntryProtocol.proto b/protocol/src/main/java/com/alibaba/otter/canal/protocol/EntryProtocol.proto
index c755921d..1330bbc7 100644
--- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/EntryProtocol.proto
+++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/EntryProtocol.proto
@@ -1,4 +1,4 @@
-syntax = "proto2";
+syntax = "proto3";
 package com.alibaba.otter.canal.protocol;
 
 option java_package = "com.alibaba.otter.canal.protocol";
@@ -11,88 +11,101 @@ option optimize_for = SPEED;
  ****************************************************************/
 message Entry {
 	/**协议头部信息**/
-	optional Header						header 				= 1;
-	
-	/**打散后的事件类型**/
-	optional EntryType					entryType			= 2 [default = ROWDATA];
-	
+     Header						header 				= 1;
+	///**打散后的事件类型**/ [default = ROWDATA]
+	oneof entryType_present{
+		EntryType					entryType			= 2;
+	}
+
 	/**传输的二进制数组**/
-	optional bytes						storeValue			= 3;
+	bytes						storeValue			= 3;
 }
 
 /**message Header**/
 message Header {
-	/**协议的版本号**/
-	optional int32 					version				= 1 [default = 1];	
-	
+	/**协议的版本号**/  //[default = 1]
+	oneof version_present {
+		int32 					version				= 1;
+	}
+
+
 	/**binlog/redolog 文件名**/
-	optional string					logfileName			= 2;
-	
+	string					logfileName			= 2;
+
 	/**binlog/redolog 文件的偏移位置**/
-	optional int64 					logfileOffset		= 3;
-	
+	int64 					logfileOffset		= 3;
+
 	/**服务端serverId**/
-	optional 	int64				serverId         	= 4;	
-	
+	int64				serverId         	= 4;
+
 	/** 变更数据的编码 **/
-	optional string					serverenCode		= 5;
-	
+	string					serverenCode		= 5;
+
 	/**变更数据的执行时间 **/
-	optional int64					executeTime			= 6;
-	
-	/** 变更数据的来源**/
-	optional Type					sourceType			= 7 [default = MYSQL];
-	
+	int64					executeTime			= 6;
+
+	/** 变更数据的来源**/ //[default = MYSQL]
+	oneof sourceType_present {
+		Type					sourceType			= 7;
+	}
+
+
 	/** 变更数据的schemaname**/
-	optional string					schemaName			= 8;
-	
+	string					schemaName			= 8;
+
 	/**变更数据的tablename**/
-	optional string					tableName			= 9;	
-	
+	string					tableName			= 9;
+
 	/**每个event的长度**/
-	optional int64					eventLength         = 10;
-	
-	/**数据变更类型**/
-	optional EventType 				eventType			= 11 [default = UPDATE];
-	
+	int64					eventLength         = 10;
+
+	/**数据变更类型**/  // [default = UPDATE]
+	oneof eventType_present {
+		EventType 				eventType			= 11;
+	}
+
+
 	/**预留扩展**/
 	repeated Pair					props				= 12;
 
     /**当前事务的gitd**/
-	optional string                 gtid                = 13;
+	string                 gtid                = 13;
 }
 
 /**每个字段的数据结构**/
 message Column {
 	/**字段下标**/
-	optional int32		index			= 		1;
-	
+	int32		index			= 		1;
+
 	/**字段java中类型**/
-	optional int32 		sqlType			= 		2;
-	
+	int32 		sqlType			= 		2;
+
 	/**字段名称(忽略大小写),在mysql中是没有的**/
-	optional string		name			=		3;
-	
+	string		name			=		3;
+
 	/**是否是主键**/
-	optional bool 		isKey			= 		4;
-	
+	bool 		isKey			= 		4;
+
 	/**如果EventType=UPDATE,用于标识这个字段值是否有修改**/
-	optional bool		updated			= 		5;
-	
-	/** 标识是否为空  **/
-	optional bool		isNull			= 		6 [default = false];
-	
+	bool		updated			= 		5;
+
+	/** 标识是否为空  **/ //[default = false]
+	oneof isNull_present {
+		bool		isNull			= 		6;
+	}
+
+
 	/**预留扩展**/
-	repeated Pair		props			=		7;	
-	
+	repeated Pair		props			=		7;
+
 	/** 字段值,timestamp,Datetime是一个时间格式的文本 **/
-	optional string		value			= 		8;
-	
+	string		value			= 		8;
+
 	/** 对应数据对象原始长度 **/
-	optional int32		length			= 		9;
-	
+	int32		length			= 		9;
+
 	/**字段mysql类型**/
-	optional string		mysqlType		= 		10;
+	string		mysqlType		= 		10;
 }
 
 message RowData {
@@ -102,73 +115,81 @@ message RowData {
 
 	/** 字段信息,增量数据(修改后,新增后)  **/
 	repeated Column			afterColumns	= 		2;
-	
+
 	/**预留扩展**/
-	repeated Pair			props			=		3;	
+	repeated Pair			props			=		3;
 }
 
 /**message row 每行变更数据的数据结构**/
 message RowChange {
 
 	/**tableId,由数据库产生**/
-	optional int64	 		tableId			=		1;
-	
-	/**数据变更类型**/
-	optional EventType 		eventType		= 		2 [default = UPDATE];
-	
-	/** 标识是否是ddl语句  **/
-	optional bool			isDdl			= 		10 [default = false];
+	int64	 		tableId			=		1;
+
+
+	/**数据变更类型**/ //[default = UPDATE]
+	oneof eventType_present {
+		EventType 		eventType		= 		2;
+	}
+
+
+	/** 标识是否是ddl语句  **/ // [default = false]
+	oneof isDdl_present {
+		bool			isDdl			= 		10;
+	}
+
 
 	/** ddl/query的sql语句  **/
-	optional string			sql 			= 		11;
-	
+	string			sql 			= 		11;
+
 	/** 一次数据库变更可能存在多行  **/
 	repeated RowData		rowDatas		= 		12;
-	
+
 	/**预留扩展**/
-	repeated Pair			props			=		13;	
-	
+	repeated Pair			props			=		13;
+
 	/** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  **/
-	optional string			ddlSchemaName 	= 		14;
+	string			ddlSchemaName 	= 		14;
 }
 
 /**开始事务的一些信息**/
 message TransactionBegin{
-	
+
 	/**已废弃,请使用header里的executeTime**/
-	optional int64			executeTime		=		1;
-	
+	int64			executeTime		=		1;
+
 	/**已废弃,Begin里不提供事务id**/
-	optional string			transactionId	=		2;
-	
+	string			transactionId	=		2;
+
 	/**预留扩展**/
-	repeated Pair			props			=		3;	
-	
+	repeated Pair			props			=		3;
+
 	/**执行的thread Id**/
-	optional int64			threadId		=		4;
+	int64			threadId		=		4;
 }
 
 /**结束事务的一些信息**/
 message TransactionEnd{
-	
+
 	/**已废弃,请使用header里的executeTime**/
-	optional int64			executeTime		=		1;
-	
+	int64			executeTime		=		1;
+
 	/**事务号**/
-	optional string			transactionId	=		2;
-	
+	string			transactionId	=		2;
+
 	/**预留扩展**/
-	repeated Pair			props			=		3;	
+	repeated Pair			props			=		3;
 }
 
 /**预留扩展**/
 message Pair{
-	optional string 		key				= 			1;	
-	optional string 		value			= 			2;	
+	string 		key				= 			1;
+	string 		value			= 			2;
 }
 
 /**打散后的事件类型,主要用于标识事务的开始,变更数据,结束**/
 enum EntryType{
+	ENTRYTYPECOMPATIBLEPROTO2 = 0;
 	TRANSACTIONBEGIN 		=		1;
 	ROWDATA					=		2;
 	TRANSACTIONEND			=		3;
@@ -179,6 +200,7 @@ enum EntryType{
 
 /** 事件类型 **/
 enum EventType {
+	EVENTTYPECOMPATIBLEPROTO2 = 0;
     INSERT 		= 		1;
     UPDATE 		= 		2;
     DELETE 		= 		3;
@@ -201,6 +223,7 @@ enum EventType {
 
 /**数据库类型**/
 enum Type {
+	TYPECOMPATIBLEPROTO2 = 0;
     ORACLE		= 		1;
     MYSQL		= 		2;
     PGSQL		= 		3;
diff --git a/server/src/test/java/com/alibaba/otter/canal/server/CanalServerWithNettyTest.java b/server/src/test/java/com/alibaba/otter/canal/server/CanalServerWithNettyTest.java
index 3b3c0ee0..673918fe 100644
--- a/server/src/test/java/com/alibaba/otter/canal/server/CanalServerWithNettyTest.java
+++ b/server/src/test/java/com/alibaba/otter/canal/server/CanalServerWithNettyTest.java
@@ -66,6 +66,8 @@ public class CanalServerWithNettyTest {
 
     @Test
     public void testAuth() {
+
+
         try {
             SocketChannel channel = SocketChannel.open();
             channel.connect(new InetSocketAddress("127.0.0.1", 1088));
@@ -80,7 +82,7 @@ public class CanalServerWithNettyTest {
             }
             //
             Handshake handshake = Handshake.parseFrom(p.getBody());
-            System.out.println(handshake.getSupportedCompressionsList());
+            System.out.println(handshake.getSupportedCompressions());
             //
             ClientAuth ca = ClientAuth.newBuilder()
                 .setUsername("")

From e8e00324044f54a385345f99229c3c8cd38b5bd5 Mon Sep 17 00:00:00 2001
From: mcy 
Date: Fri, 14 Sep 2018 11:22:47 +0800
Subject: [PATCH 22/42] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=81=E5=B9=B3Messa?=
 =?UTF-8?q?ge=E7=94=A8=E4=BA=8E=E5=8D=A1=E5=A4=AB=E5=8D=A1=E6=95=B0?=
 =?UTF-8?q?=E6=8D=AE=E6=8A=95=E9=80=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../client/adapter/CanalOuterAdapter.java     |   8 +-
 .../adapter/support/CanalClientConfig.java    |  10 +
 .../client/adapter/support/JdbcTypeUtil.java  |   4 +-
 .../client/adapter/support/MessageUtil.java   |  58 +++-
 .../client/adapter/hbase/HbaseAdapter.java    |  23 +-
 .../adapter/logger/LoggerAdapterExample.java  |  15 +-
 .../loader/AbstractCanalAdapterWorker.java    |  60 +++-
 .../loader/CanalAdapterKafkaWorker.java       |  99 +++---
 .../adapter/loader/CanalAdapterLoader.java    |   7 +-
 .../src/main/resources/canal-client.yml       |  31 +-
 .../client/kafka/KafkaCanalConnector.java     | 162 +++++-----
 .../client/kafka/KafkaCanalConnectors.java    |  27 +-
 .../kafka/CanalKafkaClientExample.java        |  63 ++--
 .../running/kafka/KafkaClientRunningTest.java |   9 +-
 deployer/src/main/resources/kafka.yml         |   5 +-
 .../otter/canal/protocol/FlatMessage.java     | 286 ++++++++++++++++++
 .../otter/canal/kafka/CanalKafkaProducer.java |  50 ++-
 .../otter/canal/kafka/KafkaProperties.java    |   9 +
 .../embedded/CanalServerWithEmbedded.java     |   7 +-
 19 files changed, 686 insertions(+), 247 deletions(-)
 create mode 100644 protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java

diff --git a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/CanalOuterAdapter.java b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/CanalOuterAdapter.java
index 53368472..0871eb74 100644
--- a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/CanalOuterAdapter.java
+++ b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/CanalOuterAdapter.java
@@ -1,7 +1,9 @@
 package com.alibaba.otter.canal.client.adapter;
 
 import com.alibaba.otter.canal.client.adapter.support.CanalOuterAdapterConfiguration;
+import com.alibaba.otter.canal.client.adapter.support.Dml;
 import com.alibaba.otter.canal.client.adapter.support.SPI;
+import com.alibaba.otter.canal.protocol.FlatMessage;
 import com.alibaba.otter.canal.protocol.Message;
 
 /**
@@ -23,9 +25,11 @@ public interface CanalOuterAdapter {
     /**
      * 往适配器中写入数据
      *
-     * @param message message数据包
+     * @param dml 数据包
      */
-    void writeOut(Message message);
+    void writeOut(Dml dml);
+
+    // void writeOut(FlatMessage flatMessage);
 
     /**
      * 外部适配器销毁接口
diff --git a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/CanalClientConfig.java b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/CanalClientConfig.java
index f6fa7707..25b339fe 100644
--- a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/CanalClientConfig.java
+++ b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/CanalClientConfig.java
@@ -20,6 +20,8 @@ public class CanalClientConfig {
 
     private String              bootstrapServers;
 
+    private Boolean             flatMessage = true;
+
     private List    kafkaTopics;
 
     private List canalInstances;
@@ -56,6 +58,14 @@ public class CanalClientConfig {
         this.bootstrapServers = bootstrapServers;
     }
 
+    public Boolean getFlatMessage() {
+        return flatMessage;
+    }
+
+    public void setFlatMessage(Boolean flatMessage) {
+        this.flatMessage = flatMessage;
+    }
+
     public List getKafkaTopics() {
         return kafkaTopics;
     }
diff --git a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/JdbcTypeUtil.java b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/JdbcTypeUtil.java
index fd65589f..777770ef 100644
--- a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/JdbcTypeUtil.java
+++ b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/JdbcTypeUtil.java
@@ -21,7 +21,7 @@ public class JdbcTypeUtil {
 
     private static Logger logger = LoggerFactory.getLogger(JdbcTypeUtil.class);
 
-    public static Object typeConvert(String tableName, String columnName, String value, int sqlType, String mysqlType) {
+    public static Object typeConvert(String columnName, String value, int sqlType, String mysqlType) {
         if (value == null || value.equals("")) {
             return null;
         }
@@ -96,7 +96,7 @@ public class JdbcTypeUtil {
             }
             return res;
         } catch (Exception e) {
-            logger.error("table: {} column: {}, failed convert type {} to {}", tableName, columnName, value, sqlType);
+            logger.error("table: {} column: {}, failed convert type {} to {}", columnName, value, sqlType);
             return value;
         }
     }
diff --git a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/MessageUtil.java b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/MessageUtil.java
index 7f3722f1..4765ec30 100644
--- a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/MessageUtil.java
+++ b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/MessageUtil.java
@@ -3,6 +3,7 @@ package com.alibaba.otter.canal.client.adapter.support;
 import java.util.*;
 
 import com.alibaba.otter.canal.protocol.CanalEntry;
+import com.alibaba.otter.canal.protocol.FlatMessage;
 import com.alibaba.otter.canal.protocol.Message;
 
 /**
@@ -63,8 +64,7 @@ public class MessageUtil {
 
                     for (CanalEntry.Column column : columns) {
                         row.put(column.getName(),
-                            JdbcTypeUtil.typeConvert(dml.getTable(),
-                                column.getName(),
+                            JdbcTypeUtil.typeConvert(column.getName(),
                                 column.getValue(),
                                 column.getSqlType(),
                                 column.getMysqlType()));
@@ -82,8 +82,7 @@ public class MessageUtil {
                         for (CanalEntry.Column column : rowData.getBeforeColumnsList()) {
                             if (updateSet.contains(column.getName())) {
                                 rowOld.put(column.getName(),
-                                    JdbcTypeUtil.typeConvert(dml.getTable(),
-                                        column.getName(),
+                                    JdbcTypeUtil.typeConvert(column.getName(),
                                         column.getValue(),
                                         column.getSqlType(),
                                         column.getMysqlType()));
@@ -106,6 +105,57 @@ public class MessageUtil {
         }
     }
 
+    public static Dml flatMessage2Dml(FlatMessage flatMessage) {
+        if (flatMessage == null) {
+            return null;
+        }
+        Dml dml = new Dml();
+        dml.setDatabase(flatMessage.getDatabase());
+        dml.setTable(flatMessage.getTable());
+        dml.setType(flatMessage.getType());
+        dml.setTs(flatMessage.getTs());
+        dml.setSql(flatMessage.getSql());
+        if (flatMessage.getSqlType() == null || flatMessage.getMysqlType() == null) {
+            throw new RuntimeException("SqlType or mysqlType is null");
+        }
+        List> data = flatMessage.getData();
+        if (data != null) {
+            dml.setData(changeRows(data, flatMessage.getSqlType(), flatMessage.getMysqlType()));
+        }
+        List> old = flatMessage.getOld();
+        if (old != null) {
+            dml.setOld(changeRows(old, flatMessage.getSqlType(), flatMessage.getMysqlType()));
+        }
+        return dml;
+    }
+
+    private static List> changeRows(List> rows, Map sqlTypes,
+                                                        Map mysqlTypes) {
+        List> result = new ArrayList<>();
+        for (Map row : rows) {
+            Map resultRow = new LinkedHashMap<>();
+            for (Map.Entry entry : row.entrySet()) {
+                String columnName = entry.getKey();
+                String columnValue = entry.getValue();
+
+                Integer sqlType = sqlTypes.get(columnName);
+                if (sqlType == null) {
+                    continue;
+                }
+
+                String mysqlType = mysqlTypes.get(columnName);
+                if (mysqlType == null) {
+                    continue;
+                }
+
+                Object finalValue = JdbcTypeUtil.typeConvert(columnName, columnValue, sqlType, mysqlType);
+                resultRow.put(columnName, finalValue);
+            }
+            result.add(resultRow);
+        }
+        return result;
+    }
+
     public interface Consumer {
 
         void accept(T t);
diff --git a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/HbaseAdapter.java b/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/HbaseAdapter.java
index 03103b8b..bbd8fb1c 100644
--- a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/HbaseAdapter.java
+++ b/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/HbaseAdapter.java
@@ -4,6 +4,7 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import com.alibaba.otter.canal.protocol.FlatMessage;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
@@ -86,20 +87,14 @@ public class HbaseAdapter implements CanalOuterAdapter {
     }
 
     @Override
-    public void writeOut(Message message) {
-        MessageUtil.parse4Dml(message, new MessageUtil.Consumer() {
-
-            @Override
-            public void accept(Dml dml) {
-                if (dml == null) {
-                    return;
-                }
-                String database = dml.getDatabase();
-                String table = dml.getTable();
-                MappingConfig config = mappingConfigCache.get(database + "-" + table);
-                hbaseSyncService.sync(config, dml);
-            }
-        });
+    public void writeOut(Dml dml) {
+        if (dml == null) {
+            return;
+        }
+        String database = dml.getDatabase();
+        String table = dml.getTable();
+        MappingConfig config = mappingConfigCache.get(database + "-" + table);
+        hbaseSyncService.sync(config, dml);
     }
 
     @Override
diff --git a/client-adapter/logger/src/main/java/com/alibaba/otter/canal/client/adapter/logger/LoggerAdapterExample.java b/client-adapter/logger/src/main/java/com/alibaba/otter/canal/client/adapter/logger/LoggerAdapterExample.java
index c6c1cb44..c72a0ee0 100644
--- a/client-adapter/logger/src/main/java/com/alibaba/otter/canal/client/adapter/logger/LoggerAdapterExample.java
+++ b/client-adapter/logger/src/main/java/com/alibaba/otter/canal/client/adapter/logger/LoggerAdapterExample.java
@@ -6,9 +6,7 @@ import org.slf4j.LoggerFactory;
 import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter;
 import com.alibaba.otter.canal.client.adapter.support.CanalOuterAdapterConfiguration;
 import com.alibaba.otter.canal.client.adapter.support.Dml;
-import com.alibaba.otter.canal.client.adapter.support.MessageUtil;
 import com.alibaba.otter.canal.client.adapter.support.SPI;
-import com.alibaba.otter.canal.protocol.Message;
 
 /**
  * 外部适配器示例
@@ -22,20 +20,13 @@ public class LoggerAdapterExample implements CanalOuterAdapter {
     private Logger logger = LoggerFactory.getLogger(this.getClass());
 
     @Override
-    public void writeOut(Message message) {
-        // 直接输出日志信息
-        MessageUtil.parse4Dml(message, new MessageUtil.Consumer() {
+    public void init(CanalOuterAdapterConfiguration configuration) {
 
-            @Override
-            public void accept(Dml dml) {
-                logger.info(dml.toString());
-            }
-        });
     }
 
     @Override
-    public void init(CanalOuterAdapterConfiguration configuration) {
-
+    public void writeOut(Dml dml) {
+        logger.info(dml.toString());
     }
 
     @Override
diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/AbstractCanalAdapterWorker.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/AbstractCanalAdapterWorker.java
index 9dd328e3..46e5922f 100644
--- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/AbstractCanalAdapterWorker.java
+++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/AbstractCanalAdapterWorker.java
@@ -7,10 +7,13 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 
-import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter;
+import com.alibaba.otter.canal.client.adapter.support.Dml;
+import com.alibaba.otter.canal.client.adapter.support.MessageUtil;
+import com.alibaba.otter.canal.protocol.FlatMessage;
 import com.alibaba.otter.canal.protocol.Message;
 
 /**
@@ -47,9 +50,16 @@ public abstract class AbstractCanalAdapterWorker {
                 public Boolean call() {
                     try {
                         // 组内适配器穿行运行,尽量不要配置组内适配器
-                        for (CanalOuterAdapter c : adapters) {
+                        for (final CanalOuterAdapter c : adapters) {
                             long begin = System.currentTimeMillis();
-                            c.writeOut(message);
+                            MessageUtil.parse4Dml(message, new MessageUtil.Consumer() {
+
+                                @Override
+                                public void accept(Dml dml) {
+                                    c.writeOut(dml);
+                                }
+                            });
+
                             if (logger.isDebugEnabled()) {
                                 logger.debug("{} elapsed time: {}",
                                     c.getClass().getName(),
@@ -71,7 +81,49 @@ public abstract class AbstractCanalAdapterWorker {
                         logger.error("Outer adapter write failed");
                     }
                 } catch (InterruptedException | ExecutionException e) {
-                    logger.error(e.getMessage(), e);
+                    // ignore
+                }
+            }
+        }
+    }
+
+    protected void writeOut(final FlatMessage flatMessage) {
+        List> futures = new ArrayList<>();
+        // 组间适配器并行运行
+        for (List outerAdapters : canalOuterAdapters) {
+            final List adapters = outerAdapters;
+            futures.add(groupInnerExecutorService.submit(new Callable() {
+
+                @Override
+                public Boolean call() {
+                    try {
+                        // 组内适配器穿行运行,尽量不要配置组内适配器
+                        for (CanalOuterAdapter c : adapters) {
+                            long begin = System.currentTimeMillis();
+                            Dml dml = MessageUtil.flatMessage2Dml(flatMessage);
+                            c.writeOut(dml);
+                            if (logger.isDebugEnabled()) {
+                                logger.debug("{} elapsed time: {}",
+                                    c.getClass().getName(),
+                                    (System.currentTimeMillis() - begin));
+                            }
+                        }
+                        return true;
+                    } catch (Exception e) {
+                        return false;
+                    }
+                }
+            }));
+
+            // 等待所有适配器写入完成
+            // 由于是组间并发操作,所以将阻塞直到耗时最久的工作组操作完成
+            for (Future f : futures) {
+                try {
+                    if (!f.get()) {
+                        logger.error("Outer adapter write failed");
+                    }
+                } catch (InterruptedException | ExecutionException e) {
+                    // ignore
                 }
             }
         }
diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java
index 4a7bd7a3..d7324cda 100644
--- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java
+++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java
@@ -12,6 +12,7 @@ import org.apache.kafka.common.errors.WakeupException;
 import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter;
 import com.alibaba.otter.canal.client.kafka.KafkaCanalConnector;
 import com.alibaba.otter.canal.client.kafka.KafkaCanalConnectors;
+import com.alibaba.otter.canal.protocol.FlatMessage;
 import com.alibaba.otter.canal.protocol.Message;
 
 /**
@@ -26,14 +27,17 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker {
 
     private String              topic;
 
-    public CanalAdapterKafkaWorker(String zkServers, String bootstrapServers, String topic, String groupId,
-                                   List> canalOuterAdapters){
+    private boolean             flatMessage;
+
+    public CanalAdapterKafkaWorker(String bootstrapServers, String topic, String groupId,
+                                   List> canalOuterAdapters, boolean flatMessage){
         this.canalOuterAdapters = canalOuterAdapters;
         this.groupInnerExecutorService = Executors.newFixedThreadPool(canalOuterAdapters.size());
         this.topic = topic;
         this.canalDestination = topic;
-        connector = KafkaCanalConnectors.newKafkaConnector(zkServers, bootstrapServers, topic, null, groupId);
-        connector.setSessionTimeout(5L, TimeUnit.MINUTES);
+        this.flatMessage = flatMessage;
+        connector = KafkaCanalConnectors.newKafkaConnector(bootstrapServers, topic, null, groupId, flatMessage);
+        // connector.setSessionTimeout(1L, TimeUnit.MINUTES);
 
         // super.initSwitcher(topic);
     }
@@ -104,56 +108,47 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker {
                     try {
                         // switcher.get(); //等待开关开启
 
-                        final Message message = connector.getWithoutAck();
+                        List messages;
+                        if (!flatMessage) {
+                            messages = connector.getWithoutAck();
+                        } else {
+                            messages = connector.getFlatMessageWithoutAck(100L, TimeUnit.MILLISECONDS);
+                        }
+                        if (messages != null) {
+                            for (final Object message : messages) {
+                                executing.set(true);
+                                if (message != null) {
+                                    executor.submit(new Runnable() {
 
-                        executing.set(true);
-                        if (message != null) {
-                            executor.submit(new Runnable() {
+                                        @Override
+                                        public void run() {
+                                            try {
+                                                if (message instanceof FlatMessage) {
+                                                    writeOut((FlatMessage) message);
+                                                } else {
+                                                    writeOut((Message) message);
+                                                }
+                                            } catch (Exception e) {
+                                                logger.error(e.getMessage(), e);
+                                            } finally {
+                                                executing.compareAndSet(true, false);
+                                            }
+                                        }
+                                    });
 
-                                @Override
-                                public void run() {
-                                    try {
-                                        if (logger.isDebugEnabled()) {
-                                            logger.debug("topic: {} batchId: {} batchSize: {} ",
-                                                topic,
-                                                message.getId(),
-                                                message.getEntries().size());
+                                    // 间隔一段时间ack一次, 防止因超时未响应切换到另外台客户端
+                                    long currentTS = System.currentTimeMillis();
+                                    while (executing.get()) {
+                                        // 大于10秒未消费完ack一次keep alive
+                                        if (System.currentTimeMillis() - currentTS > 10000) {
+                                            connector.ack();
+                                            currentTS = System.currentTimeMillis();
                                         }
-                                        long begin = System.currentTimeMillis();
-                                        writeOut(message);
-                                        long now = System.currentTimeMillis();
-                                        if ((System.currentTimeMillis() - begin) > 5 * 60 * 1000) {
-                                            logger.error("topic: {} batchId {} elapsed time: {} ms",
-                                                topic,
-                                                message.getId(),
-                                                now - begin);
-                                        }
-                                        if (logger.isDebugEnabled()) {
-                                            logger.debug("topic: {} batchId {} elapsed time: {} ms",
-                                                topic,
-                                                message.getId(),
-                                                now - begin);
-                                        }
-                                    } catch (Exception e) {
-                                        logger.error(e.getMessage(), e);
-                                    } finally {
-                                        executing.compareAndSet(true, false);
                                     }
                                 }
-                            });
-
-                            // 间隔一段时间ack一次, 防止因超时未响应切换到另外台客户端
-                            long currentTS = System.currentTimeMillis();
-                            while (executing.get()) {
-                                // 大于1分钟未消费完ack一次keep alive
-                                if (System.currentTimeMillis() - currentTS > 60000) {
-                                    connector.ack();
-                                    currentTS = System.currentTimeMillis();
-                                }
                             }
-                        } else {
-                            connector.ack();
                         }
+                        connector.ack();
                     } catch (CommitFailedException e) {
                         logger.warn(e.getMessage());
                     } catch (Exception e) {
@@ -161,19 +156,23 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker {
                         TimeUnit.SECONDS.sleep(1L);
                     }
                 }
-            } catch (Exception e) {
+            } catch (
+
+            Exception e) {
                 logger.error(e.getMessage(), e);
             }
         }
 
         executor.shutdown();
 
-        try {
+        try
+
+        {
             connector.unsubscribe();
         } catch (WakeupException e) {
             // No-op. Continue process
         }
-        connector.disconnnect();
+        connector.disconnect();
         logger.info("=============> Disconnect topic: {} <=============", this.topic);
     }
 }
diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterLoader.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterLoader.java
index 14efe493..15945b6c 100644
--- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterLoader.java
+++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterLoader.java
@@ -59,6 +59,8 @@ public class CanalAdapterLoader {
         }
         String zkHosts = this.canalClientConfig.getZookeeperHosts();
 
+        boolean flatMessage = this.canalClientConfig.getFlatMessage();
+
         // if (zkHosts == null && sa == null) {
         // throw new RuntimeException("Blank config property: canalServerHost or
         // zookeeperHosts");
@@ -104,11 +106,12 @@ public class CanalAdapterLoader {
                     canalOuterAdapterGroups.add(canalOuterAdapters);
 
                     // String zkServers = canalClientConfig.getZookeeperHosts();
-                    CanalAdapterKafkaWorker canalKafkaWorker = new CanalAdapterKafkaWorker(zkHosts,
+                    CanalAdapterKafkaWorker canalKafkaWorker = new CanalAdapterKafkaWorker(
                         canalClientConfig.getBootstrapServers(),
                         kafkaTopic.getTopic(),
                         group.getGroupId(),
-                        canalOuterAdapterGroups);
+                        canalOuterAdapterGroups,
+                        flatMessage);
                     canalKafkaWorkers.put(kafkaTopic.getTopic() + "-" + group.getGroupId(), canalKafkaWorker);
                     canalKafkaWorker.start();
                     logger.info("Start adapter for canal-client kafka topic: {} succeed",
diff --git a/client-launcher/src/main/resources/canal-client.yml b/client-launcher/src/main/resources/canal-client.yml
index 12e016a7..6c8874c3 100644
--- a/client-launcher/src/main/resources/canal-client.yml
+++ b/client-launcher/src/main/resources/canal-client.yml
@@ -1,21 +1,22 @@
-canalServerHost: 127.0.0.1:11111
+#canalServerHost: 127.0.0.1:11111
 #zookeeperHosts: slave1:2181
-#bootstrapServers: slave1:6667,slave2:6667
+bootstrapServers: slave1:6667,slave2:6667
+flatMessage: true
 
-canalInstances:
-- instance: example
-  adapterGroups:
-  - outAdapters:
-    - name: logger
-    - name: hbase
-      hosts: slave1:2181
-      properties: {znodeParent: "/hbase-unsecure"}
-#kafkaTopics:
-#- topic: example
-#  groups:
-#  - groupId: example_g1
-#    outAdapters:
+#canalInstances:
+#- instance: example
+#  adapterGroups:
+#  - outAdapters:
 #    - name: logger
 #    - name: hbase
 #      hosts: slave1:2181
 #      properties: {znodeParent: "/hbase-unsecure"}
+kafkaTopics:
+- topic: example
+  groups:
+  - groupId: egroup
+    outAdapters:
+    - name: logger
+#    - name: hbase
+#      hosts: slave1:2181
+#      properties: {znodeParent: "/hbase-unsecure"}
diff --git a/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnector.java
index 7afb9c09..ad94ba98 100644
--- a/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnector.java
+++ b/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnector.java
@@ -1,19 +1,20 @@
 package com.alibaba.otter.canal.client.kafka;
 
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.List;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.kafka.clients.consumer.ConsumerRecord;
 import org.apache.kafka.clients.consumer.ConsumerRecords;
 import org.apache.kafka.clients.consumer.KafkaConsumer;
 import org.apache.kafka.common.TopicPartition;
 import org.apache.kafka.common.serialization.StringDeserializer;
 
-import com.alibaba.otter.canal.client.kafka.running.ClientRunningData;
-import com.alibaba.otter.canal.common.utils.AddressUtils;
-import com.alibaba.otter.canal.common.zookeeper.ZkClientx;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.otter.canal.protocol.FlatMessage;
 import com.alibaba.otter.canal.protocol.Message;
-import com.alibaba.otter.canal.protocol.exception.CanalClientException;
 
 /**
  * canal kafka 数据操作客户端
@@ -24,18 +25,19 @@ import com.alibaba.otter.canal.protocol.exception.CanalClientException;
 public class KafkaCanalConnector {
 
     private KafkaConsumer kafkaConsumer;
+    private KafkaConsumer  kafkaConsumer2;   // 用于扁平message的数据消费
     private String                         topic;
     private Integer                        partition;
     private Properties                     properties;
-    // private ClientRunningMonitor runningMonitor; // 运行控制
-    // private BooleanMutex mutex = new BooleanMutex(false);
-    private ZkClientx                      zkClientx;
     private volatile boolean               connected = false;
     private volatile boolean               running   = false;
+    private boolean                        flatMessage;
 
-    public KafkaCanalConnector(String zkServers, String servers, String topic, Integer partition, String groupId){
+    public KafkaCanalConnector(String servers, String topic, Integer partition, String groupId,
+                               boolean flatMessage){
         this.topic = topic;
         this.partition = partition;
+        this.flatMessage = flatMessage;
 
         properties = new Properties();
         properties.put("bootstrap.servers", servers);
@@ -45,32 +47,13 @@ public class KafkaCanalConnector {
         properties.put("auto.offset.reset", "latest"); // 如果没有offset则从最后的offset开始读
         properties.put("request.timeout.ms", "40000"); // 必须大于session.timeout.ms的设置
         properties.put("session.timeout.ms", "30000"); // 默认为30秒
-        properties.put("max.poll.records", "1"); // 一次只取一条message数据
+        properties.put("max.poll.records", "100");
         properties.put("key.deserializer", StringDeserializer.class.getName());
-        properties.put("value.deserializer", MessageDeserializer.class.getName());
-
-        if (zkServers != null) {
-            zkClientx = new ZkClientx(zkServers);
-
-            ClientRunningData clientData = new ClientRunningData();
-            clientData.setGroupId(groupId);
-            clientData.setAddress(AddressUtils.getHostIp());
-
-            // runningMonitor = new ClientRunningMonitor();
-            // runningMonitor.setTopic(topic);
-            // runningMonitor.setZkClient(zkClientx);
-            // runningMonitor.setClientData(clientData);
-            // runningMonitor.setListener(new ClientRunningListener() {
-            // public void processActiveEnter() {
-            // mutex.set(true);
-            // }
-            //
-            // public void processActiveExit() {
-            // mutex.set(false);
-            // }
-            // });
+        if (!flatMessage) {
+            properties.put("value.deserializer", MessageDeserializer.class.getName());
+        } else {
+            properties.put("value.deserializer", StringDeserializer.class.getName());
         }
-
     }
 
     /**
@@ -93,57 +76,36 @@ public class KafkaCanalConnector {
             return;
         }
 
-        // if (runningMonitor != null) {
-        // if (!runningMonitor.isStart()) {
-        // runningMonitor.start();
-        // }
-        // }
-
         connected = true;
 
-        if (kafkaConsumer == null) {
+        if (kafkaConsumer == null && !flatMessage) {
             kafkaConsumer = new KafkaConsumer(properties);
         }
+        if (kafkaConsumer2 == null && flatMessage) {
+            kafkaConsumer2 = new KafkaConsumer(properties);
+        }
     }
 
     /**
      * 关闭链接
      */
-    public void disconnnect() {
-        kafkaConsumer.close();
+    public void disconnect() {
+        if (kafkaConsumer != null) {
+            kafkaConsumer.close();
+        }
+        if (kafkaConsumer2 != null) {
+            kafkaConsumer2.close();
+        }
 
         connected = false;
-        // if (runningMonitor.isStart()) {
-        // runningMonitor.stop();
-        // }
     }
 
     private void waitClientRunning() {
-        try {
-            if (zkClientx != null) {
-                if (!connected) {// 未调用connect
-                    throw new CanalClientException("should connect first");
-                }
-
-                running = true;
-                // mutex.get();// 阻塞等待
-            } else {
-                // 单机模式直接设置为running
-                running = true;
-            }
-        } catch (Exception e) {
-            Thread.currentThread().interrupt();
-            throw new CanalClientException(e);
-        }
+        running = true;
     }
 
     public boolean checkValid() {
-        if (zkClientx != null) {
-            // return mutex.state();
-            return true;
-        } else {
-            return true;// 默认都放过
-        }
+        return true;// 默认都放过
     }
 
     /**
@@ -156,10 +118,20 @@ public class KafkaCanalConnector {
         }
 
         if (partition == null) {
-            kafkaConsumer.subscribe(Collections.singletonList(topic));
+            if (kafkaConsumer != null) {
+                kafkaConsumer.subscribe(Collections.singletonList(topic));
+            }
+            if (kafkaConsumer2 != null) {
+                kafkaConsumer2.subscribe(Collections.singletonList(topic));
+            }
         } else {
             TopicPartition topicPartition = new TopicPartition(topic, partition);
-            kafkaConsumer.assign(Collections.singletonList(topicPartition));
+            if (kafkaConsumer != null) {
+                kafkaConsumer.assign(Collections.singletonList(topicPartition));
+            }
+            if (kafkaConsumer2 != null) {
+                kafkaConsumer2.assign(Collections.singletonList(topicPartition));
+            }
         }
     }
 
@@ -172,7 +144,12 @@ public class KafkaCanalConnector {
             return;
         }
 
-        kafkaConsumer.unsubscribe();
+        if (kafkaConsumer != null) {
+            kafkaConsumer.unsubscribe();
+        }
+        if (kafkaConsumer2 != null) {
+            kafkaConsumer2.unsubscribe();
+        }
     }
 
     /**
@@ -180,22 +157,22 @@ public class KafkaCanalConnector {
      *
      * @return
      */
-    public Message get() {
+    public List get() {
         return get(100L, TimeUnit.MILLISECONDS);
     }
 
-    public Message get(Long timeout, TimeUnit unit) {
+    public List get(Long timeout, TimeUnit unit) {
         waitClientRunning();
         if (!running) {
             return null;
         }
 
-        Message message = getWithoutAck(timeout, unit);
+        List messages = getWithoutAck(timeout, unit);
         this.ack();
-        return message;
+        return messages;
     }
 
-    public Message getWithoutAck() {
+    public List getWithoutAck() {
         return getWithoutAck(100L, TimeUnit.MILLISECONDS);
     }
 
@@ -204,7 +181,7 @@ public class KafkaCanalConnector {
      *
      * @return
      */
-    public Message getWithoutAck(Long timeout, TimeUnit unit) {
+    public List getWithoutAck(Long timeout, TimeUnit unit) {
         waitClientRunning();
         if (!running) {
             return null;
@@ -213,7 +190,33 @@ public class KafkaCanalConnector {
         ConsumerRecords records = kafkaConsumer.poll(unit.toMillis(timeout)); // 基于配置,最多只能poll到一条数据
 
         if (!records.isEmpty()) {
-            return records.iterator().next().value();
+            // return records.iterator().next().value();
+            List messages = new ArrayList<>();
+            for (ConsumerRecord record : records) {
+                messages.add(record.value());
+            }
+            return messages;
+        }
+        return null;
+    }
+
+    public List getFlatMessageWithoutAck(Long timeout, TimeUnit unit) {
+        waitClientRunning();
+        if (!running) {
+            return null;
+        }
+
+        ConsumerRecords records = kafkaConsumer2.poll(unit.toMillis(timeout));
+
+        if (!records.isEmpty()) {
+            List flatMessages = new ArrayList<>();
+            for (ConsumerRecord record : records) {
+                String flatMessageJson = record.value();
+                FlatMessage flatMessage = JSON.parseObject(flatMessageJson, FlatMessage.class);
+                flatMessages.add(flatMessage);
+            }
+
+            return flatMessages;
         }
         return null;
     }
@@ -227,7 +230,12 @@ public class KafkaCanalConnector {
             return;
         }
 
-        kafkaConsumer.commitSync();
+        if (kafkaConsumer != null) {
+            kafkaConsumer.commitSync();
+        }
+        if (kafkaConsumer2 != null) {
+            kafkaConsumer2.commitAsync();
+        }
     }
 
     public void stopRunning() {
diff --git a/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnectors.java b/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnectors.java
index 0634a747..436fde8f 100644
--- a/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnectors.java
+++ b/client/src/main/java/com/alibaba/otter/canal/client/kafka/KafkaCanalConnectors.java
@@ -17,8 +17,9 @@ public class KafkaCanalConnectors {
      * @param groupId
      * @return
      */
-    public static KafkaCanalConnector newKafkaConnector(String servers, String topic, Integer partition, String groupId) {
-        return new KafkaCanalConnector(null, servers, topic, partition, groupId);
+    public static KafkaCanalConnector newKafkaConnector(String servers, String topic, Integer partition,
+                                                        String groupId) {
+        return new KafkaCanalConnector(servers, topic, partition, groupId, false);
     }
 
     /**
@@ -30,33 +31,21 @@ public class KafkaCanalConnectors {
      * @return
      */
     public static KafkaCanalConnector newKafkaConnector(String servers, String topic, String groupId) {
-        return new KafkaCanalConnector(null, servers, topic, null, groupId);
+        return new KafkaCanalConnector(servers, topic, null, groupId, false);
     }
 
     /**
      * 创建kafka客户端链接
      *
-     * @param zkServers
      * @param servers
      * @param topic
      * @param partition
      * @param groupId
+     * @param flatMessage
      * @return
      */
-    public static KafkaCanalConnector newKafkaConnector(String zkServers, String servers, String topic, Integer partition, String groupId) {
-        return new KafkaCanalConnector(zkServers, servers, topic, partition, groupId);
-    }
-
-    /**
-     * 创建kafka客户端链接
-     *
-     * @param zkServers
-     * @param servers
-     * @param topic
-     * @param groupId
-     * @return
-     */
-    public static KafkaCanalConnector newKafkaConnector(String zkServers, String servers, String topic, String groupId) {
-        return new KafkaCanalConnector(zkServers, servers, topic, null, groupId);
+    public static KafkaCanalConnector newKafkaConnector( String servers, String topic,
+                                                        Integer partition, String groupId,boolean flatMessage) {
+        return new KafkaCanalConnector(servers, topic, partition, groupId, flatMessage);
     }
 }
diff --git a/client/src/test/java/com/alibaba/otter/canal/client/running/kafka/CanalKafkaClientExample.java b/client/src/test/java/com/alibaba/otter/canal/client/running/kafka/CanalKafkaClientExample.java
index 0a53a1df..93f443cd 100644
--- a/client/src/test/java/com/alibaba/otter/canal/client/running/kafka/CanalKafkaClientExample.java
+++ b/client/src/test/java/com/alibaba/otter/canal/client/running/kafka/CanalKafkaClientExample.java
@@ -1,5 +1,6 @@
 package com.alibaba.otter.canal.client.running.kafka;
 
+import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.kafka.common.errors.WakeupException;
@@ -19,32 +20,33 @@ import com.alibaba.otter.canal.protocol.Message;
  */
 public class CanalKafkaClientExample {
 
-    protected final static Logger logger = LoggerFactory.getLogger(CanalKafkaClientExample.class);
+    protected final static Logger           logger  = LoggerFactory.getLogger(CanalKafkaClientExample.class);
 
-    private KafkaCanalConnector connector;
+    private KafkaCanalConnector             connector;
 
-    private static volatile boolean running = false;
+    private static volatile boolean         running = false;
 
-    private Thread thread = null;
+    private Thread                          thread  = null;
 
     private Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {
 
-        public void uncaughtException(Thread t, Throwable e) {
-            logger.error("parse events has an error", e);
-        }
-    };
+                                                        public void uncaughtException(Thread t, Throwable e) {
+                                                            logger.error("parse events has an error", e);
+                                                        }
+                                                    };
 
-    public CanalKafkaClientExample(String zkServers, String servers, String topic, Integer partition, String groupId) {
-        connector = KafkaCanalConnectors.newKafkaConnector(zkServers, servers, topic, partition, groupId);
+    public CanalKafkaClientExample(String zkServers, String servers, String topic, Integer partition, String groupId){
+        connector = KafkaCanalConnectors.newKafkaConnector(servers, topic, partition, groupId, false);
     }
 
     public static void main(String[] args) {
         try {
-            final CanalKafkaClientExample kafkaCanalClientExample = new CanalKafkaClientExample(AbstractKafkaTest.zkServers,
-                    AbstractKafkaTest.servers,
-                    AbstractKafkaTest.topic,
-                    AbstractKafkaTest.partition,
-                    AbstractKafkaTest.groupId);
+            final CanalKafkaClientExample kafkaCanalClientExample = new CanalKafkaClientExample(
+                AbstractKafkaTest.zkServers,
+                AbstractKafkaTest.servers,
+                AbstractKafkaTest.topic,
+                AbstractKafkaTest.partition,
+                AbstractKafkaTest.groupId);
             logger.info("## start the kafka consumer: {}-{}", AbstractKafkaTest.topic, AbstractKafkaTest.groupId);
             kafkaCanalClientExample.start();
             logger.info("## the canal kafka consumer is running now ......");
@@ -107,21 +109,24 @@ public class CanalKafkaClientExample {
                 connector.subscribe();
                 while (running) {
                     try {
-                        Message message = connector.getWithoutAck(1L, TimeUnit.SECONDS); // 获取message
-                        if (message == null) {
+                        List messages = connector.getWithoutAck(1L, TimeUnit.SECONDS); // 获取message
+
+                        if (messages == null) {
                             continue;
                         }
-                        long batchId = message.getId();
-                        int size = message.getEntries().size();
-                        if (batchId == -1 || size == 0) {
-                            // try {
-                            // Thread.sleep(1000);
-                            // } catch (InterruptedException e) {
-                            // }
-                        } else {
-                            // printSummary(message, batchId, size);
-                            // printEntry(message.getEntries());
-                            logger.info(message.toString());
+                        for (Message message : messages) {
+                            long batchId = message.getId();
+                            int size = message.getEntries().size();
+                            if (batchId == -1 || size == 0) {
+                                // try {
+                                // Thread.sleep(1000);
+                                // } catch (InterruptedException e) {
+                                // }
+                            } else {
+                                // printSummary(message, batchId, size);
+                                // printEntry(message.getEntries());
+                                logger.info(message.toString());
+                            }
                         }
 
                         connector.ack(); // 提交确认
@@ -139,6 +144,6 @@ public class CanalKafkaClientExample {
         } catch (WakeupException e) {
             // No-op. Continue process
         }
-        connector.disconnnect();
+        connector.disconnect();
     }
 }
diff --git a/client/src/test/java/com/alibaba/otter/canal/client/running/kafka/KafkaClientRunningTest.java b/client/src/test/java/com/alibaba/otter/canal/client/running/kafka/KafkaClientRunningTest.java
index ebc4d549..fcdc0bf6 100644
--- a/client/src/test/java/com/alibaba/otter/canal/client/running/kafka/KafkaClientRunningTest.java
+++ b/client/src/test/java/com/alibaba/otter/canal/client/running/kafka/KafkaClientRunningTest.java
@@ -1,5 +1,6 @@
 package com.alibaba.otter.canal.client.running.kafka;
 
+import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
@@ -39,9 +40,9 @@ public class KafkaClientRunningTest extends AbstractKafkaTest {
                 connector.subscribe();
                 while (running) {
                     try {
-                        Message message = connector.getWithoutAck(3L, TimeUnit.SECONDS);
-                        if (message != null) {
-                            System.out.println(message);
+                        List messages = connector.getWithoutAck(3L, TimeUnit.SECONDS);
+                        if (messages != null) {
+                            System.out.println(messages);
                         }
                         connector.ack();
                     } catch (WakeupException e) {
@@ -49,7 +50,7 @@ public class KafkaClientRunningTest extends AbstractKafkaTest {
                     }
                 }
                 connector.unsubscribe();
-                connector.disconnnect();
+                connector.disconnect();
             }
         });
 
diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/kafka.yml
index db4a9abe..735f723d 100644
--- a/deployer/src/main/resources/kafka.yml
+++ b/deployer/src/main/resources/kafka.yml
@@ -8,8 +8,11 @@ bufferMemory: 33554432
 canalBatchSize: 50
 # Canal get数据的超时时间, 单位: 毫秒, 空为不限超时
 canalGetTimeout: 100
+flatMessage: true
 
 canalDestinations:
   - canalDestination: example
     topic: example
-    partition:
\ No newline at end of file
+    partition:
+
+
diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java b/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java
new file mode 100644
index 00000000..e6aab531
--- /dev/null
+++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java
@@ -0,0 +1,286 @@
+package com.alibaba.otter.canal.protocol;
+
+import java.io.Serializable;
+import java.util.*;
+
+import com.google.common.collect.Table;
+import com.google.protobuf.ByteString;
+
+/**
+ * @author machengyuan 2018-9-13 下午10:31:14
+ * @version 1.0.0
+ */
+public class FlatMessage implements Serializable {
+
+    private static final long         serialVersionUID = -3386650678735860050L;
+
+    private long                      id;
+    private String                    database;
+    private String                    table;
+    private Boolean                   isDdl;
+    private String                    type;
+    private Long                      ts;
+    private String                    sql;
+    private Map      sqlType;
+    private Map       mysqlType;
+    private List> data;
+    private List> old;
+
+    public FlatMessage() {
+    }
+
+    public FlatMessage(long id){
+        this.id = id;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getDatabase() {
+        return database;
+    }
+
+    public void setDatabase(String database) {
+        this.database = database;
+    }
+
+    public String getTable() {
+        return table;
+    }
+
+    public void setTable(String table) {
+        this.table = table;
+    }
+
+    public Boolean getIsDdl() {
+        return isDdl;
+    }
+
+    public void setIsDdl(Boolean isDdl) {
+        this.isDdl = isDdl;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Long getTs() {
+        return ts;
+    }
+
+    public void setTs(Long ts) {
+        this.ts = ts;
+    }
+
+    public String getSql() {
+        return sql;
+    }
+
+    public void setSql(String sql) {
+        this.sql = sql;
+    }
+
+    public Map getSqlType() {
+        return sqlType;
+    }
+
+    public void setSqlType(Map sqlType) {
+        this.sqlType = sqlType;
+    }
+
+    public Map getMysqlType() {
+        return mysqlType;
+    }
+
+    public void setMysqlType(Map mysqlType) {
+        this.mysqlType = mysqlType;
+    }
+
+    public List> getData() {
+        return data;
+    }
+
+    public void setData(List> data) {
+        this.data = data;
+    }
+
+    public List> getOld() {
+        return old;
+    }
+
+    public void setOld(List> old) {
+        this.old = old;
+    }
+
+    public static List messageConverter(Message message) {
+        try {
+            if (message == null) {
+                return null;
+            }
+
+            List flatMessages = new ArrayList<>();
+
+            List rawEntries = message.getRawEntries();
+
+            for (ByteString byteString : rawEntries) {
+                CanalEntry.Entry entry = CanalEntry.Entry.parseFrom(byteString);
+                if (entry.getEntryType() == CanalEntry.EntryType.TRANSACTIONBEGIN
+                    || entry.getEntryType() == CanalEntry.EntryType.TRANSACTIONEND) {
+                    continue;
+                }
+
+                CanalEntry.RowChange rowChange;
+                try {
+                    rowChange = CanalEntry.RowChange.parseFrom(entry.getStoreValue());
+                } catch (Exception e) {
+                    throw new RuntimeException(
+                        "ERROR ## parser of eromanga-event has an error , data:" + entry.toString(),
+                        e);
+                }
+
+                CanalEntry.EventType eventType = rowChange.getEventType();
+
+                FlatMessage flatMessage = new FlatMessage(message.getId());
+                flatMessages.add(flatMessage);
+                flatMessage.setDatabase(entry.getHeader().getSchemaName());
+                flatMessage.setTable(entry.getHeader().getTableName());
+                flatMessage.setIsDdl(rowChange.getIsDdl());
+                flatMessage.setType(eventType.toString());
+                flatMessage.setTs(System.currentTimeMillis());
+                flatMessage.setSql(rowChange.getSql());
+
+                if (!rowChange.getIsDdl()) {
+                    Map sqlType = new LinkedHashMap<>();
+                    Map mysqlType = new LinkedHashMap<>();
+                    List> data = new ArrayList<>();
+                    List> old = new ArrayList<>();
+
+                    Set updateSet = new HashSet<>();
+                    for (CanalEntry.RowData rowData : rowChange.getRowDatasList()) {
+                        if (eventType != CanalEntry.EventType.INSERT && eventType != CanalEntry.EventType.UPDATE
+                            && eventType != CanalEntry.EventType.DELETE) {
+                            continue;
+                        }
+
+                        Map row = new LinkedHashMap<>();
+                        List columns;
+
+                        if (eventType == CanalEntry.EventType.DELETE) {
+                            columns = rowData.getBeforeColumnsList();
+                        } else {
+                            columns = rowData.getAfterColumnsList();
+                        }
+
+                        for (CanalEntry.Column column : columns) {
+                            sqlType.put(column.getName(), column.getSqlType());
+                            mysqlType.put(column.getName(), column.getMysqlType());
+                            row.put(column.getName(), column.getValue());
+                            // 获取update为true的字段
+                            if (column.getUpdated()) {
+                                updateSet.add(column.getName());
+                            }
+                        }
+                        if (!row.isEmpty()) {
+                            data.add(row);
+                        }
+
+                        if (eventType == CanalEntry.EventType.UPDATE) {
+                            Map rowOld = new LinkedHashMap<>();
+                            for (CanalEntry.Column column : rowData.getBeforeColumnsList()) {
+                                if (updateSet.contains(column.getName())) {
+                                    rowOld.put(column.getName(), column.getValue());
+                                }
+                            }
+                            // update操作将记录修改前的值
+                            if (!rowOld.isEmpty()) {
+                                old.add(rowOld);
+                            }
+                        }
+                    }
+                    if (!sqlType.isEmpty()) {
+                        flatMessage.setSqlType(sqlType);
+                    }
+                    if (!mysqlType.isEmpty()) {
+                        flatMessage.setMysqlType(mysqlType);
+                    }
+                    if (!data.isEmpty()) {
+                        flatMessage.setData(data);
+                    }
+                    if (!old.isEmpty()) {
+                        flatMessage.setOld(old);
+                    }
+                }
+            }
+            return flatMessages;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static FlatMessage[] messagePartition(FlatMessage flatMessage, Integer partitionsNum,
+                                                 Table pkHashConfig) {
+        FlatMessage[] partitionMessages = new FlatMessage[partitionsNum];
+
+        String pk = pkHashConfig.get(flatMessage.getDatabase(), flatMessage.getTable());
+        if (pk == null || flatMessage.getIsDdl()) {
+            partitionMessages[0] = flatMessage;
+        } else {
+            if (flatMessage.getData() != null) {
+                int idx = 0;
+                for (Map row : flatMessage.getData()) {
+                    String value = row.get(pk);
+                    if (value == null) {
+                        value = "";
+                    }
+                    int hash = value.hashCode();
+                    int pkHash = Math.abs(hash) % partitionsNum;
+
+                    FlatMessage flatMessageTmp = partitionMessages[pkHash];
+                    if (flatMessageTmp == null) {
+                        flatMessageTmp = new FlatMessage(flatMessage.getId());
+                        partitionMessages[pkHash] = flatMessageTmp;
+                        flatMessageTmp.setDatabase(flatMessage.getDatabase());
+                        flatMessageTmp.setTable(flatMessage.getTable());
+                        flatMessageTmp.setIsDdl(flatMessage.getIsDdl());
+                        flatMessageTmp.setType(flatMessage.getType());
+                        flatMessageTmp.setSql(flatMessage.getSql());
+                        flatMessageTmp.setSqlType(flatMessage.getSqlType());
+                        flatMessageTmp.setMysqlType(flatMessage.getMysqlType());
+                    }
+                    List> data = flatMessageTmp.getData();
+                    if (data == null) {
+                        data = new ArrayList<>();
+                        flatMessageTmp.setData(data);
+                    }
+                    data.add(row);
+                    if (flatMessage.getOld() != null && !flatMessage.getOld().isEmpty()) {
+                        List> old = flatMessageTmp.getOld();
+                        if (old == null) {
+                            old = new ArrayList<>();
+                            flatMessageTmp.setOld(old);
+                        }
+                        old.add(flatMessage.getOld().get(idx));
+                    }
+                    idx++;
+                }
+            }
+        }
+        return partitionMessages;
+    }
+
+    @Override
+    public String toString() {
+        return "FlatMessage{" + "id=" + id + ", database='" + database + '\'' + ", table='" + table + '\'' + ", isDdl="
+               + isDdl + ", type='" + type + '\'' + ", ts=" + ts + ", sql='" + sql + '\'' + ", sqlType=" + sqlType
+               + ", mysqlType=" + mysqlType + ", data=" + data + ", old=" + old + '}';
+    }
+}
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
index 0685f76e..22f15229 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
@@ -1,5 +1,6 @@
 package com.alibaba.otter.canal.kafka;
 
+import java.util.List;
 import java.util.Properties;
 import java.util.concurrent.Future;
 
@@ -11,6 +12,8 @@ import org.apache.kafka.common.serialization.StringSerializer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.otter.canal.protocol.FlatMessage;
 import com.alibaba.otter.canal.protocol.Message;
 
 /**
@@ -25,7 +28,12 @@ public class CanalKafkaProducer {
 
     private Producer producer;
 
+    private Producer  producer2;                                                 // 用于扁平message的数据投递
+
+    private KafkaProperties           kafkaProperties;
+
     public void init(KafkaProperties kafkaProperties) {
+        this.kafkaProperties = kafkaProperties;
         Properties properties = new Properties();
         properties.put("bootstrap.servers", kafkaProperties.getServers());
         properties.put("acks", "all");
@@ -34,15 +42,26 @@ public class CanalKafkaProducer {
         properties.put("linger.ms", kafkaProperties.getLingerMs());
         properties.put("buffer.memory", kafkaProperties.getBufferMemory());
         properties.put("key.serializer", StringSerializer.class.getName());
-        properties.put("value.serializer", MessageSerializer.class.getName());
-        producer = new KafkaProducer(properties);
+        if (!kafkaProperties.getFlatMessage()) {
+            properties.put("value.serializer", MessageSerializer.class.getName());
+            producer = new KafkaProducer(properties);
+        } else {
+            properties.put("value.serializer", StringSerializer.class.getName());
+            producer2 = new KafkaProducer(properties);
+        }
+
         // producer.initTransactions();
     }
 
     public void stop() {
         try {
             logger.info("## stop the kafka producer");
-            producer.close();
+            if (producer != null) {
+                producer.close();
+            }
+            if (producer2 != null) {
+                producer2.close();
+            }
         } catch (Throwable e) {
             logger.warn("##something goes wrong when stopping kafka producer:", e);
         } finally {
@@ -53,14 +72,27 @@ public class CanalKafkaProducer {
     public void send(KafkaProperties.Topic topic, Message message, Callback callback) {
         try {
             // producer.beginTransaction();
-            ProducerRecord record;
-            if (topic.getPartition() != null) {
-                record = new ProducerRecord(topic.getTopic(), topic.getPartition(), null, message);
+            if (!kafkaProperties.getFlatMessage()) {
+                ProducerRecord record;
+                if (topic.getPartition() != null) {
+                    record = new ProducerRecord(topic.getTopic(), topic.getPartition(), null, message);
+                } else {
+                    record = new ProducerRecord(topic.getTopic(), message);
+                }
+                Future future = producer.send(record);
+                future.get();
             } else {
-                record = new ProducerRecord(topic.getTopic(), message);
+                // 发送扁平数据json
+                List flatMessages = FlatMessage.messageConverter(message);
+                if (flatMessages != null) {
+                    for (FlatMessage flatMessage : flatMessages) {
+                        ProducerRecord record = new ProducerRecord(topic.getTopic(),
+                            JSON.toJSONString(flatMessage));
+                        producer2.send(record);
+                    }
+                }
             }
-            Future future = producer.send(record);
-            future.get();
+
             // producer.commitTransaction();
             callback.commit();
             if (logger.isDebugEnabled()) {
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java b/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java
index 40f11bf5..82707ba4 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java
@@ -21,6 +21,7 @@ public class KafkaProperties {
     private boolean                filterTransactionEntry = true;
     private int                    canalBatchSize         = 50;
     private Long                   canalGetTimeout;
+    private boolean                flatMessage            = true;
 
     private List canalDestinations      = new ArrayList();
 
@@ -160,6 +161,14 @@ public class KafkaProperties {
         this.canalGetTimeout = canalGetTimeout;
     }
 
+    public boolean getFlatMessage() {
+        return flatMessage;
+    }
+
+    public void setFlatMessage(boolean flatMessage) {
+        this.flatMessage = flatMessage;
+    }
+
     public List getCanalDestinations() {
         return canalDestinations;
     }
diff --git a/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java b/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java
index 9ac5a834..a4f74c90 100644
--- a/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java
+++ b/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java
@@ -311,9 +311,10 @@ public class CanalServerWithEmbedded extends AbstractCanalLifeCycle implements C
             }
 
             if (CollectionUtils.isEmpty(events.getEvents())) {
-                logger.debug("getWithoutAck successfully, clientId:{} batchSize:{} but result is null",
-                    clientIdentity.getClientId(),
-                    batchSize);
+                // logger.debug("getWithoutAck successfully, clientId:{} batchSize:{} but result
+                // is null",
+                // clientIdentity.getClientId(),
+                // batchSize);
                 return new Message(-1, true, new ArrayList()); // 返回空包,避免生成batchId,浪费性能
             } else {
                 // 记录到流式信息

From db56effd911fffc60fa068993d3e9008c4707754 Mon Sep 17 00:00:00 2001
From: mcy 
Date: Fri, 14 Sep 2018 11:45:52 +0800
Subject: [PATCH 23/42] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../client/adapter/loader/CanalAdapterKafkaWorker.java    | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java
index d7324cda..72320bb5 100644
--- a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java
+++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterKafkaWorker.java
@@ -156,18 +156,14 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker {
                         TimeUnit.SECONDS.sleep(1L);
                     }
                 }
-            } catch (
-
-            Exception e) {
+            } catch (Exception e) {
                 logger.error(e.getMessage(), e);
             }
         }
 
         executor.shutdown();
 
-        try
-
-        {
+        try {
             connector.unsubscribe();
         } catch (WakeupException e) {
             // No-op. Continue process

From 1516cf779db1bcd311c1aa2266403b7399685d00 Mon Sep 17 00:00:00 2001
From: winger 
Date: Fri, 14 Sep 2018 14:06:32 +0800
Subject: [PATCH 24/42] =?UTF-8?q?=E5=B0=86=E5=BD=93=E5=89=8D=E7=9A=84gtid?=
 =?UTF-8?q?=EF=BC=8Csequence=20no=20=E5=92=8Clast=20committed=E4=BF=A1?=
 =?UTF-8?q?=E6=81=AF=E5=A2=9E=E5=8A=A0=E8=87=B3Entry(trx=20begin/end,=20ro?=
 =?UTF-8?q?wdata)=20Header=20=E4=B8=AD,=E5=AE=A2=E6=88=B7=E7=AB=AF?=
 =?UTF-8?q?=E5=8F=AF=E4=BB=8Eproperty=E4=B8=AD=E8=8E=B7=E5=8F=96=E7=9B=B8?=
 =?UTF-8?q?=E5=85=B3=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../taobao/tddl/dbsync/binlog/LogContext.java | 11 ++++++
 .../taobao/tddl/dbsync/binlog/LogDecoder.java | 24 +++++++------
 .../tddl/dbsync/binlog/event/LogHeader.java   | 35 ++++++++++++++++---
 .../inbound/mysql/dbsync/LogEventConvert.java | 21 +++++++++--
 4 files changed, 72 insertions(+), 19 deletions(-)

diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java
index d8699629..0668ac4e 100644
--- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java
+++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogContext.java
@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet;
 import com.taobao.tddl.dbsync.binlog.event.FormatDescriptionLogEvent;
+import com.taobao.tddl.dbsync.binlog.event.GtidLogEvent;
 import com.taobao.tddl.dbsync.binlog.event.TableMapLogEvent;
 
 /**
@@ -23,6 +24,8 @@ public final class LogContext {
 
     private GTIDSet                           gtidSet;
 
+    private GtidLogEvent                      gtidLogEvent; // save current gtid log event
+
     public LogContext(){
         this.formatDescription = FormatDescriptionLogEvent.FORMAT_DESCRIPTION_EVENT_5_x;
     }
@@ -71,4 +74,12 @@ public final class LogContext {
     public void setGtidSet(GTIDSet gtidSet) {
         this.gtidSet = gtidSet;
     }
+
+    public GtidLogEvent getGtidLogEvent() {
+        return gtidLogEvent;
+    }
+
+    public void setGtidLogEvent(GtidLogEvent gtidLogEvent) {
+        this.gtidLogEvent = gtidLogEvent;
+    }
 }
diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java
index cfe51a1c..6670f259 100644
--- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java
+++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogDecoder.java
@@ -161,19 +161,20 @@ public final class LogDecoder {
             buffer.limit(header.getEventLen() - LogEvent.BINLOG_CHECKSUM_LEN);
         }
         GTIDSet gtidSet = context.getGtidSet();
+        GtidLogEvent gtidLogEvent = context.getGtidLogEvent();
         switch (header.getType()) {
             case LogEvent.QUERY_EVENT: {
                 QueryLogEvent event = new QueryLogEvent(header, buffer, descriptionEvent);
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.XID_EVENT: {
                 XidLogEvent event = new XidLogEvent(header, buffer, descriptionEvent);
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.TABLE_MAP_EVENT: {
@@ -271,14 +272,14 @@ public final class LogDecoder {
                 RandLogEvent event = new RandLogEvent(header, buffer, descriptionEvent);
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.USER_VAR_EVENT: {
                 UserVarLogEvent event = new UserVarLogEvent(header, buffer, descriptionEvent);
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.FORMAT_DESCRIPTION_EVENT: {
@@ -329,7 +330,6 @@ public final class LogDecoder {
                 HeartbeatLogEvent event = new HeartbeatLogEvent(header, buffer, descriptionEvent);
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
-                header.putGtidStr(context.getGtidSet());
                 return event;
             }
             case LogEvent.IGNORABLE_LOG_EVENT: {
@@ -342,7 +342,7 @@ public final class LogDecoder {
                 RowsQueryLogEvent event = new RowsQueryLogEvent(header, buffer, descriptionEvent);
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.WRITE_ROWS_EVENT: {
@@ -350,7 +350,7 @@ public final class LogDecoder {
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
                 event.fillTable(context);
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.UPDATE_ROWS_EVENT: {
@@ -358,7 +358,7 @@ public final class LogDecoder {
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
                 event.fillTable(context);
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.DELETE_ROWS_EVENT: {
@@ -366,7 +366,7 @@ public final class LogDecoder {
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
                 event.fillTable(context);
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.GTID_LOG_EVENT:
@@ -377,8 +377,10 @@ public final class LogDecoder {
                 if (gtidSet != null) {
                     gtidSet.update(event.getGtidStr());
                     // update latest gtid
-                    header.putGtidStr(gtidSet);
+                    header.putGtid(gtidSet, event);
                 }
+                // update current gtid event to context
+                context.setGtidLogEvent(event);
                 return event;
             }
             case LogEvent.PREVIOUS_GTIDS_LOG_EVENT: {
@@ -409,7 +411,7 @@ public final class LogDecoder {
                 AnnotateRowsEvent event = new AnnotateRowsEvent(header, buffer, descriptionEvent);
                 /* updating position in context */
                 logPosition.position = header.getLogPos();
-                header.putGtidStr(context.getGtidSet());
+                header.putGtid(context.getGtidSet(), gtidLogEvent);
                 return event;
             }
             case LogEvent.BINLOG_CHECKPOINT_EVENT: {
diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/LogHeader.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/LogHeader.java
index 77e48ddb..ab273f1b 100644
--- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/LogHeader.java
+++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/LogHeader.java
@@ -4,6 +4,9 @@ import com.alibaba.otter.canal.parse.driver.mysql.packets.GTIDSet;
 import com.taobao.tddl.dbsync.binlog.LogBuffer;
 import com.taobao.tddl.dbsync.binlog.LogEvent;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * The Common-Header, documented in the table @ref Table_common_header "below",
  * always has the same form and length within one version of MySQL. Each event
@@ -121,7 +124,12 @@ public final class LogHeader {
      */
     protected String    logFileName;
 
-    protected String    gtidStr;
+    protected Map gtidMap = new HashMap<>();
+
+    private static final String CURRENT_GTID_STRING = "curt_gtid";
+    private static final String CURRENT_GTID_SN = "curt_gtid_sn";
+    private static final String CURRENT_GTID_LAST_COMMIT = "curt_gtid_lct";
+    private static final String GTID_SET_STRING = "gtid_str";
 
     /* for Start_event_v3 */
     public LogHeader(final int type){
@@ -292,13 +300,30 @@ public final class LogHeader {
         }
     }
 
-    public String getGtidStr() {
-        return gtidStr;
+    public String getGtidSetStr() {
+        return gtidMap.get(GTID_SET_STRING);
     }
 
-    public void putGtidStr(GTIDSet gtidSet) {
+    public String getCurrentGtid() {
+        return gtidMap.get(CURRENT_GTID_STRING);
+    }
+
+    public String getCurrentGtidSn() {
+        return gtidMap.get(CURRENT_GTID_SN);
+    }
+
+    public String getCurrentGtidLastCommit() {
+        return gtidMap.get(CURRENT_GTID_LAST_COMMIT);
+    }
+
+    public void putGtid(GTIDSet gtidSet, GtidLogEvent event) {
         if (gtidSet != null) {
-            this.gtidStr = gtidSet.toString();
+            gtidMap.put(GTID_SET_STRING, gtidSet.toString());
+            if (event != null) {
+                gtidMap.put(CURRENT_GTID_STRING, event.getGtidStr());
+                gtidMap.put(CURRENT_GTID_SN, String.valueOf(event.getSequenceNumber()));
+                gtidMap.put(CURRENT_GTID_LAST_COMMIT, String.valueOf(event.getLastCommitted()));
+            }
         }
     }
 }
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java
index 55090f65..7fcd1a1f 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/LogEventConvert.java
@@ -545,7 +545,6 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar
                 rowsCount++;
                 rowChangeBuider.addRowDatas(rowDataBuilder.build());
             }
-
             TableMapLogEvent table = event.getTable();
             Header header = createHeader(event.getHeader(),
                 table.getDbName(),
@@ -834,8 +833,24 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar
         }
         headerBuilder.setEventLength(logHeader.getEventLen());
         // enable gtid position
-        if (StringUtils.isNotEmpty(logHeader.getGtidStr())) {
-            headerBuilder.setGtid(logHeader.getGtidStr());
+        if (StringUtils.isNotEmpty(logHeader.getGtidSetStr())) {
+            headerBuilder.setGtid(logHeader.getGtidSetStr());
+        }
+        // add current gtid
+        if (StringUtils.isNotEmpty(logHeader.getCurrentGtid())) {
+            Pair pair = createSpecialPair("curtGtid", logHeader.getCurrentGtid());
+            headerBuilder.addProps(pair);
+        }
+        // add current gtid sequence no
+        if (StringUtils.isNotEmpty(logHeader.getCurrentGtidSn())) {
+            Pair pair = createSpecialPair("curtGtidSn", logHeader.getCurrentGtidSn());
+            headerBuilder.addProps(pair);
+        }
+
+        // add current gtid last committed
+        if (StringUtils.isNotEmpty(logHeader.getCurrentGtidLastCommit())) {
+            Pair pair = createSpecialPair("curtGtidLct", logHeader.getCurrentGtidLastCommit());
+            headerBuilder.addProps(pair);
         }
 
         // add rowsCount suppport

From 6e84b98651df5ff5a9450b25f5edca7fc77101ac Mon Sep 17 00:00:00 2001
From: winger 
Date: Fri, 14 Sep 2018 14:22:55 +0800
Subject: [PATCH 25/42] =?UTF-8?q?example=20=E5=A2=9E=E5=8A=A0=E8=8E=B7?=
 =?UTF-8?q?=E5=8F=96=E5=BD=93=E5=89=8Dgtid=E7=9B=B8=E5=85=B3=E4=BF=A1?=
 =?UTF-8?q?=E6=81=AF=E7=A4=BA=E4=BE=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../example/AbstractCanalClientTest.java      | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/example/src/main/java/com/alibaba/otter/canal/example/AbstractCanalClientTest.java b/example/src/main/java/com/alibaba/otter/canal/example/AbstractCanalClientTest.java
index 599b5da7..9cb5eb00 100644
--- a/example/src/main/java/com/alibaba/otter/canal/example/AbstractCanalClientTest.java
+++ b/example/src/main/java/com/alibaba/otter/canal/example/AbstractCanalClientTest.java
@@ -5,6 +5,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
+import com.alibaba.otter.canal.protocol.CanalEntry;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.SystemUtils;
 import org.slf4j.Logger;
@@ -299,4 +300,55 @@ public class AbstractCanalClientTest {
         this.connector = connector;
     }
 
+    /**
+     * 获取当前Entry的 GTID信息示例
+     * @param header
+     * @return
+     */
+    public static String getCurrentGtid(CanalEntry.Header header) {
+        List props = header.getPropsList();
+        if (props != null && props.size() > 0) {
+            for (CanalEntry.Pair pair : props) {
+                if ("curtGtid".equals(pair.getKey())) {
+                    return pair.getValue();
+                }
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 获取当前Entry的 GTID Sequence No信息示例
+     * @param header
+     * @return
+     */
+    public static String getCurrentGtidSn(CanalEntry.Header header) {
+        List props = header.getPropsList();
+        if (props != null && props.size() > 0) {
+            for (CanalEntry.Pair pair : props) {
+                if ("curtGtidSn".equals(pair.getKey())) {
+                    return pair.getValue();
+                }
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 获取当前Entry的 GTID Last Committed信息示例
+     * @param header
+     * @return
+     */
+    public static String getCurrentGtidLct(CanalEntry.Header header) {
+        List props = header.getPropsList();
+        if (props != null && props.size() > 0) {
+            for (CanalEntry.Pair pair : props) {
+                if ("curtGtidLct".equals(pair.getKey())) {
+                    return pair.getValue();
+                }
+            }
+        }
+        return "";
+    }
+
 }

From 6682c56b9f1f15b544daeb2fda51964c371d8c6b Mon Sep 17 00:00:00 2001
From: Chuanyi Li 
Date: Sat, 15 Sep 2018 13:21:38 +0800
Subject: [PATCH 26/42] Canal metrics group mode support.

---
 .../mysql/AbstractMysqlEventParser.java       |  6 ++
 .../parse/inbound/mysql/MysqlEventParser.java |  7 --
 .../prometheus/impl/ParserCollector.java      | 96 +++++++++++++------
 3 files changed, 75 insertions(+), 34 deletions(-)

diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java
index e36893a3..00e302e6 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/AbstractMysqlEventParser.java
@@ -38,6 +38,8 @@ public abstract class AbstractMysqlEventParser extends AbstractEventParser {
     protected boolean              filterRows                = false;
     protected boolean              filterTableError          = false;
     protected boolean              useDruidDdlFilter         = true;
+    // instance received binlog bytes
+    protected final AtomicLong     receivedBinlogBytes       = new AtomicLong(0L);
     private final AtomicLong       eventsPublishBlockingTime = new AtomicLong(0L);
 
     protected BinlogParser buildParser() {
@@ -204,4 +206,8 @@ public abstract class AbstractMysqlEventParser extends AbstractEventParser {
         return this.eventsPublishBlockingTime;
     }
 
+    public AtomicLong getReceivedBinlogBytes() {
+        return this.receivedBinlogBytes;
+    }
+
 }
diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java
index b585d9ab..a5c8d870 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java
@@ -71,9 +71,6 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
     private int                  dumpErrorCount                    = 0;                 // binlogDump失败异常计数
     private int                  dumpErrorCountThreshold           = 2;                 // binlogDump失败异常计数阀值
 
-    // instance received binlog bytes
-    private final AtomicLong     receivedBinlogBytes               = new AtomicLong(0L);
-
     protected ErosaConnection buildErosaConnection() {
         return buildMysqlConnection(this.runningInfo);
     }
@@ -907,8 +904,4 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
         this.dumpErrorCountThreshold = dumpErrorCountThreshold;
     }
 
-    public AtomicLong getReceivedBinlogBytes() {
-        return this.receivedBinlogBytes;
-    }
-
 }
diff --git a/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/ParserCollector.java b/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/ParserCollector.java
index 867e1e89..660bf1ca 100644
--- a/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/ParserCollector.java
+++ b/prometheus/src/main/java/com/alibaba/otter/canal/prometheus/impl/ParserCollector.java
@@ -1,14 +1,15 @@
 package com.alibaba.otter.canal.prometheus.impl;
 
 import static com.alibaba.otter.canal.prometheus.CanalInstanceExports.DEST;
-import static com.alibaba.otter.canal.prometheus.CanalInstanceExports.DEST_LABELS_LIST;
+
+import com.alibaba.otter.canal.parse.inbound.group.GroupEventParser;
+import com.alibaba.otter.canal.parse.inbound.mysql.AbstractMysqlEventParser;
 import io.prometheus.client.Collector;
 import io.prometheus.client.CounterMetricFamily;
 import io.prometheus.client.GaugeMetricFamily;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -19,7 +20,6 @@ import org.slf4j.LoggerFactory;
 
 import com.alibaba.otter.canal.instance.core.CanalInstance;
 import com.alibaba.otter.canal.parse.CanalEventParser;
-import com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser;
 import com.alibaba.otter.canal.prometheus.InstanceRegistry;
 import com.google.common.base.Preconditions;
 
@@ -34,11 +34,13 @@ public class ParserCollector extends Collector implements InstanceRegistry {
     private static final String                              RECEIVED_BINLOG       = "canal_instance_received_binlog_bytes";
     private static final String                              PARSER_MODE           = "canal_instance_parser_mode";
     private static final String                              MODE_LABEL            = "parallel";
+    private static final String                              PARSER_LABEL          = "parser";
     private static final String                              PUBLISH_BLOCKING_HELP = "Publish blocking time of dump thread in milliseconds";
     private static final String                              RECEIVED_BINLOG_HELP  = "Received binlog bytes";
     private static final String                              MODE_HELP             = "Parser mode(parallel/serial) of instance";
     private final List                               modeLabels            = Arrays.asList(DEST, MODE_LABEL);
-    private final ConcurrentMap instances             = new ConcurrentHashMap();
+    private final List                               parserLabels          = Arrays.asList(DEST, PARSER_LABEL);
+    private final ConcurrentMap instances             = new ConcurrentHashMap<>();
 
     private ParserCollector() {}
 
@@ -52,53 +54,87 @@ public class ParserCollector extends Collector implements InstanceRegistry {
 
     @Override
     public List collect() {
-        List mfs = new ArrayList();
-        boolean hasParallel = false;
+        List mfs = new ArrayList<>();
         CounterMetricFamily bytesCounter = new CounterMetricFamily(RECEIVED_BINLOG,
-                RECEIVED_BINLOG_HELP, DEST_LABELS_LIST);
+                RECEIVED_BINLOG_HELP, parserLabels);
         GaugeMetricFamily modeGauge = new GaugeMetricFamily(PARSER_MODE,
                 MODE_HELP, modeLabels);
         CounterMetricFamily blockingCounter = new CounterMetricFamily(PUBLISH_BLOCKING,
-                PUBLISH_BLOCKING_HELP, DEST_LABELS_LIST);
+                PUBLISH_BLOCKING_HELP, parserLabels);
         for (ParserMetricsHolder emh : instances.values()) {
-            if (emh.isParallel) {
-                blockingCounter.addMetric(emh.destLabelValues, (emh.eventsPublishBlockingTime.doubleValue() / NANO_PER_MILLI));
-                hasParallel = true;
+            if (emh instanceof GroupParserMetricsHolder) {
+                GroupParserMetricsHolder group = (GroupParserMetricsHolder) emh;
+                for (ParserMetricsHolder semh :  group.holders) {
+                    singleCollect(bytesCounter, blockingCounter, modeGauge, semh);
+                }
+            }
+            else {
+                singleCollect(bytesCounter, blockingCounter, modeGauge, emh);
             }
-            modeGauge.addMetric(emh.modeLabelValues, 1);
-            bytesCounter.addMetric(emh.destLabelValues, emh.receivedBinlogBytes.doubleValue());
-
         }
         mfs.add(bytesCounter);
         mfs.add(modeGauge);
-        if (hasParallel) {
+        if (!blockingCounter.samples.isEmpty()) {
             mfs.add(blockingCounter);
         }
         return mfs;
     }
 
+    private void singleCollect(CounterMetricFamily bytesCounter, CounterMetricFamily blockingCounter, GaugeMetricFamily modeGauge, ParserMetricsHolder holder) {
+        if (holder.isParallel) {
+            blockingCounter.addMetric(holder.parserLabelValues, (holder.eventsPublishBlockingTime.doubleValue() / NANO_PER_MILLI));
+        }
+        modeGauge.addMetric(holder.modeLabelValues, 1);
+        bytesCounter.addMetric(holder.parserLabelValues, holder.receivedBinlogBytes.doubleValue());
+    }
+
     @Override
     public void register(CanalInstance instance) {
         final String destination = instance.getDestination();
-        ParserMetricsHolder holder = new ParserMetricsHolder();
+        ParserMetricsHolder holder;
         CanalEventParser parser = instance.getEventParser();
-        if (!(parser instanceof MysqlEventParser)) {
-            throw new IllegalArgumentException("CanalEventParser must be MysqlEventParser");
+        if (parser instanceof AbstractMysqlEventParser) {
+            holder = singleHolder(destination, (AbstractMysqlEventParser)parser, "0");
+        } else if (parser instanceof GroupEventParser) {
+            holder = groupHolder(destination, (GroupEventParser)parser);
+        } else {
+            throw new IllegalArgumentException("CanalEventParser must be either AbstractMysqlEventParser or GroupEventParser.");
         }
-        MysqlEventParser mysqlParser = (MysqlEventParser) parser;
-        holder.destLabelValues = Collections.singletonList(destination);
-        holder.modeLabelValues = Arrays.asList(destination, Boolean.toString(mysqlParser.isParallel()));
-        holder.eventsPublishBlockingTime = mysqlParser.getEventsPublishBlockingTime();
-        holder.receivedBinlogBytes = mysqlParser.getReceivedBinlogBytes();
-        holder.isParallel = mysqlParser.isParallel();
-        Preconditions.checkNotNull(holder.eventsPublishBlockingTime);
-        Preconditions.checkNotNull(holder.receivedBinlogBytes);
+        Preconditions.checkNotNull(holder);
         ParserMetricsHolder old = instances.put(destination, holder);
         if (old != null) {
             logger.warn("Remove stale ParserCollector for instance {}.", destination);
         }
     }
 
+    private ParserMetricsHolder singleHolder(String destination, AbstractMysqlEventParser parser, String id) {
+        ParserMetricsHolder holder = new ParserMetricsHolder();
+        holder.parserLabelValues = Arrays.asList(destination, id);
+        holder.modeLabelValues = Arrays.asList(destination, Boolean.toString(parser.isParallel()));
+        holder.eventsPublishBlockingTime = parser.getEventsPublishBlockingTime();
+        holder.receivedBinlogBytes = parser.getReceivedBinlogBytes();
+        holder.isParallel = parser.isParallel();
+        Preconditions.checkNotNull(holder.eventsPublishBlockingTime);
+        Preconditions.checkNotNull(holder.receivedBinlogBytes);
+        return holder;
+    }
+
+    private GroupParserMetricsHolder groupHolder(String destination, GroupEventParser group) {
+        List parsers = group.getEventParsers();
+        GroupParserMetricsHolder groupHolder = new GroupParserMetricsHolder();
+        int num = parsers.size();
+        for (int i = 0; i < num; i ++) {
+            CanalEventParser parser = parsers.get(i);
+            if (parser instanceof AbstractMysqlEventParser) {
+                ParserMetricsHolder single = singleHolder(destination, (AbstractMysqlEventParser)parser, Integer.toString(i + 1));
+                groupHolder.holders.add(single);
+            } else {
+                logger.warn("Null or non AbstractMysqlEventParser, ignore.");
+            }
+        }
+        return groupHolder;
+    }
+
     @Override
     public void unregister(CanalInstance instance) {
         final String destination = instance.getDestination();
@@ -106,11 +142,17 @@ public class ParserCollector extends Collector implements InstanceRegistry {
     }
 
     private class ParserMetricsHolder {
-        private List destLabelValues;
+        private List parserLabelValues;
         private List modeLabelValues;
+        // metrics for single parser
         private AtomicLong   receivedBinlogBytes;
         private AtomicLong   eventsPublishBlockingTime;
+        // parser mode
         private boolean      isParallel;
     }
 
+    private class GroupParserMetricsHolder extends ParserMetricsHolder {
+        private final List holders = new ArrayList<>();
+    }
+
 }

From cae6df1457a6d4871aa55ec82885dd6f74286b63 Mon Sep 17 00:00:00 2001
From: Chuanyi Li 
Date: Sat, 15 Sep 2018 13:28:27 +0800
Subject: [PATCH 27/42] Update grafana tmpl.

---
 .../metrics/Canal_instances_tmpl.json         | 455 ++++++++++--------
 1 file changed, 263 insertions(+), 192 deletions(-)

diff --git a/deployer/src/main/resources/metrics/Canal_instances_tmpl.json b/deployer/src/main/resources/metrics/Canal_instances_tmpl.json
index 0d7c94d2..141810c0 100644
--- a/deployer/src/main/resources/metrics/Canal_instances_tmpl.json
+++ b/deployer/src/main/resources/metrics/Canal_instances_tmpl.json
@@ -1,4 +1,34 @@
 {
+  "__inputs": [
+    {
+      "name": "DS_PROMETHEUS",
+      "label": "prometheus",
+      "description": "",
+      "type": "datasource",
+      "pluginId": "prometheus",
+      "pluginName": "Prometheus"
+    }
+  ],
+  "__requires": [
+    {
+      "type": "grafana",
+      "id": "grafana",
+      "name": "Grafana",
+      "version": "5.2.2"
+    },
+    {
+      "type": "panel",
+      "id": "graph",
+      "name": "Graph",
+      "version": "5.0.0"
+    },
+    {
+      "type": "datasource",
+      "id": "prometheus",
+      "name": "Prometheus",
+      "version": "5.0.0"
+    }
+  ],
   "annotations": {
     "list": [
       {
@@ -15,8 +45,8 @@
   "editable": true,
   "gnetId": null,
   "graphTooltip": 0,
-  "id": 8,
-  "iteration": 1534740332233,
+  "id": null,
+  "iteration": 1536989235272,
   "links": [],
   "panels": [
     {
@@ -189,7 +219,7 @@
       "steppedLine": false,
       "targets": [
         {
-          "expr": "rate(canal_instance_received_binlog_bytes{destination=~\"$destination\"}[2m]) / 1024",
+          "expr": "rate(canal_instance_received_binlog_bytes{destination=~\"$destination\", parser=\"0\"}[2m]) / 1024",
           "format": "time_series",
           "interval": "15s",
           "intervalFactor": 2,
@@ -203,6 +233,22 @@
           "intervalFactor": 2,
           "legendFormat": "outbound",
           "refId": "B"
+        },
+        {
+          "expr": "rate(canal_instance_received_binlog_bytes{destination=~\"$destination\", parser=\"1\"}[2m]) / 1024",
+          "format": "time_series",
+          "interval": "15s",
+          "intervalFactor": 2,
+          "legendFormat": "inbound-1",
+          "refId": "C"
+        },
+        {
+          "expr": "rate(canal_instance_received_binlog_bytes{destination=~\"$destination\", parser=\"2\"}[2m]) / 1024",
+          "format": "time_series",
+          "interval": "15s",
+          "intervalFactor": 2,
+          "legendFormat": "inbound-2",
+          "refId": "D"
         }
       ],
       "thresholds": [],
@@ -399,20 +445,36 @@
       "steppedLine": false,
       "targets": [
         {
-          "expr": "clamp_max(rate(canal_instance_sink_blocking_time{destination=~\"$destination\"}[2m]), 1000) / 10",
+          "expr": "clamp_max(rate(canal_instance_publish_blocking_time{destination=~\"$destination\", parser=\"0\"}[2m]), 1000) / 10",
           "format": "time_series",
           "interval": "15s",
           "intervalFactor": 2,
           "legendFormat": "dump",
-          "refId": "A"
+          "refId": "B"
         },
         {
-          "expr": "clamp_max(rate(canal_instance_publish_blocking_time{destination=~\"$destination\"}[2m]), 1000) / 10",
+          "expr": "clamp_max(rate(canal_instance_sink_blocking_time{destination=~\"$destination\"}[2m]), 1000) / 10",
           "format": "time_series",
           "interval": "15s",
           "intervalFactor": 2,
           "legendFormat": "sink",
-          "refId": "B"
+          "refId": "A"
+        },
+        {
+          "expr": "clamp_max(rate(canal_instance_publish_blocking_time{destination=~\"$destination\", parser=\"1\"}[2m]), 1000) / 10",
+          "format": "time_series",
+          "interval": "15s",
+          "intervalFactor": 2,
+          "legendFormat": "dump-1",
+          "refId": "C"
+        },
+        {
+          "expr": "clamp_max(rate(canal_instance_publish_blocking_time{destination=~\"$destination\", parser=\"2\"}[2m]), 1000) / 10",
+          "format": "time_series",
+          "interval": "15s",
+          "intervalFactor": 2,
+          "legendFormat": "dump-2",
+          "refId": "D"
         }
       ],
       "thresholds": [],
@@ -465,7 +527,7 @@
       },
       "id": 32,
       "panels": [],
-      "title": "Server",
+      "title": "Throughput",
       "type": "row"
     },
     {
@@ -660,180 +722,6 @@
         "alignLevel": null
       }
     },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Canal instance ringbuffer内未释放的events数量。",
-      "fill": 1,
-      "gridPos": {
-        "h": 5,
-        "w": 6,
-        "x": 12,
-        "y": 7
-      },
-      "id": 20,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "canal_instance_store_produce_seq{destination=~\"$destination\"} - canal_instance_store_consume_seq{destination=~\"$destination\"}",
-          "format": "time_series",
-          "interval": "15s",
-          "intervalFactor": 2,
-          "legendFormat": "events",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Store remain events",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "decimals": null,
-          "format": "none",
-          "label": "",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "decimals": null,
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Canal instance ringbuffer 内未释放events占用内存。",
-      "fill": 1,
-      "gridPos": {
-        "h": 5,
-        "w": 6,
-        "x": 18,
-        "y": 7
-      },
-      "id": 22,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "(canal_instance_store_produce_mem{destination=~\"$destination\"} - canal_instance_store_consume_mem{destination=~\"$destination\"}) / 1024",
-          "format": "time_series",
-          "interval": "15s",
-          "intervalFactor": 2,
-          "legendFormat": "memsize",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Store remain mem",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "deckbytes",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
     {
       "collapsed": false,
       "gridPos": {
@@ -938,7 +826,7 @@
       "bars": false,
       "dashLength": 10,
       "dashes": false,
-      "datasource": "$datasource",
+      "datasource": "${DS_PROMETHEUS}",
       "description": "client 请求的GET与ACK包的QPS。",
       "fill": 1,
       "gridPos": {
@@ -1218,6 +1106,193 @@
         "align": false,
         "alignLevel": null
       }
+    },
+    {
+      "collapsed": false,
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 18
+      },
+      "id": 36,
+      "panels": [],
+      "title": "Store",
+      "type": "row"
+    },
+    {
+      "aliasColors": {},
+      "bars": false,
+      "dashLength": 10,
+      "dashes": false,
+      "datasource": "$datasource",
+      "description": "Canal instance ringbuffer内未释放的events数量。",
+      "fill": 1,
+      "gridPos": {
+        "h": 5,
+        "w": 6,
+        "x": 0,
+        "y": 19
+      },
+      "id": 20,
+      "legend": {
+        "avg": false,
+        "current": false,
+        "max": false,
+        "min": false,
+        "show": true,
+        "total": false,
+        "values": false
+      },
+      "lines": true,
+      "linewidth": 1,
+      "links": [],
+      "nullPointMode": "null",
+      "percentage": false,
+      "pointradius": 5,
+      "points": false,
+      "renderer": "flot",
+      "seriesOverrides": [],
+      "spaceLength": 10,
+      "stack": false,
+      "steppedLine": false,
+      "targets": [
+        {
+          "expr": "canal_instance_store_produce_seq{destination=~\"$destination\"} - canal_instance_store_consume_seq{destination=~\"$destination\"}",
+          "format": "time_series",
+          "interval": "15s",
+          "intervalFactor": 2,
+          "legendFormat": "events",
+          "refId": "A"
+        }
+      ],
+      "thresholds": [],
+      "timeFrom": null,
+      "timeShift": null,
+      "title": "Store remain events",
+      "tooltip": {
+        "shared": true,
+        "sort": 0,
+        "value_type": "individual"
+      },
+      "type": "graph",
+      "xaxis": {
+        "buckets": null,
+        "mode": "time",
+        "name": null,
+        "show": true,
+        "values": []
+      },
+      "yaxes": [
+        {
+          "decimals": null,
+          "format": "none",
+          "label": "",
+          "logBase": 1,
+          "max": null,
+          "min": null,
+          "show": true
+        },
+        {
+          "decimals": null,
+          "format": "short",
+          "label": null,
+          "logBase": 1,
+          "max": null,
+          "min": null,
+          "show": true
+        }
+      ],
+      "yaxis": {
+        "align": false,
+        "alignLevel": null
+      }
+    },
+    {
+      "aliasColors": {},
+      "bars": false,
+      "dashLength": 10,
+      "dashes": false,
+      "datasource": "$datasource",
+      "description": "Canal instance ringbuffer 内未释放events占用内存。",
+      "fill": 1,
+      "gridPos": {
+        "h": 5,
+        "w": 6,
+        "x": 6,
+        "y": 19
+      },
+      "id": 22,
+      "legend": {
+        "avg": false,
+        "current": false,
+        "max": false,
+        "min": false,
+        "show": true,
+        "total": false,
+        "values": false
+      },
+      "lines": true,
+      "linewidth": 1,
+      "links": [],
+      "nullPointMode": "null",
+      "percentage": false,
+      "pointradius": 5,
+      "points": false,
+      "renderer": "flot",
+      "seriesOverrides": [],
+      "spaceLength": 10,
+      "stack": false,
+      "steppedLine": false,
+      "targets": [
+        {
+          "expr": "(canal_instance_store_produce_mem{destination=~\"$destination\"} - canal_instance_store_consume_mem{destination=~\"$destination\"}) / 1024",
+          "format": "time_series",
+          "interval": "15s",
+          "intervalFactor": 2,
+          "legendFormat": "memsize",
+          "refId": "A"
+        }
+      ],
+      "thresholds": [],
+      "timeFrom": null,
+      "timeShift": null,
+      "title": "Store remain mem",
+      "tooltip": {
+        "shared": true,
+        "sort": 0,
+        "value_type": "individual"
+      },
+      "type": "graph",
+      "xaxis": {
+        "buckets": null,
+        "mode": "time",
+        "name": null,
+        "show": true,
+        "values": []
+      },
+      "yaxes": [
+        {
+          "format": "deckbytes",
+          "label": null,
+          "logBase": 1,
+          "max": null,
+          "min": null,
+          "show": true
+        },
+        {
+          "format": "short",
+          "label": null,
+          "logBase": 1,
+          "max": null,
+          "min": null,
+          "show": true
+        }
+      ],
+      "yaxis": {
+        "align": false,
+        "alignLevel": null
+      }
     }
   ],
   "refresh": false,
@@ -1230,9 +1305,8 @@
     "list": [
       {
         "current": {
-          "tags": [],
-          "text": "Prometheus",
-          "value": "Prometheus"
+          "text": "prometheus",
+          "value": "prometheus"
         },
         "hide": 0,
         "label": "datasource",
@@ -1245,10 +1319,7 @@
       },
       {
         "allValue": null,
-        "current": {
-          "text": "example",
-          "value": "example"
-        },
+        "current": {},
         "datasource": "$datasource",
         "hide": 0,
         "includeAll": false,
@@ -1269,7 +1340,7 @@
     ]
   },
   "time": {
-    "from": "now-1h",
+    "from": "now-6h",
     "to": "now"
   },
   "timepicker": {
@@ -1300,5 +1371,5 @@
   "timezone": "",
   "title": "Canal instances",
   "uid": "8vh8NGpiz",
-  "version": 1
+  "version": 103
 }
\ No newline at end of file

From 7005c11ac2b64abad4704c1bab1212d657f5e614 Mon Sep 17 00:00:00 2001
From: mcy 
Date: Mon, 17 Sep 2018 11:10:50 +0800
Subject: [PATCH 28/42] =?UTF-8?q?fix=E5=BA=8F=E5=88=97=E5=8C=96=E7=9A=84?=
 =?UTF-8?q?=E4=B8=80=E4=BA=9B=E9=97=AE=E9=A2=98,=20kafka=E7=94=9F=E4=BA=A7?=
 =?UTF-8?q?=E7=AB=AF=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=E5=BC=82=E6=AD=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../canal/client/impl/SimpleCanalConnector.java   | 15 +++++++--------
 .../canal/client/kafka/MessageDeserializer.java   |  3 ++-
 .../otter/canal/kafka/CanalKafkaProducer.java     |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
index b7951912..a73baadc 100644
--- a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
+++ b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
@@ -180,8 +180,8 @@ public class SimpleCanalConnector implements CanalConnector {
 
             Ack ackBody = Ack.parseFrom(ack.getBody());
             if (ackBody.getErrorCode() > 0) {
-                throw new CanalClientException("something goes wrong when doing authentication: "
-                                               + ackBody.getErrorMessage());
+                throw new CanalClientException(
+                    "something goes wrong when doing authentication: " + ackBody.getErrorMessage());
             }
 
             connected = true;
@@ -323,7 +323,9 @@ public class SimpleCanalConnector implements CanalConnector {
         Packet p = Packet.parseFrom(data);
         switch (p.getType()) {
             case MESSAGES: {
-                if (!p.getCompression().equals(Compression.NONE)) {
+                // if (!p.getCompression().equals(Compression.NONE)) {
+                if (!p.getCompression().equals(Compression.NONE)
+                    && !p.getCompression().equals(Compression.COMPRESSIONCOMPATIBLEPROTO2)) {
                     throw new CanalClientException("compression is not supported in this connector");
                 }
 
@@ -360,11 +362,8 @@ public class SimpleCanalConnector implements CanalConnector {
             .setBatchId(batchId)
             .build();
         try {
-            writeWithHeader(Packet.newBuilder()
-                .setType(PacketType.CLIENTACK)
-                .setBody(ca.toByteString())
-                .build()
-                .toByteArray());
+            writeWithHeader(
+                Packet.newBuilder().setType(PacketType.CLIENTACK).setBody(ca.toByteString()).build().toByteArray());
         } catch (IOException e) {
             throw new CanalClientException(e);
         }
diff --git a/client/src/main/java/com/alibaba/otter/canal/client/kafka/MessageDeserializer.java b/client/src/main/java/com/alibaba/otter/canal/client/kafka/MessageDeserializer.java
index e716d2d6..b5640cfd 100644
--- a/client/src/main/java/com/alibaba/otter/canal/client/kafka/MessageDeserializer.java
+++ b/client/src/main/java/com/alibaba/otter/canal/client/kafka/MessageDeserializer.java
@@ -36,7 +36,8 @@ public class MessageDeserializer implements Deserializer {
                 CanalPacket.Packet p = CanalPacket.Packet.parseFrom(data);
                 switch (p.getType()) {
                     case MESSAGES: {
-                        if (!p.getCompression().equals(CanalPacket.Compression.NONE)) {
+                        if (!p.getCompression().equals(CanalPacket.Compression.NONE)
+                                && !p.getCompression().equals(CanalPacket.Compression.COMPRESSIONCOMPATIBLEPROTO2)) {
                             throw new CanalClientException("compression is not supported in this connector");
                         }
 
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
index 22f15229..84656fb1 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
@@ -79,8 +79,8 @@ public class CanalKafkaProducer {
                 } else {
                     record = new ProducerRecord(topic.getTopic(), message);
                 }
-                Future future = producer.send(record);
-                future.get();
+
+                producer.send(record);
             } else {
                 // 发送扁平数据json
                 List flatMessages = FlatMessage.messageConverter(message);

From 9748fceda8cefb01e673da5575c914e9799d6ffd Mon Sep 17 00:00:00 2001
From: WithLin 
Date: Mon, 17 Sep 2018 11:11:07 +0800
Subject: [PATCH 29/42] fix proto3 bug

---
 .../alibaba/otter/canal/client/impl/SimpleCanalConnector.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
index b7951912..b8fcc36a 100644
--- a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
+++ b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
@@ -323,7 +323,7 @@ public class SimpleCanalConnector implements CanalConnector {
         Packet p = Packet.parseFrom(data);
         switch (p.getType()) {
             case MESSAGES: {
-                if (!p.getCompression().equals(Compression.NONE)) {
+                if (!p.getCompression().equals(Compression.NONE) && !p.getCompression().equals(Compression.COMPRESSIONCOMPATIBLEPROTO2)) {
                     throw new CanalClientException("compression is not supported in this connector");
                 }
 

From 1a8d6e65cf3b471c6ca90f28f13fed6a3464fd15 Mon Sep 17 00:00:00 2001
From: WithLin 
Date: Mon, 17 Sep 2018 11:17:55 +0800
Subject: [PATCH 30/42] FIx

---
 .../alibaba/otter/canal/client/impl/SimpleCanalConnector.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
index b8fcc36a..956c06af 100644
--- a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
+++ b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java
@@ -323,7 +323,7 @@ public class SimpleCanalConnector implements CanalConnector {
         Packet p = Packet.parseFrom(data);
         switch (p.getType()) {
             case MESSAGES: {
-                if (!p.getCompression().equals(Compression.NONE) && !p.getCompression().equals(Compression.COMPRESSIONCOMPATIBLEPROTO2)) {
+                if (!p.getCompression().equals(Compression.COMPRESSIONCOMPATIBLEPROTO2)) {
                     throw new CanalClientException("compression is not supported in this connector");
                 }
 

From 19f765df77410c2e56a893a1d77aa98b084cef6c Mon Sep 17 00:00:00 2001
From: zhikuodai 
Date: Wed, 19 Sep 2018 15:16:38 +0800
Subject: [PATCH 31/42] =?UTF-8?q?=E5=8D=95=E8=AF=8D=E6=8B=BC=E5=86=99?=
 =?UTF-8?q?=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../memory/MemoryEventStoreWithBuffer.java    | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/store/src/main/java/com/alibaba/otter/canal/store/memory/MemoryEventStoreWithBuffer.java b/store/src/main/java/com/alibaba/otter/canal/store/memory/MemoryEventStoreWithBuffer.java
index 6c6d08ff..5fdb0323 100644
--- a/store/src/main/java/com/alibaba/otter/canal/store/memory/MemoryEventStoreWithBuffer.java
+++ b/store/src/main/java/com/alibaba/otter/canal/store/memory/MemoryEventStoreWithBuffer.java
@@ -35,16 +35,16 @@ import com.alibaba.otter.canal.store.model.Events;
  */
 public class MemoryEventStoreWithBuffer extends AbstractCanalStoreScavenge implements CanalEventStore, CanalStoreScavenge {
 
-    private static final long INIT_SQEUENCE = -1;
+    private static final long INIT_SEQUENCE = -1;
     private int               bufferSize    = 16 * 1024;
     private int               bufferMemUnit = 1024;                         // memsize的单位,默认为1kb大小
     private int               indexMask;
     private Event[]           entries;
 
     // 记录下put/get/ack操作的三个下标
-    private AtomicLong        putSequence   = new AtomicLong(INIT_SQEUENCE); // 代表当前put操作最后一次写操作发生的位置
-    private AtomicLong        getSequence   = new AtomicLong(INIT_SQEUENCE); // 代表当前get操作读取的最后一条的位置
-    private AtomicLong        ackSequence   = new AtomicLong(INIT_SQEUENCE); // 代表当前ack操作的最后一条的位置
+    private AtomicLong        putSequence   = new AtomicLong(INIT_SEQUENCE); // 代表当前put操作最后一次写操作发生的位置
+    private AtomicLong        getSequence   = new AtomicLong(INIT_SEQUENCE); // 代表当前get操作读取的最后一条的位置
+    private AtomicLong        ackSequence   = new AtomicLong(INIT_SEQUENCE); // 代表当前ack操作的最后一条的位置
 
     // 记录下put/get/ack操作的三个memsize大小
     private AtomicLong        putMemSize    = new AtomicLong(0);
@@ -358,17 +358,17 @@ public class MemoryEventStoreWithBuffer extends AbstractCanalStoreScavenge imple
         lock.lock();
         try {
             long firstSeqeuence = ackSequence.get();
-            if (firstSeqeuence == INIT_SQEUENCE && firstSeqeuence < putSequence.get()) {
+            if (firstSeqeuence == INIT_SEQUENCE && firstSeqeuence < putSequence.get()) {
                 // 没有ack过数据
                 Event event = entries[getIndex(firstSeqeuence + 1)]; // 最后一次ack为-1,需要移动到下一条,included
                                                                      // = false
                 return CanalEventUtils.createPosition(event, false);
-            } else if (firstSeqeuence > INIT_SQEUENCE && firstSeqeuence < putSequence.get()) {
+            } else if (firstSeqeuence > INIT_SEQUENCE && firstSeqeuence < putSequence.get()) {
                 // ack未追上put操作
                 Event event = entries[getIndex(firstSeqeuence + 1)]; // 最后一次ack的位置数据
                                                                      // + 1
                 return CanalEventUtils.createPosition(event, true);
-            } else if (firstSeqeuence > INIT_SQEUENCE && firstSeqeuence == putSequence.get()) {
+            } else if (firstSeqeuence > INIT_SEQUENCE && firstSeqeuence == putSequence.get()) {
                 // 已经追上,store中没有数据
                 Event event = entries[getIndex(firstSeqeuence)]; // 最后一次ack的位置数据,和last为同一条,included
                                                                  // = false
@@ -387,10 +387,10 @@ public class MemoryEventStoreWithBuffer extends AbstractCanalStoreScavenge imple
         lock.lock();
         try {
             long latestSequence = putSequence.get();
-            if (latestSequence > INIT_SQEUENCE && latestSequence != ackSequence.get()) {
+            if (latestSequence > INIT_SEQUENCE && latestSequence != ackSequence.get()) {
                 Event event = entries[(int) putSequence.get() & indexMask]; // 最后一次写入的数据,最后一条未消费的数据
                 return CanalEventUtils.createPosition(event, true);
-            } else if (latestSequence > INIT_SQEUENCE && latestSequence == ackSequence.get()) {
+            } else if (latestSequence > INIT_SEQUENCE && latestSequence == ackSequence.get()) {
                 // ack已经追上了put操作
                 Event event = entries[(int) putSequence.get() & indexMask]; // 最后一次写入的数据,included
                                                                             // =
@@ -473,9 +473,9 @@ public class MemoryEventStoreWithBuffer extends AbstractCanalStoreScavenge imple
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
-            putSequence.set(INIT_SQEUENCE);
-            getSequence.set(INIT_SQEUENCE);
-            ackSequence.set(INIT_SQEUENCE);
+            putSequence.set(INIT_SEQUENCE);
+            getSequence.set(INIT_SEQUENCE);
+            ackSequence.set(INIT_SEQUENCE);
 
             putMemSize.set(0);
             getMemSize.set(0);

From 09df602f3bd060a297bb7362409b344523cb5b8f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=83=E9=94=8B?= 
Date: Thu, 20 Sep 2018 11:30:10 +0800
Subject: [PATCH 32/42] support filterTransactionEntry

---
 .../parse/inbound/mysql/MysqlEventParser.java | 25 ++++++-----
 .../otter/canal/protocol/FlatMessage.java     |  9 +++-
 .../otter/canal/kafka/CanalKafkaProducer.java |  2 -
 .../otter/canal/kafka/MessageSerializer.java  |  7 ++--
 .../server/netty/handler/SessionHandler.java  |  3 +-
 .../canal/sink/entry/EntryEventSink.java      | 42 ++++++++++---------
 6 files changed, 47 insertions(+), 41 deletions(-)

diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java
index a5c8d870..cf102d3d 100644
--- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java
+++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java
@@ -8,7 +8,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TimerTask;
-import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.commons.lang.StringUtils;
 import org.springframework.util.CollectionUtils;
@@ -49,27 +48,27 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
 
     private CanalHAController    haController                      = null;
 
-    private int                  defaultConnectionTimeoutInSeconds = 30;                // sotimeout
+    private int                  defaultConnectionTimeoutInSeconds = 30;       // sotimeout
     private int                  receiveBufferSize                 = 64 * 1024;
     private int                  sendBufferSize                    = 64 * 1024;
     // 数据库信息
-    protected AuthenticationInfo masterInfo;                                            // 主库
-    protected AuthenticationInfo standbyInfo;                                           // 备库
+    protected AuthenticationInfo masterInfo;                                   // 主库
+    protected AuthenticationInfo standbyInfo;                                  // 备库
     // binlog信息
     protected EntryPosition      masterPosition;
     protected EntryPosition      standbyPosition;
-    private long                 slaveId;                                               // 链接到mysql的slave
+    private long                 slaveId;                                      // 链接到mysql的slave
     // 心跳检查信息
-    private String               detectingSQL;                                          // 心跳sql
-    private MysqlConnection      metaConnection;                                        // 查询meta信息的链接
-    private TableMetaCache       tableMetaCache;                                        // 对应meta
-    private int                  fallbackIntervalInSeconds         = 60;                // 切换回退时间
-    private BinlogFormat[]       supportBinlogFormats;                                  // 支持的binlogFormat,如果设置会执行强校验
-    private BinlogImage[]        supportBinlogImages;                                   // 支持的binlogImage,如果设置会执行强校验
+    private String               detectingSQL;                                 // 心跳sql
+    private MysqlConnection      metaConnection;                               // 查询meta信息的链接
+    private TableMetaCache       tableMetaCache;                               // 对应meta
+    private int                  fallbackIntervalInSeconds         = 60;       // 切换回退时间
+    private BinlogFormat[]       supportBinlogFormats;                         // 支持的binlogFormat,如果设置会执行强校验
+    private BinlogImage[]        supportBinlogImages;                          // 支持的binlogImage,如果设置会执行强校验
 
     // update by yishun.chen,特殊异常处理参数
-    private int                  dumpErrorCount                    = 0;                 // binlogDump失败异常计数
-    private int                  dumpErrorCountThreshold           = 2;                 // binlogDump失败异常计数阀值
+    private int                  dumpErrorCount                    = 0;        // binlogDump失败异常计数
+    private int                  dumpErrorCountThreshold           = 2;        // binlogDump失败异常计数阀值
 
     protected ErosaConnection buildErosaConnection() {
         return buildMysqlConnection(this.runningInfo);
diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java b/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java
index e6aab531..d7150b79 100644
--- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java
+++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java
@@ -1,7 +1,12 @@
 package com.alibaba.otter.canal.protocol;
 
 import java.io.Serializable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import com.google.common.collect.Table;
 import com.google.protobuf.ByteString;
@@ -243,6 +248,8 @@ public class FlatMessage implements Serializable {
                     }
                     int hash = value.hashCode();
                     int pkHash = Math.abs(hash) % partitionsNum;
+                    // math.abs可能返回负值,这里再取反,把出现负值的数据还是写到固定的分区,仍然可以保证消费顺序
+                    pkHash = Math.abs(pkHash);
 
                     FlatMessage flatMessageTmp = partitionMessages[pkHash];
                     if (flatMessageTmp == null) {
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
index 84656fb1..4942a37b 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
@@ -2,12 +2,10 @@ package com.alibaba.otter.canal.kafka;
 
 import java.util.List;
 import java.util.Properties;
-import java.util.concurrent.Future;
 
 import org.apache.kafka.clients.producer.KafkaProducer;
 import org.apache.kafka.clients.producer.Producer;
 import org.apache.kafka.clients.producer.ProducerRecord;
-import org.apache.kafka.clients.producer.RecordMetadata;
 import org.apache.kafka.common.serialization.StringSerializer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/MessageSerializer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/MessageSerializer.java
index 49db5aa1..86b31502 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/MessageSerializer.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/MessageSerializer.java
@@ -28,6 +28,7 @@ public class MessageSerializer implements Serializer {
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public byte[] serialize(String topic, Message data) {
         try {
             if (data != null) {
@@ -47,11 +48,9 @@ public class MessageSerializer implements Serializer {
                         messageSize += 1 * rowEntries.size();
                         // packet size
                         int size = 0;
-                        size += CodedOutputStream.computeEnumSize(3,
-                            PacketType.MESSAGES.getNumber());
+                        size += CodedOutputStream.computeEnumSize(3, PacketType.MESSAGES.getNumber());
                         size += CodedOutputStream.computeTagSize(5)
-                                + CodedOutputStream.computeRawVarint32Size(messageSize)
-                                + messageSize;
+                                + CodedOutputStream.computeRawVarint32Size(messageSize) + messageSize;
                         // build data
                         byte[] body = new byte[size];
                         CodedOutputStream output = CodedOutputStream.newInstance(body);
diff --git a/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/SessionHandler.java b/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/SessionHandler.java
index fe8c5538..d060c026 100644
--- a/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/SessionHandler.java
+++ b/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/SessionHandler.java
@@ -3,7 +3,6 @@ package com.alibaba.otter.canal.server.netty.handler;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
-import com.alibaba.otter.canal.server.netty.listener.ChannelFutureAggregator;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.jboss.netty.buffer.ChannelBuffer;
@@ -34,6 +33,7 @@ import com.alibaba.otter.canal.protocol.ClientIdentity;
 import com.alibaba.otter.canal.protocol.Message;
 import com.alibaba.otter.canal.server.embedded.CanalServerWithEmbedded;
 import com.alibaba.otter.canal.server.netty.NettyUtils;
+import com.alibaba.otter.canal.server.netty.listener.ChannelFutureAggregator;
 import com.google.protobuf.ByteString;
 import com.google.protobuf.CodedOutputStream;
 import com.google.protobuf.WireFormat;
@@ -50,6 +50,7 @@ public class SessionHandler extends SimpleChannelHandler {
         this.embeddedServer = embeddedServer;
     }
 
+    @SuppressWarnings("deprecation")
     public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
         logger.info("message receives in session handler...");
         long start = System.nanoTime();
diff --git a/sink/src/main/java/com/alibaba/otter/canal/sink/entry/EntryEventSink.java b/sink/src/main/java/com/alibaba/otter/canal/sink/entry/EntryEventSink.java
index 7afde6b6..76124ec4 100644
--- a/sink/src/main/java/com/alibaba/otter/canal/sink/entry/EntryEventSink.java
+++ b/sink/src/main/java/com/alibaba/otter/canal/sink/entry/EntryEventSink.java
@@ -33,10 +33,13 @@ public class EntryEventSink extends AbstractCanalEventSink eventStore;
-    protected boolean              filterTransactionEntry        = false;                                        // 是否需要过滤事务头/尾
+    protected boolean              filterTransactionEntry        = false;                                        // 是否需要尽可能过滤事务头/尾
     protected boolean              filterEmtryTransactionEntry   = true;                                         // 是否需要过滤空的事务头/尾
     protected long                 emptyTransactionInterval      = 5 * 1000;                                     // 空的事务输出的频率
-    protected long                 emptyTransctionThresold       = 8192;                                         // 超过1024个事务头,输出一个
+    protected long                 emptyTransctionThresold       = 8192;                                         // 超过8192个事务头,输出一个
+
+    protected volatile long        lastTransactionTimestamp      = 0L;
+    protected AtomicLong           lastTransactionCount          = new AtomicLong(0L);
     protected volatile long        lastEmptyTransactionTimestamp = 0L;
     protected AtomicLong           lastEmptyTransactionCount     = new AtomicLong(0L);
     private AtomicLong             eventsSinkBlockingTime        = new AtomicLong(0L);
@@ -74,17 +77,7 @@ public class EntryEventSink extends AbstractCanalEventSink entrys, InetSocketAddress remoteAddress, String destination)
                                                                                                            throws CanalSinkException,
                                                                                                            InterruptedException {
-        List rowDatas = entrys;
-        if (filterTransactionEntry) {
-            rowDatas = new ArrayList();
-            for (CanalEntry.Entry entry : entrys) {
-                if (entry.getEntryType() == EntryType.ROWDATA) {
-                    rowDatas.add(entry);
-                }
-            }
-        }
-
-        return sinkData(rowDatas, remoteAddress);
+        return sinkData(entrys, remoteAddress);
     }
 
     private boolean sinkData(List entrys, InetSocketAddress remoteAddress)
@@ -97,17 +90,26 @@ public class EntryEventSink extends AbstractCanalEventSink emptyTransactionInterval
+                    || lastTransactionCount.incrementAndGet() > emptyTransctionThresold) {
+                    lastTransactionCount.set(0L);
+                    lastTransactionTimestamp = currentTimestamp;
+                    continue;
+                }
+            }
+
             hasRowData |= (entry.getEntryType() == EntryType.ROWDATA);
             hasHeartBeat |= (entry.getEntryType() == EntryType.HEARTBEAT);
+            Event event = new Event(new LogIdentity(remoteAddress, -1L), entry);
+            events.add(event);
         }
 
-        if (hasRowData) {
-            // 存在row记录
-            return doSink(events);
-        } else if (hasHeartBeat) {
-            // 存在heartbeat记录,直接跳给后续处理
+        if (hasRowData || hasHeartBeat) {
+            // 存在row记录 或者 存在heartbeat记录,直接跳给后续处理
             return doSink(events);
         } else {
             // 需要过滤的数据

From 0cda90cdeae57c4d30468ffa581e105c784695da Mon Sep 17 00:00:00 2001
From: mcy 
Date: Thu, 20 Sep 2018 16:17:38 +0800
Subject: [PATCH 33/42] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=B0=86=E6=95=B0?=
 =?UTF-8?q?=E6=8D=AE=E5=8F=91=E7=8E=B0kafka=E7=9A=84partition=200=EF=BC=8C?=
 =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=A4=9A=E5=88=86=E5=8C=BA=E7=9A=84=E6=95=B0?=
 =?UTF-8?q?=E6=8D=AE=E4=B8=80=E8=87=B4=E6=80=A7=E9=97=AE=E9=A2=98=20?=
 =?UTF-8?q?=E5=90=8E=E7=BB=AD=E5=B0=86=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87?=
 =?UTF-8?q?id=20hash=E5=88=86=E5=8F=91=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../otter/canal/kafka/CanalKafkaProducer.java    | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
index 4942a37b..e1ea5e47 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
@@ -75,7 +75,7 @@ public class CanalKafkaProducer {
                 if (topic.getPartition() != null) {
                     record = new ProducerRecord(topic.getTopic(), topic.getPartition(), null, message);
                 } else {
-                    record = new ProducerRecord(topic.getTopic(), message);
+                    record = new ProducerRecord(topic.getTopic(), 0, null, message);
                 }
 
                 producer.send(record);
@@ -84,8 +84,18 @@ public class CanalKafkaProducer {
                 List flatMessages = FlatMessage.messageConverter(message);
                 if (flatMessages != null) {
                     for (FlatMessage flatMessage : flatMessages) {
-                        ProducerRecord record = new ProducerRecord(topic.getTopic(),
-                            JSON.toJSONString(flatMessage));
+                        ProducerRecord record;
+                        if (topic.getPartition() != null) {
+                            record = new ProducerRecord(topic.getTopic(),
+                                topic.getPartition(),
+                                null,
+                                JSON.toJSONString(flatMessage));
+                        } else {
+                            record = new ProducerRecord(topic.getTopic(),
+                                0,
+                                null,
+                                JSON.toJSONString(flatMessage));
+                        }
                         producer2.send(record);
                     }
                 }

From 74890050d0c323877eb9c1e3dec128e989eb6ee8 Mon Sep 17 00:00:00 2001
From: mcy 
Date: Thu, 20 Sep 2018 16:48:14 +0800
Subject: [PATCH 34/42] =?UTF-8?q?kafka=E7=94=9F=E4=BA=A7=E7=AB=AF=E5=A2=9E?=
 =?UTF-8?q?=E5=8A=A0=E6=8C=89pk=20hash=E5=88=B0=E5=AF=B9=E5=BA=94partition?=
 =?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 deployer/src/main/resources/kafka.yml         |  6 +-
 .../otter/canal/protocol/FlatMessage.java     | 31 ++++++----
 .../otter/canal/kafka/CanalKafkaProducer.java | 55 ++++++++++++-----
 .../otter/canal/kafka/CanalKafkaStarter.java  |  5 +-
 .../otter/canal/kafka/KafkaProperties.java    | 60 +++++--------------
 5 files changed, 79 insertions(+), 78 deletions(-)

diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/kafka.yml
index 735f723d..b86b3034 100644
--- a/deployer/src/main/resources/kafka.yml
+++ b/deployer/src/main/resources/kafka.yml
@@ -12,7 +12,9 @@ flatMessage: true
 
 canalDestinations:
   - canalDestination: example
-    topic: example
-    partition:
+    topic: expample
+    #partitionsNum: 3
+    #partitionHash:
+    #  mytest.person: id
 
 
diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java b/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java
index d7150b79..51bd320a 100644
--- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java
+++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/FlatMessage.java
@@ -1,14 +1,8 @@
 package com.alibaba.otter.canal.protocol;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
-import com.google.common.collect.Table;
 import com.google.protobuf.ByteString;
 
 /**
@@ -31,7 +25,7 @@ public class FlatMessage implements Serializable {
     private List> data;
     private List> old;
 
-    public FlatMessage() {
+    public FlatMessage(){
     }
 
     public FlatMessage(long id){
@@ -126,6 +120,12 @@ public class FlatMessage implements Serializable {
         this.old = old;
     }
 
+    /**
+     * 将Message转换为FlatMessage
+     * 
+     * @param message 原生message
+     * @return FlatMessage列表
+     */
     public static List messageConverter(Message message) {
         try {
             if (message == null) {
@@ -231,11 +231,22 @@ public class FlatMessage implements Serializable {
         }
     }
 
+    /**
+     * 将FlatMessage按指定的字段值hash拆分
+     * 
+     * @param flatMessage flatMessage
+     * @param partitionsNum 分区数量
+     * @param pkHashConfig hash映射
+     * @return 拆分后的flatMessage数组
+     */
     public static FlatMessage[] messagePartition(FlatMessage flatMessage, Integer partitionsNum,
-                                                 Table pkHashConfig) {
+                                                 Map pkHashConfig) {
+        if (partitionsNum == null) {
+            partitionsNum = 1;
+        }
         FlatMessage[] partitionMessages = new FlatMessage[partitionsNum];
 
-        String pk = pkHashConfig.get(flatMessage.getDatabase(), flatMessage.getTable());
+        String pk = pkHashConfig.get(flatMessage.getDatabase() + "." + flatMessage.getTable());
         if (pk == null || flatMessage.getIsDdl()) {
             partitionMessages[0] = flatMessage;
         } else {
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
index e1ea5e47..fbeeeb87 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
@@ -67,15 +67,18 @@ public class CanalKafkaProducer {
         }
     }
 
-    public void send(KafkaProperties.Topic topic, Message message, Callback callback) {
+    public void send(KafkaProperties.CanalDestination canalDestination, Message message, Callback callback) {
         try {
             // producer.beginTransaction();
             if (!kafkaProperties.getFlatMessage()) {
                 ProducerRecord record;
-                if (topic.getPartition() != null) {
-                    record = new ProducerRecord(topic.getTopic(), topic.getPartition(), null, message);
+                if (canalDestination.getPartition() != null) {
+                    record = new ProducerRecord(canalDestination.getTopic(),
+                        canalDestination.getPartition(),
+                        null,
+                        message);
                 } else {
-                    record = new ProducerRecord(topic.getTopic(), 0, null, message);
+                    record = new ProducerRecord(canalDestination.getTopic(), 0, null, message);
                 }
 
                 producer.send(record);
@@ -84,19 +87,39 @@ public class CanalKafkaProducer {
                 List flatMessages = FlatMessage.messageConverter(message);
                 if (flatMessages != null) {
                     for (FlatMessage flatMessage : flatMessages) {
-                        ProducerRecord record;
-                        if (topic.getPartition() != null) {
-                            record = new ProducerRecord(topic.getTopic(),
-                                topic.getPartition(),
-                                null,
-                                JSON.toJSONString(flatMessage));
+                        if (canalDestination.getPartition() != null) {
+                            ProducerRecord record = new ProducerRecord(canalDestination
+                                .getTopic(), canalDestination.getPartition(), null, JSON.toJSONString(flatMessage));
+                            producer2.send(record);
                         } else {
-                            record = new ProducerRecord(topic.getTopic(),
-                                0,
-                                null,
-                                JSON.toJSONString(flatMessage));
+                            if (canalDestination.getPartitionHash() != null
+                                && !canalDestination.getPartitionHash().isEmpty()) {
+                                FlatMessage[] partitionFlatMessage = FlatMessage.messagePartition(flatMessage,
+                                    canalDestination.getPartitionsNum(),
+                                    canalDestination.getPartitionHash());
+                                int length = partitionFlatMessage.length;
+                                for (int i = 0; i < length; i++) {
+                                    FlatMessage flatMessage1 = partitionFlatMessage[i];
+                                    if (flatMessage1 == null) {
+                                        continue;
+                                    }
+                                    ProducerRecord record = new ProducerRecord(
+                                        canalDestination.getTopic(),
+                                        i,
+                                        null,
+                                        JSON.toJSONString(partitionFlatMessage[i]));
+                                    producer2.send(record);
+                                }
+                            } else {
+                                ProducerRecord record = new ProducerRecord(
+                                    canalDestination.getTopic(),
+                                    0,
+                                    null,
+                                    JSON.toJSONString(flatMessage));
+                                producer2.send(record);
+                            }
                         }
-                        producer2.send(record);
+
                     }
                 }
             }
@@ -104,7 +127,7 @@ public class CanalKafkaProducer {
             // producer.commitTransaction();
             callback.commit();
             if (logger.isDebugEnabled()) {
-                logger.debug("send message to kafka topic: {}", topic.getTopic());
+                logger.debug("send message to kafka topic: {}", canalDestination.getTopic());
             }
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java
index 5b73bf3b..abe7bf09 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java
@@ -132,10 +132,7 @@ public class CanalKafkaStarter implements CanalServerStarter {
                     try {
                         int size = message.isRaw() ? message.getRawEntries().size() : message.getEntries().size();
                         if (batchId != -1 && size != 0) {
-                            Topic topic = new Topic();
-                            topic.setTopic(destination.getTopic());
-                            topic.setPartition(destination.getPartition());
-                            canalKafkaProducer.send(topic, message, new CanalKafkaProducer.Callback() {
+                            canalKafkaProducer.send(destination, message, new CanalKafkaProducer.Callback() {
 
                                 @Override
                                 public void commit() {
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java b/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java
index 82707ba4..5e4145fe 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java
@@ -1,9 +1,8 @@
 package com.alibaba.otter.canal.kafka;
 
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
+import java.util.Map;
 
 /**
  * kafka 配置项
@@ -27,10 +26,11 @@ public class KafkaProperties {
 
     public static class CanalDestination {
 
-        private String     canalDestination;
-        private String     topic;
-        private Integer    partition;
-        private Set topics = new HashSet();
+        private String              canalDestination;
+        private String              topic;
+        private Integer             partition;
+        private Integer             partitionsNum;
+        private Map partitionHash;
 
         public String getCanalDestination() {
             return canalDestination;
@@ -56,52 +56,20 @@ public class KafkaProperties {
             this.partition = partition;
         }
 
-        public Set getTopics() {
-            return topics;
+        public Integer getPartitionsNum() {
+            return partitionsNum;
         }
 
-        public void setTopics(Set topics) {
-            this.topics = topics;
-        }
-    }
-
-    public static class Topic {
-
-        private String  topic;
-        private Integer partition;
-
-        public String getTopic() {
-            return topic;
+        public void setPartitionsNum(Integer partitionsNum) {
+            this.partitionsNum = partitionsNum;
         }
 
-        public void setTopic(String topic) {
-            this.topic = topic;
+        public Map getPartitionHash() {
+            return partitionHash;
         }
 
-        public Integer getPartition() {
-            return partition;
-        }
-
-        public void setPartition(Integer partition) {
-            this.partition = partition;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (this == o) return true;
-            if (o == null || getClass() != o.getClass()) return false;
-
-            Topic topic1 = (Topic) o;
-
-            if (topic != null ? !topic.equals(topic1.topic) : topic1.topic != null) return false;
-            return partition != null ? partition.equals(topic1.partition) : topic1.partition == null;
-        }
-
-        @Override
-        public int hashCode() {
-            int result = topic != null ? topic.hashCode() : 0;
-            result = 31 * result + (partition != null ? partition.hashCode() : 0);
-            return result;
+        public void setPartitionHash(Map partitionHash) {
+            this.partitionHash = partitionHash;
         }
     }
 

From e566160f1ea24c3db15b45f51b1b6ad2ce226b42 Mon Sep 17 00:00:00 2001
From: mcy 
Date: Thu, 20 Sep 2018 17:24:32 +0800
Subject: [PATCH 35/42] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 deployer/src/main/resources/kafka.yml           | 10 ++++++----
 .../otter/canal/kafka/CanalKafkaProducer.java   | 17 ++++++++---------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/kafka.yml
index b86b3034..76e2bade 100644
--- a/deployer/src/main/resources/kafka.yml
+++ b/deployer/src/main/resources/kafka.yml
@@ -12,9 +12,11 @@ flatMessage: true
 
 canalDestinations:
   - canalDestination: example
-    topic: expample
-    #partitionsNum: 3
-    #partitionHash:
-    #  mytest.person: id
+    topic: example
+#    #对应topic分区数量
+#    partitionsNum: 3
+#    partitionHash:
+#      #库名.表名: 唯一主键
+#      mytest.person: id
 
 
diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
index fbeeeb87..5708105c 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaProducer.java
@@ -99,16 +99,15 @@ public class CanalKafkaProducer {
                                     canalDestination.getPartitionHash());
                                 int length = partitionFlatMessage.length;
                                 for (int i = 0; i < length; i++) {
-                                    FlatMessage flatMessage1 = partitionFlatMessage[i];
-                                    if (flatMessage1 == null) {
-                                        continue;
+                                    FlatMessage flatMessagePart = partitionFlatMessage[i];
+                                    if (flatMessagePart != null) {
+                                        ProducerRecord record = new ProducerRecord(
+                                                canalDestination.getTopic(),
+                                                i,
+                                                null,
+                                                JSON.toJSONString(flatMessagePart));
+                                        producer2.send(record);
                                     }
-                                    ProducerRecord record = new ProducerRecord(
-                                        canalDestination.getTopic(),
-                                        i,
-                                        null,
-                                        JSON.toJSONString(partitionFlatMessage[i]));
-                                    producer2.send(record);
                                 }
                             } else {
                                 ProducerRecord record = new ProducerRecord(

From 4f2b4cea53e9dfc526f6600fbf1c0a3bf955dabd Mon Sep 17 00:00:00 2001
From: mcy 
Date: Thu, 20 Sep 2018 17:25:32 +0800
Subject: [PATCH 36/42] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 deployer/src/main/resources/kafka.yml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/kafka.yml
index 76e2bade..aa23c1ee 100644
--- a/deployer/src/main/resources/kafka.yml
+++ b/deployer/src/main/resources/kafka.yml
@@ -11,12 +11,12 @@ canalGetTimeout: 100
 flatMessage: true
 
 canalDestinations:
-  - canalDestination: example
-    topic: example
-#    #对应topic分区数量
-#    partitionsNum: 3
-#    partitionHash:
-#      #库名.表名: 唯一主键
-#      mytest.person: id
+- canalDestination: example
+  topic: exp3
+#  #对应topic分区数量
+#  partitionsNum: 3
+#  partitionHash:
+#    #库名.表名: 唯一主键
+#    mytest.person: id
 
 

From 19b7f730b640471150796f487f002378dca0cc0b Mon Sep 17 00:00:00 2001
From: mcy 
Date: Thu, 20 Sep 2018 18:06:47 +0800
Subject: [PATCH 37/42] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java    | 1 -
 1 file changed, 1 deletion(-)

diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java
index abe7bf09..f2df3547 100644
--- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java
+++ b/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java
@@ -12,7 +12,6 @@ import org.slf4j.LoggerFactory;
 import org.yaml.snakeyaml.Yaml;
 
 import com.alibaba.otter.canal.kafka.KafkaProperties.CanalDestination;
-import com.alibaba.otter.canal.kafka.KafkaProperties.Topic;
 import com.alibaba.otter.canal.protocol.ClientIdentity;
 import com.alibaba.otter.canal.protocol.Message;
 import com.alibaba.otter.canal.server.CanalServerStarter;

From fd80f953e97eaf741ace487f950c8d2492ea60a8 Mon Sep 17 00:00:00 2001
From: agapple 
Date: Fri, 21 Sep 2018 15:30:35 +0800
Subject: [PATCH 38/42] Update README.md

---
 README.md | 44 +++++++++++++++++++++++++++++---------------
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md
index 86ef8755..2d7bc589 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,7 @@
 
  1. canal QQ讨论群已经建立,群号:161559791 ,欢迎加入进行技术讨论。
  2. canal消费端项目开源: Otter(分布式数据库同步系统),地址:https://github.com/alibaba/otter
  3. +
  4. canal c#客户端开源项目地址: https://github.com/CanalSharp/CanalSharp ,推荐!
  5. Canal已在阿里云推出商业化版本 数据传输服务DTS, 开通即用,免去部署维护的昂贵使用成本。DTS针对阿里云RDS、DRDS等产品进行了适配,解决了Binlog日志回收,主备切换、VPC网络切换等场景下的订阅高可用问题。同时,针对RDS进行了针对性的性能优化。出于稳定性、性能及成本的考虑,强烈推荐阿里云用户使用DTS产品。DTS产品使用文档
  6. DTS支持阿里云RDS&DRDS的Binlog日志实时订阅,现推出首月免费体验,限时限量,立即体验>>>
@@ -52,18 +53,38 @@ See the wiki page for : wiki文

wiki文档列表

+

多语言业务使用

+ +1. canal整体交互协议设计上使用了protobuf3.0,理论上可以支持绝大部分的多语言场景,欢迎大家提交多客户端的PR + * canal java客户端: https://github.com/alibaba/canal/wiki/ClientExample + * canal c#客户端开源项目地址: https://github.com/CanalSharp/CanalSharp + * canal go客户端,开发进行中 +2. canal作为MySQL binlog的增量获取工具,可以将数据投递到MQ系统中,比如Kafka/RocketMQ,可以借助于MQ的多语言能力 +

相关资料

* ADC阿里技术嘉年华分享ppt (放在google docs上,可能需要翻墙): ppt下载 @@ -90,10 +111,3 @@ See the wiki page for : wiki文
  • 新浪微博: agapple0002
  • 报告issue:issues
  • - -
    -【招聘】阿里巴巴中间件团队招聘JAVA高级工程师
    -岗位主要为技术型内容(非业务部门),阿里中间件整个体系对于未来想在技术上有所沉淀的同学还是非常有帮助的
    -工作地点:杭州、北京均可. ps. 阿里待遇向来都是不错的,有意者可以QQ、微博私聊. 
    -具体招聘内容:https://job.alibaba.com/zhaopin/position_detail.htm?positionId=32666
    -
    From 9535e82da6a3ed760919747122f25b8ee1ae334e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=83=E9=94=8B?= Date: Fri, 21 Sep 2018 15:40:18 +0800 Subject: [PATCH 39/42] fixed readme --- README.md | 17 +++++++++++++++-- .../resources/spring/tsdb/sql/create_table.sql | 8 ++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2d7bc589..95331c55 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,11 @@

    最新更新

      +
    1. canal发布重大版本更新1.1.0,具体releaseNode参考:https://github.com/alibaba/canal/releases/tag/canal-1.1.0
    2. +
    3. canal c#客户端开源项目地址: https://github.com/CanalSharp/CanalSharp ,推荐!
    4. canal QQ讨论群已经建立,群号:161559791 ,欢迎加入进行技术讨论。
    5. canal消费端项目开源: Otter(分布式数据库同步系统),地址:https://github.com/alibaba/otter
    6. -
    7. canal c#客户端开源项目地址: https://github.com/CanalSharp/CanalSharp ,推荐!
    8. +
    9. Canal已在阿里云推出商业化版本 数据传输服务DTS, 开通即用,免去部署维护的昂贵使用成本。DTS针对阿里云RDS、DRDS等产品进行了适配,解决了Binlog日志回收,主备切换、VPC网络切换等场景下的订阅高可用问题。同时,针对RDS进行了针对性的性能优化。出于稳定性、性能及成本的考虑,强烈推荐阿里云用户使用DTS产品。DTS产品使用文档
    10. DTS支持阿里云RDS&DRDS的Binlog日志实时订阅,现推出首月免费体验,限时限量,立即体验>>>
    @@ -47,6 +49,16 @@ DTS支持阿里云RDS&DRDS的Binlog日志实时订阅,现推出首月免费体
  • canal解析binary log对象(原始为byte流)
  • +

    重要版本更新说明

    + +canal 1.1.x系列,参考release文档:版本发布信息: + +1. 整体性能测试&优化,提升了150%. #726 参考: 【[Performance](https://github.com/alibaba/canal/wiki/Performance)】 +2. 原生支持prometheus监控 #765 【[Prometheus QuickStart](https://github.com/alibaba/canal/wiki/Prometheus-QuickStart)】 +3. 原生支持kafka消息投递 #695 【[Canal Kafka QuickStart](https://github.com/alibaba/canal/wiki/Canal-Kafka-QuickStart)】 +4. 原生支持aliyun rds的binlog订阅 (解决自动主备切换/oss binlog离线解析) 参考: 【[Aliyun RDS QuickStart](https://github.com/alibaba/canal/wiki/aliyun-RDS-QuickStart)】 +5. 原生支持docker镜像 #801 参考: 【[Docker QuickStart](https://github.com/alibaba/canal/wiki/Docker-QuickStart)】 +

    相关文档

    See the wiki page for : wiki文档 @@ -77,7 +89,7 @@ See the wiki page for : wiki文
  • FAQ
  • -

    多语言业务使用

    +

    多语言业务

    1. canal整体交互协议设计上使用了protobuf3.0,理论上可以支持绝大部分的多语言场景,欢迎大家提交多客户端的PR * canal java客户端: https://github.com/alibaba/canal/wiki/ClientExample @@ -111,3 +123,4 @@ See the wiki page for : wiki文
  • 新浪微博: agapple0002
  • 报告issue:issues
  • + diff --git a/deployer/src/main/resources/spring/tsdb/sql/create_table.sql b/deployer/src/main/resources/spring/tsdb/sql/create_table.sql index e5d6dbf4..322bc2b6 100644 --- a/deployer/src/main/resources/spring/tsdb/sql/create_table.sql +++ b/deployer/src/main/resources/spring/tsdb/sql/create_table.sql @@ -26,10 +26,10 @@ CREATE TABLE IF NOT EXISTS `meta_history` ( `binlog_master_id` varchar(64) DEFAULT NULL COMMENT 'binlog节点id', `binlog_timestamp` bigint(20) DEFAULT NULL COMMENT 'binlog应用的时间戳', `use_schema` varchar(1024) DEFAULT NULL COMMENT '执行sql时对应的schema', - `schema` varchar(1024) DEFAULT NULL COMMENT '对应的schema', - `table` varchar(1024) DEFAULT NULL COMMENT '对应的table', - `sql` longtext DEFAULT NULL COMMENT '执行的sql', - `type` varchar(256) DEFAULT NULL COMMENT 'sql类型', + `sql_schema` varchar(1024) DEFAULT NULL COMMENT '对应的schema', + `sql_table` varchar(1024) DEFAULT NULL COMMENT '对应的table', + `sql_text` longtext DEFAULT NULL COMMENT '执行的sql', + `sql_type` varchar(256) DEFAULT NULL COMMENT 'sql类型', `extra` text DEFAULT NULL COMMENT '额外的扩展信息', PRIMARY KEY (`id`), UNIQUE KEY binlog_file_offest(`destination`,`binlog_master_id`,`binlog_file`,`binlog_offest`), From 9d48d23787c8e24689c7a3c8b431c6109e0a5d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=83=E9=94=8B?= Date: Fri, 21 Sep 2018 15:44:03 +0800 Subject: [PATCH 40/42] fixed readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95331c55..9a87de8f 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ DTS支持阿里云RDS&DRDS的Binlog日志实时订阅,现推出首月免费体

    重要版本更新说明

    -canal 1.1.x系列,参考release文档:版本发布信息: +canal 1.1.x系列,参考release文档:版本发布信息 1. 整体性能测试&优化,提升了150%. #726 参考: 【[Performance](https://github.com/alibaba/canal/wiki/Performance)】 2. 原生支持prometheus监控 #765 【[Prometheus QuickStart](https://github.com/alibaba/canal/wiki/Prometheus-QuickStart)】 From 00ec70d425e5ebbd0dbcb7211c7354325af99be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=83=E9=94=8B?= Date: Fri, 21 Sep 2018 15:45:52 +0800 Subject: [PATCH 41/42] fixed readme --- README.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9a87de8f..c28fc0ea 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,6 @@
    - -

    最新更新

    -
      -
    1. canal发布重大版本更新1.1.0,具体releaseNode参考:https://github.com/alibaba/canal/releases/tag/canal-1.1.0
    2. -
    3. canal c#客户端开源项目地址: https://github.com/CanalSharp/CanalSharp ,推荐!
    4. -
    5. canal QQ讨论群已经建立,群号:161559791 ,欢迎加入进行技术讨论。
    6. -
    7. canal消费端项目开源: Otter(分布式数据库同步系统),地址:https://github.com/alibaba/otter
    8. - -
    9. Canal已在阿里云推出商业化版本 数据传输服务DTS, 开通即用,免去部署维护的昂贵使用成本。DTS针对阿里云RDS、DRDS等产品进行了适配,解决了Binlog日志回收,主备切换、VPC网络切换等场景下的订阅高可用问题。同时,针对RDS进行了针对性的性能优化。出于稳定性、性能及成本的考虑,强烈推荐阿里云用户使用DTS产品。DTS产品使用文档
    10. -DTS支持阿里云RDS&DRDS的Binlog日志实时订阅,现推出首月免费体验,限时限量,立即体验>>> -
    - +

    背景

    早期,阿里巴巴B2B公司因为存在杭州和美国双机房部署,存在跨机房同步的业务需求。不过早期的数据库同步业务,主要是基于trigger的方式获取增量变更,不过从2010年开始,阿里系公司开始逐步的尝试基于数据库的日志解析,获取增量变更进行同步,由此衍生出了增量订阅&消费的业务,从此开启了一段新纪元。

    ps. 目前内部版本已经支持mysql和oracle部分版本的日志解析,当前的canal开源版本支持5.7及以下的版本(阿里内部mysql 5.7.13, 5.6.10, mysql 5.5.18和5.1.40/48)

    @@ -124,3 +113,13 @@ See the wiki page for : wiki文
  • 报告issue:issues
  • +

    最新更新

    +
      +
    1. canal发布重大版本更新1.1.0,具体releaseNode参考:https://github.com/alibaba/canal/releases/tag/canal-1.1.0
    2. +
    3. canal c#客户端开源项目地址: https://github.com/CanalSharp/CanalSharp ,推荐!
    4. +
    5. canal QQ讨论群已经建立,群号:161559791 ,欢迎加入进行技术讨论。
    6. +
    7. canal消费端项目开源: Otter(分布式数据库同步系统),地址:https://github.com/alibaba/otter
    8. + +
    9. Canal已在阿里云推出商业化版本 数据传输服务DTS, 开通即用,免去部署维护的昂贵使用成本。DTS针对阿里云RDS、DRDS等产品进行了适配,解决了Binlog日志回收,主备切换、VPC网络切换等场景下的订阅高可用问题。同时,针对RDS进行了针对性的性能优化。出于稳定性、性能及成本的考虑,强烈推荐阿里云用户使用DTS产品。DTS产品使用文档
    10. +DTS支持阿里云RDS&DRDS的Binlog日志实时订阅,现推出首月免费体验,限时限量,立即体验>>> +
    \ No newline at end of file From 40f8c931c7540c826b9dfc8208e2e5950f0b5dce Mon Sep 17 00:00:00 2001 From: winger Date: Tue, 25 Sep 2018 18:46:10 +0800 Subject: [PATCH 42/42] =?UTF-8?q?fix=20bug=20#968:=20=E5=AF=B9=E4=BA=8Ewor?= =?UTF-8?q?kpool=E4=B8=8EBatchEventProcessor=E9=9C=80=E8=A6=81=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E8=B0=83=E7=94=A8halt()=EF=BC=8C=E5=90=A6=E5=88=99?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=85=B6=E4=BD=BF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=BA=BF=E7=A8=8B(=E6=B1=A0)=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E5=B8=B8=E5=85=B3=E9=97=AD(parserExecutor/st?= =?UTF-8?q?ageExecutor.shutdownNow()=E6=97=A0=E6=95=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mysql/MysqlMultiStageCoprocessor.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java index 99bb94f5..2e200e2f 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlMultiStageCoprocessor.java @@ -2,6 +2,7 @@ package com.alibaba.otter.canal.parse.inbound.mysql; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.LockSupport; @@ -36,6 +37,7 @@ import com.taobao.tddl.dbsync.binlog.event.RowsLogEvent; import com.taobao.tddl.dbsync.binlog.event.UpdateRowsLogEvent; import com.taobao.tddl.dbsync.binlog.event.WriteRowsLogEvent; + /** * 针对解析器提供一个多阶段协同的处理 * @@ -65,6 +67,9 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement private volatile CanalParseException exception; private AtomicLong eventsPublishBlockingTime; private GTIDSet gtidSet; + private WorkerPool workerPool; + private BatchEventProcessor simpleParserStage; + private BatchEventProcessor sinkStoreStage; public MysqlMultiStageCoprocessor(int ringBufferSize, int parserThreadCount, LogEventConvert logEventConvert, EventTransactionBuffer transactionBuffer, String destination){ @@ -91,7 +96,7 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement SequenceBarrier sequenceBarrier = disruptorMsgBuffer.newBarrier(); ExceptionHandler exceptionHandler = new SimpleFatalExceptionHandler(); // stage 2 - BatchEventProcessor simpleParserStage = new BatchEventProcessor(disruptorMsgBuffer, + simpleParserStage = new BatchEventProcessor(disruptorMsgBuffer, sequenceBarrier, new SimpleParserStage()); simpleParserStage.setExceptionHandler(exceptionHandler); @@ -103,7 +108,7 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement for (int i = 0; i < parserThreadCount; i++) { workHandlers[i] = new DmlParserStage(); } - WorkerPool workerPool = new WorkerPool(disruptorMsgBuffer, + workerPool = new WorkerPool(disruptorMsgBuffer, dmlParserSequenceBarrier, exceptionHandler, workHandlers); @@ -112,7 +117,7 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement // stage 4 SequenceBarrier sinkSequenceBarrier = disruptorMsgBuffer.newBarrier(sequence); - BatchEventProcessor sinkStoreStage = new BatchEventProcessor(disruptorMsgBuffer, + sinkStoreStage = new BatchEventProcessor(disruptorMsgBuffer, sinkSequenceBarrier, new SinkStoreStage()); sinkStoreStage.setExceptionHandler(exceptionHandler); @@ -126,14 +131,24 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement @Override public void stop() { + // fix bug #968,对于pool与 + workerPool.halt(); + simpleParserStage.halt(); + sinkStoreStage.halt(); try { parserExecutor.shutdownNow(); + while (!parserExecutor.awaitTermination(1, TimeUnit.SECONDS)) { + parserExecutor.shutdownNow(); + } } catch (Throwable e) { // ignore } try { stageExecutor.shutdownNow(); + while (!stageExecutor.awaitTermination(1, TimeUnit.SECONDS)) { + stageExecutor.shutdownNow(); + } } catch (Throwable e) { // ignore }