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 25b339fe..493d902a 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,9 +20,10 @@ public class CanalClientConfig { private String bootstrapServers; + private List mqTopics; + private Boolean flatMessage = true; - private List kafkaTopics; private List canalInstances; @@ -58,6 +59,10 @@ public class CanalClientConfig { this.bootstrapServers = bootstrapServers; } + public List getMqTopics() { + return mqTopics; + } + public Boolean getFlatMessage() { return flatMessage; } @@ -66,12 +71,8 @@ public class CanalClientConfig { this.flatMessage = flatMessage; } - public List getKafkaTopics() { - return kafkaTopics; - } - - public void setKafkaTopics(List kafkaTopics) { - this.kafkaTopics = kafkaTopics; + public void setMqTopics(List mqTopics) { + this.mqTopics = mqTopics; } public List getCanalInstances() { @@ -120,12 +121,21 @@ public class CanalClientConfig { } } - public static class KafkaTopic { + public static class MQTopic { + private String mqMode; private String topic; private List groups = new ArrayList<>(); + public String getMqMode() { + return mqMode; + } + + public void setMqMode(String mqMode) { + this.mqMode = mqMode; + } + public String getTopic() { return topic; } @@ -167,25 +177,6 @@ public class CanalClientConfig { this.outAdapters = outAdapters; } - // public List getAdapters() { - // return adapters; - // } - // - // public void setAdapters(List adapters) { - // this.adapters = adapters; - // } } - // public static class Adaptor { - // private List outAdapters; - // - // public List getOutAdapters() { - // return outAdapters; - // } - // - // public void setOutAdapters(List outAdapters) - // { - // this.outAdapters = outAdapters; - // } - // } } 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 46e5922f..0dde5211 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 @@ -129,6 +129,47 @@ public abstract class AbstractCanalAdapterWorker { } } + protected void writeOut(Message message,String topic){ + if (logger.isDebugEnabled()) { + logger.debug("topic: {} batchId: {} batchSize: {} ", + topic, + message.getId(), + message.getEntries().size()); + } + 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); + } + } + + protected void stopOutAdapters(){ + if (thread != null) { + try { + thread.join(); + } catch (InterruptedException e) { + // ignore + } + } + groupInnerExecutorService.shutdown(); + logger.info("topic connectors' worker thread dead!"); + for (List outerAdapters : canalOuterAdapters) { + for (CanalOuterAdapter adapter : outerAdapters) { + adapter.destroy(); + } + } + logger.info("topic all connectors destroyed!"); + } public abstract void start(); public abstract void stop(); 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 72320bb5..3775ed11 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 @@ -30,7 +30,7 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker { private boolean flatMessage; public CanalAdapterKafkaWorker(String bootstrapServers, String topic, String groupId, - List> canalOuterAdapters, boolean flatMessage){ + List> canalOuterAdapters, boolean flatMessage){ this.canalOuterAdapters = canalOuterAdapters; this.groupInnerExecutorService = Executors.newFixedThreadPool(canalOuterAdapters.size()); this.topic = topic; @@ -171,4 +171,4 @@ public class CanalAdapterKafkaWorker extends AbstractCanalAdapterWorker { connector.disconnect(); logger.info("=============> Disconnect topic: {} <=============", this.topic); } -} +} \ No newline at end of file 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 15945b6c..59f1b3cf 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,5 +1,9 @@ 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 java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.ArrayList; @@ -8,44 +12,38 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; - +import org.apache.commons.lang.StringUtils; 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; - /** - * 外部适配器的加载器 + * MQ外部适配器的加载器 * - * @author machengyuan 2018-8-19 下午11:45:49 * @version 1.0.0 */ public class CanalAdapterLoader { - private static final Logger logger = LoggerFactory.getLogger(CanalAdapterLoader.class); + private static final Logger logger = LoggerFactory.getLogger(CanalAdapterLoader.class); - private CanalClientConfig canalClientConfig; + private CanalClientConfig canalClientConfig; - private Map canalWorkers = new HashMap<>(); + private Map canalWorkers = new HashMap<>(); - private Map canalKafkaWorkers = new HashMap<>(); + private Map canalMQWorker = new HashMap<>(); - private ExtensionLoader loader; + private ExtensionLoader loader; - public CanalAdapterLoader(CanalClientConfig canalClientConfig){ + public CanalAdapterLoader(CanalClientConfig canalClientConfig) { this.canalClientConfig = canalClientConfig; } /** - * 初始化canal-client、 canal-client-kafka的适配器 + * 初始化canal-client、 canal-client-rocketmq的适配器 */ public void init() { - // canal instances 和 kafka topics 配置不能同时为空 - if (canalClientConfig.getCanalInstances() == null && canalClientConfig.getKafkaTopics() == null) { - throw new RuntimeException("Blank config property: canalInstances or canalKafkaTopics"); + // canal instances 和 mq topics 配置不能同时为空 + if (canalClientConfig.getCanalInstances() == null && canalClientConfig.getMqTopics() == null) { + throw new RuntimeException("Blank config property: canalInstances or canalMQTopics"); } loader = ExtensionLoader.getExtensionLoader(CanalOuterAdapter.class, @@ -59,13 +57,6 @@ 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"); - // } - // 初始化canal-client的适配器 if (canalClientConfig.getCanalInstances() != null) { for (CanalClientConfig.CanalInstance instance : canalClientConfig.getCanalInstances()) { @@ -90,32 +81,38 @@ public class CanalAdapterLoader { } } - // 初始化canal-client-kafka的适配器 - if (canalClientConfig.getKafkaTopics() != null) { - for (CanalClientConfig.KafkaTopic kafkaTopic : canalClientConfig.getKafkaTopics()) { - for (CanalClientConfig.Group group : kafkaTopic.getGroups()) { + // 初始化canal-client-mq的适配器 + if (canalClientConfig.getMqTopics() != null) { + for (CanalClientConfig.MQTopic topic : canalClientConfig.getMqTopics()) { + for (CanalClientConfig.Group group : topic.getGroups()) { List> canalOuterAdapterGroups = new ArrayList<>(); List canalOuterAdapters = new ArrayList<>(); for (CanalOuterAdapterConfiguration config : group.getOutAdapters()) { - // for (CanalOuterAdapterConfiguration config : adaptor.getOutAdapters()) { loadConnector(config, canalOuterAdapters); - // } } canalOuterAdapterGroups.add(canalOuterAdapters); + if (StringUtils.isBlank(topic.getMqMode()) || "rocketmq".equalsIgnoreCase(topic.getMqMode())) { + CanalAdapterRocketMQWorker rocketMQWorker = new CanalAdapterRocketMQWorker( + canalClientConfig.getBootstrapServers(), + topic.getTopic(), + group.getGroupId(), + canalOuterAdapterGroups); + canalMQWorker.put(topic.getTopic() + "-rocketmq-" + group.getGroupId(), rocketMQWorker); + rocketMQWorker.start(); + } else if ("kafka".equalsIgnoreCase(topic.getMqMode())) { + CanalAdapterKafkaWorker canalKafkaWorker = new CanalAdapterKafkaWorker( + canalClientConfig.getBootstrapServers(), + topic.getTopic(), + group.getGroupId(), + canalOuterAdapterGroups,canalClientConfig.getFlatMessage()); + canalMQWorker.put(topic.getTopic() + "-kafka-" + group.getGroupId(), canalKafkaWorker); + canalKafkaWorker.start(); + } + logger.info("Start adapter for canal-client rocketmq topic: {} succeed", + topic.getTopic() + "-" + group.getGroupId()); - // String zkServers = canalClientConfig.getZookeeperHosts(); - CanalAdapterKafkaWorker canalKafkaWorker = new CanalAdapterKafkaWorker( - canalClientConfig.getBootstrapServers(), - kafkaTopic.getTopic(), - group.getGroupId(), - canalOuterAdapterGroups, - flatMessage); - canalKafkaWorkers.put(kafkaTopic.getTopic() + "-" + group.getGroupId(), canalKafkaWorker); - canalKafkaWorker.start(); - logger.info("Start adapter for canal-client kafka topic: {} succeed", - kafkaTopic.getTopic() + "-" + group.getGroupId()); } } } @@ -154,19 +151,18 @@ public class CanalAdapterLoader { } stopExecutorService.shutdown(); } - if (canalKafkaWorkers.size() > 0) { - ExecutorService stopKafkaExecutorService = Executors.newFixedThreadPool(canalKafkaWorkers.size()); - for (CanalAdapterKafkaWorker v : canalKafkaWorkers.values()) { - final CanalAdapterKafkaWorker cakw = v; - stopKafkaExecutorService.submit(new Runnable() { - + if (canalMQWorker.size() > 0) { + ExecutorService stopMQWokerService = Executors.newFixedThreadPool(canalMQWorker.size()); + for (AbstractCanalAdapterWorker tmp : canalMQWorker.values()) { + final AbstractCanalAdapterWorker worker = tmp; + stopMQWokerService.submit(new Runnable() { @Override public void run() { - cakw.stop(); + worker.stop(); } }); } - stopKafkaExecutorService.shutdown(); + stopMQWokerService.shutdown(); } logger.info("All canal adapters destroyed"); } diff --git a/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterRocketMQWorker.java b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterRocketMQWorker.java new file mode 100644 index 00000000..98f08286 --- /dev/null +++ b/client-launcher/src/main/java/com/alibaba/otter/canal/client/adapter/loader/CanalAdapterRocketMQWorker.java @@ -0,0 +1,123 @@ +package com.alibaba.otter.canal.client.adapter.loader; + +import com.alibaba.otter.canal.client.adapter.CanalOuterAdapter; +import com.alibaba.otter.canal.client.rocketmq.RocketMQCanalConnector; +import com.alibaba.otter.canal.client.rocketmq.RocketMQCanalConnectorProvider; +import com.alibaba.otter.canal.protocol.Message; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.kafka.clients.consumer.CommitFailedException; +import org.apache.kafka.common.errors.WakeupException; + +/** + * kafka对应的client适配器工作线程 + * + * @author machengyuan 2018-8-19 下午11:30:49 + * @version 1.0.0 + */ +public class CanalAdapterRocketMQWorker extends AbstractCanalAdapterWorker { + + private RocketMQCanalConnector connector; + + private String topic; + + public CanalAdapterRocketMQWorker(String nameServers, String topic, String groupId, + List> canalOuterAdapters) { + logger.info("RocketMQ consumer config topic:{}, nameServer:{}, groupId:{}", topic, nameServers, groupId); + this.canalOuterAdapters = canalOuterAdapters; + this.groupInnerExecutorService = Executors.newFixedThreadPool(canalOuterAdapters.size()); + this.topic = topic; + this.canalDestination = topic; + connector = RocketMQCanalConnectorProvider.newRocketMQConnector(nameServers, topic, groupId); + } + + @Override + public void start() { + if (!running) { + thread = new Thread(new Runnable() { + + @Override + public void run() { + process(); + } + }); + thread.setUncaughtExceptionHandler(handler); + running = true; + thread.start(); + } + } + + @Override + public void stop() { + try { + if (!running) { + return; + } + connector.stopRunning(); + running = false; + logger.info("Stop topic {} out adapters begin", this.topic); + stopOutAdapters(); + logger.info("Stop topic {} out adapters end", this.topic); + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + } + + private void process() { + while (!running) + ; + ExecutorService executor = Executors.newSingleThreadExecutor(); + while (running) { + try { + logger.info("=============> Start to connect topic: {} <=============", this.topic); + connector.connect(); + logger.info("=============> Start to subscribe topic: {}<=============", this.topic); + connector.subscribe(); + logger.info("=============> Subscribe topic: {} succeed<=============", this.topic); + while (running) { + try { + // switcher.get(); //等待开关开启 + + final Message message = connector.getWithoutAck(1); + if (message != null) { + executor.submit(new Runnable() { + + @Override + public void run() { + try { + writeOut(message, topic); + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + connector.ack(message.getId()); + } + }); + } else { + logger.debug("Message is null"); + } + } catch (CommitFailedException e) { + logger.warn(e.getMessage()); + } catch (Exception e) { + logger.error(e.getMessage(), e); + TimeUnit.SECONDS.sleep(1L); + } + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + } + + executor.shutdown(); + + try { + connector.unsubscribe(); + } catch (WakeupException e) { + // No-op. Continue process + } + connector.stopRunning(); + logger.info("=============> Disconnect topic: {} <=============", this.topic); + } +} diff --git a/client-launcher/src/main/resources/canal-client.yml b/client-launcher/src/main/resources/canal-client.yml index 6c8874c3..d2cb2175 100644 --- a/client-launcher/src/main/resources/canal-client.yml +++ b/client-launcher/src/main/resources/canal-client.yml @@ -1,6 +1,6 @@ #canalServerHost: 127.0.0.1:11111 #zookeeperHosts: slave1:2181 -bootstrapServers: slave1:6667,slave2:6667 +bootstrapServers: slave1:6667,slave2:6667 #or rocketmq nameservers:host1:9876;host2:9876 flatMessage: true #canalInstances: @@ -11,10 +11,12 @@ flatMessage: true # - name: hbase # hosts: slave1:2181 # properties: {znodeParent: "/hbase-unsecure"} -kafkaTopics: -- topic: example + +mqTopics: +- mqMode: rocketmq + topic: example groups: - - groupId: egroup + - groupId: example outAdapters: - name: logger # - name: hbase diff --git a/client/pom.xml b/client/pom.xml index 02b0f66a..43b3067f 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -101,7 +101,11 @@ ${spring_version} test - + + org.apache.rocketmq + rocketmq-client + 4.3.0 + org.apache.kafka diff --git a/client/src/main/java/com/alibaba/otter/canal/client/CanalMessageDeserializer.java b/client/src/main/java/com/alibaba/otter/canal/client/CanalMessageDeserializer.java new file mode 100644 index 00000000..2e7cd5e5 --- /dev/null +++ b/client/src/main/java/com/alibaba/otter/canal/client/CanalMessageDeserializer.java @@ -0,0 +1,42 @@ +package com.alibaba.otter.canal.client; + +import com.alibaba.otter.canal.protocol.CanalEntry; +import com.alibaba.otter.canal.protocol.CanalPacket; +import com.alibaba.otter.canal.protocol.Message; +import com.alibaba.otter.canal.protocol.exception.CanalClientException; +import com.google.protobuf.ByteString; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CanalMessageDeserializer { + private static Logger logger = LoggerFactory.getLogger(CanalMessageDeserializer.class); + + public static Message deserializer(byte[] data) { + try { + if (data == null) { + return null; + } else { + CanalPacket.Packet p = CanalPacket.Packet.parseFrom(data); + switch (p.getType()) { + case MESSAGES: { +// if (!p.getCompression().equals(CanalPacket.Compression.NONE)) { +// throw new CanalClientException("compression is not supported in this connector"); +// } + + CanalPacket.Messages messages = CanalPacket.Messages.parseFrom(p.getBody()); + Message result = new Message(messages.getBatchId()); + for (ByteString byteString : messages.getMessagesList()) { + result.addEntry(CanalEntry.Entry.parseFrom(byteString)); + } + return result; + } + default: + break; + } + } + } catch (Exception e) { + logger.error("Error when deserializing byte[] to message ", e); + } + return null; + } +} 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 b5640cfd..6de67c7a 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 @@ -1,17 +1,12 @@ package com.alibaba.otter.canal.client.kafka; +import com.alibaba.otter.canal.client.CanalMessageDeserializer; +import com.alibaba.otter.canal.protocol.Message; import java.util.Map; - import org.apache.kafka.common.serialization.Deserializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.alibaba.otter.canal.protocol.CanalEntry; -import com.alibaba.otter.canal.protocol.CanalPacket; -import com.alibaba.otter.canal.protocol.Message; -import com.alibaba.otter.canal.protocol.exception.CanalClientException; -import com.google.protobuf.ByteString; - /** * Kafka Message类的反序列化 * @@ -27,35 +22,8 @@ public class MessageDeserializer implements Deserializer { } @Override - public Message deserialize(String topic, byte[] data) { - try { - if (data == null) { - return null; - } - else { - CanalPacket.Packet p = CanalPacket.Packet.parseFrom(data); - switch (p.getType()) { - case MESSAGES: { - if (!p.getCompression().equals(CanalPacket.Compression.NONE) - && !p.getCompression().equals(CanalPacket.Compression.COMPRESSIONCOMPATIBLEPROTO2)) { - throw new CanalClientException("compression is not supported in this connector"); - } - - CanalPacket.Messages messages = CanalPacket.Messages.parseFrom(p.getBody()); - Message result = new Message(messages.getBatchId()); - for (ByteString byteString : messages.getMessagesList()) { - result.addEntry(CanalEntry.Entry.parseFrom(byteString)); - } - return result; - } - default: - break; - } - } - } catch (Exception e) { - logger.error("Error when deserializing byte[] to message "); - } - return null; + public Message deserialize(String topic1, byte[] data) { + return CanalMessageDeserializer.deserializer(data); } @Override diff --git a/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/ConsumerBatchMessage.java b/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/ConsumerBatchMessage.java new file mode 100644 index 00000000..ef83a798 --- /dev/null +++ b/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/ConsumerBatchMessage.java @@ -0,0 +1,47 @@ +package com.alibaba.otter.canal.client.rocketmq; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +public class ConsumerBatchMessage { + private final BlockingQueue data; + private CountDownLatch latch; + private boolean hasFailure = false; + + public ConsumerBatchMessage(BlockingQueue data) { + this.data = data; + latch = new CountDownLatch(data.size()); + } + + public boolean waitFinish(long timeout) throws InterruptedException { + return latch.await(timeout, TimeUnit.MILLISECONDS); + } + + public boolean isSuccess() { + return !hasFailure; + } + + public BlockingQueue getData() { + return data; + } + + /** + * Countdown if the sub message is successful. + */ + public void ack() { + latch.countDown(); + } + + /** + * Countdown and fail-fast if the sub message is failed. + */ + public void fail() { + hasFailure = true; + // fail fast + long count = latch.getCount(); + for (int i = 0; i < count; i++) { + latch.countDown(); + } + } +} diff --git a/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalConnector.java new file mode 100644 index 00000000..8031e792 --- /dev/null +++ b/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalConnector.java @@ -0,0 +1,199 @@ +package com.alibaba.otter.canal.client.rocketmq; + +import com.alibaba.otter.canal.client.CanalConnector; +import com.alibaba.otter.canal.client.CanalMessageDeserializer; +import com.alibaba.otter.canal.protocol.Message; +import com.alibaba.otter.canal.protocol.exception.CanalClientException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import org.apache.commons.lang.StringUtils; +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.message.MessageExt; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RocketMQCanalConnector implements CanalConnector { + private static final Logger logger = LoggerFactory.getLogger(RocketMQCanalConnector.class); + + private String nameServer; + private String topic; + private String groupName; + private volatile boolean connected = false; + private DefaultMQPushConsumer rocketMQConsumer; + private BlockingQueue> messageBlockingQueue; + Map> messageCache; + private long batchProcessTimeout = 10000; + + public RocketMQCanalConnector(String nameServer, String topic, String groupName) { + this.nameServer = nameServer; + this.topic = topic; + this.groupName = groupName; + messageBlockingQueue = new LinkedBlockingQueue<>(); + messageCache = new ConcurrentHashMap<>(); + } + + @Override + public void connect() throws CanalClientException { + rocketMQConsumer = new DefaultMQPushConsumer(groupName); + if (!StringUtils.isBlank(nameServer)) { + rocketMQConsumer.setNamesrvAddr(nameServer); + } + } + + @Override + public void disconnect() throws CanalClientException { + rocketMQConsumer.shutdown(); + } + + @Override + public boolean checkValid() throws CanalClientException { + return connected; + } + + @Override + public synchronized void subscribe(String filter) throws CanalClientException { + if (connected) { + return; + } + try { + if (rocketMQConsumer == null) { + this.connect(); + } + rocketMQConsumer.subscribe(topic, "*"); + rocketMQConsumer.registerMessageListener(new MessageListenerOrderly() { + @Override + public ConsumeOrderlyStatus consumeMessage(List messageExts, + ConsumeOrderlyContext context) { + context.setAutoCommit(true); + boolean isSuccess = process(messageExts); + if (isSuccess) { + return ConsumeOrderlyStatus.SUCCESS; + } else { + return ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT; + } + } + }); + rocketMQConsumer.start(); + } catch (MQClientException ex) { + connected = false; + logger.error("Start RocketMQ consumer error", ex); + } + connected = true; + } + + private boolean process(List messageExts) { + BlockingQueue messageList = new LinkedBlockingQueue<>(); + for (MessageExt messageExt : messageExts) { + byte[] data = messageExt.getBody(); + Message message = CanalMessageDeserializer.deserializer(data); + try { + messageList.put(message); + } catch (InterruptedException ex) { + logger.error("Add message error"); + } + } + ConsumerBatchMessage batchMessage = new ConsumerBatchMessage<>(messageList); + try { + messageBlockingQueue.put(batchMessage); + } catch (InterruptedException e) { + logger.error("Put message to queue error", e); + throw new RuntimeException(e); + } + boolean isCompleted; + try { + isCompleted = batchMessage.waitFinish(batchProcessTimeout); + } catch (InterruptedException e) { + logger.error("Interrupted when waiting messages to be finished.", e); + throw new RuntimeException(e); + } + boolean isSuccess = batchMessage.isSuccess(); + return isCompleted && isSuccess; + } + + @Override + public void subscribe() throws CanalClientException { + this.subscribe(null); + } + + @Override + public void unsubscribe() throws CanalClientException { + this.rocketMQConsumer.unsubscribe(this.topic); + } + + @Override + public Message get(int batchSize) throws CanalClientException { + Message message = getWithoutAck(batchSize); + ack(message.getId()); + return message; + } + + @Override + public Message get(int batchSize, Long timeout, TimeUnit unit) throws CanalClientException { + Message message = getWithoutAck(batchSize, timeout, unit); + ack(message.getId()); + return message; + } + + private Message getMessage(ConsumerBatchMessage consumerBatchMessage) { + BlockingQueue messageList = consumerBatchMessage.getData(); + if (messageList != null & messageList.size() > 0) { + Message message = messageList.poll(); + messageCache.put(message.getId(), consumerBatchMessage); + return message; + } + return null; + } + + @Override + public Message getWithoutAck(int batchSize) throws CanalClientException { + ConsumerBatchMessage batchMessage = messageBlockingQueue.poll(); + if (batchMessage != null) { + return getMessage(batchMessage); + } + return null; + } + + @Override + public Message getWithoutAck(int batchSize, Long timeout, TimeUnit unit) throws CanalClientException { + try { + ConsumerBatchMessage batchMessage = messageBlockingQueue.poll(timeout, unit); + return getMessage(batchMessage); + } catch (InterruptedException ex) { + logger.warn("Get message timeout", ex); + throw new CanalClientException("Failed to fetch the data after: " + timeout); + } + } + + @Override + public void ack(long batchId) throws CanalClientException { + ConsumerBatchMessage batchMessage = messageCache.get(batchId); + if (batchMessage != null) { + batchMessage.ack(); + } + } + + @Override + public void rollback(long batchId) throws CanalClientException { + + } + + @Override + public void rollback() throws CanalClientException { + + } + + @Override + public void stopRunning() throws CanalClientException { + this.rocketMQConsumer.shutdown(); + connected = false; + } + +} diff --git a/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalConnectorProvider.java b/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalConnectorProvider.java new file mode 100644 index 00000000..3b876f49 --- /dev/null +++ b/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalConnectorProvider.java @@ -0,0 +1,20 @@ +package com.alibaba.otter.canal.client.rocketmq; + +/** + * RocketMQ connector provider. + */ +public class RocketMQCanalConnectorProvider { + /** + * Create RocketMQ connector + * + * @param nameServers name servers for RocketMQ + * @param topic + * @param groupId + * @return {@link RocketMQCanalConnector} + */ + public static RocketMQCanalConnector newRocketMQConnector(String nameServers, String topic, + String groupId) { + return new RocketMQCanalConnector(nameServers, topic, groupId); + } + +} diff --git a/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalListener.java b/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalListener.java new file mode 100644 index 00000000..c30cd61f --- /dev/null +++ b/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/RocketMQCanalListener.java @@ -0,0 +1,11 @@ +package com.alibaba.otter.canal.client.rocketmq; + +import java.util.List; +import org.apache.rocketmq.common.message.MessageExt; + +/** + * RocketMQ message listener + */ +public interface RocketMQCanalListener { + boolean onReceive(List messageExts); +} diff --git a/client/src/test/java/com/alibaba/otter/canal/client/running/rocketmq/AbstractRocektMQTest.java b/client/src/test/java/com/alibaba/otter/canal/client/running/rocketmq/AbstractRocektMQTest.java new file mode 100644 index 00000000..3e65e66e --- /dev/null +++ b/client/src/test/java/com/alibaba/otter/canal/client/running/rocketmq/AbstractRocektMQTest.java @@ -0,0 +1,8 @@ +package com.alibaba.otter.canal.client.running.rocketmq; + +public class AbstractRocektMQTest { + public static String topic = "example"; + public static String groupId = "group"; + public static String nameServers = "localhost:9876"; + +} diff --git a/client/src/test/java/com/alibaba/otter/canal/client/running/rocketmq/CanalRocketMQClientExample.java b/client/src/test/java/com/alibaba/otter/canal/client/running/rocketmq/CanalRocketMQClientExample.java new file mode 100644 index 00000000..7b15efbf --- /dev/null +++ b/client/src/test/java/com/alibaba/otter/canal/client/running/rocketmq/CanalRocketMQClientExample.java @@ -0,0 +1,135 @@ +package com.alibaba.otter.canal.client.running.rocketmq; + +import com.alibaba.otter.canal.client.rocketmq.RocketMQCanalConnector; +import com.alibaba.otter.canal.client.rocketmq.RocketMQCanalConnectorProvider; +import com.alibaba.otter.canal.client.running.kafka.AbstractKafkaTest; +import com.alibaba.otter.canal.protocol.Message; +import org.apache.kafka.common.errors.WakeupException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.Assert; + +/** + * Kafka client example + * + * @author machengyuan @ 2018-6-12 + * @version 1.0.0 + */ +public class CanalRocketMQClientExample extends AbstractRocektMQTest { + + protected final static Logger logger = LoggerFactory.getLogger(CanalRocketMQClientExample.class); + + private RocketMQCanalConnector connector; + + private static volatile boolean running = false; + + 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 CanalRocketMQClientExample(String nameServers, String topic, + String groupId) { + connector = RocketMQCanalConnectorProvider.newRocketMQConnector(nameServers, + topic, + groupId); + } + + public static void main(String[] args) { + try { + final CanalRocketMQClientExample rocketMQClientExample = new CanalRocketMQClientExample(nameServers, + topic, groupId); + logger.info("## Start the rocketmq consumer: {}-{}", AbstractKafkaTest.topic, AbstractKafkaTest.groupId); + rocketMQClientExample.start(); + logger.info("## The canal rocketmq consumer is running now ......"); + Runtime.getRuntime().addShutdownHook(new Thread() { + + public void run() { + try { + logger.info("## Stop the rocketmq consumer"); + rocketMQClientExample.stop(); + } catch (Throwable e) { + logger.warn("## Something goes wrong when stopping rocketmq consumer:", e); + } finally { + logger.info("## Rocketmq consumer is down."); + } + } + + }); + while (running) + ; + } catch (Throwable e) { + logger.error("## Something going wrong when starting up the rocketmq consumer:", e); + System.exit(0); + } + } + + public void start() { + Assert.notNull(connector, "connector is null"); + thread = new Thread(new Runnable() { + + public void run() { + process(); + } + }); + thread.setUncaughtExceptionHandler(handler); + thread.start(); + running = true; + } + + public void stop() { + if (!running) { + return; + } + connector.stopRunning(); + running = false; + if (thread != null) { + try { + thread.join(); + } catch (InterruptedException e) { + // ignore + } + } + } + + private void process() { + while (!running) + ; + while (running) { + try { + connector.connect(); + connector.subscribe(); + while (running) { + Message message = connector.getWithoutAck(1); // 获取message + try { + if (message == null) { + continue; + } + long batchId = message.getId(); + int size = message.getEntries().size(); + if (batchId == -1 || size == 0) { + } else { + logger.info(message.toString()); + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + connector.ack(message.getId()); // 提交确认 + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + } + + try { + connector.unsubscribe(); + } catch (WakeupException e) { + // No-op. Continue process + } + connector.stopRunning(); + } +} diff --git a/deployer/pom.xml b/deployer/pom.xml index 3580869b..690b8c91 100644 --- a/deployer/pom.xml +++ b/deployer/pom.xml @@ -40,7 +40,7 @@ **/canal.properties **/spring/** **/example/** - **/kafka.yml + **/mq.yml 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 62b73b1d..081248e5 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 @@ -1,25 +1,25 @@ package com.alibaba.otter.canal.deployer; +import com.alibaba.otter.canal.kafka.CanalKafkaProducer; +import com.alibaba.otter.canal.rocketmq.CanalRocketMQProducer; +import com.alibaba.otter.canal.server.CanalMQStarter; +import com.alibaba.otter.canal.spi.CanalMQProducer; import java.io.FileInputStream; import java.util.Properties; - 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独立版本启动的入口类 - * + * * @author jianghang 2012-11-6 下午05:20:49 * @version 1.0.0 */ public class CanalLauncher { private static final String CLASSPATH_URL_PREFIX = "classpath:"; - private static final Logger logger = LoggerFactory.getLogger(CanalLauncher.class); + private static final Logger logger = LoggerFactory.getLogger(CanalLauncher.class); public static void main(String[] args) throws Throwable { try { @@ -55,16 +55,19 @@ public class CanalLauncher { }); - CanalServerStarter canalServerStarter = null; + CanalMQProducer canalMQProducer = null; String serverMode = controller.getProperty(properties, CanalConstants.CANAL_SERVER_MODE); if (serverMode.equalsIgnoreCase("kafka")) { - canalServerStarter = new CanalKafkaStarter(); - } else if (serverMode.equalsIgnoreCase("rocketMQ")) { - // 预留rocketMQ启动 + canalMQProducer = new CanalKafkaProducer(); + } else if (serverMode.equalsIgnoreCase("rocketmq")) { + canalMQProducer = new CanalRocketMQProducer(); } + if (canalMQProducer != null) { + CanalMQStarter canalServerStarter = new CanalMQStarter(canalMQProducer); + if (canalServerStarter != null) { + canalServerStarter.init(); + } - if (canalServerStarter != null) { - canalServerStarter.init(); } } catch (Throwable e) { logger.error("## Something goes wrong when starting up the canal Server:", e); diff --git a/deployer/src/main/resources/canal.properties b/deployer/src/main/resources/canal.properties index 3d580bae..e2ad657b 100644 --- a/deployer/src/main/resources/canal.properties +++ b/deployer/src/main/resources/canal.properties @@ -9,8 +9,8 @@ canal.zkServers= # flush data to zk canal.zookeeper.flush.period = 1000 canal.withoutNetty = false -# tcp, kafka, rocketMQ -canal.serverMode = tcp +# tcp, kafka, RocketMQ +canal.serverMode = rocketmq # flush meta cursor/parse position to file canal.file.data.dir = ${canal.conf.dir} canal.file.flush.period = 1000 diff --git a/deployer/src/main/resources/kafka.yml b/deployer/src/main/resources/mq.yml similarity index 77% rename from deployer/src/main/resources/kafka.yml rename to deployer/src/main/resources/mq.yml index aa23c1ee..b4bb9c29 100644 --- a/deployer/src/main/resources/kafka.yml +++ b/deployer/src/main/resources/mq.yml @@ -1,4 +1,4 @@ -servers: slave1:6667,slave2:6667,slave3:6667 +servers: localhost:9876 #for rocketmq: means the nameserver retries: 0 batchSize: 16384 lingerMs: 1 @@ -11,8 +11,9 @@ canalGetTimeout: 100 flatMessage: true canalDestinations: -- canalDestination: example - topic: exp3 + - canalDestination: example + topic: example + partition: 1 # #对应topic分区数量 # partitionsNum: 3 # partitionHash: 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 997f76c5..0ff7d1ab 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,59 +5,44 @@ 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 { - /** - * ENTRYTYPECOMPATIBLEPROTO2 = 0; - */ - ENTRYTYPECOMPATIBLEPROTO2(0), + implements com.google.protobuf.ProtocolMessageEnum { /** * TRANSACTIONBEGIN = 1; */ - TRANSACTIONBEGIN(1), + TRANSACTIONBEGIN(0, 1), /** * ROWDATA = 2; */ - ROWDATA(2), + ROWDATA(1, 2), /** * TRANSACTIONEND = 3; */ - TRANSACTIONEND(3), + TRANSACTIONEND(2, 3), /** + * HEARTBEAT = 4; + * *
      ** 心跳类型,内部使用,外部暂不可见,可忽略 *
      * 
- * - * HEARTBEAT = 4; */ - HEARTBEAT(4), + HEARTBEAT(3, 4), /** * GTIDLOG = 5; */ - GTIDLOG(5), - UNRECOGNIZED(-1), + GTIDLOG(4, 5), ; - /** - * ENTRYTYPECOMPATIBLEPROTO2 = 0; - */ - public static final int ENTRYTYPECOMPATIBLEPROTO2_VALUE = 0; /** * TRANSACTIONBEGIN = 1; */ @@ -71,11 +56,11 @@ public final class CanalEntry { */ public static final int TRANSACTIONEND_VALUE = 3; /** + * HEARTBEAT = 4; + * *
      ** 心跳类型,内部使用,外部暂不可见,可忽略 *
      * 
- * - * HEARTBEAT = 4; */ public static final int HEARTBEAT_VALUE = 4; /** @@ -84,25 +69,10 @@ public final class CanalEntry { public static final int GTIDLOG_VALUE = 5; - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - 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 0: return ENTRYTYPECOMPATIBLEPROTO2; case 1: return TRANSACTIONBEGIN; case 2: return ROWDATA; case 3: return TRANSACTIONEND; @@ -113,47 +83,46 @@ 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); - } - }; + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public EntryType findValueByNumber(int number) { + return EntryType.valueOf(number); + } + }; public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); + getValueDescriptor() { + return getDescriptor().getValues().get(index); } public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { + getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(0); + getDescriptor() { + return 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."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; + throw new IllegalArgumentException( + "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; } + private final int index; private final int value; - private EntryType(int value) { + private EntryType(int index, int value) { + this.index = index; this.value = value; } @@ -161,97 +130,88 @@ 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 { - /** - * EVENTTYPECOMPATIBLEPROTO2 = 0; - */ - EVENTTYPECOMPATIBLEPROTO2(0), /** * INSERT = 1; */ - INSERT(1), + INSERT(0, 1), /** * UPDATE = 2; */ - UPDATE(2), + UPDATE(1, 2), /** * DELETE = 3; */ - DELETE(3), + DELETE(2, 3), /** * CREATE = 4; */ - CREATE(4), + CREATE(3, 4), /** * ALTER = 5; */ - ALTER(5), + ALTER(4, 5), /** * ERASE = 6; */ - ERASE(6), + ERASE(5, 6), /** * QUERY = 7; */ - QUERY(7), + QUERY(6, 7), /** * TRUNCATE = 8; */ - TRUNCATE(8), + TRUNCATE(7, 8), /** * RENAME = 9; */ - RENAME(9), + RENAME(8, 9), /** + * CINDEX = 10; + * *
      **CREATE INDEX*
      * 
- * - * CINDEX = 10; */ - CINDEX(10), + CINDEX(9, 10), /** * DINDEX = 11; */ - DINDEX(11), + DINDEX(10, 11), /** * GTID = 12; */ - GTID(12), + GTID(11, 12), /** + * XACOMMIT = 13; + * *
      ** XA *
      * 
- * - * XACOMMIT = 13; */ - XACOMMIT(13), + XACOMMIT(12, 13), /** * XAROLLBACK = 14; */ - XAROLLBACK(14), + XAROLLBACK(13, 14), /** + * MHEARTBEAT = 15; + * *
      ** MASTER HEARTBEAT *
      * 
- * - * MHEARTBEAT = 15; */ - MHEARTBEAT(15), - UNRECOGNIZED(-1), + MHEARTBEAT(14, 15), ; - /** - * EVENTTYPECOMPATIBLEPROTO2 = 0; - */ - public static final int EVENTTYPECOMPATIBLEPROTO2_VALUE = 0; /** * INSERT = 1; */ @@ -289,11 +249,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; /** @@ -305,11 +265,11 @@ public final class CanalEntry { */ public static final int GTID_VALUE = 12; /** + * XACOMMIT = 13; + * *
      ** XA *
      * 
- * - * XACOMMIT = 13; */ public static final int XACOMMIT_VALUE = 13; /** @@ -317,34 +277,19 @@ 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() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - 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 0: return EVENTTYPECOMPATIBLEPROTO2; case 1: return INSERT; case 2: return UPDATE; case 3: return DELETE; @@ -368,17 +313,17 @@ public final class CanalEntry { internalGetValueMap() { return internalValueMap; } - private static final com.google.protobuf.Internal.EnumLiteMap< - EventType> internalValueMap = + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { public EventType findValueByNumber(int number) { - return EventType.forNumber(number); + return EventType.valueOf(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); + return getDescriptor().getValues().get(index); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { @@ -386,7 +331,7 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(1); + return CanalEntry.getDescriptor().getEnumTypes().get(1); } private static final EventType[] VALUES = values(); @@ -394,18 +339,17 @@ public final class CanalEntry { public static EventType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "EnumValueDescriptor is not for this type."); } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } return VALUES[desc.getIndex()]; } + private final int index; private final int value; - private EventType(int value) { + private EventType(int index, int value) { + this.index = index; this.value = value; } @@ -413,37 +357,28 @@ 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 { - /** - * TYPECOMPATIBLEPROTO2 = 0; - */ - TYPECOMPATIBLEPROTO2(0), /** * ORACLE = 1; */ - ORACLE(1), + ORACLE(0, 1), /** * MYSQL = 2; */ - MYSQL(2), + MYSQL(1, 2), /** * PGSQL = 3; */ - PGSQL(3), - UNRECOGNIZED(-1), + PGSQL(2, 3), ; - /** - * TYPECOMPATIBLEPROTO2 = 0; - */ - public static final int TYPECOMPATIBLEPROTO2_VALUE = 0; /** * ORACLE = 1; */ @@ -458,25 +393,10 @@ public final class CanalEntry { public static final int PGSQL_VALUE = 3; - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - 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 0: return TYPECOMPATIBLEPROTO2; case 1: return ORACLE; case 2: return MYSQL; case 3: return PGSQL; @@ -488,17 +408,17 @@ public final class CanalEntry { internalGetValueMap() { return internalValueMap; } - private static final com.google.protobuf.Internal.EnumLiteMap< - Type> internalValueMap = + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { public Type findValueByNumber(int number) { - return Type.forNumber(number); + return Type.valueOf(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); + return getDescriptor().getValues().get(index); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { @@ -506,7 +426,7 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(2); + return CanalEntry.getDescriptor().getEnumTypes().get(2); } private static final Type[] VALUES = values(); @@ -514,18 +434,17 @@ public final class CanalEntry { public static Type valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "EnumValueDescriptor is not for this type."); } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } return VALUES[desc.getIndex()]; } + private final int index; private final int value; - private Type(int value) { + private Type(int index, int value) { + this.index = index; this.value = value; } @@ -537,86 +456,105 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * *
      **协议头部信息*
      * 
- * - * .com.alibaba.otter.canal.protocol.Header header = 1; */ boolean hasHeader(); /** + * 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(); + Header getHeader(); /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * *
      **协议头部信息*
      * 
+ */ + HeaderOrBuilder getHeaderOrBuilder(); + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; * - * .com.alibaba.otter.canal.protocol.Header header = 1; + *
+     **打散后的事件类型*
+     * 
*/ - com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder(); - + boolean hasEntryType(); /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
+     **打散后的事件类型*
+     * 
*/ - int getEntryTypeValue(); - /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; - */ - com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType(); + EntryType getEntryType(); /** + * 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(); } /** + * 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.GeneratedMessageV3 implements + public static final class Entry extends + com.google.protobuf.GeneratedMessage 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.GeneratedMessageV3.Builder builder) { + private Entry(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Entry() { - storeValue_ = com.google.protobuf.ByteString.EMPTY; + private Entry(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Entry defaultInstance; + public static Entry getDefaultInstance() { + return defaultInstance; } - @java.lang.Override + public Entry getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } + initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -628,44 +566,49 @@ public final class CanalEntry { case 0: done = true; break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } case 10: { - com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder subBuilder = null; - if (header_ != null) { + Header.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { subBuilder = header_.toBuilder(); } - header_ = input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Header.parser(), extensionRegistry); + header_ = input.readMessage(Header.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(header_); header_ = subBuilder.buildPartial(); } - + bitField0_ |= 0x00000001; break; } case 16: { int rawValue = input.readEnum(); - entryTypePresentCase_ = 2; - entryTypePresent_ = rawValue; + EntryType value = EntryType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(2, rawValue); + } else { + bitField0_ |= 0x00000002; + entryType_ = value; + } break; } case 26: { - + bitField0_ |= 0x00000004; storeValue_ = input.readBytes(); break; } - default: { - if (!parseUnknownFieldProto3( - 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); + e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -673,124 +616,117 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.Entry.class, com.alibaba.otter.canal.protocol.CanalEntry.Entry.Builder.class); + Entry.class, Builder.class); } - 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 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); } }; - public EntryTypePresentCase - getEntryTypePresentCase() { - return EntryTypePresentCase.forNumber( - entryTypePresentCase_); + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; } + private int bitField0_; public static final int HEADER_FIELD_NUMBER = 1; - private com.alibaba.otter.canal.protocol.CanalEntry.Header header_; + private Header header_; /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * *
      **协议头部信息*
      * 
- * - * .com.alibaba.otter.canal.protocol.Header header = 1; */ public boolean hasHeader() { - return header_ != null; + return ((bitField0_ & 0x00000001) == 0x00000001); } /** + * 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_; + public Header getHeader() { + return header_; } /** + * 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 getHeader(); + public HeaderOrBuilder getHeaderOrBuilder() { + return header_; } public static final int ENTRYTYPE_FIELD_NUMBER = 2; + private EntryType entryType_; /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
+     **打散后的事件类型*
+     * 
*/ - public int getEntryTypeValue() { - if (entryTypePresentCase_ == 2) { - return (java.lang.Integer) entryTypePresent_; - } - return EntryType.ROWDATA_VALUE; + public boolean hasEntryType() { + return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
+     **打散后的事件类型*
+     * 
*/ - public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { - 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 EntryType getEntryType() { + return entryType_; } public static final int STOREVALUE_FIELD_NUMBER = 3; private com.google.protobuf.ByteString storeValue_; /** + * 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_; } + 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; @@ -800,218 +736,141 @@ public final class CanalEntry { return true; } - @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (header_ != null) { - output.writeMessage(1, getHeader()); + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, header_); } - if (entryTypePresentCase_ == 2) { - output.writeEnum(2, ((java.lang.Integer) entryTypePresent_)); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeEnum(2, entryType_.getNumber()); } - if (!storeValue_.isEmpty()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, storeValue_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } - @java.lang.Override + private int memoizedSerializedSize = -1; public int getSerializedSize() { - int size = memoizedSize; + int size = memoizedSerializedSize; if (size != -1) return size; size = 0; - if (header_ != null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getHeader()); + .computeMessageSize(1, header_); } - if (entryTypePresentCase_ == 2) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, ((java.lang.Integer) entryTypePresent_)); + .computeEnumSize(2, entryType_.getNumber()); } - if (!storeValue_.isEmpty()) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, storeValue_); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = 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.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 && 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; + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); } - @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(); - } - 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; - 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( + public static Entry parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( + public static Entry 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.CanalEntry.Entry parseFrom(byte[] data) + public static Entry parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( + public static Entry 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.CanalEntry.Entry parseFrom(java.io.InputStream input) + public static Entry parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( + public static Entry parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseDelimitedFrom(java.io.InputStream input) + public static Entry parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); + return PARSER.parseDelimitedFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseDelimitedFrom( + public static Entry parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( + public static Entry parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( + public static Entry parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - @java.lang.Override + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - 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 static Builder newBuilder(Entry prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Entry) - com.alibaba.otter.canal.protocol.CanalEntry.EntryOrBuilder { + EntryOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.Entry.class, com.alibaba.otter.canal.protocol.CanalEntry.Entry.Builder.class); + Entry.class, Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Entry.newBuilder() @@ -1020,148 +879,118 @@ public final class CanalEntry { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getHeaderFieldBuilder(); } } - @java.lang.Override + private static Builder create() { + return new Builder(); + } + public Builder clear() { super.clear(); if (headerBuilder_ == null) { - header_ = null; + header_ = Header.getDefaultInstance(); } else { - header_ = null; - headerBuilder_ = null; + headerBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); + entryType_ = EntryType.ROWDATA; + bitField0_ = (bitField0_ & ~0x00000002); storeValue_ = com.google.protobuf.ByteString.EMPTY; - - entryTypePresentCase_ = 0; - entryTypePresent_ = null; + bitField0_ = (bitField0_ & ~0x00000004); return this; } - @java.lang.Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.Entry getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.Entry.getDefaultInstance(); + public Entry getDefaultInstanceForType() { + return Entry.getDefaultInstance(); } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.Entry build() { - com.alibaba.otter.canal.protocol.CanalEntry.Entry result = buildPartial(); + public Entry build() { + Entry result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @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); + public Entry buildPartial() { + Entry result = new 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 (entryTypePresentCase_ == 2) { - result.entryTypePresent_ = entryTypePresent_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.entryType_ = entryType_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; } result.storeValue_ = storeValue_; - result.entryTypePresentCase_ = entryTypePresentCase_; + 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.CanalEntry.Entry) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.Entry)other); + if (other instanceof Entry) { + return mergeFrom((Entry)other); } else { super.mergeFrom(other); 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; + public Builder mergeFrom(Entry other) { + if (other == Entry.getDefaultInstance()) return this; if (other.hasHeader()) { mergeHeader(other.getHeader()); } - if (other.getStoreValue() != com.google.protobuf.ByteString.EMPTY) { + if (other.hasEntryType()) { + setEntryType(other.getEntryType()); + } + if (other.hasStoreValue()) { setStoreValue(other.getStoreValue()); } - switch (other.getEntryTypePresentCase()) { - case ENTRYTYPE: { - setEntryTypeValue(other.getEntryTypeValue()); - break; - } - case ENTRYTYPEPRESENT_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + this.mergeUnknownFields(other.getUnknownFields()); 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.CanalEntry.Entry parsedMessage = null; + Entry parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.Entry) e.getUnfinishedMessage(); - throw e.unwrapIOException(); + parsedMessage = (Entry) e.getUnfinishedMessage(); + throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -1169,57 +998,43 @@ public final class CanalEntry { } return this; } - private int entryTypePresentCase_ = 0; - private java.lang.Object entryTypePresent_; - public EntryTypePresentCase - getEntryTypePresentCase() { - return EntryTypePresentCase.forNumber( - entryTypePresentCase_); - } + private int bitField0_; - 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< - com.alibaba.otter.canal.protocol.CanalEntry.Header, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder, com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder> headerBuilder_; + private Header header_ = Header.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + Header, Header.Builder, HeaderOrBuilder> headerBuilder_; /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * *
        **协议头部信息*
        * 
- * - * .com.alibaba.otter.canal.protocol.Header header = 1; */ public boolean hasHeader() { - return headerBuilder_ != null || header_ != null; + return ((bitField0_ & 0x00000001) == 0x00000001); } /** + * 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() { + public Header getHeader() { if (headerBuilder_ == null) { - return header_ == null ? com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance() : header_; + return header_; } else { return headerBuilder_.getMessage(); } } /** + * 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) { + public Builder setHeader(Header value) { if (headerBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -1229,39 +1044,40 @@ public final class CanalEntry { } else { headerBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; return this; } /** + * 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) { + Header.Builder builderForValue) { if (headerBuilder_ == null) { header_ = builderForValue.build(); onChanged(); } else { headerBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; return this; } /** + * 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) { + public Builder mergeHeader(Header value) { if (headerBuilder_ == null) { - if (header_ != null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + header_ != Header.getDefaultInstance()) { header_ = - com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder(header_).mergeFrom(value).buildPartial(); + Header.newBuilder(header_).mergeFrom(value).buildPartial(); } else { header_ = value; } @@ -1269,67 +1085,65 @@ public final class CanalEntry { } else { headerBuilder_.mergeFrom(value); } - + bitField0_ |= 0x00000001; return this; } /** + * 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; + header_ = Header.getDefaultInstance(); onChanged(); } else { - header_ = null; - headerBuilder_ = null; + headerBuilder_.clear(); } - + bitField0_ = (bitField0_ & ~0x00000001); return this; } /** + * 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() { - + public Header.Builder getHeaderBuilder() { + bitField0_ |= 0x00000001; onChanged(); return getHeaderFieldBuilder().getBuilder(); } /** + * 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() { + public HeaderOrBuilder getHeaderOrBuilder() { if (headerBuilder_ != null) { return headerBuilder_.getMessageOrBuilder(); } else { - return header_ == null ? - com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance() : header_; + return header_; } } /** + * 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> + private com.google.protobuf.SingleFieldBuilder< + Header, Header.Builder, HeaderOrBuilder> getHeaderFieldBuilder() { if (headerBuilder_ == null) { - 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>( + headerBuilder_ = new com.google.protobuf.SingleFieldBuilder< + Header, Header.Builder, HeaderOrBuilder>( getHeader(), getParentForChildren(), isClean()); @@ -1338,151 +1152,117 @@ public final class CanalEntry { return headerBuilder_; } + private EntryType entryType_ = EntryType.ROWDATA; /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
+       **打散后的事件类型*
+       * 
*/ - public int getEntryTypeValue() { - if (entryTypePresentCase_ == 2) { - return ((java.lang.Integer) entryTypePresent_).intValue(); - } - return 0; + public boolean hasEntryType() { + return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
+       **打散后的事件类型*
+       * 
*/ - public Builder setEntryTypeValue(int value) { - entryTypePresentCase_ = 2; - entryTypePresent_ = value; - onChanged(); - return this; + public EntryType getEntryType() { + return entryType_; } /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
+       **打散后的事件类型*
+       * 
*/ - public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { - 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; - } - /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; - */ - public Builder setEntryType(com.alibaba.otter.canal.protocol.CanalEntry.EntryType value) { + public Builder setEntryType(EntryType value) { if (value == null) { throw new NullPointerException(); } - entryTypePresentCase_ = 2; - entryTypePresent_ = value.getNumber(); + bitField0_ |= 0x00000002; + entryType_ = value; onChanged(); return this; } /** - * .com.alibaba.otter.canal.protocol.EntryType entryType = 2; + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
+       **打散后的事件类型*
+       * 
*/ public Builder clearEntryType() { - if (entryTypePresentCase_ == 2) { - entryTypePresentCase_ = 0; - entryTypePresent_ = null; - onChanged(); - } + bitField0_ = (bitField0_ & ~0x00000002); + entryType_ = EntryType.ROWDATA; + onChanged(); return this; } private com.google.protobuf.ByteString storeValue_ = com.google.protobuf.ByteString.EMPTY; /** + * 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_; } /** + * 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; } /** + * optional bytes storeValue = 3; + * *
        **传输的二进制数组*
        * 
- * - * bytes storeValue = 3; */ public Builder clearStoreValue() { - + bitField0_ = (bitField0_ & ~0x00000004); storeValue_ = getDefaultInstance().getStoreValue(); onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(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 { - DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.Entry(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private 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; + defaultInstance = new Entry(true); + defaultInstance.initFields(); } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Entry) } public interface HeaderOrBuilder extends @@ -1490,246 +1270,335 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * int32 version = 1; + * optional int32 version = 1 [default = 1]; + * + *
+     **协议的版本号*
+     * 
+ */ + boolean hasVersion(); + /** + * optional int32 version = 1 [default = 1]; + * + *
+     **协议的版本号*
+     * 
*/ int getVersion(); /** + * optional string logfileName = 2; + * *
      **binlog/redolog 文件名*
      * 
- * - * string logfileName = 2; */ - java.lang.String getLogfileName(); + boolean hasLogfileName(); /** + * optional string logfileName = 2; + * *
      **binlog/redolog 文件名*
      * 
+ */ + String getLogfileName(); + /** + * optional string logfileName = 2; * - * string logfileName = 2; + *
+     **binlog/redolog 文件名*
+     * 
*/ com.google.protobuf.ByteString getLogfileNameBytes(); /** + * optional int64 logfileOffset = 3; + * *
      **binlog/redolog 文件的偏移位置*
      * 
+ */ + boolean hasLogfileOffset(); + /** + * optional int64 logfileOffset = 3; * - * int64 logfileOffset = 3; + *
+     **binlog/redolog 文件的偏移位置*
+     * 
*/ long getLogfileOffset(); /** + * optional int64 serverId = 4; + * *
      **服务端serverId*
      * 
+ */ + boolean hasServerId(); + /** + * optional int64 serverId = 4; * - * int64 serverId = 4; + *
+     **服务端serverId*
+     * 
*/ long getServerId(); /** + * optional string serverenCode = 5; + * *
      ** 变更数据的编码 *
      * 
- * - * string serverenCode = 5; */ - java.lang.String getServerenCode(); + boolean hasServerenCode(); /** + * optional string serverenCode = 5; + * *
      ** 变更数据的编码 *
      * 
+ */ + String getServerenCode(); + /** + * optional string serverenCode = 5; * - * string serverenCode = 5; + *
+     ** 变更数据的编码 *
+     * 
*/ com.google.protobuf.ByteString getServerenCodeBytes(); /** + * optional int64 executeTime = 6; + * *
      **变更数据的执行时间 *
      * 
+ */ + boolean hasExecuteTime(); + /** + * optional int64 executeTime = 6; * - * int64 executeTime = 6; + *
+     **变更数据的执行时间 *
+     * 
*/ long getExecuteTime(); /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
+     ** 变更数据的来源*
+     * 
*/ - int getSourceTypeValue(); + boolean hasSourceType(); /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
+     ** 变更数据的来源*
+     * 
*/ - com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType(); + Type getSourceType(); /** + * optional string schemaName = 8; + * *
      ** 变更数据的schemaname*
      * 
- * - * string schemaName = 8; */ - java.lang.String getSchemaName(); + boolean hasSchemaName(); /** + * optional string schemaName = 8; + * *
      ** 变更数据的schemaname*
      * 
+ */ + String getSchemaName(); + /** + * optional string schemaName = 8; * - * string schemaName = 8; + *
+     ** 变更数据的schemaname*
+     * 
*/ com.google.protobuf.ByteString getSchemaNameBytes(); /** + * optional string tableName = 9; + * *
      **变更数据的tablename*
      * 
- * - * string tableName = 9; */ - java.lang.String getTableName(); + boolean hasTableName(); /** + * optional string tableName = 9; + * *
      **变更数据的tablename*
      * 
+ */ + String getTableName(); + /** + * optional string tableName = 9; * - * string tableName = 9; + *
+     **变更数据的tablename*
+     * 
*/ com.google.protobuf.ByteString getTableNameBytes(); /** + * optional int64 eventLength = 10; + * *
      **每个event的长度*
      * 
+ */ + boolean hasEventLength(); + /** + * optional int64 eventLength = 10; * - * int64 eventLength = 10; + *
+     **每个event的长度*
+     * 
*/ long getEventLength(); /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
+     **数据变更类型*
+     * 
*/ - int getEventTypeValue(); + boolean hasEventType(); /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
+     **数据变更类型*
+     * 
*/ - com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); + PairOrBuilder getPropsOrBuilder(int index); /** + * optional string gtid = 13; + * *
      **当前事务的gitd*
      * 
- * - * string gtid = 13; */ - java.lang.String getGtid(); + boolean hasGtid(); /** + * optional string gtid = 13; + * *
      **当前事务的gitd*
      * 
+ */ + String getGtid(); + /** + * optional string gtid = 13; * - * string gtid = 13; + *
+     **当前事务的gitd*
+     * 
*/ 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(); } /** + * 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.GeneratedMessageV3 implements + public static final class Header extends + com.google.protobuf.GeneratedMessage 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.GeneratedMessageV3.Builder builder) { + private Header(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Header() { - logfileName_ = ""; - logfileOffset_ = 0L; - serverId_ = 0L; - serverenCode_ = ""; - executeTime_ = 0L; - schemaName_ = ""; - tableName_ = ""; - eventLength_ = 0L; - props_ = java.util.Collections.emptyList(); - gtid_ = ""; + private Header(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Header defaultInstance; + public static Header getDefaultInstance() { + return defaultInstance; } - @java.lang.Override + public Header getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } + initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -1741,87 +1610,96 @@ public final class CanalEntry { case 0: done = true; break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } case 8: { - versionPresentCase_ = 1; - versionPresent_ = input.readInt32(); + bitField0_ |= 0x00000001; + version_ = input.readInt32(); break; } case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - logfileName_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + logfileName_ = bs; break; } case 24: { - + bitField0_ |= 0x00000004; logfileOffset_ = input.readInt64(); break; } case 32: { - + bitField0_ |= 0x00000008; serverId_ = input.readInt64(); break; } case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - serverenCode_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + serverenCode_ = bs; break; } case 48: { - + bitField0_ |= 0x00000020; executeTime_ = input.readInt64(); break; } case 56: { int rawValue = input.readEnum(); - sourceTypePresentCase_ = 7; - sourceTypePresent_ = rawValue; + Type value = Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(7, rawValue); + } else { + bitField0_ |= 0x00000040; + sourceType_ = value; + } break; } case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - schemaName_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000080; + schemaName_ = bs; break; } case 74: { - java.lang.String s = input.readStringRequireUtf8(); - - tableName_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000100; + tableName_ = bs; break; } case 80: { - + bitField0_ |= 0x00000200; eventLength_ = input.readInt64(); break; } case 88: { int rawValue = input.readEnum(); - eventTypePresentCase_ = 11; - eventTypePresent_ = rawValue; + EventType value = EventType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(11, rawValue); + } else { + bitField0_ |= 0x00000400; + eventType_ = value; + } 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(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); + props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; } case 106: { - java.lang.String s = input.readStringRequireUtf8(); - - gtid_ = s; - break; - } - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000800; + gtid_ = bs; break; } } @@ -1830,7 +1708,7 @@ public final class CanalEntry { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); + e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -1841,172 +1719,102 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.Header.class, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder.class); + 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; } private int bitField0_; - 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; + private int version_; /** - * int32 version = 1; + * optional int32 version = 1 [default = 1]; + * + *
+     **协议的版本号*
+     * 
+ */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 version = 1 [default = 1]; + * + *
+     **协议的版本号*
+     * 
*/ public int getVersion() { - if (versionPresentCase_ == 1) { - return (java.lang.Integer) versionPresent_; - } - return 1; + return version_; } public static final int LOGFILENAME_FIELD_NUMBER = 2; - private volatile java.lang.Object logfileName_; + private Object logfileName_; /** + * optional string logfileName = 2; + * *
      **binlog/redolog 文件名*
      * 
- * - * string logfileName = 2; */ - public java.lang.String getLogfileName() { - java.lang.Object ref = logfileName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasLogfileName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string logfileName = 2; + * + *
+     **binlog/redolog 文件名*
+     * 
+ */ + public String getLogfileName() { + Object ref = logfileName_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logfileName_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + logfileName_ = s; + } return s; } } /** + * optional string logfileName = 2; + * *
      **binlog/redolog 文件名*
      * 
- * - * string logfileName = 2; */ public com.google.protobuf.ByteString getLogfileNameBytes() { - java.lang.Object ref = logfileName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = logfileName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); logfileName_ = b; return b; } else { @@ -2017,11 +1825,21 @@ public final class CanalEntry { public static final int LOGFILEOFFSET_FIELD_NUMBER = 3; private long logfileOffset_; /** + * optional int64 logfileOffset = 3; + * *
      **binlog/redolog 文件的偏移位置*
      * 
+ */ + public boolean hasLogfileOffset() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 logfileOffset = 3; * - * int64 logfileOffset = 3; + *
+     **binlog/redolog 文件的偏移位置*
+     * 
*/ public long getLogfileOffset() { return logfileOffset_; @@ -2030,51 +1848,73 @@ public final class CanalEntry { public static final int SERVERID_FIELD_NUMBER = 4; private long serverId_; /** + * optional int64 serverId = 4; + * *
      **服务端serverId*
      * 
+ */ + public boolean hasServerId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int64 serverId = 4; * - * int64 serverId = 4; + *
+     **服务端serverId*
+     * 
*/ public long getServerId() { return serverId_; } public static final int SERVERENCODE_FIELD_NUMBER = 5; - private volatile java.lang.Object serverenCode_; + private Object serverenCode_; /** + * optional string serverenCode = 5; + * *
      ** 变更数据的编码 *
      * 
- * - * string serverenCode = 5; */ - public java.lang.String getServerenCode() { - java.lang.Object ref = serverenCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasServerenCode() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string serverenCode = 5; + * + *
+     ** 变更数据的编码 *
+     * 
+ */ + public String getServerenCode() { + Object ref = serverenCode_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serverenCode_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + serverenCode_ = s; + } return s; } } /** + * optional string serverenCode = 5; + * *
      ** 变更数据的编码 *
      * 
- * - * string serverenCode = 5; */ public com.google.protobuf.ByteString getServerenCodeBytes() { - java.lang.Object ref = serverenCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = serverenCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); serverenCode_ = b; return b; } else { @@ -2085,74 +1925,96 @@ public final class CanalEntry { public static final int EXECUTETIME_FIELD_NUMBER = 6; private long executeTime_; /** + * 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 Type sourceType_; /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
+     ** 变更数据的来源*
+     * 
*/ - public int getSourceTypeValue() { - if (sourceTypePresentCase_ == 7) { - return (java.lang.Integer) sourceTypePresent_; - } - return 0; + public boolean hasSourceType() { + return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
+     ** 变更数据的来源*
+     * 
*/ - public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { - 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 Type getSourceType() { + return sourceType_; } public static final int SCHEMANAME_FIELD_NUMBER = 8; - private volatile java.lang.Object schemaName_; + private Object schemaName_; /** + * optional string schemaName = 8; + * *
      ** 变更数据的schemaname*
      * 
- * - * string schemaName = 8; */ - public java.lang.String getSchemaName() { - java.lang.Object ref = schemaName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasSchemaName() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional string schemaName = 8; + * + *
+     ** 变更数据的schemaname*
+     * 
+ */ + public String getSchemaName() { + Object ref = schemaName_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - schemaName_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + schemaName_ = s; + } return s; } } /** + * optional string schemaName = 8; + * *
      ** 变更数据的schemaname*
      * 
- * - * string schemaName = 8; */ public com.google.protobuf.ByteString getSchemaNameBytes() { - java.lang.Object ref = schemaName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = schemaName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); schemaName_ = b; return b; } else { @@ -2161,40 +2023,52 @@ public final class CanalEntry { } public static final int TABLENAME_FIELD_NUMBER = 9; - private volatile java.lang.Object tableName_; + private Object tableName_; /** + * optional string tableName = 9; + * *
      **变更数据的tablename*
      * 
- * - * string tableName = 9; */ - public java.lang.String getTableName() { - java.lang.Object ref = tableName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasTableName() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional string tableName = 9; + * + *
+     **变更数据的tablename*
+     * 
+ */ + public String getTableName() { + Object ref = tableName_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tableName_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + tableName_ = s; + } return s; } } /** + * optional string tableName = 9; + * *
      **变更数据的tablename*
      * 
- * - * string tableName = 9; */ public com.google.protobuf.ByteString getTableNameBytes() { - java.lang.Object ref = tableName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); tableName_ = b; return b; } else { @@ -2205,129 +2079,151 @@ public final class CanalEntry { public static final int EVENTLENGTH_FIELD_NUMBER = 10; private long eventLength_; /** + * optional int64 eventLength = 10; + * *
      **每个event的长度*
      * 
+ */ + public boolean hasEventLength() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional int64 eventLength = 10; * - * int64 eventLength = 10; + *
+     **每个event的长度*
+     * 
*/ public long getEventLength() { return eventLength_; } public static final int EVENTTYPE_FIELD_NUMBER = 11; + private EventType eventType_; /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
+     **数据变更类型*
+     * 
*/ - public int getEventTypeValue() { - if (eventTypePresentCase_ == 11) { - return (java.lang.Integer) eventTypePresent_; - } - return 0; + public boolean hasEventType() { + return ((bitField0_ & 0x00000400) == 0x00000400); } /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
+     **数据变更类型*
+     * 
*/ - public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - 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 EventType getEventType() { + return eventType_; } 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 com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } public static final int GTID_FIELD_NUMBER = 13; - private volatile java.lang.Object gtid_; + private Object gtid_; /** + * optional string gtid = 13; + * *
      **当前事务的gitd*
      * 
- * - * string gtid = 13; */ - public java.lang.String getGtid() { - java.lang.Object ref = gtid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasGtid() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional string gtid = 13; + * + *
+     **当前事务的gitd*
+     * 
+ */ + public String getGtid() { + Object ref = gtid_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gtid_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + gtid_ = s; + } return s; } } /** + * optional string gtid = 13; + * *
      **当前事务的gitd*
      * 
- * - * string gtid = 13; */ public com.google.protobuf.ByteString getGtidBytes() { - java.lang.Object ref = gtid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = gtid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); gtid_ = b; return b; } else { @@ -2335,8 +2231,22 @@ 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; @@ -2346,353 +2256,208 @@ public final class CanalEntry { return true; } - @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (versionPresentCase_ == 1) { - output.writeInt32( - 1, (int)((java.lang.Integer) versionPresent_)); + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, version_); } - if (!getLogfileNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, logfileName_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getLogfileNameBytes()); } - if (logfileOffset_ != 0L) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt64(3, logfileOffset_); } - if (serverId_ != 0L) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt64(4, serverId_); } - if (!getServerenCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serverenCode_); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, getServerenCodeBytes()); } - if (executeTime_ != 0L) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeInt64(6, executeTime_); } - if (sourceTypePresentCase_ == 7) { - output.writeEnum(7, ((java.lang.Integer) sourceTypePresent_)); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeEnum(7, sourceType_.getNumber()); } - if (!getSchemaNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, schemaName_); + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeBytes(8, getSchemaNameBytes()); } - if (!getTableNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, tableName_); + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeBytes(9, getTableNameBytes()); } - if (eventLength_ != 0L) { + if (((bitField0_ & 0x00000200) == 0x00000200)) { output.writeInt64(10, eventLength_); } - if (eventTypePresentCase_ == 11) { - output.writeEnum(11, ((java.lang.Integer) eventTypePresent_)); + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeEnum(11, eventType_.getNumber()); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(12, props_.get(i)); } - if (!getGtidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, gtid_); + if (((bitField0_ & 0x00000800) == 0x00000800)) { + output.writeBytes(13, getGtidBytes()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } - @java.lang.Override + private int memoizedSerializedSize = -1; public int getSerializedSize() { - int size = memoizedSize; + int size = memoizedSerializedSize; if (size != -1) return size; size = 0; - if (versionPresentCase_ == 1) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size( - 1, (int)((java.lang.Integer) versionPresent_)); + .computeInt32Size(1, version_); } - if (!getLogfileNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, logfileName_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getLogfileNameBytes()); } - if (logfileOffset_ != 0L) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, logfileOffset_); } - if (serverId_ != 0L) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(4, serverId_); } - if (!getServerenCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serverenCode_); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, getServerenCodeBytes()); } - if (executeTime_ != 0L) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(6, executeTime_); } - if (sourceTypePresentCase_ == 7) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, ((java.lang.Integer) sourceTypePresent_)); + .computeEnumSize(7, sourceType_.getNumber()); } - if (!getSchemaNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, schemaName_); + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(8, getSchemaNameBytes()); } - if (!getTableNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, tableName_); + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(9, getTableNameBytes()); } - if (eventLength_ != 0L) { + if (((bitField0_ & 0x00000200) == 0x00000200)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(10, eventLength_); } - if (eventTypePresentCase_ == 11) { + if (((bitField0_ & 0x00000400) == 0x00000400)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(11, ((java.lang.Integer) eventTypePresent_)); + .computeEnumSize(11, eventType_.getNumber()); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(12, props_.get(i)); } - if (!getGtidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, gtid_); + if (((bitField0_ & 0x00000800) == 0x00000800)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(13, getGtidBytes()); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = 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.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 && 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 && 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; + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - 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(); - } - 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; - 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( + public static Header parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( + public static Header 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.CanalEntry.Header parseFrom(byte[] data) + public static Header parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( + public static Header 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.CanalEntry.Header parseFrom(java.io.InputStream input) + public static Header parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( + public static Header parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseDelimitedFrom(java.io.InputStream input) + public static Header parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); + return PARSER.parseDelimitedFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseDelimitedFrom( + public static Header parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( + public static Header parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( + public static Header parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - @java.lang.Override + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - 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 static Builder newBuilder(Header prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Header) - com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder { + HeaderOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.Header.class, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder.class); + Header.class, Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder() @@ -2701,35 +2466,43 @@ public final class CanalEntry { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getPropsFieldBuilder(); } } - @java.lang.Override + private static Builder create() { + return new Builder(); + } + 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_ = Type.MYSQL; + bitField0_ = (bitField0_ & ~0x00000040); schemaName_ = ""; - + bitField0_ = (bitField0_ & ~0x00000080); tableName_ = ""; - + bitField0_ = (bitField0_ & ~0x00000100); eventLength_ = 0L; - + bitField0_ = (bitField0_ & ~0x00000200); + eventType_ = EventType.UPDATE; + bitField0_ = (bitField0_ & ~0x00000400); if (propsBuilder_ == null) { props_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000800); @@ -2737,58 +2510,79 @@ public final class CanalEntry { propsBuilder_.clear(); } gtid_ = ""; - - versionPresentCase_ = 0; - versionPresent_ = null; - sourceTypePresentCase_ = 0; - sourceTypePresent_ = null; - eventTypePresentCase_ = 0; - eventTypePresent_ = null; + bitField0_ = (bitField0_ & ~0x00001000); return this; } - @java.lang.Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.Header getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); + public Header getDefaultInstanceForType() { + return Header.getDefaultInstance(); } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.Header build() { - com.alibaba.otter.canal.protocol.CanalEntry.Header result = buildPartial(); + public Header build() { + Header result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @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); + public Header buildPartial() { + Header result = new Header(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (versionPresentCase_ == 1) { - result.versionPresent_ = versionPresent_; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.version_ = version_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; } 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 (sourceTypePresentCase_ == 7) { - result.sourceTypePresent_ = sourceTypePresent_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.sourceType_ = sourceType_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; } result.schemaName_ = schemaName_; - result.tableName_ = tableName_; - result.eventLength_ = eventLength_; - if (eventTypePresentCase_ == 11) { - result.eventTypePresent_ = eventTypePresent_; + 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; + } + result.eventType_ = eventType_; if (propsBuilder_ == null) { if (((bitField0_ & 0x00000800) == 0x00000800)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -2798,87 +2592,67 @@ 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; } - @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.CanalEntry.Header) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.Header)other); + if (other instanceof Header) { + return mergeFrom((Header)other); } else { super.mergeFrom(other); 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.getLogfileName().isEmpty()) { + public Builder mergeFrom(Header other) { + if (other == Header.getDefaultInstance()) return this; + if (other.hasVersion()) { + setVersion(other.getVersion()); + } + if (other.hasLogfileName()) { + bitField0_ |= 0x00000002; logfileName_ = other.logfileName_; onChanged(); } - if (other.getLogfileOffset() != 0L) { + if (other.hasLogfileOffset()) { setLogfileOffset(other.getLogfileOffset()); } - if (other.getServerId() != 0L) { + if (other.hasServerId()) { setServerId(other.getServerId()); } - if (!other.getServerenCode().isEmpty()) { + if (other.hasServerenCode()) { + bitField0_ |= 0x00000010; serverenCode_ = other.serverenCode_; onChanged(); } - if (other.getExecuteTime() != 0L) { + if (other.hasExecuteTime()) { setExecuteTime(other.getExecuteTime()); } - if (!other.getSchemaName().isEmpty()) { + if (other.hasSourceType()) { + setSourceType(other.getSourceType()); + } + if (other.hasSchemaName()) { + bitField0_ |= 0x00000080; schemaName_ = other.schemaName_; onChanged(); } - if (!other.getTableName().isEmpty()) { + if (other.hasTableName()) { + bitField0_ |= 0x00000100; tableName_ = other.tableName_; onChanged(); } - if (other.getEventLength() != 0L) { + if (other.hasEventLength()) { setEventLength(other.getEventLength()); } + if (other.hasEventType()) { + setEventType(other.getEventType()); + } if (propsBuilder_ == null) { if (!other.props_.isEmpty()) { if (props_.isEmpty()) { @@ -2897,66 +2671,37 @@ public final class CanalEntry { propsBuilder_ = null; props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000800); - propsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + propsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); } } } - if (!other.getGtid().isEmpty()) { + if (other.hasGtid()) { + bitField0_ |= 0x00001000; 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(); + this.mergeUnknownFields(other.getUnknownFields()); 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.CanalEntry.Header parsedMessage = null; + Header parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.Header) e.getUnfinishedMessage(); - throw e.unwrapIOException(); + parsedMessage = (Header) e.getUnfinishedMessage(); + throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -2964,117 +2709,102 @@ 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; /** - * int32 version = 1; + * optional int32 version = 1 [default = 1]; + * + *
+       **协议的版本号*
+       * 
*/ - public int getVersion() { - if (versionPresentCase_ == 1) { - return (java.lang.Integer) versionPresent_; - } - return 0; + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * int32 version = 1; + * optional int32 version = 1 [default = 1]; + * + *
+       **协议的版本号*
+       * 
+ */ + public int getVersion() { + return version_; + } + /** + * optional int32 version = 1 [default = 1]; + * + *
+       **协议的版本号*
+       * 
*/ public Builder setVersion(int value) { - versionPresentCase_ = 1; - versionPresent_ = value; + bitField0_ |= 0x00000001; + version_ = value; onChanged(); return this; } /** - * int32 version = 1; + * optional int32 version = 1 [default = 1]; + * + *
+       **协议的版本号*
+       * 
*/ public Builder clearVersion() { - if (versionPresentCase_ == 1) { - versionPresentCase_ = 0; - versionPresent_ = null; - onChanged(); - } + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 1; + onChanged(); return this; } - private java.lang.Object logfileName_ = ""; + private Object logfileName_ = ""; /** + * optional string logfileName = 2; + * *
        **binlog/redolog 文件名*
        * 
- * - * string logfileName = 2; */ - public java.lang.String getLogfileName() { - java.lang.Object ref = logfileName_; - if (!(ref instanceof java.lang.String)) { + public boolean hasLogfileName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string logfileName = 2; + * + *
+       **binlog/redolog 文件名*
+       * 
+ */ + public String getLogfileName() { + Object ref = logfileName_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logfileName_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + logfileName_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string logfileName = 2; + * *
        **binlog/redolog 文件名*
        * 
- * - * string logfileName = 2; */ public com.google.protobuf.ByteString getLogfileNameBytes() { - java.lang.Object ref = logfileName_; + Object ref = logfileName_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); logfileName_ = b; return b; } else { @@ -3082,49 +2812,48 @@ public final class CanalEntry { } } /** + * optional string logfileName = 2; + * *
        **binlog/redolog 文件名*
        * 
- * - * string logfileName = 2; */ public Builder setLogfileName( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000002; logfileName_ = value; onChanged(); return this; } /** + * optional string logfileName = 2; + * *
        **binlog/redolog 文件名*
        * 
- * - * string logfileName = 2; */ public Builder clearLogfileName() { - + bitField0_ = (bitField0_ & ~0x00000002); logfileName_ = getDefaultInstance().getLogfileName(); onChanged(); return this; } /** + * optional string logfileName = 2; + * *
        **binlog/redolog 文件名*
        * 
- * - * string logfileName = 2; */ public Builder setLogfileNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000002; logfileName_ = value; onChanged(); return this; @@ -3132,37 +2861,47 @@ public final class CanalEntry { private long logfileOffset_ ; /** + * optional int64 logfileOffset = 3; + * *
        **binlog/redolog 文件的偏移位置*
        * 
+ */ + public boolean hasLogfileOffset() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 logfileOffset = 3; * - * int64 logfileOffset = 3; + *
+       **binlog/redolog 文件的偏移位置*
+       * 
*/ public long getLogfileOffset() { return logfileOffset_; } /** + * optional int64 logfileOffset = 3; + * *
        **binlog/redolog 文件的偏移位置*
        * 
- * - * int64 logfileOffset = 3; */ public Builder setLogfileOffset(long value) { - + bitField0_ |= 0x00000004; logfileOffset_ = value; onChanged(); return this; } /** + * optional int64 logfileOffset = 3; + * *
        **binlog/redolog 文件的偏移位置*
        * 
- * - * int64 logfileOffset = 3; */ public Builder clearLogfileOffset() { - + bitField0_ = (bitField0_ & ~0x00000004); logfileOffset_ = 0L; onChanged(); return this; @@ -3170,76 +2909,98 @@ public final class CanalEntry { private long serverId_ ; /** + * optional int64 serverId = 4; + * *
        **服务端serverId*
        * 
+ */ + public boolean hasServerId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int64 serverId = 4; * - * int64 serverId = 4; + *
+       **服务端serverId*
+       * 
*/ public long getServerId() { return serverId_; } /** + * optional int64 serverId = 4; + * *
        **服务端serverId*
        * 
- * - * int64 serverId = 4; */ public Builder setServerId(long value) { - + bitField0_ |= 0x00000008; serverId_ = value; onChanged(); return this; } /** + * optional int64 serverId = 4; + * *
        **服务端serverId*
        * 
- * - * int64 serverId = 4; */ public Builder clearServerId() { - + bitField0_ = (bitField0_ & ~0x00000008); serverId_ = 0L; onChanged(); return this; } - private java.lang.Object serverenCode_ = ""; + private Object serverenCode_ = ""; /** + * optional string serverenCode = 5; + * *
        ** 变更数据的编码 *
        * 
- * - * string serverenCode = 5; */ - public java.lang.String getServerenCode() { - java.lang.Object ref = serverenCode_; - if (!(ref instanceof java.lang.String)) { + public boolean hasServerenCode() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string serverenCode = 5; + * + *
+       ** 变更数据的编码 *
+       * 
+ */ + public String getServerenCode() { + Object ref = serverenCode_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serverenCode_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + serverenCode_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string serverenCode = 5; + * *
        ** 变更数据的编码 *
        * 
- * - * string serverenCode = 5; */ public com.google.protobuf.ByteString getServerenCodeBytes() { - java.lang.Object ref = serverenCode_; + Object ref = serverenCode_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); serverenCode_ = b; return b; } else { @@ -3247,49 +3008,48 @@ public final class CanalEntry { } } /** + * optional string serverenCode = 5; + * *
        ** 变更数据的编码 *
        * 
- * - * string serverenCode = 5; */ public Builder setServerenCode( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000010; serverenCode_ = value; onChanged(); return this; } /** + * optional string serverenCode = 5; + * *
        ** 变更数据的编码 *
        * 
- * - * string serverenCode = 5; */ public Builder clearServerenCode() { - + bitField0_ = (bitField0_ & ~0x00000010); serverenCode_ = getDefaultInstance().getServerenCode(); onChanged(); return this; } /** + * optional string serverenCode = 5; + * *
        ** 变更数据的编码 *
        * 
- * - * string serverenCode = 5; */ public Builder setServerenCodeBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000010; serverenCode_ = value; onChanged(); return this; @@ -3297,130 +3057,149 @@ public final class CanalEntry { private long executeTime_ ; /** + * optional int64 executeTime = 6; + * *
        **变更数据的执行时间 *
        * 
+ */ + public boolean hasExecuteTime() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int64 executeTime = 6; * - * int64 executeTime = 6; + *
+       **变更数据的执行时间 *
+       * 
*/ public long getExecuteTime() { return executeTime_; } /** + * optional int64 executeTime = 6; + * *
        **变更数据的执行时间 *
        * 
- * - * int64 executeTime = 6; */ public Builder setExecuteTime(long value) { - + bitField0_ |= 0x00000020; executeTime_ = value; onChanged(); return this; } /** + * optional int64 executeTime = 6; + * *
        **变更数据的执行时间 *
        * 
- * - * int64 executeTime = 6; */ public Builder clearExecuteTime() { - + bitField0_ = (bitField0_ & ~0x00000020); executeTime_ = 0L; onChanged(); return this; } + private Type sourceType_ = Type.MYSQL; /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
+       ** 变更数据的来源*
+       * 
*/ - public int getSourceTypeValue() { - if (sourceTypePresentCase_ == 7) { - return ((java.lang.Integer) sourceTypePresent_).intValue(); - } - return Type.MYSQL_VALUE; + public boolean hasSourceType() { + return ((bitField0_ & 0x00000040) == 0x00000040); } /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
+       ** 变更数据的来源*
+       * 
*/ - public Builder setSourceTypeValue(int value) { - sourceTypePresentCase_ = 7; - sourceTypePresent_ = value; - onChanged(); - return this; + public Type getSourceType() { + return sourceType_; } /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
+       ** 变更数据的来源*
+       * 
*/ - public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { - 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; - } - /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; - */ - public Builder setSourceType(com.alibaba.otter.canal.protocol.CanalEntry.Type value) { + public Builder setSourceType(Type value) { if (value == null) { throw new NullPointerException(); } - sourceTypePresentCase_ = 7; - sourceTypePresent_ = value.getNumber(); + bitField0_ |= 0x00000040; + sourceType_ = value; onChanged(); return this; } /** - * .com.alibaba.otter.canal.protocol.Type sourceType = 7; + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
+       ** 变更数据的来源*
+       * 
*/ public Builder clearSourceType() { - if (sourceTypePresentCase_ == 7) { - sourceTypePresentCase_ = 0; - sourceTypePresent_ = null; - onChanged(); - } + bitField0_ = (bitField0_ & ~0x00000040); + sourceType_ = Type.MYSQL; + onChanged(); return this; } - private java.lang.Object schemaName_ = ""; + private Object schemaName_ = ""; /** + * optional string schemaName = 8; + * *
        ** 变更数据的schemaname*
        * 
- * - * string schemaName = 8; */ - public java.lang.String getSchemaName() { - java.lang.Object ref = schemaName_; - if (!(ref instanceof java.lang.String)) { + public boolean hasSchemaName() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional string schemaName = 8; + * + *
+       ** 变更数据的schemaname*
+       * 
+ */ + public String getSchemaName() { + Object ref = schemaName_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - schemaName_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + schemaName_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string schemaName = 8; + * *
        ** 变更数据的schemaname*
        * 
- * - * string schemaName = 8; */ public com.google.protobuf.ByteString getSchemaNameBytes() { - java.lang.Object ref = schemaName_; + Object ref = schemaName_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); schemaName_ = b; return b; } else { @@ -3428,88 +3207,99 @@ public final class CanalEntry { } } /** + * optional string schemaName = 8; + * *
        ** 变更数据的schemaname*
        * 
- * - * string schemaName = 8; */ public Builder setSchemaName( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000080; schemaName_ = value; onChanged(); return this; } /** + * optional string schemaName = 8; + * *
        ** 变更数据的schemaname*
        * 
- * - * string schemaName = 8; */ public Builder clearSchemaName() { - + bitField0_ = (bitField0_ & ~0x00000080); schemaName_ = getDefaultInstance().getSchemaName(); onChanged(); return this; } /** + * optional string schemaName = 8; + * *
        ** 变更数据的schemaname*
        * 
- * - * string schemaName = 8; */ public Builder setSchemaNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000080; schemaName_ = value; onChanged(); return this; } - private java.lang.Object tableName_ = ""; + private Object tableName_ = ""; /** + * optional string tableName = 9; + * *
        **变更数据的tablename*
        * 
- * - * string tableName = 9; */ - public java.lang.String getTableName() { - java.lang.Object ref = tableName_; - if (!(ref instanceof java.lang.String)) { + public boolean hasTableName() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional string tableName = 9; + * + *
+       **变更数据的tablename*
+       * 
+ */ + public String getTableName() { + Object ref = tableName_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tableName_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + tableName_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string tableName = 9; + * *
        **变更数据的tablename*
        * 
- * - * string tableName = 9; */ public com.google.protobuf.ByteString getTableNameBytes() { - java.lang.Object ref = tableName_; + Object ref = tableName_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); tableName_ = b; return b; } else { @@ -3517,49 +3307,48 @@ public final class CanalEntry { } } /** + * optional string tableName = 9; + * *
        **变更数据的tablename*
        * 
- * - * string tableName = 9; */ public Builder setTableName( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000100; tableName_ = value; onChanged(); return this; } /** + * optional string tableName = 9; + * *
        **变更数据的tablename*
        * 
- * - * string tableName = 9; */ public Builder clearTableName() { - + bitField0_ = (bitField0_ & ~0x00000100); tableName_ = getDefaultInstance().getTableName(); onChanged(); return this; } /** + * optional string tableName = 9; + * *
        **变更数据的tablename*
        * 
- * - * string tableName = 9; */ public Builder setTableNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000100; tableName_ = value; onChanged(); return this; @@ -3567,116 +3356,123 @@ public final class CanalEntry { private long eventLength_ ; /** + * optional int64 eventLength = 10; + * *
        **每个event的长度*
        * 
+ */ + public boolean hasEventLength() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional int64 eventLength = 10; * - * int64 eventLength = 10; + *
+       **每个event的长度*
+       * 
*/ public long getEventLength() { return eventLength_; } /** + * optional int64 eventLength = 10; + * *
        **每个event的长度*
        * 
- * - * int64 eventLength = 10; */ public Builder setEventLength(long value) { - + bitField0_ |= 0x00000200; eventLength_ = value; onChanged(); return this; } /** + * optional int64 eventLength = 10; + * *
        **每个event的长度*
        * 
- * - * int64 eventLength = 10; */ public Builder clearEventLength() { - + bitField0_ = (bitField0_ & ~0x00000200); eventLength_ = 0L; onChanged(); return this; } + private EventType eventType_ = EventType.UPDATE; /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
+       **数据变更类型*
+       * 
*/ - public int getEventTypeValue() { - if (eventTypePresentCase_ == 11) { - return ((java.lang.Integer) eventTypePresent_).intValue(); - } - return EventType.UPDATE_VALUE; + public boolean hasEventType() { + return ((bitField0_ & 0x00000400) == 0x00000400); } /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
+       **数据变更类型*
+       * 
*/ - public Builder setEventTypeValue(int value) { - eventTypePresentCase_ = 11; - eventTypePresent_ = value; - onChanged(); - return this; + public EventType getEventType() { + return eventType_; } /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
+       **数据变更类型*
+       * 
*/ - public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - 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; - } - /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; - */ - public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { + public Builder setEventType(EventType value) { if (value == null) { throw new NullPointerException(); } - eventTypePresentCase_ = 11; - eventTypePresent_ = value.getNumber(); + bitField0_ |= 0x00000400; + eventType_ = value; onChanged(); return this; } /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 11; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
+       **数据变更类型*
+       * 
*/ public Builder clearEventType() { - if (eventTypePresentCase_ == 11) { - eventTypePresentCase_ = 0; - eventTypePresent_ = null; - onChanged(); - } + bitField0_ = (bitField0_ & ~0x00000400); + eventType_ = EventType.UPDATE; + 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, 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 { @@ -3684,11 +3480,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) { @@ -3698,13 +3494,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -3712,14 +3508,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3733,14 +3529,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -3751,13 +3547,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(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + public Builder addProps(Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3771,14 +3567,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3792,14 +3588,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( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -3810,14 +3606,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -3828,14 +3624,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( - java.lang.Iterable values) { + Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -3847,11 +3643,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) { @@ -3864,11 +3660,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) { @@ -3881,24 +3677,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 com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -3906,13 +3702,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(); @@ -3921,45 +3717,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + public Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + Pair.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( + public Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - 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>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder>( props_, ((bitField0_ & 0x00000800) == 0x00000800), getParentForChildren(), @@ -3969,40 +3765,52 @@ public final class CanalEntry { return propsBuilder_; } - private java.lang.Object gtid_ = ""; + private Object gtid_ = ""; /** + * optional string gtid = 13; + * *
        **当前事务的gitd*
        * 
- * - * string gtid = 13; */ - public java.lang.String getGtid() { - java.lang.Object ref = gtid_; - if (!(ref instanceof java.lang.String)) { + public boolean hasGtid() { + return ((bitField0_ & 0x00001000) == 0x00001000); + } + /** + * optional string gtid = 13; + * + *
+       **当前事务的gitd*
+       * 
+ */ + public String getGtid() { + Object ref = gtid_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gtid_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + gtid_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string gtid = 13; + * *
        **当前事务的gitd*
        * 
- * - * string gtid = 13; */ public com.google.protobuf.ByteString getGtidBytes() { - java.lang.Object ref = gtid_; + Object ref = gtid_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); gtid_ = b; return b; } else { @@ -4010,104 +3818,62 @@ public final class CanalEntry { } } /** + * optional string gtid = 13; + * *
        **当前事务的gitd*
        * 
- * - * string gtid = 13; */ public Builder setGtid( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00001000; gtid_ = value; onChanged(); return this; } /** + * optional string gtid = 13; + * *
        **当前事务的gitd*
        * 
- * - * string gtid = 13; */ public Builder clearGtid() { - + bitField0_ = (bitField0_ & ~0x00001000); gtid_ = getDefaultInstance().getGtid(); onChanged(); return this; } /** + * optional string gtid = 13; + * *
        **当前事务的gitd*
        * 
- * - * string gtid = 13; */ public Builder setGtidBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00001000; gtid_ = value; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(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 { - DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.Header(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.Header getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private 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; + defaultInstance = new Header(true); + defaultInstance.initFields(); } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Header) } public interface ColumnOrBuilder extends @@ -4115,196 +3881,266 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** + * optional int32 index = 1; + * *
      **字段下标*
      * 
+ */ + boolean hasIndex(); + /** + * optional int32 index = 1; * - * int32 index = 1; + *
+     **字段下标*
+     * 
*/ int getIndex(); /** + * optional int32 sqlType = 2; + * *
      **字段java中类型*
      * 
+ */ + boolean hasSqlType(); + /** + * optional int32 sqlType = 2; * - * int32 sqlType = 2; + *
+     **字段java中类型*
+     * 
*/ int getSqlType(); /** + * optional string name = 3; + * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
- * - * string name = 3; */ - java.lang.String getName(); + boolean hasName(); /** + * optional string name = 3; + * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
+ */ + String getName(); + /** + * optional string name = 3; * - * string name = 3; + *
+     **字段名称(忽略大小写),在mysql中是没有的*
+     * 
*/ com.google.protobuf.ByteString getNameBytes(); /** + * optional bool isKey = 4; + * *
      **是否是主键*
      * 
+ */ + boolean hasIsKey(); + /** + * optional bool isKey = 4; * - * bool isKey = 4; + *
+     **是否是主键*
+     * 
*/ boolean getIsKey(); /** + * optional bool updated = 5; + * *
      **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      * 
+ */ + boolean hasUpdated(); + /** + * optional bool updated = 5; * - * bool updated = 5; + *
+     **如果EventType=UPDATE,用于标识这个字段值是否有修改*
+     * 
*/ boolean getUpdated(); /** - * bool isNull = 6; + * optional bool isNull = 6 [default = false]; + * + *
+     ** 标识是否为空  *
+     * 
+ */ + boolean hasIsNull(); + /** + * 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); + PairOrBuilder getPropsOrBuilder(int index); /** + * optional string value = 8; + * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
- * - * string value = 8; */ - java.lang.String getValue(); + boolean hasValue(); /** + * optional string value = 8; + * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
+ */ + String getValue(); + /** + * optional string value = 8; * - * string value = 8; + *
+     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
+     * 
*/ com.google.protobuf.ByteString getValueBytes(); /** + * optional int32 length = 9; + * *
      ** 对应数据对象原始长度 *
      * 
+ */ + boolean hasLength(); + /** + * optional int32 length = 9; * - * int32 length = 9; + *
+     ** 对应数据对象原始长度 *
+     * 
*/ int getLength(); /** + * optional string mysqlType = 10; + * *
      **字段mysql类型*
      * 
- * - * string mysqlType = 10; */ - java.lang.String getMysqlType(); + boolean hasMysqlType(); /** + * optional string mysqlType = 10; + * *
      **字段mysql类型*
      * 
+ */ + String getMysqlType(); + /** + * optional string mysqlType = 10; * - * string mysqlType = 10; + *
+     **字段mysql类型*
+     * 
*/ com.google.protobuf.ByteString getMysqlTypeBytes(); - - public com.alibaba.otter.canal.protocol.CanalEntry.Column.IsNullPresentCase getIsNullPresentCase(); } /** + * 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.GeneratedMessageV3 implements + public static final class Column extends + com.google.protobuf.GeneratedMessage 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.GeneratedMessageV3.Builder builder) { + private Column(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Column() { - index_ = 0; - sqlType_ = 0; - name_ = ""; - isKey_ = false; - updated_ = false; - props_ = java.util.Collections.emptyList(); - value_ = ""; - length_ = 0; - mysqlType_ = ""; + private Column(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Column defaultInstance; + public static Column getDefaultInstance() { + return defaultInstance; } - @java.lang.Override + public Column getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } + initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -4316,68 +4152,67 @@ 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(); break; } case 16: { - + bitField0_ |= 0x00000002; sqlType_ = input.readInt32(); break; } case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + name_ = bs; break; } case 32: { - + bitField0_ |= 0x00000008; isKey_ = input.readBool(); break; } case 40: { - + bitField0_ |= 0x00000010; updated_ = input.readBool(); break; } case 48: { - isNullPresentCase_ = 6; - isNullPresent_ = input.readBool(); + bitField0_ |= 0x00000020; + isNull_ = input.readBool(); break; } case 58: { if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - props_ = new java.util.ArrayList(); + props_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000040; } - props_.add( - input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); + props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; } case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000040; + value_ = bs; break; } case 72: { - + bitField0_ |= 0x00000080; length_ = input.readInt32(); break; } case 82: { - java.lang.String s = input.readStringRequireUtf8(); - - mysqlType_ = s; - break; - } - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000100; + mysqlType_ = bs; break; } } @@ -4386,7 +4221,7 @@ public final class CanalEntry { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); + e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -4397,62 +4232,50 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.Column.class, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder.class); + Column.class, Builder.class); } - 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 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); } }; - public IsNullPresentCase - getIsNullPresentCase() { - return IsNullPresentCase.forNumber( - isNullPresentCase_); + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; } + private int bitField0_; public static final int INDEX_FIELD_NUMBER = 1; private int index_; /** + * optional int32 index = 1; + * *
      **字段下标*
      * 
+ */ + public boolean hasIndex() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 index = 1; * - * int32 index = 1; + *
+     **字段下标*
+     * 
*/ public int getIndex() { return index_; @@ -4461,51 +4284,73 @@ public final class CanalEntry { public static final int SQLTYPE_FIELD_NUMBER = 2; private int sqlType_; /** + * optional int32 sqlType = 2; + * *
      **字段java中类型*
      * 
+ */ + public boolean hasSqlType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 sqlType = 2; * - * int32 sqlType = 2; + *
+     **字段java中类型*
+     * 
*/ public int getSqlType() { return sqlType_; } public static final int NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object name_; + private Object name_; /** + * optional string name = 3; + * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
- * - * string name = 3; */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string name = 3; + * + *
+     **字段名称(忽略大小写),在mysql中是没有的*
+     * 
+ */ + public String getName() { + Object ref = name_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } return s; } } /** + * optional string name = 3; + * *
      **字段名称(忽略大小写),在mysql中是没有的*
      * 
- * - * string name = 3; */ public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); name_ = b; return b; } else { @@ -4516,11 +4361,21 @@ public final class CanalEntry { public static final int ISKEY_FIELD_NUMBER = 4; private boolean isKey_; /** + * optional bool isKey = 4; + * *
      **是否是主键*
      * 
+ */ + public boolean hasIsKey() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional bool isKey = 4; * - * bool isKey = 4; + *
+     **是否是主键*
+     * 
*/ public boolean getIsKey() { return isKey_; @@ -4529,117 +4384,151 @@ public final class CanalEntry { public static final int UPDATED_FIELD_NUMBER = 5; private boolean updated_; /** + * optional bool updated = 5; + * *
      **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      * 
+ */ + public boolean hasUpdated() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bool updated = 5; * - * bool updated = 5; + *
+     **如果EventType=UPDATE,用于标识这个字段值是否有修改*
+     * 
*/ public boolean getUpdated() { return updated_; } public static final int ISNULL_FIELD_NUMBER = 6; + private boolean isNull_; /** - * bool isNull = 6; + * optional bool isNull = 6 [default = false]; + * + *
+     ** 标识是否为空  *
+     * 
+ */ + public boolean hasIsNull() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional bool isNull = 6 [default = false]; + * + *
+     ** 标识是否为空  *
+     * 
*/ public boolean getIsNull() { - if (isNullPresentCase_ == 6) { - return (java.lang.Boolean) isNullPresent_; - } - return false; + 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 com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } public static final int VALUE_FIELD_NUMBER = 8; - private volatile java.lang.Object value_; + private Object value_; /** + * optional string value = 8; + * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
- * - * string value = 8; */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasValue() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional string value = 8; + * + *
+     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
+     * 
+ */ + public String getValue() { + Object ref = value_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } return s; } } /** + * optional string value = 8; + * *
      ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      * 
- * - * string value = 8; */ public com.google.protobuf.ByteString getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); value_ = b; return b; } else { @@ -4650,51 +4539,73 @@ public final class CanalEntry { public static final int LENGTH_FIELD_NUMBER = 9; private int length_; /** + * optional int32 length = 9; + * *
      ** 对应数据对象原始长度 *
      * 
+ */ + public boolean hasLength() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int32 length = 9; * - * int32 length = 9; + *
+     ** 对应数据对象原始长度 *
+     * 
*/ public int getLength() { return length_; } public static final int MYSQLTYPE_FIELD_NUMBER = 10; - private volatile java.lang.Object mysqlType_; + private Object mysqlType_; /** + * optional string mysqlType = 10; + * *
      **字段mysql类型*
      * 
- * - * string mysqlType = 10; */ - public java.lang.String getMysqlType() { - java.lang.Object ref = mysqlType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasMysqlType() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional string mysqlType = 10; + * + *
+     **字段mysql类型*
+     * 
+ */ + public String getMysqlType() { + Object ref = mysqlType_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mysqlType_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + mysqlType_ = s; + } return s; } } /** + * optional string mysqlType = 10; + * *
      **字段mysql类型*
      * 
- * - * string mysqlType = 10; */ public com.google.protobuf.ByteString getMysqlTypeBytes() { - java.lang.Object ref = mysqlType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = mysqlType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); mysqlType_ = b; return b; } else { @@ -4702,8 +4613,19 @@ 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; @@ -4713,291 +4635,187 @@ public final class CanalEntry { return true; } - @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (index_ != 0) { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, index_); } - if (sqlType_ != 0) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt32(2, sqlType_); } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getNameBytes()); } - if (isKey_ != false) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeBool(4, isKey_); } - if (updated_ != false) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeBool(5, updated_); } - if (isNullPresentCase_ == 6) { - output.writeBool( - 6, (boolean)((java.lang.Boolean) isNullPresent_)); + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBool(6, isNull_); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(7, props_.get(i)); } - if (!getValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, value_); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBytes(8, getValueBytes()); } - if (length_ != 0) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeInt32(9, length_); } - if (!getMysqlTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, mysqlType_); + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeBytes(10, getMysqlTypeBytes()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } - @java.lang.Override + private int memoizedSerializedSize = -1; public int getSerializedSize() { - int size = memoizedSize; + int size = memoizedSerializedSize; if (size != -1) return size; size = 0; - if (index_ != 0) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, index_); } - if (sqlType_ != 0) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, sqlType_); } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, getNameBytes()); } - if (isKey_ != false) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(4, isKey_); } - if (updated_ != false) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(5, updated_); } - if (isNullPresentCase_ == 6) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 6, (boolean)((java.lang.Boolean) isNullPresent_)); + .computeBoolSize(6, isNull_); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, props_.get(i)); } - if (!getValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, value_); + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(8, getValueBytes()); } - if (length_ != 0) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(9, length_); } - if (!getMysqlTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, mysqlType_); + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(10, getMysqlTypeBytes()); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = 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.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 && (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 && 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; + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - 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(); - } - 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; - 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( + public static Column parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( + public static Column 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.CanalEntry.Column parseFrom(byte[] data) + public static Column parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( + public static Column 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.CanalEntry.Column parseFrom(java.io.InputStream input) + public static Column parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( + public static Column parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseDelimitedFrom(java.io.InputStream input) + public static Column parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); + return PARSER.parseDelimitedFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseDelimitedFrom( + public static Column parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( + public static Column parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( + public static Column parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - @java.lang.Override + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - 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 static Builder newBuilder(Column prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Column) - com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder { + ColumnOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.Column.class, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder.class); + Column.class, Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Column.newBuilder() @@ -5006,29 +4824,33 @@ public final class CanalEntry { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getPropsFieldBuilder(); } } - @java.lang.Override + private static Builder create() { + return new Builder(); + } + 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); @@ -5036,49 +4858,63 @@ public final class CanalEntry { propsBuilder_.clear(); } value_ = ""; - + bitField0_ = (bitField0_ & ~0x00000080); length_ = 0; - + bitField0_ = (bitField0_ & ~0x00000100); mysqlType_ = ""; - - isNullPresentCase_ = 0; - isNullPresent_ = null; + bitField0_ = (bitField0_ & ~0x00000200); return this; } - @java.lang.Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.Column getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance(); + public Column getDefaultInstanceForType() { + return Column.getDefaultInstance(); } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.Column build() { - com.alibaba.otter.canal.protocol.CanalEntry.Column result = buildPartial(); + public Column build() { + Column result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @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); + public Column buildPartial() { + Column result = new Column(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - result.index_ = index_; - result.sqlType_ = sqlType_; - result.name_ = name_; - result.isKey_ = isKey_; - result.updated_ = updated_; - if (isNullPresentCase_ == 6) { - result.isNullPresent_ = isNullPresent_; + 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; + } + result.isNull_ = isNull_; if (propsBuilder_ == null) { if (((bitField0_ & 0x00000040) == 0x00000040)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -5088,75 +4924,54 @@ 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; } - @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.CanalEntry.Column) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.Column)other); + if (other instanceof Column) { + return mergeFrom((Column)other); } else { super.mergeFrom(other); 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.getIndex() != 0) { + public Builder mergeFrom(Column other) { + if (other == Column.getDefaultInstance()) return this; + if (other.hasIndex()) { setIndex(other.getIndex()); } - if (other.getSqlType() != 0) { + if (other.hasSqlType()) { setSqlType(other.getSqlType()); } - if (!other.getName().isEmpty()) { + if (other.hasName()) { + bitField0_ |= 0x00000004; name_ = other.name_; onChanged(); } - if (other.getIsKey() != false) { + if (other.hasIsKey()) { setIsKey(other.getIsKey()); } - if (other.getUpdated() != false) { + if (other.hasUpdated()) { setUpdated(other.getUpdated()); } + if (other.hasIsNull()) { + setIsNull(other.getIsNull()); + } if (propsBuilder_ == null) { if (!other.props_.isEmpty()) { if (props_.isEmpty()) { @@ -5175,55 +4990,45 @@ public final class CanalEntry { propsBuilder_ = null; props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000040); - propsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + propsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); } } } - if (!other.getValue().isEmpty()) { + if (other.hasValue()) { + bitField0_ |= 0x00000080; value_ = other.value_; onChanged(); } - if (other.getLength() != 0) { + if (other.hasLength()) { setLength(other.getLength()); } - if (!other.getMysqlType().isEmpty()) { + if (other.hasMysqlType()) { + bitField0_ |= 0x00000200; mysqlType_ = other.mysqlType_; onChanged(); } - switch (other.getIsNullPresentCase()) { - case ISNULL: { - setIsNull(other.getIsNull()); - break; - } - case ISNULLPRESENT_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + this.mergeUnknownFields(other.getUnknownFields()); 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.CanalEntry.Column parsedMessage = null; + Column parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.Column) e.getUnfinishedMessage(); - throw e.unwrapIOException(); + parsedMessage = (Column) e.getUnfinishedMessage(); + throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -5231,56 +5036,51 @@ 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_ ; /** + * optional int32 index = 1; + * *
        **字段下标*
        * 
+ */ + public boolean hasIndex() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 index = 1; * - * int32 index = 1; + *
+       **字段下标*
+       * 
*/ public int getIndex() { return index_; } /** + * optional int32 index = 1; + * *
        **字段下标*
        * 
- * - * int32 index = 1; */ public Builder setIndex(int value) { - + bitField0_ |= 0x00000001; index_ = value; onChanged(); return this; } /** + * optional int32 index = 1; + * *
        **字段下标*
        * 
- * - * int32 index = 1; */ public Builder clearIndex() { - + bitField0_ = (bitField0_ & ~0x00000001); index_ = 0; onChanged(); return this; @@ -5288,76 +5088,98 @@ public final class CanalEntry { private int sqlType_ ; /** + * optional int32 sqlType = 2; + * *
        **字段java中类型*
        * 
+ */ + public boolean hasSqlType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 sqlType = 2; * - * int32 sqlType = 2; + *
+       **字段java中类型*
+       * 
*/ public int getSqlType() { return sqlType_; } /** + * optional int32 sqlType = 2; + * *
        **字段java中类型*
        * 
- * - * int32 sqlType = 2; */ public Builder setSqlType(int value) { - + bitField0_ |= 0x00000002; sqlType_ = value; onChanged(); return this; } /** + * optional int32 sqlType = 2; + * *
        **字段java中类型*
        * 
- * - * int32 sqlType = 2; */ public Builder clearSqlType() { - + bitField0_ = (bitField0_ & ~0x00000002); sqlType_ = 0; onChanged(); return this; } - private java.lang.Object name_ = ""; + private Object name_ = ""; /** + * optional string name = 3; + * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
- * - * string name = 3; */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string name = 3; + * + *
+       **字段名称(忽略大小写),在mysql中是没有的*
+       * 
+ */ + public String getName() { + Object ref = name_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string name = 3; + * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
- * - * string name = 3; */ public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; + Object ref = name_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); name_ = b; return b; } else { @@ -5365,49 +5187,48 @@ public final class CanalEntry { } } /** + * optional string name = 3; + * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
- * - * string name = 3; */ public Builder setName( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000004; name_ = value; onChanged(); return this; } /** + * optional string name = 3; + * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
- * - * string name = 3; */ public Builder clearName() { - + bitField0_ = (bitField0_ & ~0x00000004); name_ = getDefaultInstance().getName(); onChanged(); return this; } /** + * optional string name = 3; + * *
        **字段名称(忽略大小写),在mysql中是没有的*
        * 
- * - * string name = 3; */ public Builder setNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000004; name_ = value; onChanged(); return this; @@ -5415,37 +5236,47 @@ public final class CanalEntry { private boolean isKey_ ; /** + * optional bool isKey = 4; + * *
        **是否是主键*
        * 
+ */ + public boolean hasIsKey() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional bool isKey = 4; * - * bool isKey = 4; + *
+       **是否是主键*
+       * 
*/ public boolean getIsKey() { return isKey_; } /** + * optional bool isKey = 4; + * *
        **是否是主键*
        * 
- * - * bool isKey = 4; */ public Builder setIsKey(boolean value) { - + bitField0_ |= 0x00000008; isKey_ = value; onChanged(); return this; } /** + * optional bool isKey = 4; + * *
        **是否是主键*
        * 
- * - * bool isKey = 4; */ public Builder clearIsKey() { - + bitField0_ = (bitField0_ & ~0x00000008); isKey_ = false; onChanged(); return this; @@ -5453,92 +5284,120 @@ public final class CanalEntry { private boolean updated_ ; /** + * optional bool updated = 5; + * *
        **如果EventType=UPDATE,用于标识这个字段值是否有修改*
        * 
+ */ + public boolean hasUpdated() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bool updated = 5; * - * bool updated = 5; + *
+       **如果EventType=UPDATE,用于标识这个字段值是否有修改*
+       * 
*/ public boolean getUpdated() { return updated_; } /** + * optional bool updated = 5; + * *
        **如果EventType=UPDATE,用于标识这个字段值是否有修改*
        * 
- * - * bool updated = 5; */ public Builder setUpdated(boolean value) { - + bitField0_ |= 0x00000010; updated_ = value; onChanged(); return this; } /** + * optional bool updated = 5; + * *
        **如果EventType=UPDATE,用于标识这个字段值是否有修改*
        * 
- * - * bool updated = 5; */ public Builder clearUpdated() { - + bitField0_ = (bitField0_ & ~0x00000010); updated_ = false; onChanged(); return this; } + private boolean isNull_ ; /** - * bool isNull = 6; + * optional bool isNull = 6 [default = false]; + * + *
+       ** 标识是否为空  *
+       * 
*/ - public boolean getIsNull() { - if (isNullPresentCase_ == 6) { - return (java.lang.Boolean) isNullPresent_; - } - return false; + public boolean hasIsNull() { + return ((bitField0_ & 0x00000020) == 0x00000020); } /** - * bool isNull = 6; + * optional bool isNull = 6 [default = false]; + * + *
+       ** 标识是否为空  *
+       * 
+ */ + public boolean getIsNull() { + return isNull_; + } + /** + * optional bool isNull = 6 [default = false]; + * + *
+       ** 标识是否为空  *
+       * 
*/ public Builder setIsNull(boolean value) { - isNullPresentCase_ = 6; - isNullPresent_ = value; + bitField0_ |= 0x00000020; + isNull_ = value; onChanged(); return this; } /** - * bool isNull = 6; + * optional bool isNull = 6 [default = false]; + * + *
+       ** 标识是否为空  *
+       * 
*/ public Builder clearIsNull() { - if (isNullPresentCase_ == 6) { - isNullPresentCase_ = 0; - isNullPresent_ = null; - onChanged(); - } + bitField0_ = (bitField0_ & ~0x00000020); + isNull_ = false; + onChanged(); 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, 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 { @@ -5546,11 +5405,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) { @@ -5560,13 +5419,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -5574,14 +5433,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5595,14 +5454,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -5613,13 +5472,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(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + public Builder addProps(Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5633,14 +5492,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -5654,14 +5513,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( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -5672,14 +5531,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -5690,14 +5549,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( - java.lang.Iterable values) { + Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -5709,11 +5568,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) { @@ -5726,11 +5585,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) { @@ -5743,24 +5602,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 com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -5768,13 +5627,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(); @@ -5783,45 +5642,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + public Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + Pair.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( + public Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - 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>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder>( props_, ((bitField0_ & 0x00000040) == 0x00000040), getParentForChildren(), @@ -5831,40 +5690,52 @@ public final class CanalEntry { return propsBuilder_; } - private java.lang.Object value_ = ""; + private Object value_ = ""; /** + * optional string value = 8; + * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
- * - * string value = 8; */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { + public boolean hasValue() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional string value = 8; + * + *
+       ** 字段值,timestamp,Datetime是一个时间格式的文本 *
+       * 
+ */ + public String getValue() { + Object ref = value_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string value = 8; + * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
- * - * string value = 8; */ public com.google.protobuf.ByteString getValueBytes() { - java.lang.Object ref = value_; + Object ref = value_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); value_ = b; return b; } else { @@ -5872,49 +5743,48 @@ public final class CanalEntry { } } /** + * optional string value = 8; + * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
- * - * string value = 8; */ public Builder setValue( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000080; value_ = value; onChanged(); return this; } /** + * optional string value = 8; + * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
- * - * string value = 8; */ public Builder clearValue() { - + bitField0_ = (bitField0_ & ~0x00000080); value_ = getDefaultInstance().getValue(); onChanged(); return this; } /** + * optional string value = 8; + * *
        ** 字段值,timestamp,Datetime是一个时间格式的文本 *
        * 
- * - * string value = 8; */ public Builder setValueBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000080; value_ = value; onChanged(); return this; @@ -5922,76 +5792,98 @@ public final class CanalEntry { private int length_ ; /** + * optional int32 length = 9; + * *
        ** 对应数据对象原始长度 *
        * 
+ */ + public boolean hasLength() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional int32 length = 9; * - * int32 length = 9; + *
+       ** 对应数据对象原始长度 *
+       * 
*/ public int getLength() { return length_; } /** + * optional int32 length = 9; + * *
        ** 对应数据对象原始长度 *
        * 
- * - * int32 length = 9; */ public Builder setLength(int value) { - + bitField0_ |= 0x00000100; length_ = value; onChanged(); return this; } /** + * optional int32 length = 9; + * *
        ** 对应数据对象原始长度 *
        * 
- * - * int32 length = 9; */ public Builder clearLength() { - + bitField0_ = (bitField0_ & ~0x00000100); length_ = 0; onChanged(); return this; } - private java.lang.Object mysqlType_ = ""; + private Object mysqlType_ = ""; /** + * optional string mysqlType = 10; + * *
        **字段mysql类型*
        * 
- * - * string mysqlType = 10; */ - public java.lang.String getMysqlType() { - java.lang.Object ref = mysqlType_; - if (!(ref instanceof java.lang.String)) { + public boolean hasMysqlType() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional string mysqlType = 10; + * + *
+       **字段mysql类型*
+       * 
+ */ + public String getMysqlType() { + Object ref = mysqlType_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mysqlType_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + mysqlType_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string mysqlType = 10; + * *
        **字段mysql类型*
        * 
- * - * string mysqlType = 10; */ public com.google.protobuf.ByteString getMysqlTypeBytes() { - java.lang.Object ref = mysqlType_; + Object ref = mysqlType_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); mysqlType_ = b; return b; } else { @@ -5999,104 +5891,62 @@ public final class CanalEntry { } } /** + * optional string mysqlType = 10; + * *
        **字段mysql类型*
        * 
- * - * string mysqlType = 10; */ public Builder setMysqlType( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000200; mysqlType_ = value; onChanged(); return this; } /** + * optional string mysqlType = 10; + * *
        **字段mysql类型*
        * 
- * - * string mysqlType = 10; */ public Builder clearMysqlType() { - + bitField0_ = (bitField0_ & ~0x00000200); mysqlType_ = getDefaultInstance().getMysqlType(); onChanged(); return this; } /** + * optional string mysqlType = 10; + * *
        **字段mysql类型*
        * 
- * - * string mysqlType = 10; */ public Builder setMysqlTypeBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000200; mysqlType_ = value; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(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 { - DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.Column(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.Column getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private 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; + defaultInstance = new Column(true); + defaultInstance.initFields(); } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Column) } public interface RowDataOrBuilder extends @@ -6104,168 +5954,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; */ - com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( - int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( - int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); + PairOrBuilder getPropsOrBuilder(int index); } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.RowData} */ - public static final class RowData extends - com.google.protobuf.GeneratedMessageV3 implements + public static final class RowData extends + com.google.protobuf.GeneratedMessage 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.GeneratedMessageV3.Builder builder) { + private RowData(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private RowData() { - beforeColumns_ = java.util.Collections.emptyList(); - afterColumns_ = java.util.Collections.emptyList(); - props_ = java.util.Collections.emptyList(); + private RowData(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final RowData defaultInstance; + public static RowData getDefaultInstance() { + return defaultInstance; } - @java.lang.Override + public RowData getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } + initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -6277,38 +6127,35 @@ 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(com.alibaba.otter.canal.protocol.CanalEntry.Column.parser(), extensionRegistry)); + beforeColumns_.add(input.readMessage(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(com.alibaba.otter.canal.protocol.CanalEntry.Column.parser(), extensionRegistry)); + afterColumns_.add(input.readMessage(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(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } + props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; } } @@ -6317,7 +6164,7 @@ public final class CanalEntry { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); + e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { beforeColumns_ = java.util.Collections.unmodifiableList(beforeColumns_); @@ -6334,184 +6181,202 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.RowData.class, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder.class); + 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; } 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 com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public 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; @@ -6521,9 +6386,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)); } @@ -6533,12 +6398,12 @@ public final class CanalEntry { for (int i = 0; i < props_.size(); i++) { output.writeMessage(3, props_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } - @java.lang.Override + private int memoizedSerializedSize = -1; public int getSerializedSize() { - int size = memoizedSize; + int size = memoizedSerializedSize; if (size != -1) return size; size = 0; @@ -6554,143 +6419,81 @@ public final class CanalEntry { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, props_.get(i)); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = 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.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; + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); } - @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( + public static RowData parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( + public static RowData 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.CanalEntry.RowData parseFrom(byte[] data) + public static RowData parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( + public static RowData 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.CanalEntry.RowData parseFrom(java.io.InputStream input) + public static RowData parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( + public static RowData parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseDelimitedFrom(java.io.InputStream input) + public static RowData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); + return PARSER.parseDelimitedFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseDelimitedFrom( + public static RowData parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( + public static RowData parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( + public static RowData parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - @java.lang.Override + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - 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 static Builder newBuilder(RowData prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -6698,20 +6501,19 @@ public final class CanalEntry { * Protobuf type {@code com.alibaba.otter.canal.protocol.RowData} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.RowData) - com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder { + RowDataOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.RowData.class, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder.class); + RowData.class, Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.RowData.newBuilder() @@ -6720,19 +6522,21 @@ public final class CanalEntry { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getBeforeColumnsFieldBuilder(); getAfterColumnsFieldBuilder(); getPropsFieldBuilder(); } } - @java.lang.Override + private static Builder create() { + return new Builder(); + } + public Builder clear() { super.clear(); if (beforeColumnsBuilder_ == null) { @@ -6756,29 +6560,29 @@ public final class CanalEntry { return this; } - @java.lang.Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.RowData getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance(); + public RowData getDefaultInstanceForType() { + return RowData.getDefaultInstance(); } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.RowData build() { - com.alibaba.otter.canal.protocol.CanalEntry.RowData result = buildPartial(); + public RowData build() { + RowData result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @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); + public RowData buildPartial() { + RowData result = new RowData(this); int from_bitField0_ = bitField0_; if (beforeColumnsBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -6811,50 +6615,17 @@ 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 com.alibaba.otter.canal.protocol.CanalEntry.RowData) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.RowData)other); + if (other instanceof RowData) { + return mergeFrom((RowData)other); } else { super.mergeFrom(other); 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; + public Builder mergeFrom(RowData other) { + if (other == RowData.getDefaultInstance()) return this; if (beforeColumnsBuilder_ == null) { if (!other.beforeColumns_.isEmpty()) { if (beforeColumns_.isEmpty()) { @@ -6873,8 +6644,8 @@ public final class CanalEntry { beforeColumnsBuilder_ = null; beforeColumns_ = other.beforeColumns_; bitField0_ = (bitField0_ & ~0x00000001); - beforeColumnsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + beforeColumnsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getBeforeColumnsFieldBuilder() : null; } else { beforeColumnsBuilder_.addAllMessages(other.beforeColumns_); @@ -6899,8 +6670,8 @@ public final class CanalEntry { afterColumnsBuilder_ = null; afterColumns_ = other.afterColumns_; bitField0_ = (bitField0_ & ~0x00000002); - afterColumnsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + afterColumnsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getAfterColumnsFieldBuilder() : null; } else { afterColumnsBuilder_.addAllMessages(other.afterColumns_); @@ -6925,35 +6696,32 @@ public final class CanalEntry { propsBuilder_ = null; props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000004); - propsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + propsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); } } } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + this.mergeUnknownFields(other.getUnknownFields()); 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.CanalEntry.RowData parsedMessage = null; + RowData parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.RowData) e.getUnfinishedMessage(); - throw e.unwrapIOException(); + parsedMessage = (RowData) e.getUnfinishedMessage(); + throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -6963,26 +6731,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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> beforeColumnsBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + Column, Column.Builder, 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 { @@ -6990,11 +6758,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) { @@ -7004,13 +6772,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index) { + public Column getBeforeColumns(int index) { if (beforeColumnsBuilder_ == null) { return beforeColumns_.get(index); } else { @@ -7018,14 +6786,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, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + int index, Column value) { if (beforeColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7039,14 +6807,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, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + int index, Column.Builder builderForValue) { if (beforeColumnsBuilder_ == null) { ensureBeforeColumnsIsMutable(); beforeColumns_.set(index, builderForValue.build()); @@ -7057,13 +6825,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(com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + public Builder addBeforeColumns(Column value) { if (beforeColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7077,14 +6845,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, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + int index, Column value) { if (beforeColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7098,14 +6866,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( - com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + Column.Builder builderForValue) { if (beforeColumnsBuilder_ == null) { ensureBeforeColumnsIsMutable(); beforeColumns_.add(builderForValue.build()); @@ -7116,14 +6884,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, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + int index, Column.Builder builderForValue) { if (beforeColumnsBuilder_ == null) { ensureBeforeColumnsIsMutable(); beforeColumns_.add(index, builderForValue.build()); @@ -7134,14 +6902,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( - java.lang.Iterable values) { + Iterable values) { if (beforeColumnsBuilder_ == null) { ensureBeforeColumnsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -7153,11 +6921,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) { @@ -7170,11 +6938,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) { @@ -7187,24 +6955,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 com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder getBeforeColumnsBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( + public ColumnOrBuilder getBeforeColumnsOrBuilder( int index) { if (beforeColumnsBuilder_ == null) { return beforeColumns_.get(index); } else { @@ -7212,13 +6980,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(); @@ -7227,45 +6995,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addBeforeColumnsBuilder() { + public Column.Builder addBeforeColumnsBuilder() { return getBeforeColumnsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); + Column.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * *
        ** 字段信息,增量数据(修改前,删除前) *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addBeforeColumnsBuilder( + public Column.Builder addBeforeColumnsBuilder( int index) { return getBeforeColumnsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + Column, Column.Builder, ColumnOrBuilder> getBeforeColumnsFieldBuilder() { if (beforeColumnsBuilder_ == null) { - 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>( + beforeColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Column, Column.Builder, ColumnOrBuilder>( beforeColumns_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), @@ -7275,26 +7043,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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> afterColumnsBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + Column, Column.Builder, 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 { @@ -7302,11 +7070,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) { @@ -7316,13 +7084,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index) { + public Column getAfterColumns(int index) { if (afterColumnsBuilder_ == null) { return afterColumns_.get(index); } else { @@ -7330,14 +7098,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, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + int index, Column value) { if (afterColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7351,14 +7119,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, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + int index, Column.Builder builderForValue) { if (afterColumnsBuilder_ == null) { ensureAfterColumnsIsMutable(); afterColumns_.set(index, builderForValue.build()); @@ -7369,13 +7137,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(com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + public Builder addAfterColumns(Column value) { if (afterColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7389,14 +7157,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, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + int index, Column value) { if (afterColumnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7410,14 +7178,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( - com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + Column.Builder builderForValue) { if (afterColumnsBuilder_ == null) { ensureAfterColumnsIsMutable(); afterColumns_.add(builderForValue.build()); @@ -7428,14 +7196,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, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + int index, Column.Builder builderForValue) { if (afterColumnsBuilder_ == null) { ensureAfterColumnsIsMutable(); afterColumns_.add(index, builderForValue.build()); @@ -7446,14 +7214,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( - java.lang.Iterable values) { + Iterable values) { if (afterColumnsBuilder_ == null) { ensureAfterColumnsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -7465,11 +7233,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) { @@ -7482,11 +7250,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) { @@ -7499,24 +7267,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 com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder getAfterColumnsBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( + public ColumnOrBuilder getAfterColumnsOrBuilder( int index) { if (afterColumnsBuilder_ == null) { return afterColumns_.get(index); } else { @@ -7524,13 +7292,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(); @@ -7539,45 +7307,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addAfterColumnsBuilder() { + public Column.Builder addAfterColumnsBuilder() { return getAfterColumnsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); + Column.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * *
        ** 字段信息,增量数据(修改后,新增后)  *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addAfterColumnsBuilder( + public Column.Builder addAfterColumnsBuilder( int index) { return getAfterColumnsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + Column, Column.Builder, ColumnOrBuilder> getAfterColumnsFieldBuilder() { if (afterColumnsBuilder_ == null) { - 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>( + afterColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Column, Column.Builder, ColumnOrBuilder>( afterColumns_, ((bitField0_ & 0x00000002) == 0x00000002), getParentForChildren(), @@ -7587,26 +7355,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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, 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 { @@ -7614,11 +7382,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) { @@ -7628,13 +7396,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -7642,14 +7410,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7663,14 +7431,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -7681,13 +7449,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(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + public Builder addProps(Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7701,14 +7469,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -7722,14 +7490,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( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -7740,14 +7508,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -7758,14 +7526,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( - java.lang.Iterable values) { + Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -7777,11 +7545,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) { @@ -7794,11 +7562,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) { @@ -7811,24 +7579,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 com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -7836,13 +7604,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(); @@ -7851,45 +7619,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + public Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + Pair.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( + public Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - 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>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder>( props_, ((bitField0_ & 0x00000004) == 0x00000004), getParentForChildren(), @@ -7898,57 +7666,16 @@ public final class CanalEntry { } return propsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(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 { - DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.RowData(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private 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; + defaultInstance = new RowData(true); + defaultInstance.initFields(); } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowData) } public interface RowChangeOrBuilder extends @@ -7956,193 +7683,232 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** + * optional int64 tableId = 1; + * *
      **tableId,由数据库产生*
      * 
+ */ + boolean hasTableId(); + /** + * optional int64 tableId = 1; * - * int64 tableId = 1; + *
+     **tableId,由数据库产生*
+     * 
*/ long getTableId(); /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
+     **数据变更类型*
+     * 
*/ - int getEventTypeValue(); + boolean hasEventType(); /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
+     **数据变更类型*
+     * 
*/ - com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); + EventType getEventType(); /** - * bool isDdl = 10; + * optional bool isDdl = 10 [default = false]; + * + *
+     ** 标识是否是ddl语句  *
+     * 
+ */ + boolean hasIsDdl(); + /** + * optional bool isDdl = 10 [default = false]; + * + *
+     ** 标识是否是ddl语句  *
+     * 
*/ boolean getIsDdl(); /** + * optional string sql = 11; + * *
      ** ddl/query的sql语句  *
      * 
- * - * string sql = 11; */ - java.lang.String getSql(); + boolean hasSql(); /** + * optional string sql = 11; + * *
      ** ddl/query的sql语句  *
      * 
+ */ + String getSql(); + /** + * optional string sql = 11; * - * string sql = 11; + *
+     ** ddl/query的sql语句  *
+     * 
*/ 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( - int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); + PairOrBuilder getPropsOrBuilder(int index); /** + * optional string ddlSchemaName = 14; + * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
- * - * string ddlSchemaName = 14; */ - java.lang.String getDdlSchemaName(); + boolean hasDdlSchemaName(); /** + * optional string ddlSchemaName = 14; + * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
+ */ + String getDdlSchemaName(); + /** + * optional string ddlSchemaName = 14; * - * string ddlSchemaName = 14; + *
+     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
+     * 
*/ 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(); } /** + * 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.GeneratedMessageV3 implements + public static final class RowChange extends + com.google.protobuf.GeneratedMessage 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.GeneratedMessageV3.Builder builder) { + private RowChange(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private RowChange() { - tableId_ = 0L; - sql_ = ""; - rowDatas_ = java.util.Collections.emptyList(); - props_ = java.util.Collections.emptyList(); - ddlSchemaName_ = ""; + private RowChange(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final RowChange defaultInstance; + public static RowChange getDefaultInstance() { + return defaultInstance; } - @java.lang.Override + public RowChange getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } + initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -8154,57 +7920,60 @@ 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(); break; } case 16: { int rawValue = input.readEnum(); - eventTypePresentCase_ = 2; - eventTypePresent_ = rawValue; + EventType value = EventType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(2, rawValue); + } else { + bitField0_ |= 0x00000002; + eventType_ = value; + } break; } case 80: { - isDdlPresentCase_ = 10; - isDdlPresent_ = input.readBool(); + bitField0_ |= 0x00000004; + isDdl_ = input.readBool(); break; } case 90: { - java.lang.String s = input.readStringRequireUtf8(); - - sql_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + sql_ = bs; break; } case 98: { if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - rowDatas_ = new java.util.ArrayList(); + rowDatas_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000010; } - rowDatas_.add( - input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.RowData.parser(), extensionRegistry)); + rowDatas_.add(input.readMessage(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(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); + props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; } case 114: { - java.lang.String s = input.readStringRequireUtf8(); - - ddlSchemaName_ = s; - break; - } - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + ddlSchemaName_ = bs; break; } } @@ -8213,7 +7982,7 @@ public final class CanalEntry { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); + e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { rowDatas_ = java.util.Collections.unmodifiableList(rowDatas_); @@ -8227,172 +7996,148 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.RowChange.class, com.alibaba.otter.canal.protocol.CanalEntry.RowChange.Builder.class); + 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; } 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_; /** + * optional int64 tableId = 1; + * *
      **tableId,由数据库产生*
      * 
+ */ + public boolean hasTableId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 tableId = 1; * - * int64 tableId = 1; + *
+     **tableId,由数据库产生*
+     * 
*/ public long getTableId() { return tableId_; } public static final int EVENTTYPE_FIELD_NUMBER = 2; + private EventType eventType_; /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
+     **数据变更类型*
+     * 
*/ - public int getEventTypeValue() { - if (eventTypePresentCase_ == 2) { - return (java.lang.Integer) eventTypePresent_; - } - return 0; + public boolean hasEventType() { + return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
+     **数据变更类型*
+     * 
*/ - public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - 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 EventType getEventType() { + return eventType_; } public static final int ISDDL_FIELD_NUMBER = 10; + private boolean isDdl_; /** - * bool isDdl = 10; + * optional bool isDdl = 10 [default = false]; + * + *
+     ** 标识是否是ddl语句  *
+     * 
+ */ + public boolean hasIsDdl() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bool isDdl = 10 [default = false]; + * + *
+     ** 标识是否是ddl语句  *
+     * 
*/ public boolean getIsDdl() { - if (isDdlPresentCase_ == 10) { - return (java.lang.Boolean) isDdlPresent_; - } - return false; + return isDdl_; } public static final int SQL_FIELD_NUMBER = 11; - private volatile java.lang.Object sql_; + private Object sql_; /** + * optional string sql = 11; + * *
      ** ddl/query的sql语句  *
      * 
- * - * string sql = 11; */ - public java.lang.String getSql() { - java.lang.Object ref = sql_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasSql() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string sql = 11; + * + *
+     ** ddl/query的sql语句  *
+     * 
+ */ + public String getSql() { + Object ref = sql_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sql_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + sql_ = s; + } return s; } } /** + * optional string sql = 11; + * *
      ** ddl/query的sql语句  *
      * 
- * - * string sql = 11; */ public com.google.protobuf.ByteString getSqlBytes() { - java.lang.Object ref = sql_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = sql_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); sql_ = b; return b; } else { @@ -8401,150 +8146,162 @@ 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 com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } public static final int DDLSCHEMANAME_FIELD_NUMBER = 14; - private volatile java.lang.Object ddlSchemaName_; + private Object ddlSchemaName_; /** + * optional string ddlSchemaName = 14; + * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
- * - * string ddlSchemaName = 14; */ - public java.lang.String getDdlSchemaName() { - java.lang.Object ref = ddlSchemaName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasDdlSchemaName() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string ddlSchemaName = 14; + * + *
+     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
+     * 
+ */ + public String getDdlSchemaName() { + Object ref = ddlSchemaName_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ddlSchemaName_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + ddlSchemaName_ = s; + } return s; } } /** + * optional string ddlSchemaName = 14; + * *
      ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      * 
- * - * string ddlSchemaName = 14; */ public com.google.protobuf.ByteString getDdlSchemaNameBytes() { - java.lang.Object ref = ddlSchemaName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = ddlSchemaName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); ddlSchemaName_ = b; return b; } else { @@ -8552,8 +8309,16 @@ 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; @@ -8563,21 +8328,20 @@ public final class CanalEntry { return true; } - @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (tableId_ != 0L) { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, tableId_); } - if (eventTypePresentCase_ == 2) { - output.writeEnum(2, ((java.lang.Integer) eventTypePresent_)); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeEnum(2, eventType_.getNumber()); } - if (isDdlPresentCase_ == 10) { - output.writeBool( - 10, (boolean)((java.lang.Boolean) isDdlPresent_)); + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(10, isDdl_); } - if (!getSqlBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, sql_); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(11, getSqlBytes()); } for (int i = 0; i < rowDatas_.size(); i++) { output.writeMessage(12, rowDatas_.get(i)); @@ -8585,33 +8349,33 @@ public final class CanalEntry { for (int i = 0; i < props_.size(); i++) { output.writeMessage(13, props_.get(i)); } - if (!getDdlSchemaNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 14, ddlSchemaName_); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(14, getDdlSchemaNameBytes()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } - @java.lang.Override + private int memoizedSerializedSize = -1; public int getSerializedSize() { - int size = memoizedSize; + int size = memoizedSerializedSize; if (size != -1) return size; size = 0; - if (tableId_ != 0L) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, tableId_); } - if (eventTypePresentCase_ == 2) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, ((java.lang.Integer) eventTypePresent_)); + .computeEnumSize(2, eventType_.getNumber()); } - if (isDdlPresentCase_ == 10) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 10, (boolean)((java.lang.Boolean) isDdlPresent_)); + .computeBoolSize(10, isDdl_); } - if (!getSqlBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, sql_); + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(11, getSqlBytes()); } for (int i = 0; i < rowDatas_.size(); i++) { size += com.google.protobuf.CodedOutputStream @@ -8621,217 +8385,109 @@ public final class CanalEntry { size += com.google.protobuf.CodedOutputStream .computeMessageSize(13, props_.get(i)); } - if (!getDdlSchemaNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, ddlSchemaName_); + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(14, getDdlSchemaNameBytes()); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = 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.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 && (getTableId() - == other.getTableId()); - result = result && getSql() - .equals(other.getSql()); - result = result && getRowDatasList() - .equals(other.getRowDatasList()); - result = result && getPropsList() - .equals(other.getPropsList()); - 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; + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().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(); - } - if (getPropsCount() > 0) { - hash = (37 * hash) + PROPS_FIELD_NUMBER; - hash = (53 * hash) + getPropsList().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; - 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( + public static RowChange parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( + public static RowChange 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.CanalEntry.RowChange parseFrom(byte[] data) + public static RowChange parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( + public static RowChange 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.CanalEntry.RowChange parseFrom(java.io.InputStream input) + public static RowChange parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( + public static RowChange parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseDelimitedFrom(java.io.InputStream input) + public static RowChange parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); + return PARSER.parseDelimitedFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseDelimitedFrom( + public static RowChange parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( + public static RowChange parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( + public static RowChange parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - @java.lang.Override + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - 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 static Builder newBuilder(RowChange prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.RowChange) - com.alibaba.otter.canal.protocol.CanalEntry.RowChangeOrBuilder { + RowChangeOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.RowChange.class, com.alibaba.otter.canal.protocol.CanalEntry.RowChange.Builder.class); + RowChange.class, Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.RowChange.newBuilder() @@ -8840,24 +8496,30 @@ public final class CanalEntry { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getRowDatasFieldBuilder(); getPropsFieldBuilder(); } } - @java.lang.Override + private static Builder create() { + return new Builder(); + } + public Builder clear() { super.clear(); tableId_ = 0L; - + bitField0_ = (bitField0_ & ~0x00000001); + eventType_ = EventType.UPDATE; + bitField0_ = (bitField0_ & ~0x00000002); + isDdl_ = false; + bitField0_ = (bitField0_ & ~0x00000004); sql_ = ""; - + bitField0_ = (bitField0_ & ~0x00000008); if (rowDatasBuilder_ == null) { rowDatas_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); @@ -8871,45 +8533,49 @@ public final class CanalEntry { propsBuilder_.clear(); } ddlSchemaName_ = ""; - - eventTypePresentCase_ = 0; - eventTypePresent_ = null; - isDdlPresentCase_ = 0; - isDdlPresent_ = null; + bitField0_ = (bitField0_ & ~0x00000040); return this; } - @java.lang.Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.RowChange getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.RowChange.getDefaultInstance(); + public RowChange getDefaultInstanceForType() { + return RowChange.getDefaultInstance(); } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.RowChange build() { - com.alibaba.otter.canal.protocol.CanalEntry.RowChange result = buildPartial(); + public RowChange build() { + RowChange result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @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); + public RowChange buildPartial() { + RowChange result = new RowChange(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - result.tableId_ = tableId_; - if (eventTypePresentCase_ == 2) { - result.eventTypePresent_ = eventTypePresent_; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; } - if (isDdlPresentCase_ == 10) { - result.isDdlPresent_ = isDdlPresent_; + result.tableId_ = tableId_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.eventType_ = eventType_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.isDdl_ = isDdl_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; } result.sql_ = sql_; if (rowDatasBuilder_ == null) { @@ -8930,62 +8596,37 @@ 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; } - @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.CanalEntry.RowChange) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.RowChange)other); + if (other instanceof RowChange) { + return mergeFrom((RowChange)other); } else { super.mergeFrom(other); 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.getTableId() != 0L) { + public Builder mergeFrom(RowChange other) { + if (other == RowChange.getDefaultInstance()) return this; + if (other.hasTableId()) { setTableId(other.getTableId()); } - if (!other.getSql().isEmpty()) { + if (other.hasEventType()) { + setEventType(other.getEventType()); + } + if (other.hasIsDdl()) { + setIsDdl(other.getIsDdl()); + } + if (other.hasSql()) { + bitField0_ |= 0x00000008; sql_ = other.sql_; onChanged(); } @@ -9007,8 +8648,8 @@ public final class CanalEntry { rowDatasBuilder_ = null; rowDatas_ = other.rowDatas_; bitField0_ = (bitField0_ & ~0x00000010); - rowDatasBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + rowDatasBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRowDatasFieldBuilder() : null; } else { rowDatasBuilder_.addAllMessages(other.rowDatas_); @@ -9033,57 +8674,37 @@ public final class CanalEntry { propsBuilder_ = null; props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000020); - propsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + propsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); } } } - if (!other.getDdlSchemaName().isEmpty()) { + if (other.hasDdlSchemaName()) { + bitField0_ |= 0x00000040; 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(); + this.mergeUnknownFields(other.getUnknownFields()); 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.CanalEntry.RowChange parsedMessage = null; + RowChange parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.RowChange) e.getUnfinishedMessage(); - throw e.unwrapIOException(); + parsedMessage = (RowChange) e.getUnfinishedMessage(); + throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -9091,194 +8712,201 @@ 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_ ; /** + * optional int64 tableId = 1; + * *
        **tableId,由数据库产生*
        * 
+ */ + public boolean hasTableId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 tableId = 1; * - * int64 tableId = 1; + *
+       **tableId,由数据库产生*
+       * 
*/ public long getTableId() { return tableId_; } /** + * optional int64 tableId = 1; + * *
        **tableId,由数据库产生*
        * 
- * - * int64 tableId = 1; */ public Builder setTableId(long value) { - + bitField0_ |= 0x00000001; tableId_ = value; onChanged(); return this; } /** + * optional int64 tableId = 1; + * *
        **tableId,由数据库产生*
        * 
- * - * int64 tableId = 1; */ public Builder clearTableId() { - + bitField0_ = (bitField0_ & ~0x00000001); tableId_ = 0L; onChanged(); return this; } + private EventType eventType_ = EventType.UPDATE; /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
+       **数据变更类型*
+       * 
*/ - public int getEventTypeValue() { - if (eventTypePresentCase_ == 2) { - return ((java.lang.Integer) eventTypePresent_).intValue(); - } - return 0; + public boolean hasEventType() { + return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
+       **数据变更类型*
+       * 
*/ - public Builder setEventTypeValue(int value) { - eventTypePresentCase_ = 2; - eventTypePresent_ = value; - onChanged(); - return this; + public EventType getEventType() { + return eventType_; } /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
+       **数据变更类型*
+       * 
*/ - public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - 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; - } - /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; - */ - public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { + public Builder setEventType(EventType value) { if (value == null) { throw new NullPointerException(); } - eventTypePresentCase_ = 2; - eventTypePresent_ = value.getNumber(); + bitField0_ |= 0x00000002; + eventType_ = value; onChanged(); return this; } /** - * .com.alibaba.otter.canal.protocol.EventType eventType = 2; + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
+       **数据变更类型*
+       * 
*/ public Builder clearEventType() { - if (eventTypePresentCase_ == 2) { - eventTypePresentCase_ = 0; - eventTypePresent_ = null; - onChanged(); - } + bitField0_ = (bitField0_ & ~0x00000002); + eventType_ = EventType.UPDATE; + onChanged(); return this; } + private boolean isDdl_ ; /** - * bool isDdl = 10; + * optional bool isDdl = 10 [default = false]; + * + *
+       ** 标识是否是ddl语句  *
+       * 
*/ - public boolean getIsDdl() { - if (isDdlPresentCase_ == 10) { - return (java.lang.Boolean) isDdlPresent_; - } - return false; + public boolean hasIsDdl() { + return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * bool isDdl = 10; + * optional bool isDdl = 10 [default = false]; + * + *
+       ** 标识是否是ddl语句  *
+       * 
+ */ + public boolean getIsDdl() { + return isDdl_; + } + /** + * optional bool isDdl = 10 [default = false]; + * + *
+       ** 标识是否是ddl语句  *
+       * 
*/ public Builder setIsDdl(boolean value) { - isDdlPresentCase_ = 10; - isDdlPresent_ = value; + bitField0_ |= 0x00000004; + isDdl_ = value; onChanged(); return this; } /** - * bool isDdl = 10; + * optional bool isDdl = 10 [default = false]; + * + *
+       ** 标识是否是ddl语句  *
+       * 
*/ public Builder clearIsDdl() { - if (isDdlPresentCase_ == 10) { - isDdlPresentCase_ = 0; - isDdlPresent_ = null; - onChanged(); - } + bitField0_ = (bitField0_ & ~0x00000004); + isDdl_ = false; + onChanged(); return this; } - private java.lang.Object sql_ = ""; + private Object sql_ = ""; /** + * optional string sql = 11; + * *
        ** ddl/query的sql语句  *
        * 
- * - * string sql = 11; */ - public java.lang.String getSql() { - java.lang.Object ref = sql_; - if (!(ref instanceof java.lang.String)) { + public boolean hasSql() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string sql = 11; + * + *
+       ** ddl/query的sql语句  *
+       * 
+ */ + public String getSql() { + Object ref = sql_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sql_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + sql_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string sql = 11; + * *
        ** ddl/query的sql语句  *
        * 
- * - * string sql = 11; */ public com.google.protobuf.ByteString getSqlBytes() { - java.lang.Object ref = sql_; + Object ref = sql_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); sql_ = b; return b; } else { @@ -9286,74 +8914,73 @@ public final class CanalEntry { } } /** + * optional string sql = 11; + * *
        ** ddl/query的sql语句  *
        * 
- * - * string sql = 11; */ public Builder setSql( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000008; sql_ = value; onChanged(); return this; } /** + * optional string sql = 11; + * *
        ** ddl/query的sql语句  *
        * 
- * - * string sql = 11; */ public Builder clearSql() { - + bitField0_ = (bitField0_ & ~0x00000008); sql_ = getDefaultInstance().getSql(); onChanged(); return this; } /** + * optional string sql = 11; + * *
        ** ddl/query的sql语句  *
        * 
- * - * string sql = 11; */ public Builder setSqlBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000008; sql_ = value; onChanged(); 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.RowData, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder, com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder> rowDatasBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + RowData, RowData.Builder, 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 { @@ -9361,11 +8988,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) { @@ -9375,13 +9002,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * *
        ** 一次数据库变更可能存在多行  *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index) { + public RowData getRowDatas(int index) { if (rowDatasBuilder_ == null) { return rowDatas_.get(index); } else { @@ -9389,14 +9016,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, com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { + int index, RowData value) { if (rowDatasBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9410,14 +9037,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, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { + int index, RowData.Builder builderForValue) { if (rowDatasBuilder_ == null) { ensureRowDatasIsMutable(); rowDatas_.set(index, builderForValue.build()); @@ -9428,13 +9055,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(com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { + public Builder addRowDatas(RowData value) { if (rowDatasBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9448,14 +9075,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, com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { + int index, RowData value) { if (rowDatasBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9469,14 +9096,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( - com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { + RowData.Builder builderForValue) { if (rowDatasBuilder_ == null) { ensureRowDatasIsMutable(); rowDatas_.add(builderForValue.build()); @@ -9487,14 +9114,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, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { + int index, RowData.Builder builderForValue) { if (rowDatasBuilder_ == null) { ensureRowDatasIsMutable(); rowDatas_.add(index, builderForValue.build()); @@ -9505,14 +9132,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( - java.lang.Iterable values) { + Iterable values) { if (rowDatasBuilder_ == null) { ensureRowDatasIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -9524,11 +9151,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) { @@ -9541,11 +9168,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) { @@ -9558,24 +9185,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 com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder getRowDatasBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( + public RowDataOrBuilder getRowDatasOrBuilder( int index) { if (rowDatasBuilder_ == null) { return rowDatas_.get(index); } else { @@ -9583,13 +9210,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(); @@ -9598,45 +9225,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * *
        ** 一次数据库变更可能存在多行  *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder addRowDatasBuilder() { + public RowData.Builder addRowDatasBuilder() { return getRowDatasFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()); + RowData.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * *
        ** 一次数据库变更可能存在多行  *
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder addRowDatasBuilder( + public RowData.Builder addRowDatasBuilder( int index) { return getRowDatasFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.RowData, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder, com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + RowData, RowData.Builder, RowDataOrBuilder> getRowDatasFieldBuilder() { if (rowDatasBuilder_ == null) { - 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>( + rowDatasBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + RowData, RowData.Builder, RowDataOrBuilder>( rowDatas_, ((bitField0_ & 0x00000010) == 0x00000010), getParentForChildren(), @@ -9646,26 +9273,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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, 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 { @@ -9673,11 +9300,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) { @@ -9687,13 +9314,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -9701,14 +9328,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9722,14 +9349,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -9740,13 +9367,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(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + public Builder addProps(Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9760,14 +9387,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -9781,14 +9408,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( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -9799,14 +9426,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -9817,14 +9444,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( - java.lang.Iterable values) { + Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -9836,11 +9463,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) { @@ -9853,11 +9480,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) { @@ -9870,24 +9497,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 com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -9895,13 +9522,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(); @@ -9910,45 +9537,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + public Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + Pair.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( + public Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - 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>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder>( props_, ((bitField0_ & 0x00000020) == 0x00000020), getParentForChildren(), @@ -9958,40 +9585,52 @@ public final class CanalEntry { return propsBuilder_; } - private java.lang.Object ddlSchemaName_ = ""; + private Object ddlSchemaName_ = ""; /** + * optional string ddlSchemaName = 14; + * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
- * - * string ddlSchemaName = 14; */ - public java.lang.String getDdlSchemaName() { - java.lang.Object ref = ddlSchemaName_; - if (!(ref instanceof java.lang.String)) { + public boolean hasDdlSchemaName() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional string ddlSchemaName = 14; + * + *
+       ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
+       * 
+ */ + public String getDdlSchemaName() { + Object ref = ddlSchemaName_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ddlSchemaName_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + ddlSchemaName_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string ddlSchemaName = 14; + * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
- * - * string ddlSchemaName = 14; */ public com.google.protobuf.ByteString getDdlSchemaNameBytes() { - java.lang.Object ref = ddlSchemaName_; + Object ref = ddlSchemaName_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); ddlSchemaName_ = b; return b; } else { @@ -9999,104 +9638,62 @@ public final class CanalEntry { } } /** + * optional string ddlSchemaName = 14; + * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
- * - * string ddlSchemaName = 14; */ public Builder setDdlSchemaName( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000040; ddlSchemaName_ = value; onChanged(); return this; } /** + * optional string ddlSchemaName = 14; + * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
- * - * string ddlSchemaName = 14; */ public Builder clearDdlSchemaName() { - + bitField0_ = (bitField0_ & ~0x00000040); ddlSchemaName_ = getDefaultInstance().getDdlSchemaName(); onChanged(); return this; } /** + * optional string ddlSchemaName = 14; + * *
        ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
        * 
- * - * string ddlSchemaName = 14; */ public Builder setDdlSchemaNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000040; ddlSchemaName_ = value; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(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 { - DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.RowChange(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private 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; + defaultInstance = new RowChange(true); + defaultInstance.initFields(); } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowChange) } public interface TransactionBeginOrBuilder extends @@ -10104,121 +9701,146 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** + * optional int64 executeTime = 1; + * *
      **已废弃,请使用header里的executeTime*
      * 
+ */ + boolean hasExecuteTime(); + /** + * optional int64 executeTime = 1; * - * int64 executeTime = 1; + *
+     **已废弃,请使用header里的executeTime*
+     * 
*/ long getExecuteTime(); /** + * optional string transactionId = 2; + * *
      **已废弃,Begin里不提供事务id*
      * 
- * - * string transactionId = 2; */ - java.lang.String getTransactionId(); + boolean hasTransactionId(); /** + * optional string transactionId = 2; + * *
      **已废弃,Begin里不提供事务id*
      * 
+ */ + String getTransactionId(); + /** + * optional string transactionId = 2; * - * string transactionId = 2; + *
+     **已废弃,Begin里不提供事务id*
+     * 
*/ 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); + PairOrBuilder getPropsOrBuilder(int index); /** + * optional int64 threadId = 4; + * *
      **执行的thread Id*
      * 
+ */ + boolean hasThreadId(); + /** + * optional int64 threadId = 4; * - * int64 threadId = 4; + *
+     **执行的thread Id*
+     * 
*/ 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.GeneratedMessageV3 implements + public static final class TransactionBegin extends + com.google.protobuf.GeneratedMessage 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.GeneratedMessageV3.Builder builder) { + private TransactionBegin(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private TransactionBegin() { - executeTime_ = 0L; - transactionId_ = ""; - props_ = java.util.Collections.emptyList(); - threadId_ = 0L; + private TransactionBegin(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final TransactionBegin defaultInstance; + public static TransactionBegin getDefaultInstance() { + return defaultInstance; } - @java.lang.Override + public TransactionBegin getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } + initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -10230,45 +9852,44 @@ 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(); break; } case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - transactionId_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + transactionId_ = bs; 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(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); + props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; } case 32: { - + bitField0_ |= 0x00000004; threadId_ = input.readInt64(); break; } - default: { - if (!parseUnknownFieldProto3( - 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); + e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -10279,66 +9900,102 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.class, com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.Builder.class); + 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; } private int bitField0_; public static final int EXECUTETIME_FIELD_NUMBER = 1; private long executeTime_; /** + * optional int64 executeTime = 1; + * *
      **已废弃,请使用header里的executeTime*
      * 
+ */ + public boolean hasExecuteTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 executeTime = 1; * - * int64 executeTime = 1; + *
+     **已废弃,请使用header里的executeTime*
+     * 
*/ public long getExecuteTime() { return executeTime_; } public static final int TRANSACTIONID_FIELD_NUMBER = 2; - private volatile java.lang.Object transactionId_; + private Object transactionId_; /** + * optional string transactionId = 2; + * *
      **已废弃,Begin里不提供事务id*
      * 
- * - * string transactionId = 2; */ - public java.lang.String getTransactionId() { - java.lang.Object ref = transactionId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string transactionId = 2; + * + *
+     **已废弃,Begin里不提供事务id*
+     * 
+ */ + public String getTransactionId() { + Object ref = transactionId_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transactionId_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } return s; } } /** + * optional string transactionId = 2; + * *
      **已废弃,Begin里不提供事务id*
      * 
- * - * string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { - java.lang.Object ref = transactionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = transactionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); transactionId_ = b; return b; } else { @@ -10347,56 +10004,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 com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { return props_.get(index); } @@ -10404,18 +10061,33 @@ public final class CanalEntry { public static final int THREADID_FIELD_NUMBER = 4; private long threadId_; /** + * optional int64 threadId = 4; + * *
      **执行的thread Id*
      * 
+ */ + public boolean hasThreadId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int64 threadId = 4; * - * int64 threadId = 4; + *
+     **执行的thread Id*
+     * 
*/ 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; @@ -10425,209 +10097,145 @@ public final class CanalEntry { return true; } - @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (executeTime_ != 0L) { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, executeTime_); } - if (!getTransactionIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, transactionId_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getTransactionIdBytes()); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(3, props_.get(i)); } - if (threadId_ != 0L) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt64(4, threadId_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } - @java.lang.Override + private int memoizedSerializedSize = -1; public int getSerializedSize() { - int size = memoizedSize; + int size = memoizedSerializedSize; if (size != -1) return size; size = 0; - if (executeTime_ != 0L) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, executeTime_); } - if (!getTransactionIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, transactionId_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getTransactionIdBytes()); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, props_.get(i)); } - if (threadId_ != 0L) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(4, threadId_); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = 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.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 && (getExecuteTime() - == other.getExecuteTime()); - result = result && getTransactionId() - .equals(other.getTransactionId()); - result = result && getPropsList() - .equals(other.getPropsList()); - result = result && (getThreadId() - == other.getThreadId()); - result = result && unknownFields.equals(other.unknownFields); - return result; + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().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(); - } - 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( + public static TransactionBegin parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( + public static TransactionBegin 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.CanalEntry.TransactionBegin parseFrom(byte[] data) + public static TransactionBegin parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( + public static TransactionBegin 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.CanalEntry.TransactionBegin parseFrom(java.io.InputStream input) + public static TransactionBegin parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( + public static TransactionBegin parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseDelimitedFrom(java.io.InputStream input) + public static TransactionBegin parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); + return PARSER.parseDelimitedFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseDelimitedFrom( + public static TransactionBegin parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( + public static TransactionBegin parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( + public static TransactionBegin parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - @java.lang.Override + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - 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 static Builder newBuilder(TransactionBegin prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.TransactionBegin) - com.alibaba.otter.canal.protocol.CanalEntry.TransactionBeginOrBuilder { + TransactionBeginOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.class, com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.Builder.class); + TransactionBegin.class, Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.newBuilder() @@ -10636,23 +10244,25 @@ public final class CanalEntry { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getPropsFieldBuilder(); } } - @java.lang.Override + private static Builder create() { + return new Builder(); + } + 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); @@ -10660,36 +10270,42 @@ public final class CanalEntry { propsBuilder_.clear(); } threadId_ = 0L; - + bitField0_ = (bitField0_ & ~0x00000008); return this; } - @java.lang.Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.getDefaultInstance(); + public TransactionBegin getDefaultInstanceForType() { + return TransactionBegin.getDefaultInstance(); } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin build() { - com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin result = buildPartial(); + public TransactionBegin build() { + TransactionBegin result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @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); + public TransactionBegin buildPartial() { + TransactionBegin result = new 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)) { @@ -10700,60 +10316,31 @@ 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(); 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.CanalEntry.TransactionBegin) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin)other); + if (other instanceof TransactionBegin) { + return mergeFrom((TransactionBegin)other); } else { super.mergeFrom(other); 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.getExecuteTime() != 0L) { + public Builder mergeFrom(TransactionBegin other) { + if (other == TransactionBegin.getDefaultInstance()) return this; + if (other.hasExecuteTime()) { setExecuteTime(other.getExecuteTime()); } - if (!other.getTransactionId().isEmpty()) { + if (other.hasTransactionId()) { + bitField0_ |= 0x00000002; transactionId_ = other.transactionId_; onChanged(); } @@ -10775,38 +10362,35 @@ public final class CanalEntry { propsBuilder_ = null; props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000004); - propsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + propsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); } } } - if (other.getThreadId() != 0L) { + if (other.hasThreadId()) { setThreadId(other.getThreadId()); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + this.mergeUnknownFields(other.getUnknownFields()); 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.CanalEntry.TransactionBegin parsedMessage = null; + TransactionBegin parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin) e.getUnfinishedMessage(); - throw e.unwrapIOException(); + parsedMessage = (TransactionBegin) e.getUnfinishedMessage(); + throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -10818,76 +10402,98 @@ public final class CanalEntry { private long executeTime_ ; /** + * optional int64 executeTime = 1; + * *
        **已废弃,请使用header里的executeTime*
        * 
+ */ + public boolean hasExecuteTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 executeTime = 1; * - * int64 executeTime = 1; + *
+       **已废弃,请使用header里的executeTime*
+       * 
*/ public long getExecuteTime() { return executeTime_; } /** + * optional int64 executeTime = 1; + * *
        **已废弃,请使用header里的executeTime*
        * 
- * - * int64 executeTime = 1; */ public Builder setExecuteTime(long value) { - + bitField0_ |= 0x00000001; executeTime_ = value; onChanged(); return this; } /** + * optional int64 executeTime = 1; + * *
        **已废弃,请使用header里的executeTime*
        * 
- * - * int64 executeTime = 1; */ public Builder clearExecuteTime() { - + bitField0_ = (bitField0_ & ~0x00000001); executeTime_ = 0L; onChanged(); return this; } - private java.lang.Object transactionId_ = ""; + private Object transactionId_ = ""; /** + * optional string transactionId = 2; + * *
        **已废弃,Begin里不提供事务id*
        * 
- * - * string transactionId = 2; */ - public java.lang.String getTransactionId() { - java.lang.Object ref = transactionId_; - if (!(ref instanceof java.lang.String)) { + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string transactionId = 2; + * + *
+       **已废弃,Begin里不提供事务id*
+       * 
+ */ + public String getTransactionId() { + Object ref = transactionId_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transactionId_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string transactionId = 2; + * *
        **已废弃,Begin里不提供事务id*
        * 
- * - * string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { - java.lang.Object ref = transactionId_; + Object ref = transactionId_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); transactionId_ = b; return b; } else { @@ -10895,74 +10501,73 @@ public final class CanalEntry { } } /** + * optional string transactionId = 2; + * *
        **已废弃,Begin里不提供事务id*
        * 
- * - * string transactionId = 2; */ public Builder setTransactionId( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000002; transactionId_ = value; onChanged(); return this; } /** + * optional string transactionId = 2; + * *
        **已废弃,Begin里不提供事务id*
        * 
- * - * string transactionId = 2; */ public Builder clearTransactionId() { - + bitField0_ = (bitField0_ & ~0x00000002); transactionId_ = getDefaultInstance().getTransactionId(); onChanged(); return this; } /** + * optional string transactionId = 2; + * *
        **已废弃,Begin里不提供事务id*
        * 
- * - * string transactionId = 2; */ public Builder setTransactionIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000002; transactionId_ = value; onChanged(); 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, 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 { @@ -10970,11 +10575,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) { @@ -10984,13 +10589,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -10998,14 +10603,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -11019,14 +10624,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -11037,13 +10642,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(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + public Builder addProps(Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -11057,14 +10662,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -11078,14 +10683,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( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -11096,14 +10701,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -11114,14 +10719,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( - java.lang.Iterable values) { + Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -11133,11 +10738,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) { @@ -11150,11 +10755,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) { @@ -11167,24 +10772,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 com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -11192,13 +10797,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(); @@ -11207,45 +10812,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + public Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + Pair.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( + public Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - 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>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder>( props_, ((bitField0_ & 0x00000004) == 0x00000004), getParentForChildren(), @@ -11257,92 +10862,61 @@ public final class CanalEntry { private long threadId_ ; /** + * optional int64 threadId = 4; + * *
        **执行的thread Id*
        * 
+ */ + public boolean hasThreadId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int64 threadId = 4; * - * int64 threadId = 4; + *
+       **执行的thread Id*
+       * 
*/ public long getThreadId() { return threadId_; } /** + * optional int64 threadId = 4; + * *
        **执行的thread Id*
        * 
- * - * int64 threadId = 4; */ public Builder setThreadId(long value) { - + bitField0_ |= 0x00000008; threadId_ = value; onChanged(); return this; } /** + * optional int64 threadId = 4; + * *
        **执行的thread Id*
        * 
- * - * int64 threadId = 4; */ public Builder clearThreadId() { - + bitField0_ = (bitField0_ & ~0x00000008); threadId_ = 0L; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(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 { - DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private 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; + defaultInstance = new TransactionBegin(true); + defaultInstance.initFields(); } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionBegin) } public interface TransactionEndOrBuilder extends @@ -11350,111 +10924,129 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** + * optional int64 executeTime = 1; + * *
      **已废弃,请使用header里的executeTime*
      * 
+ */ + boolean hasExecuteTime(); + /** + * optional int64 executeTime = 1; * - * int64 executeTime = 1; + *
+     **已废弃,请使用header里的executeTime*
+     * 
*/ long getExecuteTime(); /** + * optional string transactionId = 2; + * *
      **事务号*
      * 
- * - * string transactionId = 2; */ - java.lang.String getTransactionId(); + boolean hasTransactionId(); /** + * optional string transactionId = 2; + * *
      **事务号*
      * 
+ */ + String getTransactionId(); + /** + * optional string transactionId = 2; * - * 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + 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; */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); + 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.GeneratedMessageV3 implements + public static final class TransactionEnd extends + com.google.protobuf.GeneratedMessage 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.GeneratedMessageV3.Builder builder) { + private TransactionEnd(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private TransactionEnd() { - executeTime_ = 0L; - transactionId_ = ""; - props_ = java.util.Collections.emptyList(); + private TransactionEnd(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final TransactionEnd defaultInstance; + public static TransactionEnd getDefaultInstance() { + return defaultInstance; } - @java.lang.Override + public TransactionEnd getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } + initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -11466,31 +11058,30 @@ 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(); break; } case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - transactionId_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + transactionId_ = bs; 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(com.alibaba.otter.canal.protocol.CanalEntry.Pair.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } + props_.add(input.readMessage(Pair.PARSER, extensionRegistry)); break; } } @@ -11499,7 +11090,7 @@ public final class CanalEntry { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); + e.getMessage()).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { props_ = java.util.Collections.unmodifiableList(props_); @@ -11510,66 +11101,102 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.class, com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.Builder.class); + 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; } private int bitField0_; public static final int EXECUTETIME_FIELD_NUMBER = 1; private long executeTime_; /** + * optional int64 executeTime = 1; + * *
      **已废弃,请使用header里的executeTime*
      * 
+ */ + public boolean hasExecuteTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 executeTime = 1; * - * int64 executeTime = 1; + *
+     **已废弃,请使用header里的executeTime*
+     * 
*/ public long getExecuteTime() { return executeTime_; } public static final int TRANSACTIONID_FIELD_NUMBER = 2; - private volatile java.lang.Object transactionId_; + private Object transactionId_; /** + * optional string transactionId = 2; + * *
      **事务号*
      * 
- * - * string transactionId = 2; */ - public java.lang.String getTransactionId() { - java.lang.Object ref = transactionId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string transactionId = 2; + * + *
+     **事务号*
+     * 
+ */ + public String getTransactionId() { + Object ref = transactionId_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transactionId_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } return s; } } /** + * optional string transactionId = 2; + * *
      **事务号*
      * 
- * - * string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { - java.lang.Object ref = transactionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = transactionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); transactionId_ = b; return b; } else { @@ -11578,62 +11205,66 @@ 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 com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public 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; @@ -11643,197 +11274,138 @@ public final class CanalEntry { return true; } - @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (executeTime_ != 0L) { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, executeTime_); } - if (!getTransactionIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, transactionId_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getTransactionIdBytes()); } for (int i = 0; i < props_.size(); i++) { output.writeMessage(3, props_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } - @java.lang.Override + private int memoizedSerializedSize = -1; public int getSerializedSize() { - int size = memoizedSize; + int size = memoizedSerializedSize; if (size != -1) return size; size = 0; - if (executeTime_ != 0L) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, executeTime_); } - if (!getTransactionIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, transactionId_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getTransactionIdBytes()); } for (int i = 0; i < props_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, props_.get(i)); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = 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.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 && (getExecuteTime() - == other.getExecuteTime()); - result = result && getTransactionId() - .equals(other.getTransactionId()); - result = result && getPropsList() - .equals(other.getPropsList()); - result = result && unknownFields.equals(other.unknownFields); - return result; + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().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(); - } - 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( + public static TransactionEnd parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( + public static TransactionEnd 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.CanalEntry.TransactionEnd parseFrom(byte[] data) + public static TransactionEnd parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( + public static TransactionEnd 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.CanalEntry.TransactionEnd parseFrom(java.io.InputStream input) + public static TransactionEnd parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( + public static TransactionEnd parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseDelimitedFrom(java.io.InputStream input) + public static TransactionEnd parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); + return PARSER.parseDelimitedFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseDelimitedFrom( + public static TransactionEnd parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( + public static TransactionEnd parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( + public static TransactionEnd parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - @java.lang.Override + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - 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 static Builder newBuilder(TransactionEnd prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.TransactionEnd) - com.alibaba.otter.canal.protocol.CanalEntry.TransactionEndOrBuilder { + TransactionEndOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.class, com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.Builder.class); + TransactionEnd.class, Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.newBuilder() @@ -11842,23 +11414,25 @@ public final class CanalEntry { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getPropsFieldBuilder(); } } - @java.lang.Override + private static Builder create() { + return new Builder(); + } + 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); @@ -11868,32 +11442,38 @@ public final class CanalEntry { return this; } - @java.lang.Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.getDefaultInstance(); + public TransactionEnd getDefaultInstanceForType() { + return TransactionEnd.getDefaultInstance(); } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd build() { - com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd result = buildPartial(); + public TransactionEnd build() { + TransactionEnd result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @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); + public TransactionEnd buildPartial() { + TransactionEnd result = new 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)) { @@ -11909,54 +11489,22 @@ 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 com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd)other); + if (other instanceof TransactionEnd) { + return mergeFrom((TransactionEnd)other); } else { super.mergeFrom(other); 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.getExecuteTime() != 0L) { + public Builder mergeFrom(TransactionEnd other) { + if (other == TransactionEnd.getDefaultInstance()) return this; + if (other.hasExecuteTime()) { setExecuteTime(other.getExecuteTime()); } - if (!other.getTransactionId().isEmpty()) { + if (other.hasTransactionId()) { + bitField0_ |= 0x00000002; transactionId_ = other.transactionId_; onChanged(); } @@ -11978,35 +11526,32 @@ public final class CanalEntry { propsBuilder_ = null; props_ = other.props_; bitField0_ = (bitField0_ & ~0x00000004); - propsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + propsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; } else { propsBuilder_.addAllMessages(other.props_); } } } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + this.mergeUnknownFields(other.getUnknownFields()); 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.CanalEntry.TransactionEnd parsedMessage = null; + TransactionEnd parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd) e.getUnfinishedMessage(); - throw e.unwrapIOException(); + parsedMessage = (TransactionEnd) e.getUnfinishedMessage(); + throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -12018,76 +11563,98 @@ public final class CanalEntry { private long executeTime_ ; /** + * optional int64 executeTime = 1; + * *
        **已废弃,请使用header里的executeTime*
        * 
+ */ + public boolean hasExecuteTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int64 executeTime = 1; * - * int64 executeTime = 1; + *
+       **已废弃,请使用header里的executeTime*
+       * 
*/ public long getExecuteTime() { return executeTime_; } /** + * optional int64 executeTime = 1; + * *
        **已废弃,请使用header里的executeTime*
        * 
- * - * int64 executeTime = 1; */ public Builder setExecuteTime(long value) { - + bitField0_ |= 0x00000001; executeTime_ = value; onChanged(); return this; } /** + * optional int64 executeTime = 1; + * *
        **已废弃,请使用header里的executeTime*
        * 
- * - * int64 executeTime = 1; */ public Builder clearExecuteTime() { - + bitField0_ = (bitField0_ & ~0x00000001); executeTime_ = 0L; onChanged(); return this; } - private java.lang.Object transactionId_ = ""; + private Object transactionId_ = ""; /** + * optional string transactionId = 2; + * *
        **事务号*
        * 
- * - * string transactionId = 2; */ - public java.lang.String getTransactionId() { - java.lang.Object ref = transactionId_; - if (!(ref instanceof java.lang.String)) { + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string transactionId = 2; + * + *
+       **事务号*
+       * 
+ */ + public String getTransactionId() { + Object ref = transactionId_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transactionId_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** + * optional string transactionId = 2; + * *
        **事务号*
        * 
- * - * string transactionId = 2; */ public com.google.protobuf.ByteString getTransactionIdBytes() { - java.lang.Object ref = transactionId_; + Object ref = transactionId_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); transactionId_ = b; return b; } else { @@ -12095,74 +11662,73 @@ public final class CanalEntry { } } /** + * optional string transactionId = 2; + * *
        **事务号*
        * 
- * - * string transactionId = 2; */ public Builder setTransactionId( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000002; transactionId_ = value; onChanged(); return this; } /** + * optional string transactionId = 2; + * *
        **事务号*
        * 
- * - * string transactionId = 2; */ public Builder clearTransactionId() { - + bitField0_ = (bitField0_ & ~0x00000002); transactionId_ = getDefaultInstance().getTransactionId(); onChanged(); return this; } /** + * optional string transactionId = 2; + * *
        **事务号*
        * 
- * - * string transactionId = 2; */ public Builder setTransactionIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000002; transactionId_ = value; onChanged(); 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, 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 { @@ -12170,11 +11736,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) { @@ -12184,13 +11750,13 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + public Pair getProps(int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -12198,14 +11764,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -12219,14 +11785,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.set(index, builderForValue.build()); @@ -12237,13 +11803,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(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + public Builder addProps(Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -12257,14 +11823,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + int index, Pair value) { if (propsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -12278,14 +11844,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( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(builderForValue.build()); @@ -12296,14 +11862,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, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + int index, Pair.Builder builderForValue) { if (propsBuilder_ == null) { ensurePropsIsMutable(); props_.add(index, builderForValue.build()); @@ -12314,14 +11880,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( - java.lang.Iterable values) { + Iterable values) { if (propsBuilder_ == null) { ensurePropsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -12333,11 +11899,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) { @@ -12350,11 +11916,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) { @@ -12367,24 +11933,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 com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( + public 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 com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( + public PairOrBuilder getPropsOrBuilder( int index) { if (propsBuilder_ == null) { return props_.get(index); } else { @@ -12392,13 +11958,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(); @@ -12407,45 +11973,45 @@ public final class CanalEntry { } } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + public Pair.Builder addPropsBuilder() { return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + Pair.getDefaultInstance()); } /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * *
        **预留扩展*
        * 
- * - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( + public Pair.Builder addPropsBuilder( int index) { return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + index, 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.RepeatedFieldBuilderV3< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> + private com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder> getPropsFieldBuilder() { if (propsBuilder_ == null) { - 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>( + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + Pair, Pair.Builder, PairOrBuilder>( props_, ((bitField0_ & 0x00000004) == 0x00000004), getParentForChildren(), @@ -12454,57 +12020,16 @@ public final class CanalEntry { } return propsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(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 { - DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private 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; + defaultInstance = new TransactionEnd(true); + defaultInstance.initFields(); } + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionEnd) } public interface PairOrBuilder extends @@ -12512,59 +12037,71 @@ public final class CanalEntry { com.google.protobuf.MessageOrBuilder { /** - * string key = 1; + * optional string key = 1; */ - java.lang.String getKey(); + boolean hasKey(); /** - * string key = 1; + * optional string key = 1; + */ + String getKey(); + /** + * optional string key = 1; */ com.google.protobuf.ByteString getKeyBytes(); /** - * string value = 2; + * optional string value = 2; */ - java.lang.String getValue(); + boolean hasValue(); /** - * string value = 2; + * optional string value = 2; + */ + String getValue(); + /** + * optional string value = 2; */ com.google.protobuf.ByteString 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.GeneratedMessageV3 implements + public static final class Pair extends + com.google.protobuf.GeneratedMessage 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.GeneratedMessageV3.Builder builder) { + private Pair(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Pair() { - key_ = ""; - value_ = ""; + private Pair(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Pair defaultInstance; + public static Pair getDefaultInstance() { + return defaultInstance; } - @java.lang.Override + public Pair getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } + initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -12576,23 +12113,23 @@ public final class CanalEntry { case 0: done = true; break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + key_ = bs; break; } case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + value_ = bs; break; } } @@ -12601,7 +12138,7 @@ public final class CanalEntry { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); + e.getMessage()).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -12609,44 +12146,67 @@ public final class CanalEntry { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.class, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder.class); + 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; + } + + private int bitField0_; public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; + private Object key_; /** - * string key = 1; + * optional string key = 1; */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string key = 1; + */ + public String getKey() { + Object ref = key_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } return s; } } /** - * string key = 1; + * optional string key = 1; */ public com.google.protobuf.ByteString getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); key_ = b; return b; } else { @@ -12655,32 +12215,40 @@ public final class CanalEntry { } public static final int VALUE_FIELD_NUMBER = 2; - private volatile java.lang.Object value_; + private Object value_; /** - * string value = 2; + * optional string value = 2; */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string value = 2; + */ + public String getValue() { + Object ref = value_; + if (ref instanceof String) { + return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } return s; } } /** - * string value = 2; + * optional string value = 2; */ public com.google.protobuf.ByteString getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = + Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); value_ = b; return b; } else { @@ -12688,8 +12256,11 @@ 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; @@ -12699,182 +12270,131 @@ public final class CanalEntry { return true; } - @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getKeyBytes()); } - if (!getValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getValueBytes()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } - @java.lang.Override + private int memoizedSerializedSize = -1; public int getSerializedSize() { - int size = memoizedSize; + int size = memoizedSerializedSize; if (size != -1) return size; size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getKeyBytes()); } - if (!getValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getValueBytes()); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = 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.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 && getKey() - .equals(other.getKey()); - result = result && getValue() - .equals(other.getValue()); - result = result && unknownFields.equals(other.unknownFields); - return result; + private static final long serialVersionUID = 0L; + @Override + protected Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().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; - } - - 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( + public static Pair parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( + public static Pair 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.CanalEntry.Pair parseFrom(byte[] data) + public static Pair parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( + public static Pair 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.CanalEntry.Pair parseFrom(java.io.InputStream input) + public static Pair parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( + public static Pair parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseDelimitedFrom(java.io.InputStream input) + public static Pair parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); + return PARSER.parseDelimitedFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseDelimitedFrom( + public static Pair parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( + public static Pair parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); + return PARSER.parseFrom(input); } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( + public static Pair parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + return PARSER.parseFrom(input, extensionRegistry); } - @java.lang.Override + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - 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 static Builder newBuilder(Pair prototype) { + return newBuilder().mergeFrom(prototype); } + public Builder toBuilder() { return newBuilder(this); } - @java.lang.Override + @Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Pair) - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder { + PairOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected FieldAccessorTable internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.class, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder.class); + Pair.class, Builder.class); } // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Pair.newBuilder() @@ -12883,127 +12403,104 @@ public final class CanalEntry { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { } } - @java.lang.Override + private static Builder create() { + return new Builder(); + } + public Builder clear() { super.clear(); key_ = ""; - + bitField0_ = (bitField0_ & ~0x00000001); value_ = ""; - + bitField0_ = (bitField0_ & ~0x00000002); return this; } - @java.lang.Override + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; + return CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance(); + public Pair getDefaultInstanceForType() { + return Pair.getDefaultInstance(); } - @java.lang.Override - public com.alibaba.otter.canal.protocol.CanalEntry.Pair build() { - com.alibaba.otter.canal.protocol.CanalEntry.Pair result = buildPartial(); + public Pair build() { + Pair result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - @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); + public Pair buildPartial() { + Pair result = new 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; } - @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.CanalEntry.Pair) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalEntry.Pair)other); + if (other instanceof Pair) { + return mergeFrom((Pair)other); } else { super.mergeFrom(other); 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.getKey().isEmpty()) { + public Builder mergeFrom(Pair other) { + if (other == Pair.getDefaultInstance()) return this; + if (other.hasKey()) { + bitField0_ |= 0x00000001; key_ = other.key_; onChanged(); } - if (!other.getValue().isEmpty()) { + if (other.hasValue()) { + bitField0_ |= 0x00000002; value_ = other.value_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + this.mergeUnknownFields(other.getUnknownFields()); 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.CanalEntry.Pair parsedMessage = null; + Pair parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalEntry.Pair) e.getUnfinishedMessage(); - throw e.unwrapIOException(); + parsedMessage = (Pair) e.getUnfinishedMessage(); + throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); @@ -13011,33 +12508,42 @@ public final class CanalEntry { } return this; } + private int bitField0_; - private java.lang.Object key_ = ""; + private Object key_ = ""; /** - * string key = 1; + * optional string key = 1; */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string key = 1; + */ + public String getKey() { + Object ref = key_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** - * string key = 1; + * optional string key = 1; */ public com.google.protobuf.ByteString getKeyBytes() { - java.lang.Object ref = key_; + Object ref = key_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); key_ = b; return b; } else { @@ -13045,68 +12551,75 @@ public final class CanalEntry { } } /** - * string key = 1; + * optional string key = 1; */ public Builder setKey( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000001; key_ = value; onChanged(); return this; } /** - * string key = 1; + * optional string key = 1; */ public Builder clearKey() { - + bitField0_ = (bitField0_ & ~0x00000001); key_ = getDefaultInstance().getKey(); onChanged(); return this; } /** - * string key = 1; + * optional string key = 1; */ public Builder setKeyBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000001; key_ = value; onChanged(); return this; } - private java.lang.Object value_ = ""; + private Object value_ = ""; /** - * string value = 2; + * optional string value = 2; */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string value = 2; + */ + public String getValue() { + Object ref = value_; + if (!(ref instanceof String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } return s; } else { - return (java.lang.String) ref; + return (String) ref; } } /** - * string value = 2; + * optional string value = 2; */ public com.google.protobuf.ByteString getValueBytes() { - java.lang.Object ref = value_; + Object ref = value_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); + (String) ref); value_ = b; return b; } else { @@ -13114,197 +12627,151 @@ public final class CanalEntry { } } /** - * string value = 2; + * optional string value = 2; */ public Builder setValue( - java.lang.String value) { + String value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000002; value_ = value; onChanged(); return this; } /** - * string value = 2; + * optional string value = 2; */ public Builder clearValue() { - + bitField0_ = (bitField0_ & ~0x00000002); value_ = getDefaultInstance().getValue(); onChanged(); return this; } /** - * string value = 2; + * optional string value = 2; */ public Builder setValueBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - + bitField0_ |= 0x00000002; value_ = value; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(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 { - DEFAULT_INSTANCE = new com.alibaba.otter.canal.protocol.CanalEntry.Pair(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private 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; + defaultInstance = new Pair(true); + defaultInstance.initFields(); } + // @@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 final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + private static + com.google.protobuf.GeneratedMessage.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 final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + private static + com.google.protobuf.GeneratedMessage.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 final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + private static + com.google.protobuf.GeneratedMessage.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 final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + private static + com.google.protobuf.GeneratedMessage.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 final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + private static + com.google.protobuf.GeneratedMessage.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 final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + private static + com.google.protobuf.GeneratedMessage.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 final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + private static + com.google.protobuf.GeneratedMessage.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 final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + private static + com.google.protobuf.GeneratedMessage.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 { - java.lang.String[] descriptorData = { + String[] descriptorData = { "\n\023EntryProtocol.proto\022 com.alibaba.otter" + - ".canal.protocol\"\254\001\n\005Entry\0228\n\006header\030\001 \001(" + + ".canal.protocol\"\236\001\n\005Entry\0228\n\006header\030\001 \001(" + "\0132(.com.alibaba.otter.canal.protocol.Hea" + - "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" + "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" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -13321,51 +12788,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.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor, - new java.lang.String[] { "Header", "EntryType", "StoreValue", "EntryTypePresent", }); + new 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.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.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", "VersionPresent", "SourceTypePresent", "EventTypePresent", }); + new 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.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Column_descriptor, - new java.lang.String[] { "Index", "SqlType", "Name", "IsKey", "Updated", "IsNull", "Props", "Value", "Length", "MysqlType", "IsNullPresent", }); + new 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.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor, - new java.lang.String[] { "BeforeColumns", "AfterColumns", "Props", }); + new 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.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor, - new java.lang.String[] { "TableId", "EventType", "IsDdl", "Sql", "RowDatas", "Props", "DdlSchemaName", "EventTypePresent", "IsDdlPresent", }); + new 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.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor, - new java.lang.String[] { "ExecuteTime", "TransactionId", "Props", "ThreadId", }); + new 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.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor, - new java.lang.String[] { "ExecuteTime", "TransactionId", "Props", }); + new 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.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor, - new java.lang.String[] { "Key", "Value", }); + new String[] { "Key", "Value", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/server/pom.xml b/server/pom.xml index a2eb437d..20108523 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -42,6 +42,11 @@ + + org.apache.rocketmq + rocketmq-client + 4.3.0 + org.jboss.netty diff --git a/server/src/main/java/com/alibaba/otter/canal/common/CanalMessageSerializer.java b/server/src/main/java/com/alibaba/otter/canal/common/CanalMessageSerializer.java new file mode 100644 index 00000000..a4b89bd9 --- /dev/null +++ b/server/src/main/java/com/alibaba/otter/canal/common/CanalMessageSerializer.java @@ -0,0 +1,71 @@ +package com.alibaba.otter.canal.common; + +import com.alibaba.otter.canal.protocol.CanalEntry; +import com.alibaba.otter.canal.protocol.CanalPacket; +import com.alibaba.otter.canal.protocol.CanalPacket.PacketType; +import com.alibaba.otter.canal.protocol.Message; +import com.google.protobuf.ByteString; +import com.google.protobuf.CodedOutputStream; +import com.google.protobuf.WireFormat; +import java.util.List; +import org.apache.kafka.common.errors.SerializationException; +import org.springframework.util.CollectionUtils; + +public class CanalMessageSerializer { + public static byte[] serializer(Message data){ + try { + if (data != null) { + if (data.getId() != -1) { + if (data.isRaw() && !CollectionUtils.isEmpty(data.getRawEntries())) { + // for performance + List rowEntries = data.getRawEntries(); + // message size + int messageSize = 0; + messageSize += CodedOutputStream.computeInt64Size(1, data.getId()); + + int dataSize = 0; + for (int i = 0; i < rowEntries.size(); i++) { + dataSize += CodedOutputStream.computeBytesSizeNoTag(rowEntries.get(i)); + } + messageSize += dataSize; + messageSize += 1 * rowEntries.size(); + // packet size + int size = 0; + size += CodedOutputStream.computeEnumSize(3, + PacketType.MESSAGES.getNumber()); + size += CodedOutputStream.computeTagSize(5) + + CodedOutputStream.computeRawVarint32Size(messageSize) + + messageSize; + // build data + byte[] body = new byte[size]; + CodedOutputStream output = CodedOutputStream.newInstance(body); + output.writeEnum(3, PacketType.MESSAGES.getNumber()); + + output.writeTag(5, WireFormat.WIRETYPE_LENGTH_DELIMITED); + output.writeRawVarint32(messageSize); + // message + output.writeInt64(1, data.getId()); + for (int i = 0; i < rowEntries.size(); i++) { + output.writeBytes(2, rowEntries.get(i)); + } + output.checkNoSpaceLeft(); + return body; + } else if (!CollectionUtils.isEmpty(data.getEntries())) { + CanalPacket.Messages.Builder messageBuilder = CanalPacket.Messages.newBuilder(); + for (CanalEntry.Entry entry : data.getEntries()) { + messageBuilder.addMessages(entry.toByteString()); + } + + CanalPacket.Packet.Builder packetBuilder = CanalPacket.Packet.newBuilder(); + packetBuilder.setType(PacketType.MESSAGES); + packetBuilder.setBody(messageBuilder.build().toByteString()); + return packetBuilder.build().toByteArray(); + } + } + } + } catch (Exception e) { + throw new SerializationException("Error when serializing message to byte[] "); + } + return null; + } +} diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java b/server/src/main/java/com/alibaba/otter/canal/common/MQProperties.java similarity index 76% rename from server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java rename to server/src/main/java/com/alibaba/otter/canal/common/MQProperties.java index 5e4145fe..0302407a 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/KafkaProperties.java +++ b/server/src/main/java/com/alibaba/otter/canal/common/MQProperties.java @@ -1,4 +1,4 @@ -package com.alibaba.otter.canal.kafka; +package com.alibaba.otter.canal.common; import java.util.ArrayList; import java.util.List; @@ -10,26 +10,27 @@ import java.util.Map; * @author machengyuan 2018-6-11 下午05:30:49 * @version 1.0.0 */ -public class KafkaProperties { +public class MQProperties { - private String servers = "localhost:6667"; - private int retries = 0; - private int batchSize = 16384; - private int lingerMs = 1; - private long bufferMemory = 33554432L; - private boolean filterTransactionEntry = true; - private int canalBatchSize = 50; - private Long canalGetTimeout; - private boolean flatMessage = true; + private String servers = "localhost:6667"; + private int retries = 0; + private int batchSize = 16384; + private int lingerMs = 1; + private long bufferMemory = 33554432L; + private boolean filterTransactionEntry = true; + private String producerGroup = "Canal-Producer"; + private int canalBatchSize = 50; + private Long canalGetTimeout; + private boolean flatMessage = true; - private List canalDestinations = new ArrayList(); + private List canalDestinations = new ArrayList(); public static class CanalDestination { - private String canalDestination; - private String topic; - private Integer partition; - private Integer partitionsNum; + private String canalDestination; + private String topic; + private Integer partition; + private Integer partitionsNum; private Map partitionHash; public String getCanalDestination() { @@ -73,6 +74,7 @@ public class KafkaProperties { } } + public String getServers() { return servers; } @@ -153,4 +155,11 @@ public class KafkaProperties { this.filterTransactionEntry = filterTransactionEntry; } + public String getProducerGroup() { + return producerGroup; + } + + public void setProducerGroup(String producerGroup) { + this.producerGroup = producerGroup; + } } 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 5708105c..fc62ad21 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,8 +1,12 @@ package com.alibaba.otter.canal.kafka; +import com.alibaba.fastjson.JSON; +import com.alibaba.otter.canal.common.MQProperties; +import com.alibaba.otter.canal.protocol.FlatMessage; +import com.alibaba.otter.canal.protocol.Message; +import com.alibaba.otter.canal.spi.CanalMQProducer; import java.util.List; 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; @@ -10,27 +14,24 @@ 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; - /** * kafka producer 主操作类 * * @author machengyuan 2018-6-11 下午05:30:49 * @version 1.0.0 */ -public class CanalKafkaProducer { +public class CanalKafkaProducer implements CanalMQProducer { - private static final Logger logger = LoggerFactory.getLogger(CanalKafkaProducer.class); + private static final Logger logger = LoggerFactory.getLogger(CanalKafkaProducer.class); private Producer producer; - private Producer producer2; // 用于扁平message的数据投递 + private Producer producer2; // 用于扁平message的数据投递 - private KafkaProperties kafkaProperties; + private MQProperties kafkaProperties; - public void init(KafkaProperties kafkaProperties) { + @Override + public void init(MQProperties kafkaProperties) { this.kafkaProperties = kafkaProperties; Properties properties = new Properties(); properties.put("bootstrap.servers", kafkaProperties.getServers()); @@ -51,6 +52,7 @@ public class CanalKafkaProducer { // producer.initTransactions(); } + @Override public void stop() { try { logger.info("## stop the kafka producer"); @@ -67,7 +69,8 @@ public class CanalKafkaProducer { } } - public void send(KafkaProperties.CanalDestination canalDestination, Message message, Callback callback) { + @Override + public void send(MQProperties.CanalDestination canalDestination, Message message, Callback callback) { try { // producer.beginTransaction(); if (!kafkaProperties.getFlatMessage()) { @@ -102,10 +105,10 @@ public class CanalKafkaProducer { FlatMessage flatMessagePart = partitionFlatMessage[i]; if (flatMessagePart != null) { ProducerRecord record = new ProducerRecord( - canalDestination.getTopic(), - i, - null, - JSON.toJSONString(flatMessagePart)); + canalDestination.getTopic(), + i, + null, + JSON.toJSONString(flatMessagePart)); producer2.send(record); } } @@ -135,10 +138,4 @@ public class CanalKafkaProducer { } } - public interface Callback { - - void commit(); - - void rollback(); - } } 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 86b31502..59d2bc20 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 @@ -1,19 +1,9 @@ package com.alibaba.otter.canal.kafka; -import java.util.List; -import java.util.Map; - -import org.apache.kafka.common.errors.SerializationException; -import org.apache.kafka.common.serialization.Serializer; -import org.springframework.util.CollectionUtils; - -import com.alibaba.otter.canal.protocol.CanalEntry; -import com.alibaba.otter.canal.protocol.CanalPacket; -import com.alibaba.otter.canal.protocol.CanalPacket.PacketType; +import com.alibaba.otter.canal.common.CanalMessageSerializer; import com.alibaba.otter.canal.protocol.Message; -import com.google.protobuf.ByteString; -import com.google.protobuf.CodedOutputStream; -import com.google.protobuf.WireFormat; +import java.util.Map; +import org.apache.kafka.common.serialization.Serializer; /** * Kafka Message类的序列化 @@ -28,60 +18,8 @@ public class MessageSerializer implements Serializer { } @Override - @SuppressWarnings("deprecation") public byte[] serialize(String topic, Message data) { - try { - if (data != null) { - if (data.getId() != -1) { - if (data.isRaw() && !CollectionUtils.isEmpty(data.getRawEntries())) { - // for performance - List rowEntries = data.getRawEntries(); - // message size - int messageSize = 0; - messageSize += CodedOutputStream.computeInt64Size(1, data.getId()); - - int dataSize = 0; - for (int i = 0; i < rowEntries.size(); i++) { - dataSize += CodedOutputStream.computeBytesSizeNoTag(rowEntries.get(i)); - } - messageSize += dataSize; - messageSize += 1 * rowEntries.size(); - // packet size - int size = 0; - size += CodedOutputStream.computeEnumSize(3, PacketType.MESSAGES.getNumber()); - size += CodedOutputStream.computeTagSize(5) - + CodedOutputStream.computeRawVarint32Size(messageSize) + messageSize; - // build data - byte[] body = new byte[size]; - CodedOutputStream output = CodedOutputStream.newInstance(body); - output.writeEnum(3, PacketType.MESSAGES.getNumber()); - - output.writeTag(5, WireFormat.WIRETYPE_LENGTH_DELIMITED); - output.writeRawVarint32(messageSize); - // message - output.writeInt64(1, data.getId()); - for (int i = 0; i < rowEntries.size(); i++) { - output.writeBytes(2, rowEntries.get(i)); - } - output.checkNoSpaceLeft(); - return body; - } else if (!CollectionUtils.isEmpty(data.getEntries())) { - CanalPacket.Messages.Builder messageBuilder = CanalPacket.Messages.newBuilder(); - for (CanalEntry.Entry entry : data.getEntries()) { - messageBuilder.addMessages(entry.toByteString()); - } - - CanalPacket.Packet.Builder packetBuilder = CanalPacket.Packet.newBuilder(); - packetBuilder.setType(PacketType.MESSAGES); - packetBuilder.setBody(messageBuilder.build().toByteString()); - return packetBuilder.build().toByteArray(); - } - } - } - } catch (Exception e) { - throw new SerializationException("Error when serializing message to byte[] "); - } - return null; + return CanalMessageSerializer.serializer(data); } @Override diff --git a/server/src/main/java/com/alibaba/otter/canal/rocketmq/CanalRocketMQProducer.java b/server/src/main/java/com/alibaba/otter/canal/rocketmq/CanalRocketMQProducer.java new file mode 100644 index 00000000..87011250 --- /dev/null +++ b/server/src/main/java/com/alibaba/otter/canal/rocketmq/CanalRocketMQProducer.java @@ -0,0 +1,64 @@ +package com.alibaba.otter.canal.rocketmq; + +import com.alibaba.otter.canal.common.CanalMessageSerializer; +import com.alibaba.otter.canal.common.MQProperties; +import com.alibaba.otter.canal.server.exception.CanalServerException; +import com.alibaba.otter.canal.spi.CanalMQProducer; +import java.util.List; +import org.apache.rocketmq.client.exception.MQBrokerException; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.client.producer.MessageQueueSelector; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.common.message.MessageQueue; +import org.apache.rocketmq.remoting.exception.RemotingException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CanalRocketMQProducer implements CanalMQProducer { + private static final Logger logger = LoggerFactory.getLogger(CanalRocketMQProducer.class); + + private DefaultMQProducer defaultMQProducer; + + @Override + public void init(MQProperties rocketMQProperties) { + defaultMQProducer = new DefaultMQProducer(); + defaultMQProducer.setNamesrvAddr(rocketMQProperties.getServers()); + defaultMQProducer.setProducerGroup(rocketMQProperties.getProducerGroup()); + defaultMQProducer.setRetryTimesWhenSendFailed(rocketMQProperties.getRetries()); + logger.info("##Start RocketMQ producer##"); + try { + defaultMQProducer.start(); + } catch (MQClientException ex) { + throw new CanalServerException("Start RocketMQ producer error", ex); + } + } + + @Override + public void send(final MQProperties.CanalDestination destination, com.alibaba.otter.canal.protocol.Message data, + Callback callback) { + try { + Message message = new Message(destination.getTopic(), CanalMessageSerializer.serializer(data)); + this.defaultMQProducer.send(message, new MessageQueueSelector() { + @Override + public MessageQueue select(List mqs, Message msg, Object arg) { + int partition = 0; + if (destination.getPartition() != null) { + partition = destination.getPartition(); + } + return mqs.get(partition); + } + }, null); + callback.commit(); + } catch (MQClientException | RemotingException | MQBrokerException | InterruptedException e) { + logger.error("Send message error!", e); + callback.rollback(); + } + } + + @Override + public void stop() { + logger.info("## Stop RocketMQ producer##"); + this.defaultMQProducer.shutdown(); + } +} diff --git a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java b/server/src/main/java/com/alibaba/otter/canal/server/CanalMQStarter.java similarity index 65% rename from server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java rename to server/src/main/java/com/alibaba/otter/canal/server/CanalMQStarter.java index f2df3547..0510eec5 100644 --- a/server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java +++ b/server/src/main/java/com/alibaba/otter/canal/server/CanalMQStarter.java @@ -1,69 +1,66 @@ -package com.alibaba.otter.canal.kafka; +package com.alibaba.otter.canal.server; +import com.alibaba.otter.canal.common.MQProperties; +import com.alibaba.otter.canal.kafka.CanalKafkaProducer; +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.spi.CanalMQProducer; 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; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; -import com.alibaba.otter.canal.kafka.KafkaProperties.CanalDestination; -import com.alibaba.otter.canal.protocol.ClientIdentity; -import com.alibaba.otter.canal.protocol.Message; -import com.alibaba.otter.canal.server.CanalServerStarter; -import com.alibaba.otter.canal.server.embedded.CanalServerWithEmbedded; - -/** - * kafka 启动类 - * - * @author machengyuan 2018-6-11 下午05:30:49 - * @version 1.0.0 - */ -public class CanalKafkaStarter implements CanalServerStarter { - - private static final Logger logger = LoggerFactory.getLogger(CanalKafkaStarter.class); +public class CanalMQStarter { + private static final Logger logger = LoggerFactory.getLogger(CanalMQStarter.class); private static final String CLASSPATH_URL_PREFIX = "classpath:"; - private volatile boolean running = false; + private volatile boolean running = false; - private ExecutorService executorService; + private ExecutorService executorService; - private CanalKafkaProducer canalKafkaProducer; + private CanalMQProducer canalMQProducer; - private KafkaProperties kafkaProperties; + private MQProperties properties; + + public CanalMQStarter(CanalMQProducer canalMQProducer) { + this.canalMQProducer = canalMQProducer; + } public void init() { try { - logger.info("## load kafka configurations"); - String conf = System.getProperty("kafka.conf", "classpath:kafka.yml"); + logger.info("## load MQ configurations"); + String conf = System.getProperty("mq.conf", "classpath:mq.yml"); if (conf.startsWith(CLASSPATH_URL_PREFIX)) { conf = StringUtils.substringAfter(conf, CLASSPATH_URL_PREFIX); - kafkaProperties = new Yaml().loadAs(CanalKafkaStarter.class.getClassLoader().getResourceAsStream(conf), - KafkaProperties.class); + properties = new Yaml().loadAs(CanalMQStarter.class.getClassLoader().getResourceAsStream(conf), + MQProperties.class); } else { - kafkaProperties = new Yaml().loadAs(new FileInputStream(conf), KafkaProperties.class); + properties = new Yaml().loadAs(new FileInputStream(conf), MQProperties.class); } // 初始化 kafka producer - canalKafkaProducer = new CanalKafkaProducer(); - canalKafkaProducer.init(kafkaProperties); +// canalMQProducer = new CanalKafkaProducer(); + canalMQProducer.init(properties); // set filterTransactionEntry - // if (kafkaProperties.isFilterTransactionEntry()) { - // System.setProperty("canal.instance.filter.transaction.entry", "true"); - // } + if (properties.isFilterTransactionEntry()) { + System.setProperty("canal.instance.filter.transaction.entry", "true"); + } + // 对应每个instance启动一个worker线程 - List destinations = kafkaProperties.getCanalDestinations(); + List destinations = properties.getCanalDestinations(); executorService = Executors.newFixedThreadPool(destinations.size()); - logger.info("## start the kafka workers."); - for (final CanalDestination destination : destinations) { + logger.info("## start the MQ workers."); + for (final MQProperties.CanalDestination destination : destinations) { executorService.execute(new Runnable() { @Override @@ -73,31 +70,31 @@ public class CanalKafkaStarter implements CanalServerStarter { }); } running = true; - logger.info("## the kafka workers is running now ......"); + logger.info("## the MQ workers is running now ......"); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { try { - logger.info("## stop the kafka workers"); + logger.info("## stop the MQ workers"); running = false; executorService.shutdown(); - canalKafkaProducer.stop(); + canalMQProducer.stop(); } catch (Throwable e) { - logger.warn("##something goes wrong when stopping kafka workers:", e); + logger.warn("##something goes wrong when stopping MQ workers:", e); } finally { - logger.info("## canal kafka is down."); + logger.info("## canal MQ is down."); } } }); } catch (Throwable e) { - logger.error("## Something goes wrong when starting up the canal kafka workers:", e); + logger.error("## Something goes wrong when starting up the canal MQ workers:", e); System.exit(0); } } - private void worker(CanalDestination destination) { + private void worker(MQProperties.CanalDestination destination) { while (!running) ; logger.info("## start the canal consumer: {}.", destination.getCanalDestination()); @@ -118,20 +115,20 @@ public class CanalKafkaStarter implements CanalServerStarter { while (running) { Message message; - if (kafkaProperties.getCanalGetTimeout() != null) { + if (properties.getCanalGetTimeout() != null) { message = server.getWithoutAck(clientIdentity, - kafkaProperties.getCanalBatchSize(), - kafkaProperties.getCanalGetTimeout(), + properties.getCanalBatchSize(), + properties.getCanalGetTimeout(), TimeUnit.MILLISECONDS); } else { - message = server.getWithoutAck(clientIdentity, kafkaProperties.getCanalBatchSize()); + message = server.getWithoutAck(clientIdentity, properties.getCanalBatchSize()); } final long batchId = message.getId(); try { int size = message.isRaw() ? message.getRawEntries().size() : message.getEntries().size(); if (batchId != -1 && size != 0) { - canalKafkaProducer.send(destination, message, new CanalKafkaProducer.Callback() { + canalMQProducer.send(destination, message, new CanalKafkaProducer.Callback() { @Override public void commit() { diff --git a/server/src/main/java/com/alibaba/otter/canal/spi/CanalMQProducer.java b/server/src/main/java/com/alibaba/otter/canal/spi/CanalMQProducer.java new file mode 100644 index 00000000..895514c4 --- /dev/null +++ b/server/src/main/java/com/alibaba/otter/canal/spi/CanalMQProducer.java @@ -0,0 +1,36 @@ +package com.alibaba.otter.canal.spi; + +import com.alibaba.otter.canal.common.MQProperties; +import com.alibaba.otter.canal.kafka.CanalKafkaProducer; +import com.alibaba.otter.canal.protocol.Message; +import java.io.IOException; + +public interface CanalMQProducer { + /** + * Init producer. + * + * @param mqProperties MQ config + */ + void init(MQProperties mqProperties); + + /** + * Send canal message to related topic + * + * @param canalDestination canal mq destination + * @param message canal message + * @throws IOException + */ + void send(MQProperties.CanalDestination canalDestination, Message message, Callback callback) throws IOException; + + /** + * Stop MQ producer service + */ + void stop(); + + interface Callback { + + void commit(); + + void rollback(); + } +} \ No newline at end of file