diff --git a/README.md b/README.md index 8a3a7786..702d6f4d 100644 --- a/README.md +++ b/README.md @@ -80,3 +80,10 @@ See the wiki page for : wiki文
  • 新浪微博: agapple0002
  • 报告issue:issues
  • + +
    +【招聘】阿里巴巴中间件团队招聘JAVA高级工程师
    +岗位主要为技术型内容(非业务部门),阿里中间件整个体系对于未来想在技术上有所沉淀的同学还是非常有帮助的
    +工作地点:杭州、北京均可. ps. 阿里待遇向来都是不错的,有意者可以QQ、微博私聊. 
    +具体招聘内容:https://job.alibaba.com/zhaopin/position_detail.htm?positionId=32666
    +
    diff --git a/client/pom.xml b/client/pom.xml index b3dd8c4a..4b68d148 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java index d062b4ff..9fd1ca10 100644 --- a/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java +++ b/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java @@ -108,7 +108,7 @@ public class ClusterCanalConnector implements CanalConnector { return; } catch (Throwable t) { logger.warn("something goes wrong when subscribing from server:{}\n{}", - currentConnector.getAddress(), + currentConnector != null ? currentConnector.getAddress() : "null", ExceptionUtils.getFullStackTrace(t)); times++; restart(); @@ -127,7 +127,7 @@ public class ClusterCanalConnector implements CanalConnector { return; } catch (Throwable t) { logger.warn("something goes wrong when unsubscribing from server:{}\n{}", - currentConnector.getAddress(), + currentConnector != null ? currentConnector.getAddress() : "null", ExceptionUtils.getFullStackTrace(t)); times++; restart(); @@ -145,7 +145,7 @@ public class ClusterCanalConnector implements CanalConnector { return msg; } catch (Throwable t) { logger.warn("something goes wrong when getting data from server:{}\n{}", - currentConnector.getAddress(), + currentConnector != null ? currentConnector.getAddress() : "null", ExceptionUtils.getFullStackTrace(t)); times++; restart(); @@ -163,7 +163,7 @@ public class ClusterCanalConnector implements CanalConnector { return msg; } catch (Throwable t) { logger.warn("something goes wrong when getting data from server:{}\n{}", - currentConnector.getAddress(), + currentConnector != null ? currentConnector.getAddress() : "null", ExceptionUtils.getFullStackTrace(t)); times++; restart(); diff --git a/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterNodeAccessStrategy.java b/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterNodeAccessStrategy.java index 6b8aedc2..6461a974 100644 --- a/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterNodeAccessStrategy.java +++ b/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterNodeAccessStrategy.java @@ -114,5 +114,4 @@ public class ClusterNodeAccessStrategy implements CanalNodeAccessStrategy { return zkClient; } - } diff --git a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java index 96cfb618..3b25e5d2 100644 --- a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java +++ b/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java @@ -5,7 +5,11 @@ import java.net.InetSocketAddress; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.nio.channels.Channel; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; import java.nio.channels.SocketChannel; +import java.nio.channels.WritableByteChannel; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; @@ -37,7 +41,6 @@ import com.alibaba.otter.canal.protocol.ClientIdentity; import com.alibaba.otter.canal.protocol.Message; import com.alibaba.otter.canal.protocol.exception.CanalClientException; import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; /** * 基于{@linkplain CanalServerWithNetty}定义的网络协议接口,对于canal数据进行get/rollback/ack等操作 @@ -57,6 +60,8 @@ public class SimpleCanalConnector implements CanalConnector { private final ByteBuffer readHeader = ByteBuffer.allocate(4).order(ByteOrder.BIG_ENDIAN); private final ByteBuffer writeHeader = ByteBuffer.allocate(4).order(ByteOrder.BIG_ENDIAN); private SocketChannel channel; + private ReadableByteChannel readableChannel; + private WritableByteChannel writableChannel; private List supportedCompressions = new ArrayList(); private ClientIdentity clientIdentity; private ClientRunningMonitor runningMonitor; // 运行控制 @@ -130,7 +135,9 @@ public class SimpleCanalConnector implements CanalConnector { address = getNextAddress(); } channel.connect(address); - Packet p = Packet.parseFrom(readNextPacket(channel)); + readableChannel = Channels.newChannel(channel.socket().getInputStream()); + writableChannel = Channels.newChannel(channel.socket().getOutputStream()); + Packet p = Packet.parseFrom(readNextPacket()); if (p.getVersion() != 1) { throw new CanalClientException("unsupported version at this client."); } @@ -144,17 +151,17 @@ public class SimpleCanalConnector implements CanalConnector { // ClientAuth ca = ClientAuth.newBuilder() .setUsername(username != null ? username : "") + .setPassword(ByteString.copyFromUtf8(password != null ? password : "")) .setNetReadTimeout(soTimeout) .setNetWriteTimeout(soTimeout) .build(); - writeWithHeader(channel, - Packet.newBuilder() - .setType(PacketType.CLIENTAUTHENTICATION) - .setBody(ca.toByteString()) - .build() - .toByteArray()); + writeWithHeader(Packet.newBuilder() + .setType(PacketType.CLIENTAUTHENTICATION) + .setBody(ca.toByteString()) + .build() + .toByteArray()); // - Packet ack = Packet.parseFrom(readNextPacket(channel)); + Packet ack = Packet.parseFrom(readNextPacket()); if (ack.getType() != PacketType.ACK) { throw new CanalClientException("unexpected packet type when ack is expected"); } @@ -173,16 +180,28 @@ public class SimpleCanalConnector implements CanalConnector { } private void doDisconnnect() throws CanalClientException { + if (readableChannel != null) { + quietlyClose(readableChannel); + readableChannel = null; + } + if (writableChannel != null) { + quietlyClose(writableChannel); + writableChannel = null; + } if (channel != null) { - try { - channel.close(); - } catch (IOException e) { - logger.warn("exception on closing channel:{} \n {}", channel, e); - } + quietlyClose(channel); channel = null; } } + private void quietlyClose(Channel channel) { + try { + channel.close(); + } catch (IOException e) { + logger.warn("exception on closing channel:{} \n {}", channel, e); + } + } + public void subscribe() throws CanalClientException { subscribe(""); // 传递空字符即可 } @@ -190,19 +209,18 @@ public class SimpleCanalConnector implements CanalConnector { public void subscribe(String filter) throws CanalClientException { waitClientRunning(); try { - writeWithHeader(channel, - Packet.newBuilder() - .setType(PacketType.SUBSCRIPTION) - .setBody(Sub.newBuilder() - .setDestination(clientIdentity.getDestination()) - .setClientId(String.valueOf(clientIdentity.getClientId())) - .setFilter(filter != null ? filter : "") - .build() - .toByteString()) + writeWithHeader(Packet.newBuilder() + .setType(PacketType.SUBSCRIPTION) + .setBody(Sub.newBuilder() + .setDestination(clientIdentity.getDestination()) + .setClientId(String.valueOf(clientIdentity.getClientId())) + .setFilter(filter != null ? filter : "") .build() - .toByteArray()); + .toByteString()) + .build() + .toByteArray()); // - Packet p = Packet.parseFrom(readNextPacket(channel)); + Packet p = Packet.parseFrom(readNextPacket()); Ack ack = Ack.parseFrom(p.getBody()); if (ack.getErrorCode() > 0) { throw new CanalClientException("failed to subscribe with reason: " + ack.getErrorMessage()); @@ -217,18 +235,17 @@ public class SimpleCanalConnector implements CanalConnector { public void unsubscribe() throws CanalClientException { waitClientRunning(); try { - writeWithHeader(channel, - Packet.newBuilder() - .setType(PacketType.UNSUBSCRIPTION) - .setBody(Unsub.newBuilder() - .setDestination(clientIdentity.getDestination()) - .setClientId(String.valueOf(clientIdentity.getClientId())) - .build() - .toByteString()) + writeWithHeader(Packet.newBuilder() + .setType(PacketType.UNSUBSCRIPTION) + .setBody(Unsub.newBuilder() + .setDestination(clientIdentity.getDestination()) + .setClientId(String.valueOf(clientIdentity.getClientId())) .build() - .toByteArray()); + .toByteString()) + .build() + .toByteArray()); // - Packet p = Packet.parseFrom(readNextPacket(channel)); + Packet p = Packet.parseFrom(readNextPacket()); Ack ack = Ack.parseFrom(p.getBody()); if (ack.getErrorCode() > 0) { throw new CanalClientException("failed to unSubscribe with reason: " + ack.getErrorMessage()); @@ -261,29 +278,27 @@ public class SimpleCanalConnector implements CanalConnector { unit = TimeUnit.MILLISECONDS; } - writeWithHeader(channel, - Packet.newBuilder() - .setType(PacketType.GET) - .setBody(Get.newBuilder() - .setAutoAck(false) - .setDestination(clientIdentity.getDestination()) - .setClientId(String.valueOf(clientIdentity.getClientId())) - .setFetchSize(size) - .setTimeout(time) - .setUnit(unit.ordinal()) - .build() - .toByteString()) + writeWithHeader(Packet.newBuilder() + .setType(PacketType.GET) + .setBody(Get.newBuilder() + .setAutoAck(false) + .setDestination(clientIdentity.getDestination()) + .setClientId(String.valueOf(clientIdentity.getClientId())) + .setFetchSize(size) + .setTimeout(time) + .setUnit(unit.ordinal()) .build() - .toByteArray()); - + .toByteString()) + .build() + .toByteArray()); return receiveMessages(); } catch (IOException e) { throw new CanalClientException(e); } } - private Message receiveMessages() throws InvalidProtocolBufferException, IOException { - Packet p = Packet.parseFrom(readNextPacket(channel)); + private Message receiveMessages() throws IOException { + Packet p = Packet.parseFrom(readNextPacket()); switch (p.getType()) { case MESSAGES: { if (!p.getCompression().equals(Compression.NONE)) { @@ -315,7 +330,7 @@ public class SimpleCanalConnector implements CanalConnector { .setBatchId(batchId) .build(); try { - writeWithHeader(channel, Packet.newBuilder() + writeWithHeader(Packet.newBuilder() .setType(PacketType.CLIENTACK) .setBody(ca.toByteString()) .build() @@ -333,7 +348,7 @@ public class SimpleCanalConnector implements CanalConnector { .setBatchId(batchId) .build(); try { - writeWithHeader(channel, Packet.newBuilder() + writeWithHeader(Packet.newBuilder() .setType(PacketType.CLIENTROLLBACK) .setBody(ca.toByteString()) .build() @@ -350,7 +365,15 @@ public class SimpleCanalConnector implements CanalConnector { // ==================== helper method ==================== - private void writeWithHeader(SocketChannel channel, byte[] body) throws IOException { + private void writeWithHeader(byte[] body) throws IOException { + writeWithHeader(writableChannel, body); + } + + private byte[] readNextPacket() throws IOException { + return readNextPacket(readableChannel); + } + + private void writeWithHeader(WritableByteChannel channel, byte[] body) throws IOException { synchronized (writeDataLock) { writeHeader.clear(); writeHeader.putInt(body.length); @@ -360,7 +383,7 @@ public class SimpleCanalConnector implements CanalConnector { } } - private byte[] readNextPacket(SocketChannel channel) throws IOException { + private byte[] readNextPacket(ReadableByteChannel channel) throws IOException { synchronized (readDataLock) { readHeader.clear(); read(channel, readHeader); @@ -371,7 +394,7 @@ public class SimpleCanalConnector implements CanalConnector { } } - private void read(SocketChannel channel, ByteBuffer buffer) throws IOException { + private void read(ReadableByteChannel channel, ByteBuffer buffer) throws IOException { while (buffer.hasRemaining()) { int r = channel.read(buffer); if (r == -1) { diff --git a/common/pom.xml b/common/pom.xml index 537a3406..6a6df57b 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml canal.common @@ -11,13 +11,18 @@ canal common module for otter ${project.version} http://b2b-doc.alibaba-inc.com/display/opentech/Otter + + + io.netty + netty-all + org.apache.zookeeper zookeeper - com.github.sgroschupf + com.101tec zkclient @@ -28,7 +33,6 @@ commons-lang commons-lang - 2.6 org.springframework @@ -61,8 +65,8 @@ - junit - junit + junit + junit - + diff --git a/common/src/main/java/com/alibaba/otter/canal/common/utils/JsonUtils.java b/common/src/main/java/com/alibaba/otter/canal/common/utils/JsonUtils.java index 1d82fb86..5b42683d 100644 --- a/common/src/main/java/com/alibaba/otter/canal/common/utils/JsonUtils.java +++ b/common/src/main/java/com/alibaba/otter/canal/common/utils/JsonUtils.java @@ -88,8 +88,9 @@ public class JsonUtils { public static InetAddressSerializer instance = new InetAddressSerializer(); - public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) - throws IOException { + @Override + public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) + throws IOException { if (object == null) { serializer.writeNull(); return; diff --git a/common/src/main/java/com/alibaba/otter/canal/common/zookeeper/ZooKeeperx.java b/common/src/main/java/com/alibaba/otter/canal/common/zookeeper/ZooKeeperx.java index a3b68dae..15275b20 100644 --- a/common/src/main/java/com/alibaba/otter/canal/common/zookeeper/ZooKeeperx.java +++ b/common/src/main/java/com/alibaba/otter/canal/common/zookeeper/ZooKeeperx.java @@ -8,20 +8,15 @@ import java.util.List; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import org.I0Itec.zkclient.IZkConnection; +import org.I0Itec.zkclient.ZkConnection; import org.I0Itec.zkclient.exception.ZkException; import org.apache.commons.lang.StringUtils; import org.apache.zookeeper.ClientCnxn; -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.Watcher; -import org.apache.zookeeper.ZooDefs.Ids; import org.apache.zookeeper.ZooKeeper; -import org.apache.zookeeper.ZooKeeper.States; import org.apache.zookeeper.client.ConnectStringParser; import org.apache.zookeeper.client.HostProvider; import org.apache.zookeeper.client.StaticHostProvider; -import org.apache.zookeeper.data.Stat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.ReflectionUtils; @@ -32,7 +27,7 @@ import org.springframework.util.ReflectionUtils; * @author jianghang 2012-7-10 下午02:31:42 * @version 1.0.0 */ -public class ZooKeeperx implements IZkConnection { +public class ZooKeeperx extends ZkConnection { private static final String SERVER_COMMA = ";"; private static final Logger logger = LoggerFactory.getLogger(ZooKeeperx.class); @@ -40,12 +35,12 @@ public class ZooKeeperx implements IZkConnection { private static final Field hostProviderField = ReflectionUtils.findField(ClientCnxn.class, "hostProvider"); private static final Field serverAddressesField = ReflectionUtils.findField(StaticHostProvider.class, "serverAddresses"); + private static final Field zookeeperLockField = ReflectionUtils.findField(ZkConnection.class, + "_zookeeperLock"); + private static final Field zookeeperFiled = ReflectionUtils.findField(ZkConnection.class, "_zk"); private static final int DEFAULT_SESSION_TIMEOUT = 90000; - private ZooKeeper _zk = null; - private Lock _zookeeperLock = new ReentrantLock(); - - private final List _servers; + private final List _serversList; private final int _sessionTimeOut; public ZooKeeperx(String zkServers){ @@ -53,109 +48,55 @@ public class ZooKeeperx implements IZkConnection { } public ZooKeeperx(String zkServers, int sessionTimeOut){ - _servers = Arrays.asList(StringUtils.split(zkServers, SERVER_COMMA)); + super(zkServers, sessionTimeOut); + _serversList = Arrays.asList(StringUtils.split(this.getServers(), SERVER_COMMA)); _sessionTimeOut = sessionTimeOut; } @Override public void connect(Watcher watcher) { + ReflectionUtils.makeAccessible(zookeeperLockField); + ReflectionUtils.makeAccessible(zookeeperFiled); + Lock _zookeeperLock = (ReentrantLock) ReflectionUtils.getField(zookeeperLockField, this); + ZooKeeper _zk = (ZooKeeper) ReflectionUtils.getField(zookeeperFiled, this); + _zookeeperLock.lock(); try { if (_zk != null) { throw new IllegalStateException("zk client has already been started"); } + String zkServers = _serversList.get(0); try { - logger.debug("Creating new ZookKeeper instance to connect to " + _servers + "."); - _zk = new ZooKeeper(_servers.get(0), _sessionTimeOut, watcher); + logger.debug("Creating new ZookKeeper instance to connect to " + zkServers + "."); + _zk = new ZooKeeper(zkServers, _sessionTimeOut, watcher); configMutliCluster(_zk); + ReflectionUtils.setField(zookeeperFiled, this, _zk); } catch (IOException e) { - throw new ZkException("Unable to connect to " + _servers, e); + throw new ZkException("Unable to connect to " + zkServers, e); } } finally { _zookeeperLock.unlock(); } } - public void close() throws InterruptedException { - _zookeeperLock.lock(); - try { - if (_zk != null) { - logger.debug("Closing ZooKeeper connected to " + _servers); - _zk.close(); - _zk = null; - } - } finally { - _zookeeperLock.unlock(); - } - } - - public String create(String path, byte[] data, CreateMode mode) throws KeeperException, InterruptedException { - return _zk.create(path, data, Ids.OPEN_ACL_UNSAFE, mode); - } - - public void delete(String path) throws InterruptedException, KeeperException { - _zk.delete(path, -1); - } - - public boolean exists(String path, boolean watch) throws KeeperException, InterruptedException { - return _zk.exists(path, watch) != null; - } - - public List getChildren(final String path, final boolean watch) throws KeeperException, - InterruptedException { - return _zk.getChildren(path, watch); - } - - public byte[] readData(String path, Stat stat, boolean watch) throws KeeperException, InterruptedException { - return _zk.getData(path, watch, stat); - } - - public void writeData(String path, byte[] data) throws KeeperException, InterruptedException { - writeData(path, data, -1); - } - - public void writeData(String path, byte[] data, int version) throws KeeperException, InterruptedException { - _zk.setData(path, data, version); - } - - public States getZookeeperState() { - return _zk != null ? _zk.getState() : null; - } - - public ZooKeeper getZookeeper() { - return _zk; - } - - public long getCreateTime(String path) throws KeeperException, InterruptedException { - Stat stat = _zk.exists(path, false); - if (stat != null) { - return stat.getCtime(); - } - return -1; - } - - public String getServers() { - return StringUtils.join(_servers, SERVER_COMMA); - } - // =============================== public void configMutliCluster(ZooKeeper zk) { - if (_servers.size() == 1) { + if (_serversList.size() == 1) { return; } - String cluster1 = _servers.get(0); + String cluster1 = _serversList.get(0); try { - if (_servers.size() > 1) { + if (_serversList.size() > 1) { // 强制的声明accessible ReflectionUtils.makeAccessible(clientCnxnField); ReflectionUtils.makeAccessible(hostProviderField); ReflectionUtils.makeAccessible(serverAddressesField); // 添加第二组集群列表 - for (int i = 1; i < _servers.size(); i++) { - String cluster = _servers.get(i); + for (int i = 1; i < _serversList.size(); i++) { + String cluster = _serversList.get(i); // 强制获取zk中的地址信息 ClientCnxn cnxn = (ClientCnxn) ReflectionUtils.getField(clientCnxnField, zk); HostProvider hostProvider = (HostProvider) ReflectionUtils.getField(hostProviderField, cnxn); diff --git a/dbsync/pom.xml b/dbsync/pom.xml index 37881fe7..f3d7f62a 100644 --- a/dbsync/pom.xml +++ b/dbsync/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/JsonConversion.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/JsonConversion.java index b4b1ad7c..251e458f 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/JsonConversion.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/JsonConversion.java @@ -52,23 +52,24 @@ public class JsonConversion { public static final int VALUE_ENTRY_SIZE_SMALL = (1 + SMALL_OFFSET_SIZE); public static final int VALUE_ENTRY_SIZE_LARGE = (1 + LARGE_OFFSET_SIZE); - public static Json_Value parse_value(int type, LogBuffer buffer, long len) { + public static Json_Value parse_value(int type, LogBuffer buffer, long len, String charsetName) { buffer = buffer.duplicate(buffer.position(), (int) len); switch (type) { case JSONB_TYPE_SMALL_OBJECT: - return parse_array_or_object(Json_enum_type.OBJECT, buffer, len, false); + return parse_array_or_object(Json_enum_type.OBJECT, buffer, len, false, charsetName); case JSONB_TYPE_LARGE_OBJECT: - return parse_array_or_object(Json_enum_type.OBJECT, buffer, len, true); + return parse_array_or_object(Json_enum_type.OBJECT, buffer, len, true, charsetName); case JSONB_TYPE_SMALL_ARRAY: - return parse_array_or_object(Json_enum_type.ARRAY, buffer, len, false); + return parse_array_or_object(Json_enum_type.ARRAY, buffer, len, false, charsetName); case JSONB_TYPE_LARGE_ARRAY: - return parse_array_or_object(Json_enum_type.ARRAY, buffer, len, true); + return parse_array_or_object(Json_enum_type.ARRAY, buffer, len, true, charsetName); default: - return parse_scalar(type, buffer, len); + return parse_scalar(type, buffer, len, charsetName); } } - private static Json_Value parse_array_or_object(Json_enum_type type, LogBuffer buffer, long len, boolean large) { + private static Json_Value parse_array_or_object(Json_enum_type type, LogBuffer buffer, long len, boolean large, + String charsetName) { long offset_size = large ? LARGE_OFFSET_SIZE : SMALL_OFFSET_SIZE; if (len < 2 * offset_size) { throw new IllegalArgumentException("illegal json data"); @@ -95,7 +96,7 @@ public class JsonConversion { return large ? buffer.getUint32() : buffer.getUint16(); } - private static Json_Value parse_scalar(int type, LogBuffer buffer, long len) { + private static Json_Value parse_scalar(int type, LogBuffer buffer, long len, String charsetName) { switch (type) { case JSONB_TYPE_LITERAL: /* purecov: inspected */ @@ -146,12 +147,12 @@ public class JsonConversion { } } - if (str_len == 0 || len < n + str_len) { + if (len < n + str_len) { throw new IllegalArgumentException("illegal json data"); } return new Json_Value(Json_enum_type.STRING, buffer.rewind() .forward((int) n) - .getFixString((int) str_len)); + .getFixString((int) str_len, charsetName)); case JSONB_TYPE_OPAQUE: /* * There should always be at least one byte, which tells the @@ -237,7 +238,7 @@ public class JsonConversion { this.m_large = large; } - public String key(int i) { + public String key(int i, String charsetName) { m_data.rewind(); int offset_size = m_large ? LARGE_OFFSET_SIZE : SMALL_OFFSET_SIZE; int key_entry_size = m_large ? KEY_ENTRY_SIZE_LARGE : KEY_ENTRY_SIZE_SMALL; @@ -250,10 +251,10 @@ public class JsonConversion { // entry, always two // bytes. long key_length = m_data.getUint16(); - return m_data.rewind().forward((int) key_offset).getFixString((int) key_length); + return m_data.rewind().forward((int) key_offset).getFixString((int) key_length, charsetName); } - public Json_Value element(int i) { + public Json_Value element(int i, String charsetName) { m_data.rewind(); int offset_size = m_large ? LARGE_OFFSET_SIZE : SMALL_OFFSET_SIZE; int key_entry_size = m_large ? KEY_ENTRY_SIZE_LARGE : KEY_ENTRY_SIZE_SMALL; @@ -266,13 +267,13 @@ public class JsonConversion { int type = m_data.forward(entry_offset).getUint8(); if (type == JSONB_TYPE_INT16 || type == JSONB_TYPE_UINT16 || type == JSONB_TYPE_LITERAL || (m_large && (type == JSONB_TYPE_INT32 || type == JSONB_TYPE_UINT32))) { - return parse_scalar(type, m_data, value_entry_size - 1); + return parse_scalar(type, m_data, value_entry_size - 1, charsetName); } int value_offset = (int) read_offset_or_size(m_data, m_large); - return parse_value(type, m_data.rewind().forward(value_offset), (int) m_length - value_offset); + return parse_value(type, m_data.rewind().forward(value_offset), (int) m_length - value_offset, charsetName); } - public StringBuilder toJsonString(StringBuilder buf) { + public StringBuilder toJsonString(StringBuilder buf, String charsetName) { switch (m_type) { case OBJECT: buf.append("{"); @@ -280,9 +281,9 @@ public class JsonConversion { if (i > 0) { buf.append(", "); } - buf.append('"').append(key(i)).append('"'); + buf.append('"').append(key(i, charsetName)).append('"'); buf.append(": "); - element(i).toJsonString(buf); + element(i, charsetName).toJsonString(buf, charsetName); } buf.append("}"); break; @@ -292,7 +293,7 @@ public class JsonConversion { if (i > 0) { buf.append(", "); } - element(i).toJsonString(buf); + element(i, charsetName).toJsonString(buf, charsetName); } buf.append("]"); break; @@ -361,7 +362,7 @@ public class JsonConversion { } buf.append('"').append(text).append('"'); } else { - text = m_data.getFixString((int) m_length); + text = m_data.getFixString((int) m_length, charsetName); buf.append('"').append(text).append('"'); } diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java index 6bae7d1a..f81660fa 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java @@ -168,8 +168,8 @@ public class LogBuffer { * @param newLimit The new limit value; must be non-negative and no larger * than this buffer's capacity * @return This buffer - * @throws IllegalArgumentException If the preconditions on newLimit - * do not hold + * @throws IllegalArgumentException If the preconditions on + * newLimit do not hold */ public final LogBuffer limit(int newLimit) { if (origin + newLimit > buffer.length || newLimit < 0) throw new IllegalArgumentException("capacity excceed: " diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/FormatDescriptionLogEvent.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/FormatDescriptionLogEvent.java index 279db972..267ee2a4 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/FormatDescriptionLogEvent.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/FormatDescriptionLogEvent.java @@ -140,15 +140,15 @@ public final class FormatDescriptionLogEvent extends StartLogEventV3 { throw new IOException("Unknown binlog version: " + binlogVersion); } } - - public FormatDescriptionLogEvent(final int binlogVersion,int binlogChecksum){ - this(binlogVersion); - this.header.checksumAlg = binlogChecksum; + + public FormatDescriptionLogEvent(final int binlogVersion, int binlogChecksum){ + this(binlogVersion); + this.header.checksumAlg = binlogChecksum; } - + public FormatDescriptionLogEvent(final int binlogVersion){ this.binlogVersion = binlogVersion; - + postHeaderLen = new short[ENUM_END_EVENT]; /* identify binlog format */ switch (binlogVersion) { diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/QueryLogEvent.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/QueryLogEvent.java index 7f2b8fc5..f6e0459c 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/QueryLogEvent.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/QueryLogEvent.java @@ -330,17 +330,14 @@ public class QueryLogEvent extends LogEvent { * MariaDb type, * sec_part of NOW() */ - + 1 + (MAX_DBS_IN_EVENT_MTS * (1 + NAME_LEN)) + 3 + 1 + 16 + 1 + 60/* - * type - * , - * user_len - * , - * user - * , - * host_len - * , - * host - */); + + 1 + (MAX_DBS_IN_EVENT_MTS * (1 + NAME_LEN)) + 3 + 1 + 32 * 3 + + 1 + 60/* + * type , + * user_len , + * user , + * host_len , + * host + */); /** * Fixed data part: *
      @@ -397,7 +394,7 @@ public class QueryLogEvent extends LogEvent { // inspection by the DBA private final long execTime; private final int errorCode; - private final long sessionId; /* thread_id */ + private final long sessionId; /* thread_id */ /** * 'flags2' is a second set of flags (on top of those in Log_event), for @@ -499,26 +496,26 @@ public class QueryLogEvent extends LogEvent { } /* query event post-header */ - public static final int Q_THREAD_ID_OFFSET = 0; - public static final int Q_EXEC_TIME_OFFSET = 4; - public static final int Q_DB_LEN_OFFSET = 8; - public static final int Q_ERR_CODE_OFFSET = 9; - public static final int Q_STATUS_VARS_LEN_OFFSET = 11; - public static final int Q_DATA_OFFSET = QUERY_HEADER_LEN; + public static final int Q_THREAD_ID_OFFSET = 0; + public static final int Q_EXEC_TIME_OFFSET = 4; + public static final int Q_DB_LEN_OFFSET = 8; + public static final int Q_ERR_CODE_OFFSET = 9; + public static final int Q_STATUS_VARS_LEN_OFFSET = 11; + public static final int Q_DATA_OFFSET = QUERY_HEADER_LEN; /* these are codes, not offsets; not more than 256 values (1 byte). */ - public static final int Q_FLAGS2_CODE = 0; - public static final int Q_SQL_MODE_CODE = 1; + public static final int Q_FLAGS2_CODE = 0; + public static final int Q_SQL_MODE_CODE = 1; /** * Q_CATALOG_CODE is catalog with end zero stored; it is used only by MySQL * 5.0.x where 0<=x<=3. We have to keep it to be able to replicate these old * masters. */ - public static final int Q_CATALOG_CODE = 2; - public static final int Q_AUTO_INCREMENT = 3; - public static final int Q_CHARSET_CODE = 4; - public static final int Q_TIME_ZONE_CODE = 5; + public static final int Q_CATALOG_CODE = 2; + public static final int Q_AUTO_INCREMENT = 3; + public static final int Q_CHARSET_CODE = 4; + public static final int Q_TIME_ZONE_CODE = 5; /** * Q_CATALOG_NZ_CODE is catalog withOUT end zero stored; it is used by MySQL @@ -528,31 +525,47 @@ public class QueryLogEvent extends LogEvent { * would crash (segfault etc) because it would expect a 0 when there is * none. */ - public static final int Q_CATALOG_NZ_CODE = 6; + public static final int Q_CATALOG_NZ_CODE = 6; - public static final int Q_LC_TIME_NAMES_CODE = 7; + public static final int Q_LC_TIME_NAMES_CODE = 7; - public static final int Q_CHARSET_DATABASE_CODE = 8; + public static final int Q_CHARSET_DATABASE_CODE = 8; - public static final int Q_TABLE_MAP_FOR_UPDATE_CODE = 9; + public static final int Q_TABLE_MAP_FOR_UPDATE_CODE = 9; - public static final int Q_MASTER_DATA_WRITTEN_CODE = 10; + public static final int Q_MASTER_DATA_WRITTEN_CODE = 10; - public static final int Q_INVOKER = 11; + public static final int Q_INVOKER = 11; /** * Q_UPDATED_DB_NAMES status variable collects of the updated databases * total number and their names to be propagated to the slave in order to * facilitate the parallel applying of the Query events. */ - public static final int Q_UPDATED_DB_NAMES = 12; + public static final int Q_UPDATED_DB_NAMES = 12; - public static final int Q_MICROSECONDS = 13; + public static final int Q_MICROSECONDS = 13; + /** + * A old (unused now) code for Query_log_event status similar to + * G_COMMIT_TS. + */ + public static final int Q_COMMIT_TS = 14; + /** + * A code for Query_log_event status, similar to G_COMMIT_TS2. + */ + public static final int Q_COMMIT_TS2 = 15; + /** + * The master connection @@session.explicit_defaults_for_timestamp which is + * recorded for queries, CREATE and ALTER table that is defined with a + * TIMESTAMP column, that are dependent on that feature. For pre-WL6292 + * master's the associated with this code value is zero. + */ + public static final int Q_EXPLICIT_DEFAULTS_FOR_TIMESTAMP = 16; /** * FROM MariaDB 5.5.34 */ - public static final int Q_HRNOW = 128; + public static final int Q_HRNOW = 128; private final void unpackVariables(LogBuffer buffer, final int end) throws IOException { int code = -1; @@ -632,6 +645,9 @@ public class QueryLogEvent extends LogEvent { mtsAccessedDbNames[i] = buffer.getFixString(length < NAME_LEN ? length : NAME_LEN); } break; + case Q_EXPLICIT_DEFAULTS_FOR_TIMESTAMP: + buffer.forward(1); + break; case Q_HRNOW: // int when_sec_part = buffer.getUint24(); buffer.forward(3); diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RotateLogEvent.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RotateLogEvent.java index e79c8b0d..6aef177d 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RotateLogEvent.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RotateLogEvent.java @@ -90,7 +90,7 @@ public final class RotateLogEvent extends LogEvent { int filenameLen = buffer.limit() - filenameOffset; if (filenameLen > FN_REFLEN - 1) filenameLen = FN_REFLEN - 1; buffer.position(filenameOffset); - + filename = buffer.getFixString(filenameLen); } diff --git a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java index a2c58493..2456f358 100644 --- a/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java +++ b/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java @@ -952,9 +952,9 @@ public final class RowsLogBuffer { len = buffer.getUint16(); buffer.forward(meta - 2); int position = buffer.position(); - Json_Value jsonValue = JsonConversion.parse_value(buffer.getUint8(), buffer, len - 1); + Json_Value jsonValue = JsonConversion.parse_value(buffer.getUint8(), buffer, len - 1, charsetName); StringBuilder builder = new StringBuilder(); - jsonValue.toJsonString(builder); + jsonValue.toJsonString(builder, charsetName); value = builder.toString(); buffer.position(position + len); // byte[] binary = new byte[len]; diff --git a/deployer/pom.xml b/deployer/pom.xml index 3d76c164..4c20ff43 100644 --- a/deployer/pom.xml +++ b/deployer/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java b/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java index a5ff5b8f..dff994cb 100644 --- a/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java +++ b/deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java @@ -149,6 +149,11 @@ public class CanalController { public void handleNewSession() throws Exception { initCid(path); } + + @Override + public void handleSessionEstablishmentError(Throwable error) throws Exception { + logger.error("failed to connect to zookeeper", error); + } }); } } finally { @@ -383,6 +388,11 @@ public class CanalController { public void handleNewSession() throws Exception { initCid(path); } + + @Override + public void handleSessionEstablishmentError(Throwable error) throws Exception { + logger.error("failed to connect to zookeeper", error); + } }); } // 优先启动embeded服务 diff --git a/deployer/src/main/java/com/alibaba/otter/canal/deployer/monitor/SpringInstanceConfigMonitor.java b/deployer/src/main/java/com/alibaba/otter/canal/deployer/monitor/SpringInstanceConfigMonitor.java index ba656b7f..864753ab 100644 --- a/deployer/src/main/java/com/alibaba/otter/canal/deployer/monitor/SpringInstanceConfigMonitor.java +++ b/deployer/src/main/java/com/alibaba/otter/canal/deployer/monitor/SpringInstanceConfigMonitor.java @@ -49,6 +49,8 @@ public class SpringInstanceConfigMonitor extends AbstractCanalLifeCycle implemen private ScheduledExecutorService executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("canal-instance-scan")); + private volatile boolean isFirst = true; + public void start() { super.start(); Assert.notNull(rootConf, "root conf dir is null!"); @@ -58,6 +60,9 @@ public class SpringInstanceConfigMonitor extends AbstractCanalLifeCycle implemen public void run() { try { scan(); + if (isFirst) { + isFirst = false; + } } catch (Throwable e) { logger.error("scan failed", e); } @@ -122,13 +127,18 @@ public class SpringInstanceConfigMonitor extends AbstractCanalLifeCycle implemen if (!actions.containsKey(destination) && instanceConfigs.length > 0) { // 存在合法的instance.properties,并且第一次添加时,进行启动操作 - notifyStart(instanceDir, destination); + notifyStart(instanceDir, destination, instanceConfigs); } else if (actions.containsKey(destination)) { // 历史已经启动过 if (instanceConfigs.length == 0) { // 如果不存在合法的instance.properties notifyStop(destination); } else { InstanceConfigFiles lastFile = lastFiles.get(destination); + // 历史启动过 所以配置文件信息必然存在 + if (!isFirst && CollectionUtils.isEmpty(lastFile.getInstanceFiles())) { + logger.error("[{}] is started, but not found instance file info.", destination); + } + boolean hasChanged = judgeFileChanged(instanceConfigs, lastFile.getInstanceFiles()); // 通知变化 if (hasChanged) { @@ -161,10 +171,19 @@ public class SpringInstanceConfigMonitor extends AbstractCanalLifeCycle implemen } } - private void notifyStart(File instanceDir, String destination) { + private void notifyStart(File instanceDir, String destination, File[] instanceConfigs) { try { defaultAction.start(destination); actions.put(destination, defaultAction); + + // 启动成功后记录配置文件信息 + InstanceConfigFiles lastFile = lastFiles.get(destination); + List newFileInfo = new ArrayList(); + for (File instanceConfig : instanceConfigs) { + newFileInfo.add(new FileInfo(instanceConfig.getName(), instanceConfig.lastModified())); + } + lastFile.setInstanceFiles(newFileInfo); + logger.info("auto notify start {} successful.", destination); } catch (Throwable e) { logger.error("scan add found[{}] but start failed", destination, ExceptionUtils.getFullStackTrace(e)); diff --git a/deployer/src/main/resources/logback.xml b/deployer/src/main/resources/logback.xml index 0d34e3f5..3d1e7a69 100644 --- a/deployer/src/main/resources/logback.xml +++ b/deployer/src/main/resources/logback.xml @@ -75,9 +75,7 @@ - + \ No newline at end of file diff --git a/deployer/src/main/resources/spring/default-instance.xml b/deployer/src/main/resources/spring/default-instance.xml index 4e092257..5631b7cb 100644 --- a/deployer/src/main/resources/spring/default-instance.xml +++ b/deployer/src/main/resources/spring/default-instance.xml @@ -128,14 +128,14 @@ - + - - + + - + - + diff --git a/deployer/src/main/resources/spring/file-instance.xml b/deployer/src/main/resources/spring/file-instance.xml index 191d0c11..b5fcc908 100644 --- a/deployer/src/main/resources/spring/file-instance.xml +++ b/deployer/src/main/resources/spring/file-instance.xml @@ -113,14 +113,14 @@ - + - - + + - + - + diff --git a/deployer/src/main/resources/spring/local-instance.xml b/deployer/src/main/resources/spring/local-instance.xml index 52cdf404..e5e4e695 100644 --- a/deployer/src/main/resources/spring/local-instance.xml +++ b/deployer/src/main/resources/spring/local-instance.xml @@ -123,14 +123,14 @@ - + - - + + - + - + diff --git a/driver/pom.xml b/driver/pom.xml index 9b7f0826..66e59ab7 100644 --- a/driver/pom.xml +++ b/driver/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter @@ -33,10 +33,6 @@ org.slf4j slf4j-api - - org.jboss.netty - netty - junit diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnector.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnector.java index 6a5a4ae6..a05c3b19 100644 --- a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnector.java +++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnector.java @@ -2,8 +2,6 @@ package com.alibaba.otter.canal.parse.driver.mysql; import java.io.IOException; import java.net.InetSocketAddress; -import java.nio.ByteBuffer; -import java.nio.channels.SocketChannel; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.lang.exception.ExceptionUtils; @@ -16,6 +14,8 @@ import com.alibaba.otter.canal.parse.driver.mysql.packets.client.QuitCommandPack import com.alibaba.otter.canal.parse.driver.mysql.packets.server.ErrorPacket; import com.alibaba.otter.canal.parse.driver.mysql.packets.server.HandshakeInitializationPacket; import com.alibaba.otter.canal.parse.driver.mysql.packets.server.Reply323Packet; +import com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannel; +import com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannelPool; import com.alibaba.otter.canal.parse.driver.mysql.utils.MySQLPasswordEncrypter; import com.alibaba.otter.canal.parse.driver.mysql.utils.PacketManager; @@ -27,22 +27,22 @@ import com.alibaba.otter.canal.parse.driver.mysql.utils.PacketManager; */ public class MysqlConnector { - private static final Logger logger = LoggerFactory.getLogger(MysqlConnector.class); - private InetSocketAddress address; - private String username; - private String password; + private static final Logger logger = LoggerFactory.getLogger(MysqlConnector.class); + private InetSocketAddress address; + private String username; + private String password; - private byte charsetNumber = 33; - private String defaultSchema = "retl"; - private int soTimeout = 30 * 1000; - private int receiveBufferSize = 16 * 1024; - private int sendBufferSize = 16 * 1024; + private byte charsetNumber = 33; + private String defaultSchema = "retl"; + private int soTimeout = 30 * 1000; + private int receiveBufferSize = 16 * 1024; + private int sendBufferSize = 16 * 1024; - private SocketChannel channel; - private volatile boolean dumping = false; + private SocketChannel channel; + private volatile boolean dumping = false; // mysql connectinnId - private long connectionId = -1; - private AtomicBoolean connected = new AtomicBoolean(false); + private long connectionId = -1; + private AtomicBoolean connected = new AtomicBoolean(false); public MysqlConnector(){ } @@ -64,10 +64,8 @@ public class MysqlConnector { public void connect() throws IOException { if (connected.compareAndSet(false, true)) { try { - channel = SocketChannel.open(); - configChannel(channel); + channel = SocketChannelPool.open(address); logger.info("connect MysqlConnection to {}...", address); - channel.connect(address); negotiate(channel); } catch (Exception e) { disconnect(); @@ -103,8 +101,7 @@ public class MysqlConnector { MysqlUpdateExecutor executor = new MysqlUpdateExecutor(connector); executor.update("KILL CONNECTION " + connectionId); } catch (Exception e) { - // 忽略具体异常 - logger.info("KILL DUMP " + connectionId + " failure:" + ExceptionUtils.getStackTrace(e)); + throw new IOException("KILL DUMP " + connectionId + " failure:" + ExceptionUtils.getStackTrace(e)); } finally { if (connector != null) { connector.disconnect(); @@ -142,19 +139,7 @@ public class MysqlConnector { HeaderPacket quitHeader = new HeaderPacket(); quitHeader.setPacketBodyLength(cmdBody.length); quitHeader.setPacketSequenceNumber((byte) 0x00); - PacketManager.write(channel, - new ByteBuffer[] { ByteBuffer.wrap(quitHeader.toBytes()), ByteBuffer.wrap(cmdBody) }); - } - - // ====================== help method ==================== - - private void configChannel(SocketChannel channel) throws IOException { - channel.socket().setKeepAlive(true); - channel.socket().setReuseAddress(true); - channel.socket().setSoTimeout(soTimeout); - channel.socket().setTcpNoDelay(true); - channel.socket().setReceiveBufferSize(receiveBufferSize); - channel.socket().setSendBufferSize(sendBufferSize); + PacketManager.writePkg(channel, quitHeader.toBytes(), cmdBody); } private void negotiate(SocketChannel channel) throws IOException { @@ -191,8 +176,7 @@ public class MysqlConnector { h.setPacketBodyLength(clientAuthPkgBody.length); h.setPacketSequenceNumber((byte) (header.getPacketSequenceNumber() + 1)); - PacketManager.write(channel, - new ByteBuffer[] { ByteBuffer.wrap(h.toBytes()), ByteBuffer.wrap(clientAuthPkgBody) }); + PacketManager.writePkg(channel, h.toBytes(), clientAuthPkgBody); logger.info("client authentication packet is sent out."); // check auth result @@ -228,7 +212,7 @@ public class MysqlConnector { h323.setPacketBodyLength(b323Body.length); h323.setPacketSequenceNumber((byte) (packetSequenceNumber + 1)); - PacketManager.write(channel, new ByteBuffer[] { ByteBuffer.wrap(h323.toBytes()), ByteBuffer.wrap(b323Body) }); + PacketManager.writePkg(channel, h323.toBytes(), b323Body); logger.info("client 323 authentication packet is sent out."); // check auth result HeaderPacket header = PacketManager.readHeader(channel, 4); diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlQueryExecutor.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlQueryExecutor.java index 07ea21a2..a389623e 100644 --- a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlQueryExecutor.java +++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlQueryExecutor.java @@ -1,7 +1,6 @@ package com.alibaba.otter.canal.parse.driver.mysql; import java.io.IOException; -import java.nio.channels.SocketChannel; import java.util.ArrayList; import java.util.List; @@ -12,6 +11,7 @@ import com.alibaba.otter.canal.parse.driver.mysql.packets.server.FieldPacket; import com.alibaba.otter.canal.parse.driver.mysql.packets.server.ResultSetHeaderPacket; import com.alibaba.otter.canal.parse.driver.mysql.packets.server.ResultSetPacket; import com.alibaba.otter.canal.parse.driver.mysql.packets.server.RowDataPacket; +import com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannel; import com.alibaba.otter.canal.parse.driver.mysql.utils.PacketManager; /** @@ -24,9 +24,9 @@ public class MysqlQueryExecutor { private SocketChannel channel; - public MysqlQueryExecutor(MysqlConnector connector){ + public MysqlQueryExecutor(MysqlConnector connector) throws IOException{ if (!connector.isConnected()) { - throw new RuntimeException("should execute connector.connect() first"); + throw new IOException("should execute connector.connect() first"); } this.channel = connector.getChannel(); @@ -51,7 +51,7 @@ public class MysqlQueryExecutor { QueryCommandPacket cmd = new QueryCommandPacket(); cmd.setQueryString(queryString); byte[] bodyBytes = cmd.toBytes(); - PacketManager.write(channel, bodyBytes); + PacketManager.writeBody(channel, bodyBytes); byte[] body = readNextPacket(); if (body[0] < 0) { @@ -88,7 +88,7 @@ public class MysqlQueryExecutor { for (RowDataPacket r : rowData) { resultSet.getFieldValues().addAll(r.getColumns()); } - resultSet.setSourceAddress(channel.socket().getRemoteSocketAddress()); + resultSet.setSourceAddress(channel.getRemoteSocketAddress()); return resultSet; } diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlUpdateExecutor.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlUpdateExecutor.java index 521b07a0..dee9006e 100644 --- a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlUpdateExecutor.java +++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlUpdateExecutor.java @@ -1,7 +1,6 @@ package com.alibaba.otter.canal.parse.driver.mysql; import java.io.IOException; -import java.nio.channels.SocketChannel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,28 +20,29 @@ public class MysqlUpdateExecutor { private static final Logger logger = LoggerFactory.getLogger(MysqlUpdateExecutor.class); - private SocketChannel channel; + private MysqlConnector connector; - public MysqlUpdateExecutor(MysqlConnector connector){ + public MysqlUpdateExecutor(MysqlConnector connector) throws IOException{ if (!connector.isConnected()) { - throw new RuntimeException("should execute connector.connect() first"); + throw new IOException("should execute connector.connect() first"); } - this.channel = connector.getChannel(); + this.connector = connector; } - public MysqlUpdateExecutor(SocketChannel ch){ - this.channel = ch; - } + /* + * public MysqlUpdateExecutor(SocketChannel ch){ this.channel = ch; } + */ public OKPacket update(String updateString) throws IOException { QueryCommandPacket cmd = new QueryCommandPacket(); cmd.setQueryString(updateString); byte[] bodyBytes = cmd.toBytes(); - PacketManager.write(channel, bodyBytes); + PacketManager.writeBody(connector.getChannel(), bodyBytes); logger.debug("read update result..."); - byte[] body = PacketManager.readBytes(channel, PacketManager.readHeader(channel, 4).getPacketBodyLength()); + byte[] body = PacketManager.readBytes(connector.getChannel(), + PacketManager.readHeader(connector.getChannel(), 4).getPacketBodyLength()); if (body[0] < 0) { ErrorPacket packet = new ErrorPacket(); packet.fromBytes(body); diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/server/FieldPacket.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/server/FieldPacket.java index 3cd1df26..56014413 100644 --- a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/server/FieldPacket.java +++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/server/FieldPacket.java @@ -74,7 +74,7 @@ public class FieldPacket extends PacketWithHeaderPacket { this.decimals = data[index]; index++; // - index += 2;//skip filter + index += 2;// skip filter // if (index < data.length) { reader.setIndex(index); diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannel.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannel.java new file mode 100644 index 00000000..e825aa2b --- /dev/null +++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannel.java @@ -0,0 +1,82 @@ +package com.alibaba.otter.canal.parse.driver.mysql.socket; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.PooledByteBufAllocator; +import io.netty.buffer.Unpooled; +import io.netty.channel.Channel; + +import java.io.IOException; +import java.net.SocketAddress; + +/** + * 封装netty的通信channel和数据接收缓存,实现读、写、连接校验的功能。 2016-12-28 + * + * @author luoyaogui + */ +public class SocketChannel { + + private Channel channel = null; + private Object lock = new Object(); + private ByteBuf cache = PooledByteBufAllocator.DEFAULT.directBuffer(1024 * 1024); // 缓存大小 + + public Channel getChannel() { + return channel; + } + + public void setChannel(Channel channel) { + this.channel = channel; + } + + public void writeCache(ByteBuf buf) { + synchronized (lock) { + cache.discardReadBytes();// 回收内存 + cache.writeBytes(buf); + } + } + + public void writeChannel(byte[]... buf) throws IOException { + if (channel != null && channel.isWritable()) channel.writeAndFlush(Unpooled.copiedBuffer(buf)); + else throw new IOException("write failed ! please checking !"); + } + + public byte[] read(int readSize) throws IOException { + do { + if (readSize > cache.readableBytes()) { + if (null == channel) { + throw new IOException("socket has Interrupted !"); + } + synchronized (this) { + try { + wait(100); + } catch (InterruptedException e) { + throw new IOException("socket has Interrupted !"); + } + } + } else { + byte[] back = new byte[readSize]; + synchronized (lock) { + cache.readBytes(back); + } + return back; + } + } while (true); + } + + public boolean isConnected() { + return channel != null ? true : false; + } + + public SocketAddress getRemoteSocketAddress() { + return channel != null ? channel.remoteAddress() : null; + } + + public void close() { + if (channel != null) { + channel.close(); + } + channel = null; + cache.discardReadBytes();// 回收已占用的内存 + cache.release();// 释放整个内存 + cache = null; + } +} diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannelPool.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannelPool.java new file mode 100644 index 00000000..13efbed9 --- /dev/null +++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/SocketChannelPool.java @@ -0,0 +1,100 @@ +package com.alibaba.otter.canal.parse.driver.mysql.socket; + +import io.netty.bootstrap.Bootstrap; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.PooledByteBufAllocator; +import io.netty.channel.AdaptiveRecvByteBufAllocator; +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.util.ReferenceCountUtil; + +import java.io.IOException; +import java.net.SocketAddress; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author luoyaogui 实现channel的管理(监听连接、读数据、回收) 2016-12-28 + */ +@SuppressWarnings({ "rawtypes", "deprecation" }) +public abstract class SocketChannelPool { + + private static EventLoopGroup group = new NioEventLoopGroup(); // 非阻塞IO线程组 + private static Bootstrap boot = new Bootstrap(); // 主 + private static Map chManager = new ConcurrentHashMap(); + + static { + boot.group(group) + .channel(NioSocketChannel.class) + .option(ChannelOption.SO_RCVBUF, 32 * 1024) + .option(ChannelOption.SO_SNDBUF, 32 * 1024) + .option(ChannelOption.TCP_NODELAY, true) + // 如果是延时敏感型应用,建议关闭Nagle算法 + .option(ChannelOption.SO_KEEPALIVE, true) + .option(ChannelOption.RCVBUF_ALLOCATOR, AdaptiveRecvByteBufAllocator.DEFAULT) + .option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) + // + .handler(new ChannelInitializer() { + + @Override + protected void initChannel(Channel arg0) throws Exception { + arg0.pipeline().addLast(new BusinessHandler());// 命令过滤和handler添加管理 + } + }); + } + + public static SocketChannel open(SocketAddress address) throws Exception { + final SocketChannel socket = new SocketChannel(); + boot.connect(address).addListener(new ChannelFutureListener() { + + @Override + public void operationComplete(ChannelFuture arg0) throws Exception { + if (arg0.isSuccess()) socket.setChannel(arg0.channel()); + synchronized (socket) { + socket.notify(); + } + } + }); + synchronized (socket) { + socket.wait(); + } + if (null == socket.getChannel()) { + throw new IOException("can't create socket!"); + } + chManager.put(socket.getChannel(), socket); + return socket; + } + + public static class BusinessHandler extends ChannelInboundHandlerAdapter { + + private SocketChannel socket = null; + + @Override + public void channelInactive(ChannelHandlerContext ctx) throws Exception { + socket.setChannel(null); + chManager.remove(ctx.channel());// 移除 + } + + @Override + public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + if (null == socket) socket = chManager.get(ctx.channel()); + if (socket != null) { + socket.writeCache((ByteBuf) msg); + } + ReferenceCountUtil.release(msg);// 添加防止内存泄漏的 + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + ctx.close(); + } + } +} diff --git a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/utils/PacketManager.java b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/utils/PacketManager.java index 2b10e822..38f9f103 100644 --- a/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/utils/PacketManager.java +++ b/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/utils/PacketManager.java @@ -1,69 +1,34 @@ package com.alibaba.otter.canal.parse.driver.mysql.utils; import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.channels.SocketChannel; import com.alibaba.otter.canal.parse.driver.mysql.packets.HeaderPacket; +import com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannel; public abstract class PacketManager { public static HeaderPacket readHeader(SocketChannel ch, int len) throws IOException { HeaderPacket header = new HeaderPacket(); - header.fromBytes(readBytesAsBuffer(ch, len).array()); + header.fromBytes(ch.read(len)); return header; } - public static ByteBuffer readBytesAsBuffer(SocketChannel ch, int len) throws IOException { - ByteBuffer buffer = ByteBuffer.allocate(len); - while (buffer.hasRemaining()) { - int readNum = ch.read(buffer); - if (readNum == -1) { - throw new IOException("Unexpected End Stream"); - } - } - return buffer; - } - public static byte[] readBytes(SocketChannel ch, int len) throws IOException { - return readBytesAsBuffer(ch, len).array(); + return ch.read(len); } - /** - * Since We r using blocking IO, so we will just write once and assert the - * length to simplify the read operation.
      - * If the block write doesn't work as we expected, we will change this - * implementation as per the result. - * - * @param ch - * @param len - * @return - * @throws IOException - */ - public static void write(SocketChannel ch, ByteBuffer[] srcs) throws IOException { - @SuppressWarnings("unused") - long total = 0; - for (ByteBuffer buffer : srcs) { - total += buffer.remaining(); - } - - ch.write(srcs); - // https://github.com/alibaba/canal/issues/24 - // 部分windows用户会出现size != total的情况,jdk为java7/openjdk,估计和java版本有关,暂时不做检查 - // long size = ch.write(srcs); - // if (size != total) { - // throw new IOException("unexpected blocking io behavior"); - // } + public static void writePkg(SocketChannel ch, byte[]... srcs) throws IOException { + ch.writeChannel(srcs); } - public static void write(SocketChannel ch, byte[] body) throws IOException { - write(ch, body, (byte) 0); + public static void writeBody(SocketChannel ch, byte[] body) throws IOException { + writeBody0(ch, body, (byte) 0); } - public static void write(SocketChannel ch, byte[] body, byte packetSeqNumber) throws IOException { + public static void writeBody0(SocketChannel ch, byte[] body, byte packetSeqNumber) throws IOException { HeaderPacket header = new HeaderPacket(); header.setPacketBodyLength(body.length); header.setPacketSequenceNumber(packetSeqNumber); - write(ch, new ByteBuffer[] { ByteBuffer.wrap(header.toBytes()), ByteBuffer.wrap(body) }); + ch.writeChannel(header.toBytes(), body); } } diff --git a/driver/src/test/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnectorTest.java b/driver/src/test/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnectorTest.java index 4c5be652..abcd1473 100644 --- a/driver/src/test/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnectorTest.java +++ b/driver/src/test/java/com/alibaba/otter/canal/parse/driver/mysql/MysqlConnectorTest.java @@ -4,7 +4,6 @@ import java.io.IOException; import java.net.InetSocketAddress; import org.junit.Assert; - import org.junit.Test; import com.alibaba.otter.canal.parse.driver.mysql.packets.server.ResultSetPacket; diff --git a/example/pom.xml b/example/pom.xml index 717cd7ef..171f873a 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/example/src/main/java/com/alibaba/otter/canal/example/SimpleCanalClientTest.java b/example/src/main/java/com/alibaba/otter/canal/example/SimpleCanalClientTest.java index ae68d145..9fa8576d 100644 --- a/example/src/main/java/com/alibaba/otter/canal/example/SimpleCanalClientTest.java +++ b/example/src/main/java/com/alibaba/otter/canal/example/SimpleCanalClientTest.java @@ -23,8 +23,11 @@ public class SimpleCanalClientTest extends AbstractCanalClientTest { public static void main(String args[]) { // 根据ip,直接创建链接,无HA的功能 String destination = "example"; - CanalConnector connector = CanalConnectors.newSingleConnector(new InetSocketAddress(AddressUtils.getHostIp(), - 11111), destination, "", ""); + String ip = AddressUtils.getHostIp(); + CanalConnector connector = CanalConnectors.newSingleConnector(new InetSocketAddress(ip, 11111), + destination, + "", + ""); final SimpleCanalClientTest clientTest = new SimpleCanalClientTest(destination); clientTest.setConnector(connector); diff --git a/filter/pom.xml b/filter/pom.xml index e517691a..ed2e5670 100644 --- a/filter/pom.xml +++ b/filter/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/filter/src/test/java/com/alibaba/otter/canal/filter/AviaterFilterTest.java b/filter/src/test/java/com/alibaba/otter/canal/filter/AviaterFilterTest.java index d972d0e6..e89c7be2 100644 --- a/filter/src/test/java/com/alibaba/otter/canal/filter/AviaterFilterTest.java +++ b/filter/src/test/java/com/alibaba/otter/canal/filter/AviaterFilterTest.java @@ -1,7 +1,6 @@ package com.alibaba.otter.canal.filter; import org.junit.Assert; - import org.junit.Test; import com.alibaba.otter.canal.filter.aviater.AviaterELFilter; diff --git a/filter/src/test/java/com/alibaba/otter/canal/filter/MutliAviaterFilterTest.java b/filter/src/test/java/com/alibaba/otter/canal/filter/MutliAviaterFilterTest.java index 480e19ed..ecf7bfbf 100644 --- a/filter/src/test/java/com/alibaba/otter/canal/filter/MutliAviaterFilterTest.java +++ b/filter/src/test/java/com/alibaba/otter/canal/filter/MutliAviaterFilterTest.java @@ -5,9 +5,8 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Assert; - import org.apache.commons.lang.RandomStringUtils; +import org.junit.Assert; import org.junit.Test; import com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter; diff --git a/instance/core/pom.xml b/instance/core/pom.xml index 90b66cb7..c87de497 100644 --- a/instance/core/pom.xml +++ b/instance/core/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../../pom.xml canal.instance.core diff --git a/instance/core/src/main/java/com/alibaba/otter/canal/instance/core/AbstractCanalInstance.java b/instance/core/src/main/java/com/alibaba/otter/canal/instance/core/AbstractCanalInstance.java index a3ae52eb..9143a626 100644 --- a/instance/core/src/main/java/com/alibaba/otter/canal/instance/core/AbstractCanalInstance.java +++ b/instance/core/src/main/java/com/alibaba/otter/canal/instance/core/AbstractCanalInstance.java @@ -1,5 +1,11 @@ package com.alibaba.otter.canal.instance.core; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; import com.alibaba.otter.canal.common.alarm.CanalAlarmHandler; import com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter; @@ -16,30 +22,22 @@ import com.alibaba.otter.canal.protocol.ClientIdentity; import com.alibaba.otter.canal.sink.CanalEventSink; import com.alibaba.otter.canal.store.CanalEventStore; import com.alibaba.otter.canal.store.model.Event; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; /** - * Created with Intellig IDEA. - * Author: yinxiu - * Date: 2016-01-07 - * Time: 22:26 + * Created with Intellig IDEA. Author: yinxiu Date: 2016-01-07 Time: 22:26 */ public class AbstractCanalInstance extends AbstractCanalLifeCycle implements CanalInstance { - private static final Logger logger = LoggerFactory.getLogger(AbstractCanalInstance.class); + private static final Logger logger = LoggerFactory.getLogger(AbstractCanalInstance.class); - protected Long canalId; // 和manager交互唯一标示 - protected String destination; // 队列名字 - protected CanalEventStore eventStore; // 有序队列 + protected Long canalId; // 和manager交互唯一标示 + protected String destination; // 队列名字 + protected CanalEventStore eventStore; // 有序队列 - protected CanalEventParser eventParser; // 解析对应的数据信息 - protected CanalEventSink> eventSink; // 链接parse和store的桥接器 - protected CanalMetaManager metaManager; // 消费信息管理器 - protected CanalAlarmHandler alarmHandler; // alarm报警机制 + protected CanalEventParser eventParser; // 解析对应的数据信息 + protected CanalEventSink> eventSink; // 链接parse和store的桥接器 + protected CanalMetaManager metaManager; // 消费信息管理器 + protected CanalAlarmHandler alarmHandler; // alarm报警机制 @Override public boolean subscribeChange(ClientIdentity identity) { @@ -121,7 +119,6 @@ public class AbstractCanalInstance extends AbstractCanalLifeCycle implements Can alarmHandler.stop(); } - logger.info("stop successful...."); } diff --git a/instance/manager/pom.xml b/instance/manager/pom.xml index 87dc73b4..6c90a9cc 100644 --- a/instance/manager/pom.xml +++ b/instance/manager/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../../pom.xml com.alibaba.otter diff --git a/instance/manager/src/main/java/com/alibaba/otter/canal/instance/manager/CanalInstanceWithManager.java b/instance/manager/src/main/java/com/alibaba/otter/canal/instance/manager/CanalInstanceWithManager.java index dd31dce2..53196169 100644 --- a/instance/manager/src/main/java/com/alibaba/otter/canal/instance/manager/CanalInstanceWithManager.java +++ b/instance/manager/src/main/java/com/alibaba/otter/canal/instance/manager/CanalInstanceWithManager.java @@ -346,29 +346,24 @@ public class CanalInstanceWithManager extends AbstractCanalInstance { protected CanalLogPositionManager initLogPositionManager() { logger.info("init logPositionPersistManager begin..."); IndexMode indexMode = parameters.getIndexMode(); - CanalLogPositionManager logPositionManager = null; + CanalLogPositionManager logPositionManager; if (indexMode.isMemory()) { logPositionManager = new MemoryLogPositionManager(); } else if (indexMode.isZookeeper()) { - logPositionManager = new ZooKeeperLogPositionManager(); - ((ZooKeeperLogPositionManager) logPositionManager).setZkClientx(getZkclientx()); + logPositionManager = new ZooKeeperLogPositionManager(getZkclientx()); } else if (indexMode.isMixed()) { - logPositionManager = new PeriodMixedLogPositionManager(); - - ZooKeeperLogPositionManager zooKeeperLogPositionManager = new ZooKeeperLogPositionManager(); - zooKeeperLogPositionManager.setZkClientx(getZkclientx()); - ((PeriodMixedLogPositionManager) logPositionManager).setZooKeeperLogPositionManager(zooKeeperLogPositionManager); + MemoryLogPositionManager memoryLogPositionManager = new MemoryLogPositionManager(); + ZooKeeperLogPositionManager zooKeeperLogPositionManager = new ZooKeeperLogPositionManager(getZkclientx()); + logPositionManager = new PeriodMixedLogPositionManager(memoryLogPositionManager, + zooKeeperLogPositionManager, + 1000L); } else if (indexMode.isMeta()) { - logPositionManager = new MetaLogPositionManager(); - ((MetaLogPositionManager) logPositionManager).setMetaManager(metaManager); + logPositionManager = new MetaLogPositionManager(metaManager); } else if (indexMode.isMemoryMetaFailback()) { - MemoryLogPositionManager primaryLogPositionManager = new MemoryLogPositionManager(); - MetaLogPositionManager failbackLogPositionManager = new MetaLogPositionManager(); - failbackLogPositionManager.setMetaManager(metaManager); + MemoryLogPositionManager primary = new MemoryLogPositionManager(); + MetaLogPositionManager secondary = new MetaLogPositionManager(metaManager); - logPositionManager = new FailbackLogPositionManager(); - ((FailbackLogPositionManager) logPositionManager).setPrimary(primaryLogPositionManager); - ((FailbackLogPositionManager) logPositionManager).setFailback(failbackLogPositionManager); + logPositionManager = new FailbackLogPositionManager(primary, secondary); } else { throw new CanalException("unsupport indexMode for " + indexMode); } diff --git a/instance/pom.xml b/instance/pom.xml index 7c29140e..c1928e99 100644 --- a/instance/pom.xml +++ b/instance/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/instance/spring/pom.xml b/instance/spring/pom.xml index a920d492..c4012218 100644 --- a/instance/spring/pom.xml +++ b/instance/spring/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../../pom.xml com.alibaba.otter diff --git a/instance/spring/src/main/java/com/alibaba/otter/canal/instance/spring/CanalInstanceWithSpring.java b/instance/spring/src/main/java/com/alibaba/otter/canal/instance/spring/CanalInstanceWithSpring.java index 81ad2ff0..79693c4c 100644 --- a/instance/spring/src/main/java/com/alibaba/otter/canal/instance/spring/CanalInstanceWithSpring.java +++ b/instance/spring/src/main/java/com/alibaba/otter/canal/instance/spring/CanalInstanceWithSpring.java @@ -2,11 +2,11 @@ package com.alibaba.otter.canal.instance.spring; import java.util.List; -import com.alibaba.otter.canal.instance.core.AbstractCanalInstance; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.alibaba.otter.canal.common.alarm.CanalAlarmHandler; +import com.alibaba.otter.canal.instance.core.AbstractCanalInstance; import com.alibaba.otter.canal.meta.CanalMetaManager; import com.alibaba.otter.canal.parse.CanalEventParser; import com.alibaba.otter.canal.protocol.CanalEntry; @@ -23,7 +23,7 @@ import com.alibaba.otter.canal.store.model.Event; */ public class CanalInstanceWithSpring extends AbstractCanalInstance { - private static final Logger logger = LoggerFactory.getLogger(CanalInstanceWithSpring.class); + private static final Logger logger = LoggerFactory.getLogger(CanalInstanceWithSpring.class); public void start() { logger.info("start CannalInstance for {}-{} ", new Object[] { 1, destination }); diff --git a/instance/spring/src/test/resources/spring/default-instance.xml b/instance/spring/src/test/resources/spring/default-instance.xml index 0e035319..417934da 100644 --- a/instance/spring/src/test/resources/spring/default-instance.xml +++ b/instance/spring/src/test/resources/spring/default-instance.xml @@ -120,14 +120,14 @@ - + - - + + - + - + diff --git a/instance/spring/src/test/resources/spring/file-instance.xml b/instance/spring/src/test/resources/spring/file-instance.xml index 1acd7050..fcd0a78f 100644 --- a/instance/spring/src/test/resources/spring/file-instance.xml +++ b/instance/spring/src/test/resources/spring/file-instance.xml @@ -102,18 +102,20 @@ - + - + - - + + - + + + - + diff --git a/meta/pom.xml b/meta/pom.xml index 1f39001c..06155714 100644 --- a/meta/pom.xml +++ b/meta/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/meta/src/test/java/com/alibaba/otter/canal/meta/FileMixedMetaManagerTest.java b/meta/src/test/java/com/alibaba/otter/canal/meta/FileMixedMetaManagerTest.java index 1bedc4ba..56ea51a8 100644 --- a/meta/src/test/java/com/alibaba/otter/canal/meta/FileMixedMetaManagerTest.java +++ b/meta/src/test/java/com/alibaba/otter/canal/meta/FileMixedMetaManagerTest.java @@ -5,9 +5,8 @@ import java.io.IOException; import java.util.List; import java.util.Map; -import org.junit.Assert; - import org.apache.commons.io.FileUtils; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/meta/src/test/java/com/alibaba/otter/canal/meta/MemoryMetaManagerTest.java b/meta/src/test/java/com/alibaba/otter/canal/meta/MemoryMetaManagerTest.java index c5f91a87..488de888 100644 --- a/meta/src/test/java/com/alibaba/otter/canal/meta/MemoryMetaManagerTest.java +++ b/meta/src/test/java/com/alibaba/otter/canal/meta/MemoryMetaManagerTest.java @@ -3,7 +3,6 @@ package com.alibaba.otter.canal.meta; import java.util.Map; import org.junit.Assert; - import org.junit.Test; import com.alibaba.otter.canal.protocol.position.PositionRange; diff --git a/meta/src/test/java/com/alibaba/otter/canal/meta/MixedMetaManagerTest.java b/meta/src/test/java/com/alibaba/otter/canal/meta/MixedMetaManagerTest.java index 78f98902..de7a3d30 100644 --- a/meta/src/test/java/com/alibaba/otter/canal/meta/MixedMetaManagerTest.java +++ b/meta/src/test/java/com/alibaba/otter/canal/meta/MixedMetaManagerTest.java @@ -3,9 +3,8 @@ package com.alibaba.otter.canal.meta; import java.util.List; import java.util.Map; -import org.junit.Assert; - import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/meta/src/test/java/com/alibaba/otter/canal/meta/PeriodMixedMetaManagerTest.java b/meta/src/test/java/com/alibaba/otter/canal/meta/PeriodMixedMetaManagerTest.java index 610758c2..1fb61c75 100644 --- a/meta/src/test/java/com/alibaba/otter/canal/meta/PeriodMixedMetaManagerTest.java +++ b/meta/src/test/java/com/alibaba/otter/canal/meta/PeriodMixedMetaManagerTest.java @@ -3,9 +3,8 @@ package com.alibaba.otter.canal.meta; import java.util.List; import java.util.Map; -import org.junit.Assert; - import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/meta/src/test/java/com/alibaba/otter/canal/meta/ZooKeeperMetaManagerTest.java b/meta/src/test/java/com/alibaba/otter/canal/meta/ZooKeeperMetaManagerTest.java index 46d410a7..e700934b 100644 --- a/meta/src/test/java/com/alibaba/otter/canal/meta/ZooKeeperMetaManagerTest.java +++ b/meta/src/test/java/com/alibaba/otter/canal/meta/ZooKeeperMetaManagerTest.java @@ -2,9 +2,8 @@ package com.alibaba.otter.canal.meta; import java.util.Map; -import org.junit.Assert; - import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/parse/pom.xml b/parse/pom.xml index 29f36327..d80342f9 100644 --- a/parse/pom.xml +++ b/parse/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml canal.parse diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java index 59fa2839..6b34edf5 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/AbstractEventParser.java @@ -191,6 +191,9 @@ public abstract class AbstractEventParser extends AbstractCanalLifeCycle } catch (TableIdNotFoundException e) { throw e; } catch (Throwable e) { + if (e.getCause() instanceof TableIdNotFoundException) { + throw (TableIdNotFoundException) e.getCause(); + } // 记录一下,出错的位点信息 processSinkError(e, this.lastPosition, diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinLogConnection.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinLogConnection.java index 49c8323f..3c91350a 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinLogConnection.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinLogConnection.java @@ -83,30 +83,27 @@ public class LocalBinLogConnection implements ErosaConnection { context.setLogPosition(new LogPosition(binlogfilename, binlogPosition)); while (running) { boolean needContinue = true; - LogEvent event = null; - L:while (fetcher.fetch()) { - /*event = decoder.decode(fetcher, context); - if (event == null) { - throw new CanalParseException("parse failed"); - } + LogEvent event = null; + L: while (fetcher.fetch()) { + /* + * event = decoder.decode(fetcher, context); if (event == + * null) { throw new CanalParseException("parse failed"); } + * if (!func.sink(event)) { needContinue = false; break; } + */ - if (!func.sink(event)) { - needContinue = false; - break; - }*/ + do { + if (event == null) { + event = new RotateLogEvent(context.getLogPosition().getFileName(), context.getLogPosition() + .getPosition()); + } else { + event = decoder.decode(fetcher, context); + } - do { - if (event == null) { - event = new RotateLogEvent(context.getLogPosition().getFileName(), context.getLogPosition().getPosition()); - } else { - event = decoder.decode(fetcher, context); - } - - if (event != null && !func.sink(event)) { - needContinue = false; - break L; - } - } while (event != null); + if (event != null && !func.sink(event)) { + needContinue = false; + break L; + } + } while (event != null); } if (needContinue) {// 读取下一个 diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogEventParser.java index 3a22e8d0..331b4d45 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogEventParser.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogEventParser.java @@ -27,7 +27,7 @@ public class LocalBinlogEventParser extends AbstractMysqlEventParser implements private EntryPosition masterPosition; // binlog信息 private MysqlConnection metaConnection; // 查询meta信息的链接 private TableMetaCache tableMetaCache; // 对应meta - + private String directory; private boolean needWait = false; private int bufferSize = 16 * 1024; @@ -39,24 +39,24 @@ public class LocalBinlogEventParser extends AbstractMysqlEventParser implements @Override protected ErosaConnection buildErosaConnection() { return buildLocalBinLogConnection(); - } - + } + @Override - protected void preDump(ErosaConnection connection) { - metaConnection = buildMysqlConnection(); + protected void preDump(ErosaConnection connection) { + metaConnection = buildMysqlConnection(); try { metaConnection.connect(); } catch (IOException e) { throw new CanalParseException(e); } - + tableMetaCache = new TableMetaCache(metaConnection); ((LogEventConvert) binlogParser).setTableMetaCache(tableMetaCache); - } + } - @Override - protected void afterDump(ErosaConnection connection) { - if (metaConnection != null) { + @Override + protected void afterDump(ErosaConnection connection) { + if (metaConnection != null) { try { metaConnection.disconnect(); } catch (IOException e) { @@ -64,19 +64,19 @@ public class LocalBinlogEventParser extends AbstractMysqlEventParser implements .getAddress(), e); } } - } + } - public void start() throws CanalParseException { + public void start() throws CanalParseException { if (runningInfo == null) { // 第一次链接主库 runningInfo = masterInfo; } super.start(); } - + @Override - public void stop() { - if (metaConnection != null) { + public void stop() { + if (metaConnection != null) { try { metaConnection.disconnect(); } catch (IOException e) { @@ -90,9 +90,9 @@ public class LocalBinlogEventParser extends AbstractMysqlEventParser implements } super.stop(); - } + } - private ErosaConnection buildLocalBinLogConnection() { + private ErosaConnection buildLocalBinLogConnection() { LocalBinLogConnection connection = new LocalBinLogConnection(); connection.setBufferSize(this.bufferSize); @@ -114,7 +114,7 @@ public class LocalBinlogEventParser extends AbstractMysqlEventParser implements connection.setCharset(connectionCharset); return connection; } - + @Override protected EntryPosition findStartPosition(ErosaConnection connection) { // 处理逻辑 diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java index 908a36d8..c648c10d 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java @@ -2,7 +2,6 @@ package com.alibaba.otter.canal.parse.inbound.mysql; import java.io.IOException; import java.net.InetSocketAddress; -import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.util.List; @@ -25,8 +24,6 @@ import com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher; import com.taobao.tddl.dbsync.binlog.LogContext; import com.taobao.tddl.dbsync.binlog.LogDecoder; import com.taobao.tddl.dbsync.binlog.LogEvent; -import com.taobao.tddl.dbsync.binlog.LogPosition; -import com.taobao.tddl.dbsync.binlog.event.FormatDescriptionLogEvent; public class MysqlConnection implements ErosaConnection { @@ -37,13 +34,11 @@ public class MysqlConnection implements ErosaConnection { private Charset charset = Charset.forName("UTF-8"); private BinlogFormat binlogFormat; private BinlogImage binlogImage; - private int binlogChecksum; public MysqlConnection(){ } public MysqlConnection(InetSocketAddress address, String username, String password){ - connector = new MysqlConnector(address, username, password); } @@ -93,7 +88,6 @@ public class MysqlConnection implements ErosaConnection { decoder.handle(LogEvent.QUERY_EVENT); decoder.handle(LogEvent.XID_EVENT); LogContext context = new LogContext(); - context.setLogPosition(new LogPosition(binlogfilename)); while (fetcher.fetch()) { LogEvent event = null; event = decoder.decode(fetcher, context); @@ -110,14 +104,11 @@ public class MysqlConnection implements ErosaConnection { public void dump(String binlogfilename, Long binlogPosition, SinkFunction func) throws IOException { updateSettings(); - loadBinlogChecksum(); sendBinlogDump(binlogfilename, binlogPosition); DirectLogFetcher fetcher = new DirectLogFetcher(connector.getReceiveBufferSize()); fetcher.start(connector.getChannel()); LogDecoder decoder = new LogDecoder(LogEvent.UNKNOWN_EVENT, LogEvent.ENUM_END_EVENT); LogContext context = new LogContext(); - context.setLogPosition(new LogPosition(binlogfilename)); - context.setFormatDescription(new FormatDescriptionLogEvent(4, binlogChecksum)); while (fetcher.fetch()) { LogEvent event = null; event = decoder.decode(fetcher, context); @@ -147,9 +138,7 @@ public class MysqlConnection implements ErosaConnection { HeaderPacket binlogDumpHeader = new HeaderPacket(); binlogDumpHeader.setPacketBodyLength(cmdBody.length); binlogDumpHeader.setPacketSequenceNumber((byte) 0x00); - PacketManager.write(connector.getChannel(), new ByteBuffer[] { ByteBuffer.wrap(binlogDumpHeader.toBytes()), - ByteBuffer.wrap(cmdBody) }); - + PacketManager.writePkg(connector.getChannel(), binlogDumpHeader.toBytes(), cmdBody); connector.setDumping(true); } @@ -204,8 +193,15 @@ public class MysqlConnection implements ErosaConnection { // 如果不设置会出现错误: Slave can not handle replication events with the // checksum that master is configured to log // 但也不能乱设置,需要和mysql server的checksum配置一致,不然RotateLogEvent会出现乱码 - // '@@global.binlog_checksum'需要去掉单引号,在mysql 5.6.29下导致master退出 - update("set @master_binlog_checksum= @@global.binlog_checksum"); + update("set @master_binlog_checksum= '@@global.binlog_checksum'"); + } catch (Exception e) { + logger.warn(ExceptionUtils.getFullStackTrace(e)); + } + + try { + // 参考:https://github.com/alibaba/canal/issues/284 + // mysql5.6需要设置slave_uuid避免被server kill链接 + update("set @slave_uuid=uuid()"); } catch (Exception e) { if (!StringUtils.contains(e.getMessage(), "Unknown system variable")) { logger.warn(ExceptionUtils.getFullStackTrace(e)); @@ -267,27 +263,6 @@ public class MysqlConnection implements ErosaConnection { } } - /** - * 获取主库checksum信息 - * https://dev.mysql.com/doc/refman/5.6/en/replication-options - * -binary-log.html#option_mysqld_binlog-checksum - */ - private void loadBinlogChecksum() { - ResultSetPacket rs = null; - try { - rs = query("select @master_binlog_checksum"); - } catch (IOException e) { - throw new CanalParseException(e); - } - - List columnValues = rs.getFieldValues(); - if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0).toUpperCase().equals("CRC32")) { - binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_CRC32; - } else { - binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF; - } - } - public static enum BinlogFormat { STATEMENT("STATEMENT"), ROW("ROW"), MIXED("MIXED"); diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java index 7060f26f..9b7b152a 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java @@ -182,7 +182,7 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE protected void stopHeartBeat() { TimerTask heartBeatTimerTask = this.heartBeatTimerTask; super.stopHeartBeat(); - if (heartBeatTimerTask != null) { + if (heartBeatTimerTask != null && heartBeatTimerTask instanceof MysqlDetectingTimeTask) { MysqlConnection mysqlConnection = ((MysqlDetectingTimeTask) heartBeatTimerTask).getMysqlConnection(); try { mysqlConnection.disconnect(); diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/DirectLogFetcher.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/DirectLogFetcher.java index 0742e391..ad0e95e7 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/DirectLogFetcher.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/DirectLogFetcher.java @@ -3,13 +3,12 @@ package com.alibaba.otter.canal.parse.inbound.mysql.dbsync; import java.io.IOException; import java.io.InterruptedIOException; import java.net.SocketTimeoutException; -import java.nio.ByteBuffer; import java.nio.channels.ClosedByInterruptException; -import java.nio.channels.SocketChannel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannel; import com.taobao.tddl.dbsync.binlog.LogFetcher; /** @@ -149,20 +148,8 @@ public class DirectLogFetcher extends LogFetcher { private final boolean fetch0(final int off, final int len) throws IOException { ensureCapacity(off + len); - ByteBuffer buffer = ByteBuffer.wrap(this.buffer, off, len); - while (buffer.hasRemaining()) { - int readNum = channel.read(buffer); - if (readNum == -1) { - throw new IOException("Unexpected End Stream"); - } - } - - // for (int count, n = 0; n < len; n += count) { - // if (0 > (count = input.read(buffer, off + n, len - n))) { - // // Reached end of input stream - // return false; - // } - // } + byte[] read = channel.read(len); + System.arraycopy(read, 0, this.buffer, off, len); if (limit < off + len) limit = off + len; return true; diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/local/BinLogFileQueue.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/local/BinLogFileQueue.java index 6e3d9142..224852cc 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/local/BinLogFileQueue.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/local/BinLogFileQueue.java @@ -190,9 +190,9 @@ public class BinLogFileQueue { files.addAll(FileUtils.listFiles(directory, new IOFileFilter() { public boolean accept(File file) { - Pattern pattern = Pattern.compile("\\d+$"); - Matcher matcher = pattern.matcher(file.getName()); - return file.getName().startsWith(baseName) && matcher.find(); + Pattern pattern = Pattern.compile("\\d+$"); + Matcher matcher = pattern.matcher(file.getName()); + return file.getName().startsWith(baseName) && matcher.find(); } public boolean accept(File dir, String name) { diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/AbstractLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/AbstractLogPositionManager.java new file mode 100644 index 00000000..95ee108e --- /dev/null +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/AbstractLogPositionManager.java @@ -0,0 +1,9 @@ +package com.alibaba.otter.canal.parse.index; + +import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; + +/** + * Created by yinxiu on 17/3/17. Email: marklin.hz@gmail.com + */ +public abstract class AbstractLogPositionManager extends AbstractCanalLifeCycle implements CanalLogPositionManager { +} diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/CanalLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/CanalLogPositionManager.java index 25f63d15..2d7cd49f 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/index/CanalLogPositionManager.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/CanalLogPositionManager.java @@ -5,14 +5,12 @@ import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.protocol.position.LogPosition; /** - * 接口组合 - * - * @author jianghang 2012-7-7 上午10:02:02 - * @version 1.0.0 + * Created by yinxiu on 17/3/17. Email: marklin.hz@gmail.com */ public interface CanalLogPositionManager extends CanalLifeCycle { LogPosition getLatestIndexBy(String destination); void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException; + } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/FailbackLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/FailbackLogPositionManager.java index 6fa8efa5..8d6fea98 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/index/FailbackLogPositionManager.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/FailbackLogPositionManager.java @@ -1,74 +1,83 @@ package com.alibaba.otter.canal.parse.index; -import org.springframework.util.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.protocol.position.LogPosition; /** + * Created by yinxiu on 17/3/18. Email: marklin.hz@gmail.com * 实现基于failover查找的机制完成meta的操作 - * + * *
        * 应用场景:比如针对内存buffer,出现HA切换,先尝试从内存buffer区中找到lastest position,如果不存在才尝试找一下meta里消费的信息
        * 
      - * - * @author jianghang 2012-7-20 下午02:33:20 */ -public class FailbackLogPositionManager extends AbstractCanalLifeCycle implements CanalLogPositionManager { +public class FailbackLogPositionManager extends AbstractLogPositionManager { - private CanalLogPositionManager primary; - private CanalLogPositionManager failback; + private final static Logger logger = LoggerFactory.getLogger(FailbackLogPositionManager.class); + private final CanalLogPositionManager primary; + private final CanalLogPositionManager secondary; + + public FailbackLogPositionManager(CanalLogPositionManager primary, CanalLogPositionManager secondary){ + if (primary == null) { + throw new NullPointerException("nul primary LogPositionManager"); + } + if (secondary == null) { + throw new NullPointerException("nul secondary LogPositionManager"); + } + + this.primary = primary; + this.secondary = secondary; + } + + @Override public void start() { super.start(); - Assert.notNull(primary); - Assert.notNull(failback); if (!primary.isStart()) { primary.start(); } - if (!failback.isStart()) { - failback.start(); + if (!secondary.isStart()) { + secondary.start(); } } + @Override public void stop() { super.stop(); + if (secondary.isStart()) { + secondary.stop(); + } + if (primary.isStart()) { primary.stop(); } - - if (failback.isStart()) { - failback.stop(); - } } + @Override public LogPosition getLatestIndexBy(String destination) { LogPosition logPosition = primary.getLatestIndexBy(destination); - if (logPosition == null) { - return failback.getLatestIndexBy(destination); - } else { + if (logPosition != null) { return logPosition; } + return secondary.getLatestIndexBy(destination); } + @Override public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { try { primary.persistLogPosition(destination, logPosition); } catch (CanalParseException e) { - failback.persistLogPosition(destination, logPosition); + logger.warn("persistLogPosition use primary log position manager exception. destination: {}, logPosition: {}", + destination, + logPosition, + e); + secondary.persistLogPosition(destination, logPosition); } } - - public void setPrimary(CanalLogPositionManager primary) { - this.primary = primary; - } - - public void setFailback(CanalLogPositionManager failback) { - this.failback = failback; - } - } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/FileMixedLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/FileMixedLogPositionManager.java index e2c15401..ed0b9879 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/index/FileMixedLogPositionManager.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/FileMixedLogPositionManager.java @@ -16,45 +16,72 @@ import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.util.Assert; import com.alibaba.otter.canal.common.utils.JsonUtils; import com.alibaba.otter.canal.meta.exception.CanalMetaManagerException; +import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.protocol.position.LogPosition; import com.google.common.base.Function; import com.google.common.collect.MigrateMap; /** - * 基于文件刷新的log position实现 - * + * Created by yinxiu on 17/3/18. Email: marklin.hz@gmail.com 基于文件刷新的log + * position实现 + * *
        * 策略:
        * 1. 先写内存,然后定时刷新数据到File
        * 2. 数据采取overwrite模式(只保留最后一次)
        * 
      - * - * @author jianghang 2013-4-15 下午09:40:48 - * @version 1.0.4 */ -public class FileMixedLogPositionManager extends MemoryLogPositionManager { +public class FileMixedLogPositionManager extends AbstractLogPositionManager { + + private final static Logger logger = LoggerFactory.getLogger(FileMixedLogPositionManager.class); + private final static Charset charset = Charset.forName("UTF-8"); - private static final Logger logger = LoggerFactory.getLogger(FileMixedLogPositionManager.class); - private static final Charset charset = Charset.forName("UTF-8"); private File dataDir; - private String dataFileName = "parse.dat"; + private Map dataFileCaches; - private ScheduledExecutorService executor; - @SuppressWarnings("serial") + + private ScheduledExecutorService executorService; + private final LogPosition nullPosition = new LogPosition() { }; - private long period = 1000; // 单位ms + private MemoryLogPositionManager memoryLogPositionManager; + + private long period; private Set persistTasks; + public FileMixedLogPositionManager(File dataDir, long period, MemoryLogPositionManager memoryLogPositionManager){ + if (dataDir == null) { + throw new NullPointerException("null dataDir"); + } + if (period <= 0) { + throw new IllegalArgumentException("period must be positive, given: " + period); + } + if (memoryLogPositionManager == null) { + throw new NullPointerException("null memoryLogPositionManager"); + } + this.dataDir = dataDir; + this.period = period; + this.memoryLogPositionManager = memoryLogPositionManager; + + this.dataFileCaches = MigrateMap.makeComputingMap(new Function() { + + public File apply(String destination) { + return getDataFile(destination); + } + }); + + this.executorService = Executors.newScheduledThreadPool(1); + this.persistTasks = Collections.synchronizedSet(new HashSet()); + } + + @Override public void start() { super.start(); - Assert.notNull(dataDir); if (!dataDir.exists()) { try { FileUtils.forceMkdir(dataDir); @@ -67,30 +94,12 @@ public class FileMixedLogPositionManager extends MemoryLogPositionManager { throw new CanalMetaManagerException("dir[" + dataDir.getPath() + "] can not read/write"); } - dataFileCaches = MigrateMap.makeComputingMap(new Function() { - - public File apply(String destination) { - return getDataFile(destination); - } - }); - - executor = Executors.newScheduledThreadPool(1); - positions = MigrateMap.makeComputingMap(new Function() { - - public LogPosition apply(String destination) { - LogPosition logPosition = loadDataFromFile(dataFileCaches.get(destination)); - if (logPosition == null) { - return nullPosition; - } else { - return logPosition; - } - } - }); - - persistTasks = Collections.synchronizedSet(new HashSet()); + if (!memoryLogPositionManager.isStart()) { + memoryLogPositionManager.start(); + } // 启动定时工作任务 - executor.scheduleAtFixedRate(new Runnable() { + executorService.scheduleAtFixedRate(new Runnable() { public void run() { List tasks = new ArrayList(persistTasks); @@ -106,28 +115,35 @@ public class FileMixedLogPositionManager extends MemoryLogPositionManager { } } }, period, period, TimeUnit.MILLISECONDS); + } + @Override public void stop() { super.stop(); flushDataToFile(); - executor.shutdownNow(); - positions.clear(); - } - - public void persistLogPosition(String destination, LogPosition logPosition) { - persistTasks.add(destination);// 添加到任务队列中进行触发 - super.persistLogPosition(destination, logPosition); + executorService.shutdown(); + memoryLogPositionManager.stop(); } + @Override public LogPosition getLatestIndexBy(String destination) { - LogPosition logPostion = super.getLatestIndexBy(destination); - if (logPostion == nullPosition) { - return null; - } else { - return logPostion; + LogPosition logPosition = memoryLogPositionManager.getLatestIndexBy(destination); + if (logPosition != null) { + return logPosition; } + logPosition = loadDataFromFile(dataFileCaches.get(destination)); + if (logPosition == null) { + return nullPosition; + } + return logPosition; + } + + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { + persistTasks.add(destination); + memoryLogPositionManager.persistLogPosition(destination, logPosition); } // ============================ helper method ====================== @@ -142,11 +158,12 @@ public class FileMixedLogPositionManager extends MemoryLogPositionManager { } } + String dataFileName = "parse.dat"; return new File(destinationMetaDir, dataFileName); } private void flushDataToFile() { - for (String destination : positions.keySet()) { + for (String destination : memoryLogPositionManager.destinations()) { flushDataToFile(destination); } } @@ -156,7 +173,7 @@ public class FileMixedLogPositionManager extends MemoryLogPositionManager { } private void flushDataToFile(String destination, File dataFile) { - LogPosition position = positions.get(destination); + LogPosition position = memoryLogPositionManager.getLatestIndexBy(destination); if (position != null && position != nullPosition) { String json = JsonUtils.marshalToString(position); try { @@ -179,16 +196,4 @@ public class FileMixedLogPositionManager extends MemoryLogPositionManager { throw new CanalMetaManagerException(e); } } - - public void setDataDir(String dataDir) { - this.dataDir = new File(dataDir); - } - - public void setDataDir(File dataDir) { - this.dataDir = dataDir; - } - - public void setPeriod(long period) { - this.period = period; - } } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/MemoryLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/MemoryLogPositionManager.java index c95fa4e2..1658dd43 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/index/MemoryLogPositionManager.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/MemoryLogPositionManager.java @@ -1,39 +1,43 @@ package com.alibaba.otter.canal.parse.index; import java.util.Map; +import java.util.Set; -import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; +import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.protocol.position.LogPosition; import com.google.common.collect.MapMaker; /** - * 基于内存的实现 - * - * @author jianghang 2012-7-7 上午10:17:23 - * @version 1.0.0 + * Created by yinxiu on 17/3/17. Email: marklin.hz@gmail.com */ -public class MemoryLogPositionManager extends AbstractCanalLifeCycle implements CanalLogPositionManager { +public class MemoryLogPositionManager extends AbstractLogPositionManager { - protected Map positions; + private Map positions; + @Override public void start() { super.start(); - positions = new MapMaker().makeMap(); } + @Override public void stop() { super.stop(); - positions.clear(); } + @Override public LogPosition getLatestIndexBy(String destination) { return positions.get(destination); } - public void persistLogPosition(String destination, LogPosition logPosition) { + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { positions.put(destination, logPosition); } + public Set destinations() { + return positions.keySet(); + } + } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/MetaLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/MetaLogPositionManager.java index 3af97411..35c3f252 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/index/MetaLogPositionManager.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/MetaLogPositionManager.java @@ -4,52 +4,56 @@ import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; -import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; import com.alibaba.otter.canal.meta.CanalMetaManager; +import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.protocol.ClientIdentity; import com.alibaba.otter.canal.protocol.position.LogPosition; import com.alibaba.otter.canal.store.helper.CanalEventUtils; /** - * 基于meta信息的实现 - * - * @author jianghang 2012-7-10 下午05:02:33 - * @version 1.0.0 + * Created by yinxiu on 17/3/18. Email: marklin.hz@gmail.com */ -public class MetaLogPositionManager extends AbstractCanalLifeCycle implements CanalLogPositionManager { +public class MetaLogPositionManager extends AbstractLogPositionManager { - private static final Logger logger = LoggerFactory.getLogger(MetaLogPositionManager.class); - private CanalMetaManager metaManager; + private final static Logger logger = LoggerFactory.getLogger(MetaLogPositionManager.class); - public void start() { - super.start(); - Assert.notNull(metaManager); - if (!metaManager.isStart()) { - metaManager.start(); + private final CanalMetaManager metaManager; + + public MetaLogPositionManager(CanalMetaManager metaManager){ + if (metaManager == null) { + throw new NullPointerException("null metaManager"); } + + this.metaManager = metaManager; } + @Override public void stop() { super.stop(); + if (metaManager.isStart()) { metaManager.stop(); } } - public void persistLogPosition(String destination, LogPosition logPosition) { - // do nothing - logger.info("persist LogPosition:{}", destination, logPosition); + @Override + public void start() { + super.start(); + + if (!metaManager.isStart()) { + metaManager.start(); + } } + @Override public LogPosition getLatestIndexBy(String destination) { - List clientIdentitys = metaManager.listAllSubscribeInfo(destination); + List clientIdentities = metaManager.listAllSubscribeInfo(destination); LogPosition result = null; - if (!CollectionUtils.isEmpty(clientIdentitys)) { + if (!CollectionUtils.isEmpty(clientIdentities)) { // 尝试找到一个最小的logPosition - for (ClientIdentity clientIdentity : clientIdentitys) { + for (ClientIdentity clientIdentity : clientIdentities) { LogPosition position = (LogPosition) metaManager.getCursor(clientIdentity); if (position == null) { continue; @@ -66,8 +70,9 @@ public class MetaLogPositionManager extends AbstractCanalLifeCycle implements Ca return result; } - public void setMetaManager(CanalMetaManager metaManager) { - this.metaManager = metaManager; + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { + // do nothing + logger.info("persist LogPosition:{}", destination, logPosition); } - } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/MixedLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/MixedLogPositionManager.java index 0016bb06..5bd2c19f 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/index/MixedLogPositionManager.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/MixedLogPositionManager.java @@ -5,86 +5,83 @@ import java.util.concurrent.Executors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.util.Assert; +import com.alibaba.otter.canal.common.zookeeper.ZkClientx; +import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.protocol.position.LogPosition; -import com.google.common.base.Function; -import com.google.common.collect.MigrateMap; /** - * 混合memory + zookeeper的存储模式 - * - * @author jianghang 2012-7-7 上午10:33:19 - * @version 1.0.0 + * Created by yinxiu on 17/3/17. Email: marklin.hz@gmail.com Memory first. + * Asynchronous commit position info to ZK. */ -public class MixedLogPositionManager extends MemoryLogPositionManager implements CanalLogPositionManager { +public class MixedLogPositionManager extends AbstractLogPositionManager { - private static final Logger logger = LoggerFactory.getLogger(MixedLogPositionManager.class); - private ZooKeeperLogPositionManager zooKeeperLogPositionManager; - private ExecutorService executor; - @SuppressWarnings("serial") - private final LogPosition nullPosition = new LogPosition() { - }; + private final Logger logger = LoggerFactory.getLogger(MixedLogPositionManager.class); + private final MemoryLogPositionManager memoryLogPositionManager; + private final ZooKeeperLogPositionManager zooKeeperLogPositionManager; + + private final ExecutorService executor; + + public MixedLogPositionManager(ZkClientx zkClient){ + if (zkClient == null) { + throw new NullPointerException("null zkClient"); + } + + this.memoryLogPositionManager = new MemoryLogPositionManager(); + this.zooKeeperLogPositionManager = new ZooKeeperLogPositionManager(zkClient); + + this.executor = Executors.newFixedThreadPool(1); + } + + @Override public void start() { super.start(); - Assert.notNull(zooKeeperLogPositionManager); + if (!memoryLogPositionManager.isStart()) { + memoryLogPositionManager.start(); + } + if (!zooKeeperLogPositionManager.isStart()) { zooKeeperLogPositionManager.start(); } - executor = Executors.newFixedThreadPool(1); - positions = MigrateMap.makeComputingMap(new Function() { - - public LogPosition apply(String destination) { - LogPosition logPosition = zooKeeperLogPositionManager.getLatestIndexBy(destination); - if (logPosition == null) { - return nullPosition; - } else { - return logPosition; - } - } - }); } + @Override public void stop() { super.stop(); - if (zooKeeperLogPositionManager.isStart()) { - zooKeeperLogPositionManager.stop(); - } - executor.shutdownNow(); - positions.clear(); + executor.shutdown(); + zooKeeperLogPositionManager.stop(); + memoryLogPositionManager.stop(); } - public void persistLogPosition(final String destination, final LogPosition logPosition) { - super.persistLogPosition(destination, logPosition); + @Override + public LogPosition getLatestIndexBy(String destination) { + LogPosition logPosition = memoryLogPositionManager.getLatestIndexBy(destination); + if (logPosition != null) { + return logPosition; + } + logPosition = zooKeeperLogPositionManager.getLatestIndexBy(destination); + // 这里保持和重构前的逻辑一致,重新添加到Memory中 + if (logPosition != null) { + memoryLogPositionManager.persistLogPosition(destination, logPosition); + } + return logPosition; + } + + @Override + public void persistLogPosition(final String destination, final LogPosition logPosition) throws CanalParseException { + memoryLogPositionManager.persistLogPosition(destination, logPosition); executor.submit(new Runnable() { public void run() { try { zooKeeperLogPositionManager.persistLogPosition(destination, logPosition); } catch (Exception e) { - logger.error("ERROR # persist to zookeepr has an error", e); + logger.error("ERROR # persist to zookeeper has an error", e); } } }); - } - - public LogPosition getLatestIndexBy(String destination) { - LogPosition logPosition = super.getLatestIndexBy(destination); - if (logPosition == nullPosition) { - return null; - } else { - return logPosition; - } - } - - // ======================== setter / getter ====================== - - public void setZooKeeperLogPositionManager(ZooKeeperLogPositionManager zooKeeperLogPositionManager) { - this.zooKeeperLogPositionManager = zooKeeperLogPositionManager; - } - } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/PeriodMixedLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/PeriodMixedLogPositionManager.java index e947720a..4a1e60c7 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/index/PeriodMixedLogPositionManager.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/PeriodMixedLogPositionManager.java @@ -11,54 +11,77 @@ import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.util.Assert; +import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.protocol.position.LogPosition; -import com.google.common.base.Function; -import com.google.common.collect.MigrateMap; /** - * 基于定时刷新的策略的mixed实现 - * - * @author jianghang 2012-9-12 上午11:18:14 - * @version 1.0.0 + * Created by yinxiu on 17/3/18. Email: marklin.hz@gmail.com */ -public class PeriodMixedLogPositionManager extends MemoryLogPositionManager implements CanalLogPositionManager { +public class PeriodMixedLogPositionManager extends AbstractLogPositionManager { private static final Logger logger = LoggerFactory.getLogger(PeriodMixedLogPositionManager.class); + + private MemoryLogPositionManager memoryLogPositionManager; private ZooKeeperLogPositionManager zooKeeperLogPositionManager; - private ScheduledExecutorService executor; - @SuppressWarnings("serial") + private ScheduledExecutorService executorService; + + private long period; + private Set persistTasks; + private final LogPosition nullPosition = new LogPosition() { }; - private long period = 1000; // 单位ms - private Set persistTasks; + public PeriodMixedLogPositionManager(MemoryLogPositionManager memoryLogPositionManager, + ZooKeeperLogPositionManager zooKeeperLogPositionManager, long period){ + if (memoryLogPositionManager == null) { + throw new NullPointerException("null memoryLogPositionManager"); + } + if (zooKeeperLogPositionManager == null) { + throw new NullPointerException("null zooKeeperLogPositionManager"); + } + + if (period <= 0) { + throw new IllegalArgumentException("period must be positive, given: " + period); + } + + this.memoryLogPositionManager = memoryLogPositionManager; + this.zooKeeperLogPositionManager = zooKeeperLogPositionManager; + this.period = period; + this.persistTasks = Collections.synchronizedSet(new HashSet()); + this.executorService = Executors.newScheduledThreadPool(1); + } + + @Override + public void stop() { + super.stop(); + + if (zooKeeperLogPositionManager.isStart()) { + zooKeeperLogPositionManager.stop(); + } + + if (memoryLogPositionManager.isStart()) { + memoryLogPositionManager.stop(); + } + + executorService.shutdown(); + } + + @Override public void start() { super.start(); - Assert.notNull(zooKeeperLogPositionManager); + if (!memoryLogPositionManager.isStart()) { + memoryLogPositionManager.start(); + } + if (!zooKeeperLogPositionManager.isStart()) { zooKeeperLogPositionManager.start(); } - executor = Executors.newScheduledThreadPool(1); - positions = MigrateMap.makeComputingMap(new Function() { - - public LogPosition apply(String destination) { - LogPosition logPosition = zooKeeperLogPositionManager.getLatestIndexBy(destination); - if (logPosition == null) { - return nullPosition; - } else { - return logPosition; - } - } - }); - - persistTasks = Collections.synchronizedSet(new HashSet()); // 启动定时工作任务 - executor.scheduleAtFixedRate(new Runnable() { + executorService.scheduleAtFixedRate(new Runnable() { public void run() { List tasks = new ArrayList(persistTasks); @@ -76,36 +99,19 @@ public class PeriodMixedLogPositionManager extends MemoryLogPositionManager impl }, period, period, TimeUnit.MILLISECONDS); } - public void stop() { - super.stop(); - - if (zooKeeperLogPositionManager.isStart()) { - zooKeeperLogPositionManager.stop(); - } - executor.shutdownNow(); - positions.clear(); - } - - public void persistLogPosition(String destination, LogPosition logPosition) { - persistTasks.add(destination);// 添加到任务队列中进行触发 - super.persistLogPosition(destination, logPosition); - } - + @Override public LogPosition getLatestIndexBy(String destination) { - LogPosition logPostion = super.getLatestIndexBy(destination); - if (logPostion == nullPosition) { + LogPosition logPosition = memoryLogPositionManager.getLatestIndexBy(destination); + if (logPosition == nullPosition) { return null; } else { - return logPostion; + return logPosition; } } - public void setZooKeeperLogPositionManager(ZooKeeperLogPositionManager zooKeeperLogPositionManager) { - this.zooKeeperLogPositionManager = zooKeeperLogPositionManager; + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { + persistTasks.add(destination); + memoryLogPositionManager.persistLogPosition(destination, logPosition); } - - public void setPeriod(long period) { - this.period = period; - } - } diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/index/ZooKeeperLogPositionManager.java b/parse/src/main/java/com/alibaba/otter/canal/parse/index/ZooKeeperLogPositionManager.java index 996297ac..65f0063d 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/index/ZooKeeperLogPositionManager.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/index/ZooKeeperLogPositionManager.java @@ -1,33 +1,29 @@ package com.alibaba.otter.canal.parse.index; import org.I0Itec.zkclient.exception.ZkNoNodeException; -import org.springframework.util.Assert; -import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; import com.alibaba.otter.canal.common.utils.JsonUtils; import com.alibaba.otter.canal.common.zookeeper.ZkClientx; import com.alibaba.otter.canal.common.zookeeper.ZookeeperPathUtils; +import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.protocol.position.LogPosition; /** - * 基于zk的实现 - * - * @author jianghang 2012-7-7 上午10:08:27 - * @version 1.0.0 + * Created by yinxiu on 17/3/17. Email: marklin.hz@gmail.com */ -public class ZooKeeperLogPositionManager extends AbstractCanalLifeCycle implements CanalLogPositionManager { +public class ZooKeeperLogPositionManager extends AbstractLogPositionManager { - private ZkClientx zkClientx; + private final ZkClientx zkClientx; - public void start() { - super.start(); - Assert.notNull(zkClientx); - } - - public void stop() { - super.stop(); + public ZooKeeperLogPositionManager(ZkClientx zkClient){ + if (zkClient == null) { + throw new NullPointerException("null zkClient"); + } + + this.zkClientx = zkClient; } + @Override public LogPosition getLatestIndexBy(String destination) { String path = ZookeeperPathUtils.getParsePath(destination); byte[] data = zkClientx.readData(path, true); @@ -38,7 +34,8 @@ public class ZooKeeperLogPositionManager extends AbstractCanalLifeCycle implemen return JsonUtils.unmarshalFromByte(data, LogPosition.class); } - public void persistLogPosition(String destination, LogPosition logPosition) { + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { String path = ZookeeperPathUtils.getParsePath(destination); byte[] data = JsonUtils.marshalToByte(logPosition); try { @@ -48,10 +45,4 @@ public class ZooKeeperLogPositionManager extends AbstractCanalLifeCycle implemen } } - // ================== setter / getter ================= - - public void setZkClientx(ZkClientx zkClientx) { - this.zkClientx = zkClientx; - } - } diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/DirectLogFetcherTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/DirectLogFetcherTest.java index 71ac0789..707eaa20 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/DirectLogFetcherTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/DirectLogFetcherTest.java @@ -2,7 +2,6 @@ package com.alibaba.otter.canal.parse; import java.io.IOException; import java.net.InetSocketAddress; -import java.nio.ByteBuffer; import org.junit.Assert; import org.junit.Test; @@ -94,7 +93,6 @@ public class DirectLogFetcherTest { HeaderPacket binlogDumpHeader = new HeaderPacket(); binlogDumpHeader.setPacketBodyLength(cmdBody.length); binlogDumpHeader.setPacketSequenceNumber((byte) 0x00); - PacketManager.write(connector.getChannel(), new ByteBuffer[] { ByteBuffer.wrap(binlogDumpHeader.toBytes()), - ByteBuffer.wrap(cmdBody) }); + PacketManager.writePkg(connector.getChannel(), binlogDumpHeader.toBytes(), cmdBody); } } diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/EventTransactionBufferTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/EventTransactionBufferTest.java index 6c433f6a..122fa2ed 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/EventTransactionBufferTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/EventTransactionBufferTest.java @@ -6,7 +6,6 @@ import java.util.Date; import java.util.List; import org.junit.Assert; - import org.junit.Test; import com.alibaba.otter.canal.parse.inbound.EventTransactionBuffer.TransactionFlushCallback; diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/group/GroupEventPaserTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/group/GroupEventPaserTest.java index b632639c..3f6dff3c 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/group/GroupEventPaserTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/group/GroupEventPaserTest.java @@ -8,7 +8,7 @@ import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.parse.inbound.AbstractBinlogParser; import com.alibaba.otter.canal.parse.inbound.BinlogParser; import com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser; -import com.alibaba.otter.canal.parse.stub.AbstractCanalLogPositionManager; +import com.alibaba.otter.canal.parse.index.AbstractLogPositionManager; import com.alibaba.otter.canal.parse.support.AuthenticationInfo; import com.alibaba.otter.canal.protocol.CanalEntry.Entry; import com.alibaba.otter.canal.protocol.position.EntryPosition; @@ -70,15 +70,17 @@ public class GroupEventPaserTest { mysqlEventPaser.setMasterPosition(defaultPosition); mysqlEventPaser.setBinlogParser(buildParser(buildAuthentication())); mysqlEventPaser.setEventSink(new EntryEventSink()); - mysqlEventPaser.setLogPositionManager(new AbstractCanalLogPositionManager() { - - public void persistLogPosition(String destination, LogPosition logPosition) { - // System.out.println(logPosition); - } + mysqlEventPaser.setLogPositionManager(new AbstractLogPositionManager() { + @Override public LogPosition getLatestIndexBy(String destination) { return null; } + + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { + System.out.println(logPosition); + } }); return mysqlEventPaser; } diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogDumpTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogDumpTest.java index e46fdc68..212f3af6 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogDumpTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogDumpTest.java @@ -5,11 +5,11 @@ import java.nio.charset.Charset; import java.util.List; import org.junit.Assert; - import org.junit.Test; +import com.alibaba.otter.canal.parse.exception.CanalParseException; +import com.alibaba.otter.canal.parse.index.AbstractLogPositionManager; import com.alibaba.otter.canal.parse.stub.AbstractCanalEventSinkTest; -import com.alibaba.otter.canal.parse.stub.AbstractCanalLogPositionManager; import com.alibaba.otter.canal.parse.support.AuthenticationInfo; import com.alibaba.otter.canal.protocol.CanalEntry.Column; import com.alibaba.otter.canal.protocol.CanalEntry.Entry; @@ -81,16 +81,17 @@ public class LocalBinlogDumpTest { } }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { - - public void persistLogPosition(String destination, LogPosition logPosition) { - System.out.println(logPosition); - } + controller.setLogPositionManager(new AbstractLogPositionManager() { @Override public LogPosition getLatestIndexBy(String destination) { return null; } + + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { + System.out.println(logPosition); + } }); controller.start(); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogEventParserTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogEventParserTest.java index c2badf00..d619916a 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogEventParserTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/LocalBinlogEventParserTest.java @@ -12,8 +12,8 @@ import org.junit.Before; import org.junit.Test; import com.alibaba.otter.canal.parse.helper.TimeoutChecker; +import com.alibaba.otter.canal.parse.index.AbstractLogPositionManager; import com.alibaba.otter.canal.parse.stub.AbstractCanalEventSinkTest; -import com.alibaba.otter.canal.parse.stub.AbstractCanalLogPositionManager; import com.alibaba.otter.canal.parse.support.AuthenticationInfo; import com.alibaba.otter.canal.protocol.CanalEntry.Entry; import com.alibaba.otter.canal.protocol.position.EntryPosition; @@ -70,7 +70,7 @@ public class LocalBinlogEventParserTest { }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { + controller.setLogPositionManager(new AbstractLogPositionManager() { public void persistLogPosition(String destination, LogPosition logPosition) { System.out.println(logPosition); @@ -133,7 +133,7 @@ public class LocalBinlogEventParserTest { } }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { + controller.setLogPositionManager(new AbstractLogPositionManager() { public void persistLogPosition(String destination, LogPosition logPosition) { System.out.println(logPosition); @@ -198,7 +198,7 @@ public class LocalBinlogEventParserTest { } }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { + controller.setLogPositionManager(new AbstractLogPositionManager() { public void persistLogPosition(String destination, LogPosition logPosition) { System.out.println(logPosition); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlDumpTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlDumpTest.java index 18042539..f7dab29a 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlDumpTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlDumpTest.java @@ -5,11 +5,11 @@ import java.nio.charset.Charset; import java.util.List; import org.junit.Assert; - import org.junit.Test; +import com.alibaba.otter.canal.parse.exception.CanalParseException; +import com.alibaba.otter.canal.parse.index.AbstractLogPositionManager; import com.alibaba.otter.canal.parse.stub.AbstractCanalEventSinkTest; -import com.alibaba.otter.canal.parse.stub.AbstractCanalLogPositionManager; import com.alibaba.otter.canal.parse.support.AuthenticationInfo; import com.alibaba.otter.canal.protocol.CanalEntry.Column; import com.alibaba.otter.canal.protocol.CanalEntry.Entry; @@ -84,16 +84,17 @@ public class MysqlDumpTest { } }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { - - public void persistLogPosition(String destination, LogPosition logPosition) { - System.out.println(logPosition); - } + controller.setLogPositionManager(new AbstractLogPositionManager() { @Override public LogPosition getLatestIndexBy(String destination) { return null; } + + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { + System.out.println(logPosition); + } }); controller.start(); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParserTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParserTest.java index fbbc595c..82ecf4af 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParserTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParserTest.java @@ -8,9 +8,10 @@ import java.util.concurrent.atomic.AtomicLong; import org.junit.Assert; import org.junit.Test; +import com.alibaba.otter.canal.parse.exception.CanalParseException; import com.alibaba.otter.canal.parse.helper.TimeoutChecker; +import com.alibaba.otter.canal.parse.index.AbstractLogPositionManager; import com.alibaba.otter.canal.parse.stub.AbstractCanalEventSinkTest; -import com.alibaba.otter.canal.parse.stub.AbstractCanalLogPositionManager; import com.alibaba.otter.canal.parse.support.AuthenticationInfo; import com.alibaba.otter.canal.protocol.CanalEntry.Entry; import com.alibaba.otter.canal.protocol.CanalEntry.EntryType; @@ -67,16 +68,17 @@ public class MysqlEventParserTest { } }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { - - public void persistLogPosition(String destination, LogPosition logPosition) { - System.out.println(logPosition); - } + controller.setLogPositionManager(new AbstractLogPositionManager() { @Override public LogPosition getLatestIndexBy(String destination) { return null; } + + @Override + public void persistLogPosition(String destination, LogPosition logPosition) throws CanalParseException { + System.out.println(logPosition); + } }); controller.start(); @@ -136,7 +138,7 @@ public class MysqlEventParserTest { } }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { + controller.setLogPositionManager(new AbstractLogPositionManager() { public void persistLogPosition(String destination, LogPosition logPosition) { System.out.println(logPosition); @@ -205,7 +207,7 @@ public class MysqlEventParserTest { } }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { + controller.setLogPositionManager(new AbstractLogPositionManager() { public void persistLogPosition(String destination, LogPosition logPosition) { System.out.println(logPosition); @@ -281,7 +283,7 @@ public class MysqlEventParserTest { } }); - controller.setLogPositionManager(new AbstractCanalLogPositionManager() { + controller.setLogPositionManager(new AbstractLogPositionManager() { public void persistLogPosition(String destination, LogPosition logPosition) { System.out.println(logPosition); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java index 233ea96b..50dce482 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/inbound/mysql/SimpleDdlParserTest.java @@ -164,7 +164,7 @@ public class SimpleDdlParserTest { Assert.assertEquals("retl_mark1", result.getOriTableName()); Assert.assertEquals("retl_mark3", result.getTableName()); - //正则匹配test case + // 正则匹配test case queryString = "rename table totl_mark to totl_mark2"; result = SimpleDdlParser.parse(queryString, "retl"); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/index/FileMixedLogPositionManagerTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/index/FileMixedLogPositionManagerTest.java index 5b05df71..e14d22d0 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/index/FileMixedLogPositionManagerTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/index/FileMixedLogPositionManagerTest.java @@ -3,9 +3,8 @@ package com.alibaba.otter.canal.parse.index; import java.io.File; import java.io.IOException; -import org.junit.Assert; - import org.apache.commons.io.FileUtils; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -27,17 +26,19 @@ public class FileMixedLogPositionManagerTest extends AbstractLogPositionManagerT @Test public void testAll() { - FileMixedLogPositionManager logPositionManager = new FileMixedLogPositionManager(); - logPositionManager.setDataDir(dataDir); - logPositionManager.setPeriod(100); + MemoryLogPositionManager memoryLogPositionManager = new MemoryLogPositionManager(); + + FileMixedLogPositionManager logPositionManager = new FileMixedLogPositionManager(dataDir, + 1000, + memoryLogPositionManager); logPositionManager.start(); LogPosition position2 = doTest(logPositionManager); sleep(1500); - FileMixedLogPositionManager logPositionManager2 = new FileMixedLogPositionManager(); - logPositionManager2.setDataDir(dataDir); - logPositionManager2.setPeriod(100); + FileMixedLogPositionManager logPositionManager2 = new FileMixedLogPositionManager(dataDir, + 1000, + memoryLogPositionManager); logPositionManager2.start(); LogPosition getPosition2 = logPositionManager2.getLatestIndexBy(destination); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/index/MetaLogPositionManagerTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/index/MetaLogPositionManagerTest.java index 1b76da52..002d1741 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/index/MetaLogPositionManagerTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/index/MetaLogPositionManagerTest.java @@ -3,9 +3,8 @@ package com.alibaba.otter.canal.parse.index; import java.net.InetSocketAddress; import java.util.Date; -import org.junit.Assert; - import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -46,8 +45,7 @@ public class MetaLogPositionManagerTest extends AbstractLogPositionManagerTest { metaManager.setZooKeeperMetaManager(zooKeeperMetaManager); metaManager.start(); - MetaLogPositionManager logPositionManager = new MetaLogPositionManager(); - logPositionManager.setMetaManager(metaManager); + MetaLogPositionManager logPositionManager = new MetaLogPositionManager(metaManager); logPositionManager.start(); // 构建meta信息 ClientIdentity client1 = new ClientIdentity(destination, (short) 1); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/index/MixedLogPositionManagerTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/index/MixedLogPositionManagerTest.java index 36faa6e0..9a59f257 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/index/MixedLogPositionManagerTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/index/MixedLogPositionManagerTest.java @@ -1,8 +1,7 @@ package com.alibaba.otter.canal.parse.index; -import org.junit.Assert; - import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -28,19 +27,16 @@ public class MixedLogPositionManagerTest extends AbstractLogPositionManagerTest @Test public void testAll() { - MixedLogPositionManager logPositionManager = new MixedLogPositionManager(); + MemoryLogPositionManager memoryLogPositionManager = new MemoryLogPositionManager(); + ZooKeeperLogPositionManager zookeeperLogPositionManager = new ZooKeeperLogPositionManager(zkclientx); - ZooKeeperLogPositionManager zookeeperLogPositionManager = new ZooKeeperLogPositionManager(); - zookeeperLogPositionManager.setZkClientx(zkclientx); - - logPositionManager.setZooKeeperLogPositionManager(zookeeperLogPositionManager); + MixedLogPositionManager logPositionManager = new MixedLogPositionManager(zkclientx); logPositionManager.start(); LogPosition position2 = doTest(logPositionManager); sleep(1000); - MixedLogPositionManager logPositionManager2 = new MixedLogPositionManager(); - logPositionManager2.setZooKeeperLogPositionManager(zookeeperLogPositionManager); + MixedLogPositionManager logPositionManager2 = new MixedLogPositionManager(zkclientx); logPositionManager2.start(); LogPosition getPosition2 = logPositionManager2.getLatestIndexBy(destination); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/index/PeriodMixedLogPositionManagerTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/index/PeriodMixedLogPositionManagerTest.java index 02c03dca..8a0d7c7d 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/index/PeriodMixedLogPositionManagerTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/index/PeriodMixedLogPositionManagerTest.java @@ -1,8 +1,7 @@ package com.alibaba.otter.canal.parse.index; -import org.junit.Assert; - import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -28,19 +27,21 @@ public class PeriodMixedLogPositionManagerTest extends AbstractLogPositionManage @Test public void testAll() { - PeriodMixedLogPositionManager logPositionManager = new PeriodMixedLogPositionManager(); + MemoryLogPositionManager memoryLogPositionManager = new MemoryLogPositionManager(); + ZooKeeperLogPositionManager zookeeperLogPositionManager = new ZooKeeperLogPositionManager(zkclientx); - ZooKeeperLogPositionManager zookeeperLogPositionManager = new ZooKeeperLogPositionManager(); - zookeeperLogPositionManager.setZkClientx(zkclientx); + PeriodMixedLogPositionManager logPositionManager = new PeriodMixedLogPositionManager(memoryLogPositionManager, + zookeeperLogPositionManager, + 1000L); - logPositionManager.setZooKeeperLogPositionManager(zookeeperLogPositionManager); logPositionManager.start(); LogPosition position2 = doTest(logPositionManager); sleep(1500); - PeriodMixedLogPositionManager logPositionManager2 = new PeriodMixedLogPositionManager(); - logPositionManager2.setZooKeeperLogPositionManager(zookeeperLogPositionManager); + PeriodMixedLogPositionManager logPositionManager2 = new PeriodMixedLogPositionManager(memoryLogPositionManager, + zookeeperLogPositionManager, + 1000L); logPositionManager2.start(); LogPosition getPosition2 = logPositionManager2.getLatestIndexBy(destination); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/index/ZooKeeperLogPositionManagerTest.java b/parse/src/test/java/com/alibaba/otter/canal/parse/index/ZooKeeperLogPositionManagerTest.java index 78f25339..0f640a49 100644 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/index/ZooKeeperLogPositionManagerTest.java +++ b/parse/src/test/java/com/alibaba/otter/canal/parse/index/ZooKeeperLogPositionManagerTest.java @@ -25,8 +25,7 @@ public class ZooKeeperLogPositionManagerTest extends AbstractLogPositionManagerT @Test public void testAll() { - ZooKeeperLogPositionManager logPositionManager = new ZooKeeperLogPositionManager(); - logPositionManager.setZkClientx(zkclientx); + ZooKeeperLogPositionManager logPositionManager = new ZooKeeperLogPositionManager(zkclientx); logPositionManager.start(); doTest(logPositionManager); diff --git a/parse/src/test/java/com/alibaba/otter/canal/parse/stub/AbstractCanalLogPositionManager.java b/parse/src/test/java/com/alibaba/otter/canal/parse/stub/AbstractCanalLogPositionManager.java deleted file mode 100644 index df73735a..00000000 --- a/parse/src/test/java/com/alibaba/otter/canal/parse/stub/AbstractCanalLogPositionManager.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.alibaba.otter.canal.parse.stub; - -import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; -import com.alibaba.otter.canal.parse.index.CanalLogPositionManager; - -public abstract class AbstractCanalLogPositionManager extends AbstractCanalLifeCycle implements CanalLogPositionManager { - -} diff --git a/pom.xml b/pom.xml index 4285d6a6..29a08fcb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ canal pom canal module for otter ${project.version} - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT https://github.com/alibaba/canal org.sonatype.oss @@ -170,14 +170,14 @@
      - com.github.sgroschupf + com.101tec zkclient - 0.1 + 0.10 com.alibaba fastjson - 1.1.35 + 1.2.28 com.google.guava @@ -195,9 +195,9 @@ 2.0.8 - org.jboss.netty - netty - 3.2.5.Final + io.netty + netty-all + 4.1.6.Final com.google.protobuf @@ -336,7 +336,7 @@ true - + org.apache.maven.plugins maven-jxr-plugin diff --git a/protocol/pom.xml b/protocol/pom.xml index 6bf5afee..b13c17b1 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter 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 f91c6790..84d6427e 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 @@ -4,12577 +4,12778 @@ package com.alibaba.otter.canal.protocol; public final class CanalEntry { - private CanalEntry() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.EntryType} - * - *
      -   **打散后的事件类型,主要用于标识事务的开始,变更数据,结束*
      -   * 
      - */ - public enum EntryType - implements com.google.protobuf.ProtocolMessageEnum { + + private CanalEntry(){ + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + } + /** - * TRANSACTIONBEGIN = 1; - */ - TRANSACTIONBEGIN(0, 1), - /** - * ROWDATA = 2; - */ - ROWDATA(1, 2), - /** - * TRANSACTIONEND = 3; - */ - TRANSACTIONEND(2, 3), - /** - * HEARTBEAT = 4; + * Protobuf enum {@code com.alibaba.otter.canal.protocol.EntryType} * *
      -     ** 心跳类型,内部使用,外部暂不可见,可忽略 *
      +     * *打散后的事件类型,主要用于标识事务的开始,变更数据,结束*
            * 
      */ - HEARTBEAT(3, 4), - ; + public enum EntryType implements com.google.protobuf.ProtocolMessageEnum { + /** + * TRANSACTIONBEGIN = 1; + */ + TRANSACTIONBEGIN(0, 1), + /** + * ROWDATA = 2; + */ + ROWDATA(1, 2), + /** + * TRANSACTIONEND = 3; + */ + TRANSACTIONEND(2, 3), + /** + * HEARTBEAT = 4; + * + *
      +         * * 心跳类型,内部使用,外部暂不可见,可忽略 *
      +         * 
      + */ + HEARTBEAT(3, 4), ; - /** - * TRANSACTIONBEGIN = 1; - */ - public static final int TRANSACTIONBEGIN_VALUE = 1; - /** - * ROWDATA = 2; - */ - public static final int ROWDATA_VALUE = 2; - /** - * TRANSACTIONEND = 3; - */ - public static final int TRANSACTIONEND_VALUE = 3; - /** - * HEARTBEAT = 4; - * - *
      -     ** 心跳类型,内部使用,外部暂不可见,可忽略 *
      -     * 
      - */ - public static final int HEARTBEAT_VALUE = 4; + /** + * TRANSACTIONBEGIN = 1; + */ + public static final int TRANSACTIONBEGIN_VALUE = 1; + /** + * ROWDATA = 2; + */ + public static final int ROWDATA_VALUE = 2; + /** + * TRANSACTIONEND = 3; + */ + public static final int TRANSACTIONEND_VALUE = 3; + /** + * HEARTBEAT = 4; + * + *
      +         * * 心跳类型,内部使用,外部暂不可见,可忽略 *
      +         * 
      + */ + public static final int HEARTBEAT_VALUE = 4; - - public final int getNumber() { return value; } - - public static EntryType valueOf(int value) { - switch (value) { - case 1: return TRANSACTIONBEGIN; - case 2: return ROWDATA; - case 3: return TRANSACTIONEND; - case 4: return HEARTBEAT; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public EntryType findValueByNumber(int number) { - return EntryType.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(0); - } - - private static final EntryType[] VALUES = values(); - - public static EntryType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private EntryType(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.EntryType) - } - - /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.EventType} - * - *
      -   ** 事件类型 *
      -   * 
      - */ - public enum EventType - implements com.google.protobuf.ProtocolMessageEnum { - /** - * INSERT = 1; - */ - INSERT(0, 1), - /** - * UPDATE = 2; - */ - UPDATE(1, 2), - /** - * DELETE = 3; - */ - DELETE(2, 3), - /** - * CREATE = 4; - */ - CREATE(3, 4), - /** - * ALTER = 5; - */ - ALTER(4, 5), - /** - * ERASE = 6; - */ - ERASE(5, 6), - /** - * QUERY = 7; - */ - QUERY(6, 7), - /** - * TRUNCATE = 8; - */ - TRUNCATE(7, 8), - /** - * RENAME = 9; - */ - RENAME(8, 9), - /** - * CINDEX = 10; - * - *
      -     **CREATE INDEX*
      -     * 
      - */ - CINDEX(9, 10), - /** - * DINDEX = 11; - */ - DINDEX(10, 11), - ; - - /** - * INSERT = 1; - */ - public static final int INSERT_VALUE = 1; - /** - * UPDATE = 2; - */ - public static final int UPDATE_VALUE = 2; - /** - * DELETE = 3; - */ - public static final int DELETE_VALUE = 3; - /** - * CREATE = 4; - */ - public static final int CREATE_VALUE = 4; - /** - * ALTER = 5; - */ - public static final int ALTER_VALUE = 5; - /** - * ERASE = 6; - */ - public static final int ERASE_VALUE = 6; - /** - * QUERY = 7; - */ - public static final int QUERY_VALUE = 7; - /** - * TRUNCATE = 8; - */ - public static final int TRUNCATE_VALUE = 8; - /** - * RENAME = 9; - */ - public static final int RENAME_VALUE = 9; - /** - * CINDEX = 10; - * - *
      -     **CREATE INDEX*
      -     * 
      - */ - public static final int CINDEX_VALUE = 10; - /** - * DINDEX = 11; - */ - public static final int DINDEX_VALUE = 11; - - - public final int getNumber() { return value; } - - public static EventType valueOf(int value) { - switch (value) { - case 1: return INSERT; - case 2: return UPDATE; - case 3: return DELETE; - case 4: return CREATE; - case 5: return ALTER; - case 6: return ERASE; - case 7: return QUERY; - case 8: return TRUNCATE; - case 9: return RENAME; - case 10: return CINDEX; - case 11: return DINDEX; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public EventType findValueByNumber(int number) { - return EventType.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(1); - } - - private static final EventType[] VALUES = values(); - - public static EventType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private EventType(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.EventType) - } - - /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.Type} - * - *
      -   **数据库类型*
      -   * 
      - */ - public enum Type - implements com.google.protobuf.ProtocolMessageEnum { - /** - * ORACLE = 1; - */ - ORACLE(0, 1), - /** - * MYSQL = 2; - */ - MYSQL(1, 2), - /** - * PGSQL = 3; - */ - PGSQL(2, 3), - ; - - /** - * ORACLE = 1; - */ - public static final int ORACLE_VALUE = 1; - /** - * MYSQL = 2; - */ - public static final int MYSQL_VALUE = 2; - /** - * PGSQL = 3; - */ - public static final int PGSQL_VALUE = 3; - - - public final int getNumber() { return value; } - - public static Type valueOf(int value) { - switch (value) { - case 1: return ORACLE; - case 2: return MYSQL; - case 3: return PGSQL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Type findValueByNumber(int number) { - return Type.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(2); - } - - private static final Type[] VALUES = values(); - - public static Type valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private Type(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.Type) - } - - public interface EntryOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Entry) - com.google.protobuf.MessageOrBuilder { - - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -     **协议头部信息*
      -     * 
      - */ - boolean hasHeader(); - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -     **协议头部信息*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader(); - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -     **协议头部信息*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder(); - - /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * - *
      -     **打散后的事件类型*
      -     * 
      - */ - boolean hasEntryType(); - /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * - *
      -     **打散后的事件类型*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType(); - - /** - * optional bytes storeValue = 3; - * - *
      -     **传输的二进制数组*
      -     * 
      - */ - boolean hasStoreValue(); - /** - * optional bytes storeValue = 3; - * - *
      -     **传输的二进制数组*
      -     * 
      - */ - com.google.protobuf.ByteString getStoreValue(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Entry} - * - *
      -   ****************************************************************
      -   * message model
      -   *如果要在Enum中新增类型,确保以前的类型的下标值不变.
      -   ***************************************************************
      -   * 
      - */ - public static final class Entry extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Entry) - EntryOrBuilder { - // Use Entry.newBuilder() to construct. - private Entry(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Entry(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Entry defaultInstance; - public static Entry getDefaultInstance() { - return defaultInstance; - } - - public Entry getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Entry( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = header_.toBuilder(); - } - header_ = input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Header.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(header_); - header_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 16: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalEntry.EntryType value = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(2, rawValue); - } else { - bitField0_ |= 0x00000002; - entryType_ = value; - } - break; - } - case 26: { - bitField0_ |= 0x00000004; - storeValue_ = input.readBytes(); - break; - } - } + public final int getNumber() { + return value; } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + + public static EntryType valueOf(int value) { + switch (value) { + case 1: + return TRANSACTIONBEGIN; + case 2: + return ROWDATA; + case 3: + return TRANSACTIONEND; + case 4: + return HEARTBEAT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + + public EntryType findValueByNumber(int number) { + return EntryType.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(0); + } + + private static final EntryType[] VALUES = values(); + + public static EntryType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private EntryType(int index, int value){ + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.EntryType) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - 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); - } - }; - - @java.lang.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_; /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * Protobuf enum {@code com.alibaba.otter.canal.protocol.EventType} * *
      -     **协议头部信息*
      +     * * 事件类型 *
            * 
      */ - public boolean hasHeader() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public enum EventType implements com.google.protobuf.ProtocolMessageEnum { + /** + * INSERT = 1; + */ + INSERT(0, 1), + /** + * UPDATE = 2; + */ + UPDATE(1, 2), + /** + * DELETE = 3; + */ + DELETE(2, 3), + /** + * CREATE = 4; + */ + CREATE(3, 4), + /** + * ALTER = 5; + */ + ALTER(4, 5), + /** + * ERASE = 6; + */ + ERASE(5, 6), + /** + * QUERY = 7; + */ + QUERY(6, 7), + /** + * TRUNCATE = 8; + */ + TRUNCATE(7, 8), + /** + * RENAME = 9; + */ + RENAME(8, 9), + /** + * CINDEX = 10; + * + *
      +         * *CREATE INDEX*
      +         * 
      + */ + CINDEX(9, 10), + /** + * DINDEX = 11; + */ + DINDEX(10, 11), ; + + /** + * INSERT = 1; + */ + public static final int INSERT_VALUE = 1; + /** + * UPDATE = 2; + */ + public static final int UPDATE_VALUE = 2; + /** + * DELETE = 3; + */ + public static final int DELETE_VALUE = 3; + /** + * CREATE = 4; + */ + public static final int CREATE_VALUE = 4; + /** + * ALTER = 5; + */ + public static final int ALTER_VALUE = 5; + /** + * ERASE = 6; + */ + public static final int ERASE_VALUE = 6; + /** + * QUERY = 7; + */ + public static final int QUERY_VALUE = 7; + /** + * TRUNCATE = 8; + */ + public static final int TRUNCATE_VALUE = 8; + /** + * RENAME = 9; + */ + public static final int RENAME_VALUE = 9; + /** + * CINDEX = 10; + * + *
      +         * *CREATE INDEX*
      +         * 
      + */ + public static final int CINDEX_VALUE = 10; + /** + * DINDEX = 11; + */ + public static final int DINDEX_VALUE = 11; + + public final int getNumber() { + return value; + } + + public static EventType valueOf(int value) { + switch (value) { + case 1: + return INSERT; + case 2: + return UPDATE; + case 3: + return DELETE; + case 4: + return CREATE; + case 5: + return ALTER; + case 6: + return ERASE; + case 7: + return QUERY; + case 8: + return TRUNCATE; + case 9: + return RENAME; + case 10: + return CINDEX; + case 11: + return DINDEX; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + + public EventType findValueByNumber(int number) { + return EventType.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(1); + } + + private static final EventType[] VALUES = values(); + + public static EventType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private EventType(int index, int value){ + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.EventType) } + /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * Protobuf enum {@code com.alibaba.otter.canal.protocol.Type} * *
      -     **协议头部信息*
      +     * *数据库类型*
            * 
      */ - public com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader() { - return header_; - } - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -     **协议头部信息*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder() { - return header_; + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * ORACLE = 1; + */ + ORACLE(0, 1), + /** + * MYSQL = 2; + */ + MYSQL(1, 2), + /** + * PGSQL = 3; + */ + PGSQL(2, 3), ; + + /** + * ORACLE = 1; + */ + public static final int ORACLE_VALUE = 1; + /** + * MYSQL = 2; + */ + public static final int MYSQL_VALUE = 2; + /** + * PGSQL = 3; + */ + public static final int PGSQL_VALUE = 3; + + public final int getNumber() { + return value; + } + + public static Type valueOf(int value) { + switch (value) { + case 1: + return ORACLE; + case 2: + return MYSQL; + case 3: + return PGSQL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + + public Type findValueByNumber(int number) { + return Type.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalEntry.getDescriptor().getEnumTypes().get(2); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private Type(int index, int value){ + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.Type) } - public static final int ENTRYTYPE_FIELD_NUMBER = 2; - private com.alibaba.otter.canal.protocol.CanalEntry.EntryType entryType_; - /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * - *
      -     **打散后的事件类型*
      -     * 
      - */ - public boolean hasEntryType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * - *
      -     **打散后的事件类型*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { - return entryType_; + public interface EntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Entry) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +         * *协议头部信息*
      +         * 
      + */ + boolean hasHeader(); + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +         * *协议头部信息*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader(); + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +         * *协议头部信息*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder(); + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
      +         * *打散后的事件类型*
      +         * 
      + */ + boolean hasEntryType(); + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
      +         * *打散后的事件类型*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType(); + + /** + * optional bytes storeValue = 3; + * + *
      +         * *传输的二进制数组*
      +         * 
      + */ + boolean hasStoreValue(); + + /** + * optional bytes storeValue = 3; + * + *
      +         * *传输的二进制数组*
      +         * 
      + */ + com.google.protobuf.ByteString getStoreValue(); } - 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; - * - *
      -     **传输的二进制数组*
      -     * 
      - */ - public com.google.protobuf.ByteString getStoreValue() { - return storeValue_; - } - - private void initFields() { - header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); - entryType_ = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA; - storeValue_ = com.google.protobuf.ByteString.EMPTY; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, header_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, entryType_.getNumber()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, storeValue_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, header_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, entryType_.getNumber()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, storeValue_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.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( - 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) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Entry prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Entry} * *
      -     ****************************************************************
      -     * message model
      -     *如果要在Enum中新增类型,确保以前的类型的下标值不变.
      +     ****************************************************************
      +     *  message model
      +     * 如果要在Enum中新增类型,确保以前的类型的下标值不变.
            ***************************************************************
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Entry extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Entry) + EntryOrBuilder { + + // Use Entry.newBuilder() to construct. + private Entry(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Entry(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Entry defaultInstance; + + public static Entry getDefaultInstance() { + return defaultInstance; + } + + public Entry getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Entry(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = header_.toBuilder(); + } + header_ = input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Header.PARSER, + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(header_); + header_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 16: { + int rawValue = input.readEnum(); + com.alibaba.otter.canal.protocol.CanalEntry.EntryType value = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(2, rawValue); + } else { + bitField0_ |= 0x00000002; + entryType_ = value; + } + break; + } + case 26: { + bitField0_ |= 0x00000004; + storeValue_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } + + 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); + } + }; + + @java.lang.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_; + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +         * *协议头部信息*
      +         * 
      + */ + public boolean hasHeader() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +         * *协议头部信息*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader() { + return header_; + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +         * *协议头部信息*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder() { + return header_; + } + + public static final int ENTRYTYPE_FIELD_NUMBER = 2; + private com.alibaba.otter.canal.protocol.CanalEntry.EntryType entryType_; + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
      +         * *打散后的事件类型*
      +         * 
      + */ + public boolean hasEntryType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
      +         * *打散后的事件类型*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.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; + * + *
      +         * *传输的二进制数组*
      +         * 
      + */ + public com.google.protobuf.ByteString getStoreValue() { + return storeValue_; + } + + private void initFields() { + header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); + entryType_ = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA; + storeValue_ = com.google.protobuf.ByteString.EMPTY; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, header_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeEnum(2, entryType_.getNumber()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, storeValue_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, header_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, entryType_.getNumber()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, storeValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.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(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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Entry parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Entry prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Entry} + * + *
      +         ****************************************************************
      +         *  message model
      +         * 如果要在Enum中新增类型,确保以前的类型的下标值不变.
      +         ***************************************************************
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Entry) com.alibaba.otter.canal.protocol.CanalEntry.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; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Entry.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getHeaderFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (headerBuilder_ == null) { - header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); - } else { - headerBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - entryType_ = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA; - bitField0_ = (bitField0_ & ~0x00000002); - storeValue_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Entry getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.Entry.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Entry build() { - com.alibaba.otter.canal.protocol.CanalEntry.Entry result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Entry buildPartial() { - com.alibaba.otter.canal.protocol.CanalEntry.Entry result = new com.alibaba.otter.canal.protocol.CanalEntry.Entry(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (headerBuilder_ == null) { - result.header_ = header_; - } else { - result.header_ = headerBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.entryType_ = entryType_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.storeValue_ = storeValue_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - 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); - } 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; - if (other.hasHeader()) { - mergeHeader(other.getHeader()); - } - if (other.hasEntryType()) { - setEntryType(other.getEntryType()); - } - if (other.hasStoreValue()) { - setStoreValue(other.getStoreValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalEntry.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; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.alibaba.otter.canal.protocol.CanalEntry.Header header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Header, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder, com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder> headerBuilder_; - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -       **协议头部信息*
      -       * 
      - */ - public boolean hasHeader() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -       **协议头部信息*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader() { - if (headerBuilder_ == null) { - return header_; - } else { - return headerBuilder_.getMessage(); - } - } - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -       **协议头部信息*
      -       * 
      - */ - public Builder setHeader(com.alibaba.otter.canal.protocol.CanalEntry.Header value) { - if (headerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - header_ = value; - onChanged(); - } else { - headerBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -       **协议头部信息*
      -       * 
      - */ - public Builder setHeader( - com.alibaba.otter.canal.protocol.CanalEntry.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; - * - *
      -       **协议头部信息*
      -       * 
      - */ - public Builder mergeHeader(com.alibaba.otter.canal.protocol.CanalEntry.Header value) { - if (headerBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - header_ != com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance()) { - header_ = - com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder(header_).mergeFrom(value).buildPartial(); - } else { - header_ = value; - } - onChanged(); - } else { - headerBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -       **协议头部信息*
      -       * 
      - */ - public Builder clearHeader() { - if (headerBuilder_ == null) { - header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); - onChanged(); - } else { - headerBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -       **协议头部信息*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder getHeaderBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getHeaderFieldBuilder().getBuilder(); - } - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -       **协议头部信息*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder() { - if (headerBuilder_ != null) { - return headerBuilder_.getMessageOrBuilder(); - } else { - return header_; - } - } - /** - * optional .com.alibaba.otter.canal.protocol.Header header = 1; - * - *
      -       **协议头部信息*
      -       * 
      - */ - private com.google.protobuf.SingleFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Header, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder, com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder> - getHeaderFieldBuilder() { - if (headerBuilder_ == null) { - headerBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Header, com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder, com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder>( - getHeader(), - getParentForChildren(), - isClean()); - header_ = null; - } - return headerBuilder_; - } - - private com.alibaba.otter.canal.protocol.CanalEntry.EntryType entryType_ = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA; - /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * - *
      -       **打散后的事件类型*
      -       * 
      - */ - public boolean hasEntryType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * - *
      -       **打散后的事件类型*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { - return entryType_; - } - /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * - *
      -       **打散后的事件类型*
      -       * 
      - */ - public Builder setEntryType(com.alibaba.otter.canal.protocol.CanalEntry.EntryType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - entryType_ = value; - onChanged(); - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; - * - *
      -       **打散后的事件类型*
      -       * 
      - */ - public Builder clearEntryType() { - bitField0_ = (bitField0_ & ~0x00000002); - entryType_ = com.alibaba.otter.canal.protocol.CanalEntry.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; - * - *
      -       **传输的二进制数组*
      -       * 
      - */ - public com.google.protobuf.ByteString getStoreValue() { - return storeValue_; - } - /** - * optional 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; - * - *
      -       **传输的二进制数组*
      -       * 
      - */ - public Builder clearStoreValue() { - bitField0_ = (bitField0_ & ~0x00000004); - storeValue_ = getDefaultInstance().getStoreValue(); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Entry) - } - - static { - defaultInstance = new Entry(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Entry) - } - - public interface HeaderOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Header) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int32 version = 1 [default = 1]; - * - *
      -     **协议的版本号*
      -     * 
      - */ - boolean hasVersion(); - /** - * optional int32 version = 1 [default = 1]; - * - *
      -     **协议的版本号*
      -     * 
      - */ - int getVersion(); - - /** - * optional string logfileName = 2; - * - *
      -     **binlog/redolog 文件名*
      -     * 
      - */ - boolean hasLogfileName(); - /** - * optional string logfileName = 2; - * - *
      -     **binlog/redolog 文件名*
      -     * 
      - */ - java.lang.String getLogfileName(); - /** - * optional string logfileName = 2; - * - *
      -     **binlog/redolog 文件名*
      -     * 
      - */ - com.google.protobuf.ByteString - getLogfileNameBytes(); - - /** - * optional int64 logfileOffset = 3; - * - *
      -     **binlog/redolog 文件的偏移位置*
      -     * 
      - */ - boolean hasLogfileOffset(); - /** - * optional int64 logfileOffset = 3; - * - *
      -     **binlog/redolog 文件的偏移位置*
      -     * 
      - */ - long getLogfileOffset(); - - /** - * optional int64 serverId = 4; - * - *
      -     **服务端serverId*
      -     * 
      - */ - boolean hasServerId(); - /** - * optional int64 serverId = 4; - * - *
      -     **服务端serverId*
      -     * 
      - */ - long getServerId(); - - /** - * optional string serverenCode = 5; - * - *
      -     ** 变更数据的编码 *
      -     * 
      - */ - boolean hasServerenCode(); - /** - * optional string serverenCode = 5; - * - *
      -     ** 变更数据的编码 *
      -     * 
      - */ - java.lang.String getServerenCode(); - /** - * optional string serverenCode = 5; - * - *
      -     ** 变更数据的编码 *
      -     * 
      - */ - com.google.protobuf.ByteString - getServerenCodeBytes(); - - /** - * optional int64 executeTime = 6; - * - *
      -     **变更数据的执行时间 *
      -     * 
      - */ - boolean hasExecuteTime(); - /** - * optional int64 executeTime = 6; - * - *
      -     **变更数据的执行时间 *
      -     * 
      - */ - long getExecuteTime(); - - /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * - *
      -     ** 变更数据的来源*
      -     * 
      - */ - boolean hasSourceType(); - /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * - *
      -     ** 变更数据的来源*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType(); - - /** - * optional string schemaName = 8; - * - *
      -     ** 变更数据的schemaname*
      -     * 
      - */ - boolean hasSchemaName(); - /** - * optional string schemaName = 8; - * - *
      -     ** 变更数据的schemaname*
      -     * 
      - */ - java.lang.String getSchemaName(); - /** - * optional string schemaName = 8; - * - *
      -     ** 变更数据的schemaname*
      -     * 
      - */ - com.google.protobuf.ByteString - getSchemaNameBytes(); - - /** - * optional string tableName = 9; - * - *
      -     **变更数据的tablename*
      -     * 
      - */ - boolean hasTableName(); - /** - * optional string tableName = 9; - * - *
      -     **变更数据的tablename*
      -     * 
      - */ - java.lang.String getTableName(); - /** - * optional string tableName = 9; - * - *
      -     **变更数据的tablename*
      -     * 
      - */ - com.google.protobuf.ByteString - getTableNameBytes(); - - /** - * optional int64 eventLength = 10; - * - *
      -     **每个event的长度*
      -     * 
      - */ - boolean hasEventLength(); - /** - * optional int64 eventLength = 10; - * - *
      -     **每个event的长度*
      -     * 
      - */ - long getEventLength(); - - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * - *
      -     **数据变更类型*
      -     * 
      - */ - boolean hasEventType(); - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * - *
      -     **数据变更类型*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - int getPropsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Header} - * - *
      -   **message Header*
      -   * 
      - */ - public static final class Header extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Header) - HeaderOrBuilder { - // Use Header.newBuilder() to construct. - private Header(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Header(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Header defaultInstance; - public static Header getDefaultInstance() { - return defaultInstance; - } - - public Header getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Header( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + 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; } - case 8: { - bitField0_ |= 0x00000001; - version_ = input.readInt32(); - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - logfileName_ = bs; - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalEntry.Entry.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 24: { - bitField0_ |= 0x00000004; - logfileOffset_ = input.readInt64(); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - case 32: { - bitField0_ |= 0x00000008; - serverId_ = input.readInt64(); - break; + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getHeaderFieldBuilder(); + } } - case 42: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000010; - serverenCode_ = bs; - break; + + private static Builder create() { + return new Builder(); } - case 48: { - bitField0_ |= 0x00000020; - executeTime_ = input.readInt64(); - break; + + public Builder clear() { + super.clear(); + if (headerBuilder_ == null) { + header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); + } else { + headerBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + entryType_ = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA; + bitField0_ = (bitField0_ & ~0x00000002); + storeValue_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; } - case 56: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalEntry.Type value = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(7, rawValue); - } else { - bitField0_ |= 0x00000040; - sourceType_ = value; - } - break; + + public Builder clone() { + return create().mergeFrom(buildPartial()); } - case 66: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000080; - schemaName_ = bs; - break; + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; } - case 74: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000100; - tableName_ = bs; - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.Entry getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.Entry.getDefaultInstance(); } - case 80: { - bitField0_ |= 0x00000200; - eventLength_ = input.readInt64(); - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.Entry build() { + com.alibaba.otter.canal.protocol.CanalEntry.Entry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; } - case 88: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalEntry.EventType value = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(11, rawValue); - } else { - bitField0_ |= 0x00000400; - eventType_ = value; - } - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.Entry buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.Entry result = new com.alibaba.otter.canal.protocol.CanalEntry.Entry(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (headerBuilder_ == null) { + result.header_ = header_; + } else { + result.header_ = headerBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.entryType_ = entryType_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.storeValue_ = storeValue_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; } - case 98: { - if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - props_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000800; - } - props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); - break; + + 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); + } 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; + if (other.hasHeader()) { + mergeHeader(other.getHeader()); + } + if (other.hasEntryType()) { + setEntryType(other.getEntryType()); + } + if (other.hasStoreValue()) { + setStoreValue(other.getStoreValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalEntry.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; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.alibaba.otter.canal.protocol.CanalEntry.Header header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder headerBuilder_; + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + public boolean hasHeader() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Header getHeader() { + if (headerBuilder_ == null) { + return header_; + } else { + return headerBuilder_.getMessage(); + } + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + public Builder setHeader(com.alibaba.otter.canal.protocol.CanalEntry.Header value) { + if (headerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + header_ = value; + onChanged(); + } else { + headerBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + public Builder setHeader(com.alibaba.otter.canal.protocol.CanalEntry.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; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + public Builder mergeHeader(com.alibaba.otter.canal.protocol.CanalEntry.Header value) { + if (headerBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) + && header_ != com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance()) { + header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder(header_) + .mergeFrom(value) + .buildPartial(); + } else { + header_ = value; + } + onChanged(); + } else { + headerBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + public Builder clearHeader() { + if (headerBuilder_ == null) { + header_ = com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); + onChanged(); + } else { + headerBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Header.Builder getHeaderBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getHeaderFieldBuilder().getBuilder(); + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.HeaderOrBuilder getHeaderOrBuilder() { + if (headerBuilder_ != null) { + return headerBuilder_.getMessageOrBuilder(); + } else { + return header_; + } + } + + /** + * optional .com.alibaba.otter.canal.protocol.Header header = 1; + * + *
      +             * *协议头部信息*
      +             * 
      + */ + private com.google.protobuf.SingleFieldBuilder getHeaderFieldBuilder() { + if (headerBuilder_ == null) { + headerBuilder_ = new com.google.protobuf.SingleFieldBuilder(getHeader(), + getParentForChildren(), + isClean()); + header_ = null; + } + return headerBuilder_; + } + + private com.alibaba.otter.canal.protocol.CanalEntry.EntryType entryType_ = com.alibaba.otter.canal.protocol.CanalEntry.EntryType.ROWDATA; + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
      +             * *打散后的事件类型*
      +             * 
      + */ + public boolean hasEntryType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
      +             * *打散后的事件类型*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.EntryType getEntryType() { + return entryType_; + } + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
      +             * *打散后的事件类型*
      +             * 
      + */ + public Builder setEntryType(com.alibaba.otter.canal.protocol.CanalEntry.EntryType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + entryType_ = value; + onChanged(); + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.EntryType entryType = 2 [default = ROWDATA]; + * + *
      +             * *打散后的事件类型*
      +             * 
      + */ + public Builder clearEntryType() { + bitField0_ = (bitField0_ & ~0x00000002); + entryType_ = com.alibaba.otter.canal.protocol.CanalEntry.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; + * + *
      +             * *传输的二进制数组*
      +             * 
      + */ + public com.google.protobuf.ByteString getStoreValue() { + return storeValue_; + } + + /** + * optional 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; + * + *
      +             * *传输的二进制数组*
      +             * 
      + */ + public Builder clearStoreValue() { + bitField0_ = (bitField0_ & ~0x00000004); + storeValue_ = getDefaultInstance().getStoreValue(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Entry) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { - props_ = java.util.Collections.unmodifiableList(props_); + + static { + defaultInstance = new Entry(true); + defaultInstance.initFields(); } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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; + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Entry) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); + public interface HeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Header) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 version = 1 [default = 1]; + * + *
      +         * *协议的版本号*
      +         * 
      + */ + boolean hasVersion(); + + /** + * optional int32 version = 1 [default = 1]; + * + *
      +         * *协议的版本号*
      +         * 
      + */ + int getVersion(); + + /** + * optional string logfileName = 2; + * + *
      +         * *binlog/redolog 文件名*
      +         * 
      + */ + boolean hasLogfileName(); + + /** + * optional string logfileName = 2; + * + *
      +         * *binlog/redolog 文件名*
      +         * 
      + */ + java.lang.String getLogfileName(); + + /** + * optional string logfileName = 2; + * + *
      +         * *binlog/redolog 文件名*
      +         * 
      + */ + com.google.protobuf.ByteString getLogfileNameBytes(); + + /** + * optional int64 logfileOffset = 3; + * + *
      +         * *binlog/redolog 文件的偏移位置*
      +         * 
      + */ + boolean hasLogfileOffset(); + + /** + * optional int64 logfileOffset = 3; + * + *
      +         * *binlog/redolog 文件的偏移位置*
      +         * 
      + */ + long getLogfileOffset(); + + /** + * optional int64 serverId = 4; + * + *
      +         * *服务端serverId*
      +         * 
      + */ + boolean hasServerId(); + + /** + * optional int64 serverId = 4; + * + *
      +         * *服务端serverId*
      +         * 
      + */ + long getServerId(); + + /** + * optional string serverenCode = 5; + * + *
      +         * * 变更数据的编码 *
      +         * 
      + */ + boolean hasServerenCode(); + + /** + * optional string serverenCode = 5; + * + *
      +         * * 变更数据的编码 *
      +         * 
      + */ + java.lang.String getServerenCode(); + + /** + * optional string serverenCode = 5; + * + *
      +         * * 变更数据的编码 *
      +         * 
      + */ + com.google.protobuf.ByteString getServerenCodeBytes(); + + /** + * optional int64 executeTime = 6; + * + *
      +         * *变更数据的执行时间 *
      +         * 
      + */ + boolean hasExecuteTime(); + + /** + * optional int64 executeTime = 6; + * + *
      +         * *变更数据的执行时间 *
      +         * 
      + */ + long getExecuteTime(); + + /** + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
      +         * * 变更数据的来源*
      +         * 
      + */ + boolean hasSourceType(); + + /** + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
      +         * * 变更数据的来源*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType(); + + /** + * optional string schemaName = 8; + * + *
      +         * * 变更数据的schemaname*
      +         * 
      + */ + boolean hasSchemaName(); + + /** + * optional string schemaName = 8; + * + *
      +         * * 变更数据的schemaname*
      +         * 
      + */ + java.lang.String getSchemaName(); + + /** + * optional string schemaName = 8; + * + *
      +         * * 变更数据的schemaname*
      +         * 
      + */ + com.google.protobuf.ByteString getSchemaNameBytes(); + + /** + * optional string tableName = 9; + * + *
      +         * *变更数据的tablename*
      +         * 
      + */ + boolean hasTableName(); + + /** + * optional string tableName = 9; + * + *
      +         * *变更数据的tablename*
      +         * 
      + */ + java.lang.String getTableName(); + + /** + * optional string tableName = 9; + * + *
      +         * *变更数据的tablename*
      +         * 
      + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * optional int64 eventLength = 10; + * + *
      +         * *每个event的长度*
      +         * 
      + */ + boolean hasEventLength(); + + /** + * optional int64 eventLength = 10; + * + *
      +         * *每个event的长度*
      +         * 
      + */ + long getEventLength(); + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
      +         * *数据变更类型*
      +         * 
      + */ + boolean hasEventType(); + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
      +         * *数据变更类型*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + int getPropsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index); } - 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); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser
      getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int VERSION_FIELD_NUMBER = 1; - private int version_; - /** - * optional int32 version = 1 [default = 1]; - * - *
      -     **协议的版本号*
      -     * 
      - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 version = 1 [default = 1]; - * - *
      -     **协议的版本号*
      -     * 
      - */ - public int getVersion() { - return version_; - } - - public static final int LOGFILENAME_FIELD_NUMBER = 2; - private java.lang.Object logfileName_; - /** - * optional string logfileName = 2; - * - *
      -     **binlog/redolog 文件名*
      -     * 
      - */ - public boolean hasLogfileName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string logfileName = 2; - * - *
      -     **binlog/redolog 文件名*
      -     * 
      - */ - public java.lang.String getLogfileName() { - java.lang.Object ref = logfileName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - logfileName_ = s; - } - return s; - } - } - /** - * optional string logfileName = 2; - * - *
      -     **binlog/redolog 文件名*
      -     * 
      - */ - public com.google.protobuf.ByteString - getLogfileNameBytes() { - java.lang.Object ref = logfileName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - logfileName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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; - * - *
      -     **binlog/redolog 文件的偏移位置*
      -     * 
      - */ - public long getLogfileOffset() { - return logfileOffset_; - } - - 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; - * - *
      -     **服务端serverId*
      -     * 
      - */ - public long getServerId() { - return serverId_; - } - - public static final int SERVERENCODE_FIELD_NUMBER = 5; - private java.lang.Object serverenCode_; - /** - * optional string serverenCode = 5; - * - *
      -     ** 变更数据的编码 *
      -     * 
      - */ - public boolean hasServerenCode() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string serverenCode = 5; - * - *
      -     ** 变更数据的编码 *
      -     * 
      - */ - public java.lang.String getServerenCode() { - java.lang.Object ref = serverenCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - serverenCode_ = s; - } - return s; - } - } - /** - * optional 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 = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serverenCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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; - * - *
      -     **变更数据的执行时间 *
      -     * 
      - */ - public long getExecuteTime() { - return executeTime_; - } - - public static final int SOURCETYPE_FIELD_NUMBER = 7; - private com.alibaba.otter.canal.protocol.CanalEntry.Type sourceType_; - /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * - *
      -     ** 变更数据的来源*
      -     * 
      - */ - public boolean hasSourceType() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * - *
      -     ** 变更数据的来源*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { - return sourceType_; - } - - public static final int SCHEMANAME_FIELD_NUMBER = 8; - private java.lang.Object schemaName_; - /** - * optional string schemaName = 8; - * - *
      -     ** 变更数据的schemaname*
      -     * 
      - */ - public boolean hasSchemaName() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional string schemaName = 8; - * - *
      -     ** 变更数据的schemaname*
      -     * 
      - */ - public java.lang.String getSchemaName() { - java.lang.Object ref = schemaName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - schemaName_ = s; - } - return s; - } - } - /** - * optional string schemaName = 8; - * - *
      -     ** 变更数据的schemaname*
      -     * 
      - */ - public com.google.protobuf.ByteString - getSchemaNameBytes() { - java.lang.Object ref = schemaName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - schemaName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TABLENAME_FIELD_NUMBER = 9; - private java.lang.Object tableName_; - /** - * optional string tableName = 9; - * - *
      -     **变更数据的tablename*
      -     * 
      - */ - public boolean hasTableName() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional string tableName = 9; - * - *
      -     **变更数据的tablename*
      -     * 
      - */ - public java.lang.String getTableName() { - java.lang.Object ref = tableName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - tableName_ = s; - } - return s; - } - } - /** - * optional string tableName = 9; - * - *
      -     **变更数据的tablename*
      -     * 
      - */ - public com.google.protobuf.ByteString - getTableNameBytes() { - java.lang.Object ref = tableName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tableName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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; - * - *
      -     **每个event的长度*
      -     * 
      - */ - public long getEventLength() { - return eventLength_; - } - - public static final int EVENTTYPE_FIELD_NUMBER = 11; - private com.alibaba.otter.canal.protocol.CanalEntry.EventType eventType_; - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * - *
      -     **数据变更类型*
      -     * 
      - */ - public boolean hasEventType() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * - *
      -     **数据变更类型*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - return eventType_; - } - - public static final int PROPS_FIELD_NUMBER = 12; - private java.util.List props_; - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List getPropsList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List - getPropsOrBuilderList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - public int getPropsCount() { - return props_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - return props_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - return props_.get(index); - } - - private void initFields() { - version_ = 1; - logfileName_ = ""; - logfileOffset_ = 0L; - serverId_ = 0L; - serverenCode_ = ""; - executeTime_ = 0L; - sourceType_ = com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL; - schemaName_ = ""; - tableName_ = ""; - eventLength_ = 0L; - eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; - props_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, version_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getLogfileNameBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt64(3, logfileOffset_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt64(4, serverId_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, getServerenCodeBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeInt64(6, executeTime_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeEnum(7, sourceType_.getNumber()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeBytes(8, getSchemaNameBytes()); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeBytes(9, getTableNameBytes()); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeInt64(10, eventLength_); - } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - output.writeEnum(11, eventType_.getNumber()); - } - for (int i = 0; i < props_.size(); i++) { - output.writeMessage(12, props_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, version_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getLogfileNameBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, logfileOffset_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, serverId_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, getServerenCodeBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, executeTime_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, sourceType_.getNumber()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(8, getSchemaNameBytes()); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(9, getTableNameBytes()); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(10, eventLength_); - } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(11, eventType_.getNumber()); - } - for (int i = 0; i < props_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, props_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.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( - 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) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Header prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Header} * *
      -     **message Header*
      +     * *message Header*
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Header extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Header) + HeaderOrBuilder { + + // Use Header.newBuilder() to construct. + private Header(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Header(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Header defaultInstance; + + public static Header getDefaultInstance() { + return defaultInstance; + } + + public Header getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Header(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + version_ = input.readInt32(); + break; + } + case 18: { + 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: { + 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(); + com.alibaba.otter.canal.protocol.CanalEntry.Type value = com.alibaba.otter.canal.protocol.CanalEntry.Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(7, rawValue); + } else { + bitField0_ |= 0x00000040; + sourceType_ = value; + } + break; + } + case 66: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000080; + schemaName_ = bs; + break; + } + case 74: { + 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(); + com.alibaba.otter.canal.protocol.CanalEntry.EventType value = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(11, rawValue); + } else { + bitField0_ |= 0x00000400; + eventType_ = value; + } + break; + } + case 98: { + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + props_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000800; + } + props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, + extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + props_ = java.util.Collections.unmodifiableList(props_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + 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; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } + + 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); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser
      getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int VERSION_FIELD_NUMBER = 1; + private int version_; + + /** + * optional int32 version = 1 [default = 1]; + * + *
      +         * *协议的版本号*
      +         * 
      + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int32 version = 1 [default = 1]; + * + *
      +         * *协议的版本号*
      +         * 
      + */ + public int getVersion() { + return version_; + } + + public static final int LOGFILENAME_FIELD_NUMBER = 2; + private java.lang.Object logfileName_; + + /** + * optional string logfileName = 2; + * + *
      +         * *binlog/redolog 文件名*
      +         * 
      + */ + public boolean hasLogfileName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string logfileName = 2; + * + *
      +         * *binlog/redolog 文件名*
      +         * 
      + */ + public java.lang.String getLogfileName() { + java.lang.Object ref = logfileName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + logfileName_ = s; + } + return s; + } + } + + /** + * optional string logfileName = 2; + * + *
      +         * *binlog/redolog 文件名*
      +         * 
      + */ + public com.google.protobuf.ByteString getLogfileNameBytes() { + java.lang.Object ref = logfileName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logfileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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; + * + *
      +         * *binlog/redolog 文件的偏移位置*
      +         * 
      + */ + public long getLogfileOffset() { + return logfileOffset_; + } + + 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; + * + *
      +         * *服务端serverId*
      +         * 
      + */ + public long getServerId() { + return serverId_; + } + + public static final int SERVERENCODE_FIELD_NUMBER = 5; + private java.lang.Object serverenCode_; + + /** + * optional string serverenCode = 5; + * + *
      +         * * 变更数据的编码 *
      +         * 
      + */ + public boolean hasServerenCode() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional string serverenCode = 5; + * + *
      +         * * 变更数据的编码 *
      +         * 
      + */ + public java.lang.String getServerenCode() { + java.lang.Object ref = serverenCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + serverenCode_ = s; + } + return s; + } + } + + /** + * optional 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 = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverenCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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; + * + *
      +         * *变更数据的执行时间 *
      +         * 
      + */ + public long getExecuteTime() { + return executeTime_; + } + + public static final int SOURCETYPE_FIELD_NUMBER = 7; + private com.alibaba.otter.canal.protocol.CanalEntry.Type sourceType_; + + /** + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
      +         * * 变更数据的来源*
      +         * 
      + */ + public boolean hasSourceType() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + + /** + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
      +         * * 变更数据的来源*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { + return sourceType_; + } + + public static final int SCHEMANAME_FIELD_NUMBER = 8; + private java.lang.Object schemaName_; + + /** + * optional string schemaName = 8; + * + *
      +         * * 变更数据的schemaname*
      +         * 
      + */ + public boolean hasSchemaName() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + + /** + * optional string schemaName = 8; + * + *
      +         * * 变更数据的schemaname*
      +         * 
      + */ + public java.lang.String getSchemaName() { + java.lang.Object ref = schemaName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + schemaName_ = s; + } + return s; + } + } + + /** + * optional string schemaName = 8; + * + *
      +         * * 变更数据的schemaname*
      +         * 
      + */ + public com.google.protobuf.ByteString getSchemaNameBytes() { + java.lang.Object ref = schemaName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLENAME_FIELD_NUMBER = 9; + private java.lang.Object tableName_; + + /** + * optional string tableName = 9; + * + *
      +         * *变更数据的tablename*
      +         * 
      + */ + public boolean hasTableName() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + + /** + * optional string tableName = 9; + * + *
      +         * *变更数据的tablename*
      +         * 
      + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + tableName_ = s; + } + return s; + } + } + + /** + * optional string tableName = 9; + * + *
      +         * *变更数据的tablename*
      +         * 
      + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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; + * + *
      +         * *每个event的长度*
      +         * 
      + */ + public long getEventLength() { + return eventLength_; + } + + public static final int EVENTTYPE_FIELD_NUMBER = 11; + private com.alibaba.otter.canal.protocol.CanalEntry.EventType eventType_; + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
      +         * *数据变更类型*
      +         * 
      + */ + public boolean hasEventType() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
      +         * *数据变更类型*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { + return eventType_; + } + + public static final int PROPS_FIELD_NUMBER = 12; + private java.util.List props_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsOrBuilderList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public int getPropsCount() { + return props_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + return props_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + return props_.get(index); + } + + private void initFields() { + version_ = 1; + logfileName_ = ""; + logfileOffset_ = 0L; + serverId_ = 0L; + serverenCode_ = ""; + executeTime_ = 0L; + sourceType_ = com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL; + schemaName_ = ""; + tableName_ = ""; + eventLength_ = 0L; + eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; + props_ = java.util.Collections.emptyList(); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getLogfileNameBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(3, logfileOffset_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt64(4, serverId_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, getServerenCodeBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt64(6, executeTime_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeEnum(7, sourceType_.getNumber()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeBytes(8, getSchemaNameBytes()); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeBytes(9, getTableNameBytes()); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeInt64(10, eventLength_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeEnum(11, eventType_.getNumber()); + } + for (int i = 0; i < props_.size(); i++) { + output.writeMessage(12, props_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, version_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getLogfileNameBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, logfileOffset_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, serverId_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, getServerenCodeBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, executeTime_); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, sourceType_.getNumber()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(8, getSchemaNameBytes()); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(9, getTableNameBytes()); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, eventLength_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, eventType_.getNumber()); + } + for (int i = 0; i < props_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, props_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.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(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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Header parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Header prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Header} + * + *
      +         * *message Header*
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Header) com.alibaba.otter.canal.protocol.CanalEntry.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; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getPropsFieldBuilder(); - } - } - 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_ = com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL; - bitField0_ = (bitField0_ & ~0x00000040); - schemaName_ = ""; - bitField0_ = (bitField0_ & ~0x00000080); - tableName_ = ""; - bitField0_ = (bitField0_ & ~0x00000100); - eventLength_ = 0L; - bitField0_ = (bitField0_ & ~0x00000200); - eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; - bitField0_ = (bitField0_ & ~0x00000400); - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000800); - } else { - propsBuilder_.clear(); - } - return this; - } - - 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; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Header getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Header build() { - com.alibaba.otter.canal.protocol.CanalEntry.Header result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Header buildPartial() { - com.alibaba.otter.canal.protocol.CanalEntry.Header result = new com.alibaba.otter.canal.protocol.CanalEntry.Header(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - 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 (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - result.sourceType_ = sourceType_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; - } - result.schemaName_ = schemaName_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { - to_bitField0_ |= 0x00000100; - } - result.tableName_ = tableName_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000200; - } - result.eventLength_ = eventLength_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000400; - } - result.eventType_ = eventType_; - if (propsBuilder_ == null) { - if (((bitField0_ & 0x00000800) == 0x00000800)) { - props_ = java.util.Collections.unmodifiableList(props_); - bitField0_ = (bitField0_ & ~0x00000800); - } - result.props_ = props_; - } else { - result.props_ = propsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - 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); - } 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.hasVersion()) { - setVersion(other.getVersion()); - } - if (other.hasLogfileName()) { - bitField0_ |= 0x00000002; - logfileName_ = other.logfileName_; - onChanged(); - } - if (other.hasLogfileOffset()) { - setLogfileOffset(other.getLogfileOffset()); - } - if (other.hasServerId()) { - setServerId(other.getServerId()); - } - if (other.hasServerenCode()) { - bitField0_ |= 0x00000010; - serverenCode_ = other.serverenCode_; - onChanged(); - } - if (other.hasExecuteTime()) { - setExecuteTime(other.getExecuteTime()); - } - if (other.hasSourceType()) { - setSourceType(other.getSourceType()); - } - if (other.hasSchemaName()) { - bitField0_ |= 0x00000080; - schemaName_ = other.schemaName_; - onChanged(); - } - if (other.hasTableName()) { - bitField0_ |= 0x00000100; - tableName_ = other.tableName_; - onChanged(); - } - if (other.hasEventLength()) { - setEventLength(other.getEventLength()); - } - if (other.hasEventType()) { - setEventType(other.getEventType()); - } - if (propsBuilder_ == null) { - if (!other.props_.isEmpty()) { - if (props_.isEmpty()) { - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000800); - } else { - ensurePropsIsMutable(); - props_.addAll(other.props_); + 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; } - onChanged(); - } - } else { - if (!other.props_.isEmpty()) { - if (propsBuilder_.isEmpty()) { - propsBuilder_.dispose(); - propsBuilder_ = null; - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000800); - propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPropsFieldBuilder() : null; - } else { - propsBuilder_.addAllMessages(other.props_); + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalEntry.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; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int version_ = 1; - /** - * optional int32 version = 1 [default = 1]; - * - *
      -       **协议的版本号*
      -       * 
      - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 version = 1 [default = 1]; - * - *
      -       **协议的版本号*
      -       * 
      - */ - public int getVersion() { - return version_; - } - /** - * optional int32 version = 1 [default = 1]; - * - *
      -       **协议的版本号*
      -       * 
      - */ - public Builder setVersion(int value) { - bitField0_ |= 0x00000001; - version_ = value; - onChanged(); - return this; - } - /** - * optional int32 version = 1 [default = 1]; - * - *
      -       **协议的版本号*
      -       * 
      - */ - public Builder clearVersion() { - bitField0_ = (bitField0_ & ~0x00000001); - version_ = 1; - onChanged(); - return this; - } - - private java.lang.Object logfileName_ = ""; - /** - * optional string logfileName = 2; - * - *
      -       **binlog/redolog 文件名*
      -       * 
      - */ - public boolean hasLogfileName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string logfileName = 2; - * - *
      -       **binlog/redolog 文件名*
      -       * 
      - */ - public java.lang.String getLogfileName() { - java.lang.Object ref = logfileName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - logfileName_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string logfileName = 2; - * - *
      -       **binlog/redolog 文件名*
      -       * 
      - */ - public com.google.protobuf.ByteString - getLogfileNameBytes() { - java.lang.Object ref = logfileName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - logfileName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string logfileName = 2; - * - *
      -       **binlog/redolog 文件名*
      -       * 
      - */ - public Builder setLogfileName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - logfileName_ = value; - onChanged(); - return this; - } - /** - * optional string logfileName = 2; - * - *
      -       **binlog/redolog 文件名*
      -       * 
      - */ - public Builder clearLogfileName() { - bitField0_ = (bitField0_ & ~0x00000002); - logfileName_ = getDefaultInstance().getLogfileName(); - onChanged(); - return this; - } - /** - * optional string logfileName = 2; - * - *
      -       **binlog/redolog 文件名*
      -       * 
      - */ - public Builder setLogfileNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - logfileName_ = value; - onChanged(); - return this; - } - - private long logfileOffset_ ; - /** - * optional int64 logfileOffset = 3; - * - *
      -       **binlog/redolog 文件的偏移位置*
      -       * 
      - */ - public boolean hasLogfileOffset() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 logfileOffset = 3; - * - *
      -       **binlog/redolog 文件的偏移位置*
      -       * 
      - */ - public long getLogfileOffset() { - return logfileOffset_; - } - /** - * optional int64 logfileOffset = 3; - * - *
      -       **binlog/redolog 文件的偏移位置*
      -       * 
      - */ - public Builder setLogfileOffset(long value) { - bitField0_ |= 0x00000004; - logfileOffset_ = value; - onChanged(); - return this; - } - /** - * optional int64 logfileOffset = 3; - * - *
      -       **binlog/redolog 文件的偏移位置*
      -       * 
      - */ - public Builder clearLogfileOffset() { - bitField0_ = (bitField0_ & ~0x00000004); - logfileOffset_ = 0L; - onChanged(); - return this; - } - - private long serverId_ ; - /** - * optional int64 serverId = 4; - * - *
      -       **服务端serverId*
      -       * 
      - */ - public boolean hasServerId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int64 serverId = 4; - * - *
      -       **服务端serverId*
      -       * 
      - */ - public long getServerId() { - return serverId_; - } - /** - * optional int64 serverId = 4; - * - *
      -       **服务端serverId*
      -       * 
      - */ - public Builder setServerId(long value) { - bitField0_ |= 0x00000008; - serverId_ = value; - onChanged(); - return this; - } - /** - * optional int64 serverId = 4; - * - *
      -       **服务端serverId*
      -       * 
      - */ - public Builder clearServerId() { - bitField0_ = (bitField0_ & ~0x00000008); - serverId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object serverenCode_ = ""; - /** - * optional string serverenCode = 5; - * - *
      -       ** 变更数据的编码 *
      -       * 
      - */ - public boolean hasServerenCode() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string serverenCode = 5; - * - *
      -       ** 变更数据的编码 *
      -       * 
      - */ - public java.lang.String getServerenCode() { - java.lang.Object ref = serverenCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - serverenCode_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string serverenCode = 5; - * - *
      -       ** 变更数据的编码 *
      -       * 
      - */ - public com.google.protobuf.ByteString - getServerenCodeBytes() { - java.lang.Object ref = serverenCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serverenCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string serverenCode = 5; - * - *
      -       ** 变更数据的编码 *
      -       * 
      - */ - public Builder setServerenCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - serverenCode_ = value; - onChanged(); - return this; - } - /** - * optional string serverenCode = 5; - * - *
      -       ** 变更数据的编码 *
      -       * 
      - */ - public Builder clearServerenCode() { - bitField0_ = (bitField0_ & ~0x00000010); - serverenCode_ = getDefaultInstance().getServerenCode(); - onChanged(); - return this; - } - /** - * optional string serverenCode = 5; - * - *
      -       ** 变更数据的编码 *
      -       * 
      - */ - public Builder setServerenCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - serverenCode_ = value; - onChanged(); - return this; - } - - private long executeTime_ ; - /** - * optional int64 executeTime = 6; - * - *
      -       **变更数据的执行时间 *
      -       * 
      - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional int64 executeTime = 6; - * - *
      -       **变更数据的执行时间 *
      -       * 
      - */ - public long getExecuteTime() { - return executeTime_; - } - /** - * optional int64 executeTime = 6; - * - *
      -       **变更数据的执行时间 *
      -       * 
      - */ - public Builder setExecuteTime(long value) { - bitField0_ |= 0x00000020; - executeTime_ = value; - onChanged(); - return this; - } - /** - * optional int64 executeTime = 6; - * - *
      -       **变更数据的执行时间 *
      -       * 
      - */ - public Builder clearExecuteTime() { - bitField0_ = (bitField0_ & ~0x00000020); - executeTime_ = 0L; - onChanged(); - return this; - } - - private com.alibaba.otter.canal.protocol.CanalEntry.Type sourceType_ = com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL; - /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * - *
      -       ** 变更数据的来源*
      -       * 
      - */ - public boolean hasSourceType() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * - *
      -       ** 变更数据的来源*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { - return sourceType_; - } - /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * - *
      -       ** 变更数据的来源*
      -       * 
      - */ - public Builder setSourceType(com.alibaba.otter.canal.protocol.CanalEntry.Type value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000040; - sourceType_ = value; - onChanged(); - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; - * - *
      -       ** 变更数据的来源*
      -       * 
      - */ - public Builder clearSourceType() { - bitField0_ = (bitField0_ & ~0x00000040); - sourceType_ = com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL; - onChanged(); - return this; - } - - private java.lang.Object schemaName_ = ""; - /** - * optional string schemaName = 8; - * - *
      -       ** 变更数据的schemaname*
      -       * 
      - */ - public boolean hasSchemaName() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional string schemaName = 8; - * - *
      -       ** 变更数据的schemaname*
      -       * 
      - */ - public java.lang.String getSchemaName() { - java.lang.Object ref = schemaName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - schemaName_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string schemaName = 8; - * - *
      -       ** 变更数据的schemaname*
      -       * 
      - */ - public com.google.protobuf.ByteString - getSchemaNameBytes() { - java.lang.Object ref = schemaName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - schemaName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string schemaName = 8; - * - *
      -       ** 变更数据的schemaname*
      -       * 
      - */ - public Builder setSchemaName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000080; - schemaName_ = value; - onChanged(); - return this; - } - /** - * optional string schemaName = 8; - * - *
      -       ** 变更数据的schemaname*
      -       * 
      - */ - public Builder clearSchemaName() { - bitField0_ = (bitField0_ & ~0x00000080); - schemaName_ = getDefaultInstance().getSchemaName(); - onChanged(); - return this; - } - /** - * optional string schemaName = 8; - * - *
      -       ** 变更数据的schemaname*
      -       * 
      - */ - public Builder setSchemaNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000080; - schemaName_ = value; - onChanged(); - return this; - } - - private java.lang.Object tableName_ = ""; - /** - * optional string tableName = 9; - * - *
      -       **变更数据的tablename*
      -       * 
      - */ - public boolean hasTableName() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional string tableName = 9; - * - *
      -       **变更数据的tablename*
      -       * 
      - */ - public java.lang.String getTableName() { - java.lang.Object ref = tableName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - tableName_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string tableName = 9; - * - *
      -       **变更数据的tablename*
      -       * 
      - */ - public com.google.protobuf.ByteString - getTableNameBytes() { - java.lang.Object ref = tableName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tableName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string tableName = 9; - * - *
      -       **变更数据的tablename*
      -       * 
      - */ - public Builder setTableName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000100; - tableName_ = value; - onChanged(); - return this; - } - /** - * optional string tableName = 9; - * - *
      -       **变更数据的tablename*
      -       * 
      - */ - public Builder clearTableName() { - bitField0_ = (bitField0_ & ~0x00000100); - tableName_ = getDefaultInstance().getTableName(); - onChanged(); - return this; - } - /** - * optional string tableName = 9; - * - *
      -       **变更数据的tablename*
      -       * 
      - */ - public Builder setTableNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000100; - tableName_ = value; - onChanged(); - return this; - } - - private long eventLength_ ; - /** - * optional int64 eventLength = 10; - * - *
      -       **每个event的长度*
      -       * 
      - */ - public boolean hasEventLength() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional int64 eventLength = 10; - * - *
      -       **每个event的长度*
      -       * 
      - */ - public long getEventLength() { - return eventLength_; - } - /** - * optional int64 eventLength = 10; - * - *
      -       **每个event的长度*
      -       * 
      - */ - public Builder setEventLength(long value) { - bitField0_ |= 0x00000200; - eventLength_ = value; - onChanged(); - return this; - } - /** - * optional int64 eventLength = 10; - * - *
      -       **每个event的长度*
      -       * 
      - */ - public Builder clearEventLength() { - bitField0_ = (bitField0_ & ~0x00000200); - eventLength_ = 0L; - onChanged(); - return this; - } - - private com.alibaba.otter.canal.protocol.CanalEntry.EventType eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * - *
      -       **数据变更类型*
      -       * 
      - */ - public boolean hasEventType() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * - *
      -       **数据变更类型*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - return eventType_; - } - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * - *
      -       **数据变更类型*
      -       * 
      - */ - public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000400; - eventType_ = value; - onChanged(); - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; - * - *
      -       **数据变更类型*
      -       * 
      - */ - public Builder clearEventType() { - bitField0_ = (bitField0_ & ~0x00000400); - eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; - onChanged(); - return this; - } - - private java.util.List props_ = - java.util.Collections.emptyList(); - private void ensurePropsIsMutable() { - if (!((bitField0_ & 0x00000800) == 0x00000800)) { - props_ = new java.util.ArrayList(props_); - bitField0_ |= 0x00000800; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List getPropsList() { - if (propsBuilder_ == null) { - return java.util.Collections.unmodifiableList(props_); - } else { - return propsBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public int getPropsCount() { - if (propsBuilder_ == null) { - return props_.size(); - } else { - return propsBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - if (propsBuilder_ == null) { - return props_.get(index); - } else { - return propsBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.set(index, value); - onChanged(); - } else { - propsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.set(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(value); - onChanged(); - } else { - propsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(index, value); - onChanged(); - } else { - propsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addAllProps( - java.lang.Iterable values) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, props_); - onChanged(); - } else { - propsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder clearProps() { - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000800); - onChanged(); - } else { - propsBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder removeProps(int index) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.remove(index); - onChanged(); - } else { - propsBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( - int index) { - return getPropsFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - if (propsBuilder_ == null) { - return props_.get(index); } else { - return propsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsOrBuilderList() { - if (propsBuilder_ != null) { - return propsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(props_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { - return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( - int index) { - return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsBuilderList() { - return getPropsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> - getPropsFieldBuilder() { - if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( - props_, - ((bitField0_ & 0x00000800) == 0x00000800), - getParentForChildren(), - isClean()); - props_ = null; - } - return propsBuilder_; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Header) - } - - static { - defaultInstance = new Header(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Header) - } - - public interface ColumnOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Column) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int32 index = 1; - * - *
      -     **字段下标*
      -     * 
      - */ - boolean hasIndex(); - /** - * optional int32 index = 1; - * - *
      -     **字段下标*
      -     * 
      - */ - int getIndex(); - - /** - * optional int32 sqlType = 2; - * - *
      -     **字段java中类型*
      -     * 
      - */ - boolean hasSqlType(); - /** - * optional int32 sqlType = 2; - * - *
      -     **字段java中类型*
      -     * 
      - */ - int getSqlType(); - - /** - * optional string name = 3; - * - *
      -     **字段名称(忽略大小写),在mysql中是没有的*
      -     * 
      - */ - boolean hasName(); - /** - * optional string name = 3; - * - *
      -     **字段名称(忽略大小写),在mysql中是没有的*
      -     * 
      - */ - java.lang.String getName(); - /** - * optional string name = 3; - * - *
      -     **字段名称(忽略大小写),在mysql中是没有的*
      -     * 
      - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * optional bool isKey = 4; - * - *
      -     **是否是主键*
      -     * 
      - */ - boolean hasIsKey(); - /** - * optional bool isKey = 4; - * - *
      -     **是否是主键*
      -     * 
      - */ - boolean getIsKey(); - - /** - * optional bool updated = 5; - * - *
      -     **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      -     * 
      - */ - boolean hasUpdated(); - /** - * optional bool updated = 5; - * - *
      -     **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      -     * 
      - */ - boolean getUpdated(); - - /** - * 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; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - int getPropsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); - - /** - * optional string value = 8; - * - *
      -     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -     * 
      - */ - boolean hasValue(); - /** - * optional string value = 8; - * - *
      -     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -     * 
      - */ - java.lang.String getValue(); - /** - * optional string value = 8; - * - *
      -     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -     * 
      - */ - com.google.protobuf.ByteString - getValueBytes(); - - /** - * optional int32 length = 9; - * - *
      -     ** 对应数据对象原始长度 *
      -     * 
      - */ - boolean hasLength(); - /** - * optional int32 length = 9; - * - *
      -     ** 对应数据对象原始长度 *
      -     * 
      - */ - int getLength(); - - /** - * optional string mysqlType = 10; - * - *
      -     **字段mysql类型*
      -     * 
      - */ - boolean hasMysqlType(); - /** - * optional string mysqlType = 10; - * - *
      -     **字段mysql类型*
      -     * 
      - */ - java.lang.String getMysqlType(); - /** - * optional string mysqlType = 10; - * - *
      -     **字段mysql类型*
      -     * 
      - */ - com.google.protobuf.ByteString - getMysqlTypeBytes(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Column} - * - *
      -   **每个字段的数据结构*
      -   * 
      - */ - public static final class Column extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Column) - ColumnOrBuilder { - // Use Column.newBuilder() to construct. - private Column(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Column(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Column defaultInstance; - public static Column getDefaultInstance() { - return defaultInstance; - } - - public Column getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Column( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + // Construct using + // com.alibaba.otter.canal.protocol.CanalEntry.Header.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 8: { - bitField0_ |= 0x00000001; - index_ = input.readInt32(); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - case 16: { - bitField0_ |= 0x00000002; - sqlType_ = input.readInt32(); - break; + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getPropsFieldBuilder(); + } } - case 26: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - name_ = bs; - break; + + private static Builder create() { + return new Builder(); } - case 32: { - bitField0_ |= 0x00000008; - isKey_ = input.readBool(); - break; + + 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_ = com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL; + bitField0_ = (bitField0_ & ~0x00000040); + schemaName_ = ""; + bitField0_ = (bitField0_ & ~0x00000080); + tableName_ = ""; + bitField0_ = (bitField0_ & ~0x00000100); + eventLength_ = 0L; + bitField0_ = (bitField0_ & ~0x00000200); + eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; + bitField0_ = (bitField0_ & ~0x00000400); + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + } else { + propsBuilder_.clear(); + } + return this; } - case 40: { - bitField0_ |= 0x00000010; - updated_ = input.readBool(); - break; + + public Builder clone() { + return create().mergeFrom(buildPartial()); } - case 48: { - bitField0_ |= 0x00000020; - isNull_ = input.readBool(); - break; + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; } - case 58: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - props_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.Header getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.Header.getDefaultInstance(); } - case 66: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000040; - value_ = bs; - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.Header build() { + com.alibaba.otter.canal.protocol.CanalEntry.Header result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; } - case 72: { - bitField0_ |= 0x00000080; - length_ = input.readInt32(); - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.Header buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.Header result = new com.alibaba.otter.canal.protocol.CanalEntry.Header(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + 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 (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.sourceType_ = sourceType_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.schemaName_ = schemaName_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + result.tableName_ = tableName_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000200; + } + result.eventLength_ = eventLength_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000400; + } + result.eventType_ = eventType_; + if (propsBuilder_ == null) { + if (((bitField0_ & 0x00000800) == 0x00000800)) { + props_ = java.util.Collections.unmodifiableList(props_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.props_ = props_; + } else { + result.props_ = propsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; } - case 82: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000100; - mysqlType_ = bs; - break; + + 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); + } 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.hasVersion()) { + setVersion(other.getVersion()); + } + if (other.hasLogfileName()) { + bitField0_ |= 0x00000002; + logfileName_ = other.logfileName_; + onChanged(); + } + if (other.hasLogfileOffset()) { + setLogfileOffset(other.getLogfileOffset()); + } + if (other.hasServerId()) { + setServerId(other.getServerId()); + } + if (other.hasServerenCode()) { + bitField0_ |= 0x00000010; + serverenCode_ = other.serverenCode_; + onChanged(); + } + if (other.hasExecuteTime()) { + setExecuteTime(other.getExecuteTime()); + } + if (other.hasSourceType()) { + setSourceType(other.getSourceType()); + } + if (other.hasSchemaName()) { + bitField0_ |= 0x00000080; + schemaName_ = other.schemaName_; + onChanged(); + } + if (other.hasTableName()) { + bitField0_ |= 0x00000100; + tableName_ = other.tableName_; + onChanged(); + } + if (other.hasEventLength()) { + setEventLength(other.getEventLength()); + } + if (other.hasEventType()) { + setEventType(other.getEventType()); + } + if (propsBuilder_ == null) { + if (!other.props_.isEmpty()) { + if (props_.isEmpty()) { + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensurePropsIsMutable(); + props_.addAll(other.props_); + } + onChanged(); + } + } else { + if (!other.props_.isEmpty()) { + if (propsBuilder_.isEmpty()) { + propsBuilder_.dispose(); + propsBuilder_ = null; + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000800); + propsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; + } else { + propsBuilder_.addAllMessages(other.props_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalEntry.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; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int version_ = 1; + + /** + * optional int32 version = 1 [default = 1]; + * + *
      +             * *协议的版本号*
      +             * 
      + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int32 version = 1 [default = 1]; + * + *
      +             * *协议的版本号*
      +             * 
      + */ + public int getVersion() { + return version_; + } + + /** + * optional int32 version = 1 [default = 1]; + * + *
      +             * *协议的版本号*
      +             * 
      + */ + public Builder setVersion(int value) { + bitField0_ |= 0x00000001; + version_ = value; + onChanged(); + return this; + } + + /** + * optional int32 version = 1 [default = 1]; + * + *
      +             * *协议的版本号*
      +             * 
      + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 1; + onChanged(); + return this; + } + + private java.lang.Object logfileName_ = ""; + + /** + * optional string logfileName = 2; + * + *
      +             * *binlog/redolog 文件名*
      +             * 
      + */ + public boolean hasLogfileName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string logfileName = 2; + * + *
      +             * *binlog/redolog 文件名*
      +             * 
      + */ + public java.lang.String getLogfileName() { + java.lang.Object ref = logfileName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + logfileName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string logfileName = 2; + * + *
      +             * *binlog/redolog 文件名*
      +             * 
      + */ + public com.google.protobuf.ByteString getLogfileNameBytes() { + java.lang.Object ref = logfileName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logfileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string logfileName = 2; + * + *
      +             * *binlog/redolog 文件名*
      +             * 
      + */ + public Builder setLogfileName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + logfileName_ = value; + onChanged(); + return this; + } + + /** + * optional string logfileName = 2; + * + *
      +             * *binlog/redolog 文件名*
      +             * 
      + */ + public Builder clearLogfileName() { + bitField0_ = (bitField0_ & ~0x00000002); + logfileName_ = getDefaultInstance().getLogfileName(); + onChanged(); + return this; + } + + /** + * optional string logfileName = 2; + * + *
      +             * *binlog/redolog 文件名*
      +             * 
      + */ + public Builder setLogfileNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + logfileName_ = value; + onChanged(); + return this; + } + + private long logfileOffset_; + + /** + * optional int64 logfileOffset = 3; + * + *
      +             * *binlog/redolog 文件的偏移位置*
      +             * 
      + */ + public boolean hasLogfileOffset() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int64 logfileOffset = 3; + * + *
      +             * *binlog/redolog 文件的偏移位置*
      +             * 
      + */ + public long getLogfileOffset() { + return logfileOffset_; + } + + /** + * optional int64 logfileOffset = 3; + * + *
      +             * *binlog/redolog 文件的偏移位置*
      +             * 
      + */ + public Builder setLogfileOffset(long value) { + bitField0_ |= 0x00000004; + logfileOffset_ = value; + onChanged(); + return this; + } + + /** + * optional int64 logfileOffset = 3; + * + *
      +             * *binlog/redolog 文件的偏移位置*
      +             * 
      + */ + public Builder clearLogfileOffset() { + bitField0_ = (bitField0_ & ~0x00000004); + logfileOffset_ = 0L; + onChanged(); + return this; + } + + private long serverId_; + + /** + * optional int64 serverId = 4; + * + *
      +             * *服务端serverId*
      +             * 
      + */ + public boolean hasServerId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional int64 serverId = 4; + * + *
      +             * *服务端serverId*
      +             * 
      + */ + public long getServerId() { + return serverId_; + } + + /** + * optional int64 serverId = 4; + * + *
      +             * *服务端serverId*
      +             * 
      + */ + public Builder setServerId(long value) { + bitField0_ |= 0x00000008; + serverId_ = value; + onChanged(); + return this; + } + + /** + * optional int64 serverId = 4; + * + *
      +             * *服务端serverId*
      +             * 
      + */ + public Builder clearServerId() { + bitField0_ = (bitField0_ & ~0x00000008); + serverId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object serverenCode_ = ""; + + /** + * optional string serverenCode = 5; + * + *
      +             * * 变更数据的编码 *
      +             * 
      + */ + public boolean hasServerenCode() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional string serverenCode = 5; + * + *
      +             * * 变更数据的编码 *
      +             * 
      + */ + public java.lang.String getServerenCode() { + java.lang.Object ref = serverenCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + serverenCode_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string serverenCode = 5; + * + *
      +             * * 变更数据的编码 *
      +             * 
      + */ + public com.google.protobuf.ByteString getServerenCodeBytes() { + java.lang.Object ref = serverenCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverenCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string serverenCode = 5; + * + *
      +             * * 变更数据的编码 *
      +             * 
      + */ + public Builder setServerenCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + serverenCode_ = value; + onChanged(); + return this; + } + + /** + * optional string serverenCode = 5; + * + *
      +             * * 变更数据的编码 *
      +             * 
      + */ + public Builder clearServerenCode() { + bitField0_ = (bitField0_ & ~0x00000010); + serverenCode_ = getDefaultInstance().getServerenCode(); + onChanged(); + return this; + } + + /** + * optional string serverenCode = 5; + * + *
      +             * * 变更数据的编码 *
      +             * 
      + */ + public Builder setServerenCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + serverenCode_ = value; + onChanged(); + return this; + } + + private long executeTime_; + + /** + * optional int64 executeTime = 6; + * + *
      +             * *变更数据的执行时间 *
      +             * 
      + */ + public boolean hasExecuteTime() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + + /** + * optional int64 executeTime = 6; + * + *
      +             * *变更数据的执行时间 *
      +             * 
      + */ + public long getExecuteTime() { + return executeTime_; + } + + /** + * optional int64 executeTime = 6; + * + *
      +             * *变更数据的执行时间 *
      +             * 
      + */ + public Builder setExecuteTime(long value) { + bitField0_ |= 0x00000020; + executeTime_ = value; + onChanged(); + return this; + } + + /** + * optional int64 executeTime = 6; + * + *
      +             * *变更数据的执行时间 *
      +             * 
      + */ + public Builder clearExecuteTime() { + bitField0_ = (bitField0_ & ~0x00000020); + executeTime_ = 0L; + onChanged(); + return this; + } + + private com.alibaba.otter.canal.protocol.CanalEntry.Type sourceType_ = com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL; + + /** + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
      +             * * 变更数据的来源*
      +             * 
      + */ + public boolean hasSourceType() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + + /** + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
      +             * * 变更数据的来源*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Type getSourceType() { + return sourceType_; + } + + /** + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
      +             * * 变更数据的来源*
      +             * 
      + */ + public Builder setSourceType(com.alibaba.otter.canal.protocol.CanalEntry.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + sourceType_ = value; + onChanged(); + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.Type sourceType = 7 [default = MYSQL]; + * + *
      +             * * 变更数据的来源*
      +             * 
      + */ + public Builder clearSourceType() { + bitField0_ = (bitField0_ & ~0x00000040); + sourceType_ = com.alibaba.otter.canal.protocol.CanalEntry.Type.MYSQL; + onChanged(); + return this; + } + + private java.lang.Object schemaName_ = ""; + + /** + * optional string schemaName = 8; + * + *
      +             * * 变更数据的schemaname*
      +             * 
      + */ + public boolean hasSchemaName() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + + /** + * optional string schemaName = 8; + * + *
      +             * * 变更数据的schemaname*
      +             * 
      + */ + public java.lang.String getSchemaName() { + java.lang.Object ref = schemaName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + schemaName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string schemaName = 8; + * + *
      +             * * 变更数据的schemaname*
      +             * 
      + */ + public com.google.protobuf.ByteString getSchemaNameBytes() { + java.lang.Object ref = schemaName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string schemaName = 8; + * + *
      +             * * 变更数据的schemaname*
      +             * 
      + */ + public Builder setSchemaName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + schemaName_ = value; + onChanged(); + return this; + } + + /** + * optional string schemaName = 8; + * + *
      +             * * 变更数据的schemaname*
      +             * 
      + */ + public Builder clearSchemaName() { + bitField0_ = (bitField0_ & ~0x00000080); + schemaName_ = getDefaultInstance().getSchemaName(); + onChanged(); + return this; + } + + /** + * optional string schemaName = 8; + * + *
      +             * * 变更数据的schemaname*
      +             * 
      + */ + public Builder setSchemaNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + schemaName_ = value; + onChanged(); + return this; + } + + private java.lang.Object tableName_ = ""; + + /** + * optional string tableName = 9; + * + *
      +             * *变更数据的tablename*
      +             * 
      + */ + public boolean hasTableName() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + + /** + * optional string tableName = 9; + * + *
      +             * *变更数据的tablename*
      +             * 
      + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + tableName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string tableName = 9; + * + *
      +             * *变更数据的tablename*
      +             * 
      + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string tableName = 9; + * + *
      +             * *变更数据的tablename*
      +             * 
      + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + tableName_ = value; + onChanged(); + return this; + } + + /** + * optional string tableName = 9; + * + *
      +             * *变更数据的tablename*
      +             * 
      + */ + public Builder clearTableName() { + bitField0_ = (bitField0_ & ~0x00000100); + tableName_ = getDefaultInstance().getTableName(); + onChanged(); + return this; + } + + /** + * optional string tableName = 9; + * + *
      +             * *变更数据的tablename*
      +             * 
      + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + tableName_ = value; + onChanged(); + return this; + } + + private long eventLength_; + + /** + * optional int64 eventLength = 10; + * + *
      +             * *每个event的长度*
      +             * 
      + */ + public boolean hasEventLength() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + + /** + * optional int64 eventLength = 10; + * + *
      +             * *每个event的长度*
      +             * 
      + */ + public long getEventLength() { + return eventLength_; + } + + /** + * optional int64 eventLength = 10; + * + *
      +             * *每个event的长度*
      +             * 
      + */ + public Builder setEventLength(long value) { + bitField0_ |= 0x00000200; + eventLength_ = value; + onChanged(); + return this; + } + + /** + * optional int64 eventLength = 10; + * + *
      +             * *每个event的长度*
      +             * 
      + */ + public Builder clearEventLength() { + bitField0_ = (bitField0_ & ~0x00000200); + eventLength_ = 0L; + onChanged(); + return this; + } + + private com.alibaba.otter.canal.protocol.CanalEntry.EventType eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
      +             * *数据变更类型*
      +             * 
      + */ + public boolean hasEventType() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
      +             * *数据变更类型*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { + return eventType_; + } + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
      +             * *数据变更类型*
      +             * 
      + */ + public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + eventType_ = value; + onChanged(); + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 11 [default = UPDATE]; + * + *
      +             * *数据变更类型*
      +             * 
      + */ + public Builder clearEventType() { + bitField0_ = (bitField0_ & ~0x00000400); + eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; + onChanged(); + return this; + } + + private java.util.List props_ = java.util.Collections.emptyList(); + + private void ensurePropsIsMutable() { + if (!((bitField0_ & 0x00000800) == 0x00000800)) { + props_ = new java.util.ArrayList(props_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilder propsBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsList() { + if (propsBuilder_ == null) { + return java.util.Collections.unmodifiableList(props_); + } else { + return propsBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public int getPropsCount() { + if (propsBuilder_ == null) { + return props_.size(); + } else { + return propsBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.set(index, value); + onChanged(); + } else { + propsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.set(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(value); + onChanged(); + } else { + propsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(index, value); + onChanged(); + } else { + propsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addAllProps(java.lang.Iterable values) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, props_); + onChanged(); + } else { + propsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder clearProps() { + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + propsBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder removeProps(int index) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.remove(index); + onChanged(); + } else { + propsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder(int index) { + return getPropsFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsOrBuilderList() { + if (propsBuilder_ != null) { + return propsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(props_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + return getPropsFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder(int index) { + return getPropsFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 12; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsBuilderList() { + return getPropsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getPropsFieldBuilder() { + if (propsBuilder_ == null) { + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(props_, + ((bitField0_ & 0x00000800) == 0x00000800), + getParentForChildren(), + isClean()); + props_ = null; + } + return propsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Header) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - props_ = java.util.Collections.unmodifiableList(props_); + + static { + defaultInstance = new Header(true); + defaultInstance.initFields(); } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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; + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Header) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); + public interface ColumnOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Column) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 index = 1; + * + *
      +         * *字段下标*
      +         * 
      + */ + boolean hasIndex(); + + /** + * optional int32 index = 1; + * + *
      +         * *字段下标*
      +         * 
      + */ + int getIndex(); + + /** + * optional int32 sqlType = 2; + * + *
      +         * *字段java中类型*
      +         * 
      + */ + boolean hasSqlType(); + + /** + * optional int32 sqlType = 2; + * + *
      +         * *字段java中类型*
      +         * 
      + */ + int getSqlType(); + + /** + * optional string name = 3; + * + *
      +         * *字段名称(忽略大小写),在mysql中是没有的*
      +         * 
      + */ + boolean hasName(); + + /** + * optional string name = 3; + * + *
      +         * *字段名称(忽略大小写),在mysql中是没有的*
      +         * 
      + */ + java.lang.String getName(); + + /** + * optional string name = 3; + * + *
      +         * *字段名称(忽略大小写),在mysql中是没有的*
      +         * 
      + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * optional bool isKey = 4; + * + *
      +         * *是否是主键*
      +         * 
      + */ + boolean hasIsKey(); + + /** + * optional bool isKey = 4; + * + *
      +         * *是否是主键*
      +         * 
      + */ + boolean getIsKey(); + + /** + * optional bool updated = 5; + * + *
      +         * *如果EventType=UPDATE,用于标识这个字段值是否有修改*
      +         * 
      + */ + boolean hasUpdated(); + + /** + * optional bool updated = 5; + * + *
      +         * *如果EventType=UPDATE,用于标识这个字段值是否有修改*
      +         * 
      + */ + boolean getUpdated(); + + /** + * 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; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + int getPropsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index); + + /** + * optional string value = 8; + * + *
      +         * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +         * 
      + */ + boolean hasValue(); + + /** + * optional string value = 8; + * + *
      +         * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +         * 
      + */ + java.lang.String getValue(); + + /** + * optional string value = 8; + * + *
      +         * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +         * 
      + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * optional int32 length = 9; + * + *
      +         * * 对应数据对象原始长度 *
      +         * 
      + */ + boolean hasLength(); + + /** + * optional int32 length = 9; + * + *
      +         * * 对应数据对象原始长度 *
      +         * 
      + */ + int getLength(); + + /** + * optional string mysqlType = 10; + * + *
      +         * *字段mysql类型*
      +         * 
      + */ + boolean hasMysqlType(); + + /** + * optional string mysqlType = 10; + * + *
      +         * *字段mysql类型*
      +         * 
      + */ + java.lang.String getMysqlType(); + + /** + * optional string mysqlType = 10; + * + *
      +         * *字段mysql类型*
      +         * 
      + */ + com.google.protobuf.ByteString getMysqlTypeBytes(); } - 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); - } - }; - - @java.lang.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; - * - *
      -     **字段下标*
      -     * 
      - */ - public int getIndex() { - return index_; - } - - 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; - * - *
      -     **字段java中类型*
      -     * 
      - */ - public int getSqlType() { - return sqlType_; - } - - public static final int NAME_FIELD_NUMBER = 3; - private java.lang.Object name_; - /** - * optional string name = 3; - * - *
      -     **字段名称(忽略大小写),在mysql中是没有的*
      -     * 
      - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string name = 3; - * - *
      -     **字段名称(忽略大小写),在mysql中是没有的*
      -     * 
      - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } - } - /** - * optional string name = 3; - * - *
      -     **字段名称(忽略大小写),在mysql中是没有的*
      -     * 
      - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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; - * - *
      -     **是否是主键*
      -     * 
      - */ - public boolean getIsKey() { - return isKey_; - } - - 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; - * - *
      -     **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      -     * 
      - */ - public boolean getUpdated() { - return updated_; - } - - public static final int ISNULL_FIELD_NUMBER = 6; - private boolean isNull_; - /** - * optional bool isNull = 6 [default = false]; - * - *
      -     ** 标识是否为空  *
      -     * 
      - */ - public boolean hasIsNull() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional bool isNull = 6 [default = false]; - * - *
      -     ** 标识是否为空  *
      -     * 
      - */ - public boolean getIsNull() { - return isNull_; - } - - public static final int PROPS_FIELD_NUMBER = 7; - private java.util.List props_; - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List getPropsList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List - getPropsOrBuilderList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - public int getPropsCount() { - return props_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - return props_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - return props_.get(index); - } - - public static final int VALUE_FIELD_NUMBER = 8; - private java.lang.Object value_; - /** - * optional string value = 8; - * - *
      -     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -     * 
      - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional string value = 8; - * - *
      -     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -     * 
      - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - value_ = s; - } - return s; - } - } - /** - * optional string value = 8; - * - *
      -     ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -     * 
      - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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; - * - *
      -     ** 对应数据对象原始长度 *
      -     * 
      - */ - public int getLength() { - return length_; - } - - public static final int MYSQLTYPE_FIELD_NUMBER = 10; - private java.lang.Object mysqlType_; - /** - * optional string mysqlType = 10; - * - *
      -     **字段mysql类型*
      -     * 
      - */ - public boolean hasMysqlType() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional string mysqlType = 10; - * - *
      -     **字段mysql类型*
      -     * 
      - */ - public java.lang.String getMysqlType() { - java.lang.Object ref = mysqlType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - mysqlType_ = s; - } - return s; - } - } - /** - * optional string mysqlType = 10; - * - *
      -     **字段mysql类型*
      -     * 
      - */ - public com.google.protobuf.ByteString - getMysqlTypeBytes() { - java.lang.Object ref = mysqlType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mysqlType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, index_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, sqlType_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getNameBytes()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBool(4, isKey_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBool(5, updated_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBool(6, isNull_); - } - for (int i = 0; i < props_.size(); i++) { - output.writeMessage(7, props_.get(i)); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeBytes(8, getValueBytes()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeInt32(9, length_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeBytes(10, getMysqlTypeBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, index_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, sqlType_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getNameBytes()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, isKey_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, updated_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, isNull_); - } - for (int i = 0; i < props_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, props_.get(i)); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(8, getValueBytes()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(9, length_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(10, getMysqlTypeBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.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( - 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) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Column prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Column} * *
      -     **每个字段的数据结构*
      +     * *每个字段的数据结构*
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Column extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Column) + ColumnOrBuilder { + + // Use Column.newBuilder() to construct. + private Column(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Column(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Column defaultInstance; + + public static Column getDefaultInstance() { + return defaultInstance; + } + + public Column getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Column(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + index_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + sqlType_ = input.readInt32(); + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + name_ = bs; + break; + } + case 32: { + bitField0_ |= 0x00000008; + isKey_ = input.readBool(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + updated_ = input.readBool(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + isNull_ = input.readBool(); + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + props_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, + extensionRegistry)); + break; + } + case 66: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000040; + value_ = bs; + break; + } + case 72: { + bitField0_ |= 0x00000080; + length_ = input.readInt32(); + break; + } + case 82: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000100; + mysqlType_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + props_ = java.util.Collections.unmodifiableList(props_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + 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; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } + + 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); + } + }; + + @java.lang.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; + * + *
      +         * *字段下标*
      +         * 
      + */ + public int getIndex() { + return index_; + } + + 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; + * + *
      +         * *字段java中类型*
      +         * 
      + */ + public int getSqlType() { + return sqlType_; + } + + public static final int NAME_FIELD_NUMBER = 3; + private java.lang.Object name_; + + /** + * optional string name = 3; + * + *
      +         * *字段名称(忽略大小写),在mysql中是没有的*
      +         * 
      + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional string name = 3; + * + *
      +         * *字段名称(忽略大小写),在mysql中是没有的*
      +         * 
      + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + + /** + * optional string name = 3; + * + *
      +         * *字段名称(忽略大小写),在mysql中是没有的*
      +         * 
      + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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; + * + *
      +         * *是否是主键*
      +         * 
      + */ + public boolean getIsKey() { + return isKey_; + } + + 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; + * + *
      +         * *如果EventType=UPDATE,用于标识这个字段值是否有修改*
      +         * 
      + */ + public boolean getUpdated() { + return updated_; + } + + public static final int ISNULL_FIELD_NUMBER = 6; + private boolean isNull_; + + /** + * optional bool isNull = 6 [default = false]; + * + *
      +         * * 标识是否为空  *
      +         * 
      + */ + public boolean hasIsNull() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + + /** + * optional bool isNull = 6 [default = false]; + * + *
      +         * * 标识是否为空  *
      +         * 
      + */ + public boolean getIsNull() { + return isNull_; + } + + public static final int PROPS_FIELD_NUMBER = 7; + private java.util.List props_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsOrBuilderList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public int getPropsCount() { + return props_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + return props_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + return props_.get(index); + } + + public static final int VALUE_FIELD_NUMBER = 8; + private java.lang.Object value_; + + /** + * optional string value = 8; + * + *
      +         * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +         * 
      + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + + /** + * optional string value = 8; + * + *
      +         * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +         * 
      + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } + } + + /** + * optional string value = 8; + * + *
      +         * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +         * 
      + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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; + * + *
      +         * * 对应数据对象原始长度 *
      +         * 
      + */ + public int getLength() { + return length_; + } + + public static final int MYSQLTYPE_FIELD_NUMBER = 10; + private java.lang.Object mysqlType_; + + /** + * optional string mysqlType = 10; + * + *
      +         * *字段mysql类型*
      +         * 
      + */ + public boolean hasMysqlType() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + + /** + * optional string mysqlType = 10; + * + *
      +         * *字段mysql类型*
      +         * 
      + */ + public java.lang.String getMysqlType() { + java.lang.Object ref = mysqlType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + mysqlType_ = s; + } + return s; + } + } + + /** + * optional string mysqlType = 10; + * + *
      +         * *字段mysql类型*
      +         * 
      + */ + public com.google.protobuf.ByteString getMysqlTypeBytes() { + java.lang.Object ref = mysqlType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mysqlType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, index_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, sqlType_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getNameBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBool(4, isKey_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBool(5, updated_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBool(6, isNull_); + } + for (int i = 0; i < props_.size(); i++) { + output.writeMessage(7, props_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBytes(8, getValueBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeInt32(9, length_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeBytes(10, getMysqlTypeBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, index_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, sqlType_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, getNameBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, isKey_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, updated_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, isNull_); + } + for (int i = 0; i < props_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, props_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(8, getValueBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, length_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(10, getMysqlTypeBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.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(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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Column parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Column prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Column} + * + *
      +         * *每个字段的数据结构*
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Column) com.alibaba.otter.canal.protocol.CanalEntry.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; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Column.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getPropsFieldBuilder(); - } - } - 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); - } else { - propsBuilder_.clear(); - } - value_ = ""; - bitField0_ = (bitField0_ & ~0x00000080); - length_ = 0; - bitField0_ = (bitField0_ & ~0x00000100); - mysqlType_ = ""; - bitField0_ = (bitField0_ & ~0x00000200); - return this; - } - - 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; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Column getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Column build() { - com.alibaba.otter.canal.protocol.CanalEntry.Column result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Column buildPartial() { - com.alibaba.otter.canal.protocol.CanalEntry.Column result = new com.alibaba.otter.canal.protocol.CanalEntry.Column(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - 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_); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.props_ = props_; - } 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_; - onBuilt(); - return result; - } - - 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); - } 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.hasIndex()) { - setIndex(other.getIndex()); - } - if (other.hasSqlType()) { - setSqlType(other.getSqlType()); - } - if (other.hasName()) { - bitField0_ |= 0x00000004; - name_ = other.name_; - onChanged(); - } - if (other.hasIsKey()) { - setIsKey(other.getIsKey()); - } - if (other.hasUpdated()) { - setUpdated(other.getUpdated()); - } - if (other.hasIsNull()) { - setIsNull(other.getIsNull()); - } - if (propsBuilder_ == null) { - if (!other.props_.isEmpty()) { - if (props_.isEmpty()) { - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensurePropsIsMutable(); - props_.addAll(other.props_); + 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; } - onChanged(); - } - } else { - if (!other.props_.isEmpty()) { - if (propsBuilder_.isEmpty()) { - propsBuilder_.dispose(); - propsBuilder_ = null; - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000040); - propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPropsFieldBuilder() : null; - } else { - propsBuilder_.addAllMessages(other.props_); + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); } - } - } - if (other.hasValue()) { - bitField0_ |= 0x00000080; - value_ = other.value_; - onChanged(); - } - if (other.hasLength()) { - setLength(other.getLength()); - } - if (other.hasMysqlType()) { - bitField0_ |= 0x00000200; - mysqlType_ = other.mysqlType_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalEntry.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; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int index_ ; - /** - * optional int32 index = 1; - * - *
      -       **字段下标*
      -       * 
      - */ - public boolean hasIndex() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 index = 1; - * - *
      -       **字段下标*
      -       * 
      - */ - public int getIndex() { - return index_; - } - /** - * optional int32 index = 1; - * - *
      -       **字段下标*
      -       * 
      - */ - public Builder setIndex(int value) { - bitField0_ |= 0x00000001; - index_ = value; - onChanged(); - return this; - } - /** - * optional int32 index = 1; - * - *
      -       **字段下标*
      -       * 
      - */ - public Builder clearIndex() { - bitField0_ = (bitField0_ & ~0x00000001); - index_ = 0; - onChanged(); - return this; - } - - private int sqlType_ ; - /** - * optional int32 sqlType = 2; - * - *
      -       **字段java中类型*
      -       * 
      - */ - public boolean hasSqlType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 sqlType = 2; - * - *
      -       **字段java中类型*
      -       * 
      - */ - public int getSqlType() { - return sqlType_; - } - /** - * optional int32 sqlType = 2; - * - *
      -       **字段java中类型*
      -       * 
      - */ - public Builder setSqlType(int value) { - bitField0_ |= 0x00000002; - sqlType_ = value; - onChanged(); - return this; - } - /** - * optional int32 sqlType = 2; - * - *
      -       **字段java中类型*
      -       * 
      - */ - public Builder clearSqlType() { - bitField0_ = (bitField0_ & ~0x00000002); - sqlType_ = 0; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * optional string name = 3; - * - *
      -       **字段名称(忽略大小写),在mysql中是没有的*
      -       * 
      - */ - public boolean hasName() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string name = 3; - * - *
      -       **字段名称(忽略大小写),在mysql中是没有的*
      -       * 
      - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - name_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string name = 3; - * - *
      -       **字段名称(忽略大小写),在mysql中是没有的*
      -       * 
      - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string name = 3; - * - *
      -       **字段名称(忽略大小写),在mysql中是没有的*
      -       * 
      - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - name_ = value; - onChanged(); - return this; - } - /** - * optional string name = 3; - * - *
      -       **字段名称(忽略大小写),在mysql中是没有的*
      -       * 
      - */ - public Builder clearName() { - bitField0_ = (bitField0_ & ~0x00000004); - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * optional string name = 3; - * - *
      -       **字段名称(忽略大小写),在mysql中是没有的*
      -       * 
      - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - name_ = value; - onChanged(); - return this; - } - - private boolean isKey_ ; - /** - * optional bool isKey = 4; - * - *
      -       **是否是主键*
      -       * 
      - */ - public boolean hasIsKey() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional bool isKey = 4; - * - *
      -       **是否是主键*
      -       * 
      - */ - public boolean getIsKey() { - return isKey_; - } - /** - * optional bool isKey = 4; - * - *
      -       **是否是主键*
      -       * 
      - */ - public Builder setIsKey(boolean value) { - bitField0_ |= 0x00000008; - isKey_ = value; - onChanged(); - return this; - } - /** - * optional bool isKey = 4; - * - *
      -       **是否是主键*
      -       * 
      - */ - public Builder clearIsKey() { - bitField0_ = (bitField0_ & ~0x00000008); - isKey_ = false; - onChanged(); - return this; - } - - private boolean updated_ ; - /** - * optional bool updated = 5; - * - *
      -       **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      -       * 
      - */ - public boolean hasUpdated() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional bool updated = 5; - * - *
      -       **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      -       * 
      - */ - public boolean getUpdated() { - return updated_; - } - /** - * optional bool updated = 5; - * - *
      -       **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      -       * 
      - */ - public Builder setUpdated(boolean value) { - bitField0_ |= 0x00000010; - updated_ = value; - onChanged(); - return this; - } - /** - * optional bool updated = 5; - * - *
      -       **如果EventType=UPDATE,用于标识这个字段值是否有修改*
      -       * 
      - */ - public Builder clearUpdated() { - bitField0_ = (bitField0_ & ~0x00000010); - updated_ = false; - onChanged(); - return this; - } - - private boolean isNull_ ; - /** - * optional bool isNull = 6 [default = false]; - * - *
      -       ** 标识是否为空  *
      -       * 
      - */ - public boolean hasIsNull() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional bool isNull = 6 [default = false]; - * - *
      -       ** 标识是否为空  *
      -       * 
      - */ - public boolean getIsNull() { - return isNull_; - } - /** - * optional bool isNull = 6 [default = false]; - * - *
      -       ** 标识是否为空  *
      -       * 
      - */ - public Builder setIsNull(boolean value) { - bitField0_ |= 0x00000020; - isNull_ = value; - onChanged(); - return this; - } - /** - * optional bool isNull = 6 [default = false]; - * - *
      -       ** 标识是否为空  *
      -       * 
      - */ - public Builder clearIsNull() { - bitField0_ = (bitField0_ & ~0x00000020); - isNull_ = false; - onChanged(); - return this; - } - - private java.util.List props_ = - java.util.Collections.emptyList(); - private void ensurePropsIsMutable() { - if (!((bitField0_ & 0x00000040) == 0x00000040)) { - props_ = new java.util.ArrayList(props_); - bitField0_ |= 0x00000040; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List getPropsList() { - if (propsBuilder_ == null) { - return java.util.Collections.unmodifiableList(props_); - } else { - return propsBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public int getPropsCount() { - if (propsBuilder_ == null) { - return props_.size(); - } else { - return propsBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - if (propsBuilder_ == null) { - return props_.get(index); - } else { - return propsBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.set(index, value); - onChanged(); - } else { - propsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.set(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(value); - onChanged(); - } else { - propsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(index, value); - onChanged(); - } else { - propsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addAllProps( - java.lang.Iterable values) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, props_); - onChanged(); - } else { - propsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder clearProps() { - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - onChanged(); - } else { - propsBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder removeProps(int index) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.remove(index); - onChanged(); - } else { - propsBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( - int index) { - return getPropsFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - if (propsBuilder_ == null) { - return props_.get(index); } else { - return propsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsOrBuilderList() { - if (propsBuilder_ != null) { - return propsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(props_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { - return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( - int index) { - return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsBuilderList() { - return getPropsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> - getPropsFieldBuilder() { - if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( - props_, - ((bitField0_ & 0x00000040) == 0x00000040), - getParentForChildren(), - isClean()); - props_ = null; - } - return propsBuilder_; - } - - private java.lang.Object value_ = ""; - /** - * optional string value = 8; - * - *
      -       ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -       * 
      - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional string value = 8; - * - *
      -       ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -       * 
      - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - value_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string value = 8; - * - *
      -       ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -       * 
      - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string value = 8; - * - *
      -       ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -       * 
      - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000080; - value_ = value; - onChanged(); - return this; - } - /** - * optional string value = 8; - * - *
      -       ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -       * 
      - */ - public Builder clearValue() { - bitField0_ = (bitField0_ & ~0x00000080); - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - * optional string value = 8; - * - *
      -       ** 字段值,timestamp,Datetime是一个时间格式的文本 *
      -       * 
      - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000080; - value_ = value; - onChanged(); - return this; - } - - private int length_ ; - /** - * optional int32 length = 9; - * - *
      -       ** 对应数据对象原始长度 *
      -       * 
      - */ - public boolean hasLength() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional int32 length = 9; - * - *
      -       ** 对应数据对象原始长度 *
      -       * 
      - */ - public int getLength() { - return length_; - } - /** - * optional int32 length = 9; - * - *
      -       ** 对应数据对象原始长度 *
      -       * 
      - */ - public Builder setLength(int value) { - bitField0_ |= 0x00000100; - length_ = value; - onChanged(); - return this; - } - /** - * optional int32 length = 9; - * - *
      -       ** 对应数据对象原始长度 *
      -       * 
      - */ - public Builder clearLength() { - bitField0_ = (bitField0_ & ~0x00000100); - length_ = 0; - onChanged(); - return this; - } - - private java.lang.Object mysqlType_ = ""; - /** - * optional string mysqlType = 10; - * - *
      -       **字段mysql类型*
      -       * 
      - */ - public boolean hasMysqlType() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - /** - * optional string mysqlType = 10; - * - *
      -       **字段mysql类型*
      -       * 
      - */ - public java.lang.String getMysqlType() { - java.lang.Object ref = mysqlType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - mysqlType_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string mysqlType = 10; - * - *
      -       **字段mysql类型*
      -       * 
      - */ - public com.google.protobuf.ByteString - getMysqlTypeBytes() { - java.lang.Object ref = mysqlType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mysqlType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string mysqlType = 10; - * - *
      -       **字段mysql类型*
      -       * 
      - */ - public Builder setMysqlType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000200; - mysqlType_ = value; - onChanged(); - return this; - } - /** - * optional string mysqlType = 10; - * - *
      -       **字段mysql类型*
      -       * 
      - */ - public Builder clearMysqlType() { - bitField0_ = (bitField0_ & ~0x00000200); - mysqlType_ = getDefaultInstance().getMysqlType(); - onChanged(); - return this; - } - /** - * optional string mysqlType = 10; - * - *
      -       **字段mysql类型*
      -       * 
      - */ - public Builder setMysqlTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000200; - mysqlType_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Column) - } - - static { - defaultInstance = new Column(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Column) - } - - public interface RowDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.RowData) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - java.util.List - getBeforeColumnsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - int getBeforeColumnsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - java.util.List - getBeforeColumnsOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( - int index); - - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - java.util.List - getAfterColumnsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - int getAfterColumnsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - java.util.List - getAfterColumnsOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( - int index); - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - int getPropsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.RowData} - */ - public static final class RowData extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.RowData) - RowDataOrBuilder { - // Use RowData.newBuilder() to construct. - private RowData(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private RowData(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final RowData defaultInstance; - public static RowData getDefaultInstance() { - return defaultInstance; - } - - public RowData getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RowData( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + // Construct using + // com.alibaba.otter.canal.protocol.CanalEntry.Column.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - beforeColumns_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - beforeColumns_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.PARSER, extensionRegistry)); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - afterColumns_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - afterColumns_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.PARSER, extensionRegistry)); - break; + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getPropsFieldBuilder(); + } } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); - break; + + 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); + } else { + propsBuilder_.clear(); + } + value_ = ""; + bitField0_ = (bitField0_ & ~0x00000080); + length_ = 0; + bitField0_ = (bitField0_ & ~0x00000100); + mysqlType_ = ""; + bitField0_ = (bitField0_ & ~0x00000200); + return this; + } + + 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; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.Column getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalEntry.Column build() { + com.alibaba.otter.canal.protocol.CanalEntry.Column result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.Column buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.Column result = new com.alibaba.otter.canal.protocol.CanalEntry.Column(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + 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_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.props_ = props_; + } 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_; + onBuilt(); + return result; + } + + 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); + } 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.hasIndex()) { + setIndex(other.getIndex()); + } + if (other.hasSqlType()) { + setSqlType(other.getSqlType()); + } + if (other.hasName()) { + bitField0_ |= 0x00000004; + name_ = other.name_; + onChanged(); + } + if (other.hasIsKey()) { + setIsKey(other.getIsKey()); + } + if (other.hasUpdated()) { + setUpdated(other.getUpdated()); + } + if (other.hasIsNull()) { + setIsNull(other.getIsNull()); + } + if (propsBuilder_ == null) { + if (!other.props_.isEmpty()) { + if (props_.isEmpty()) { + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensurePropsIsMutable(); + props_.addAll(other.props_); + } + onChanged(); + } + } else { + if (!other.props_.isEmpty()) { + if (propsBuilder_.isEmpty()) { + propsBuilder_.dispose(); + propsBuilder_ = null; + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000040); + propsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; + } else { + propsBuilder_.addAllMessages(other.props_); + } + } + } + if (other.hasValue()) { + bitField0_ |= 0x00000080; + value_ = other.value_; + onChanged(); + } + if (other.hasLength()) { + setLength(other.getLength()); + } + if (other.hasMysqlType()) { + bitField0_ |= 0x00000200; + mysqlType_ = other.mysqlType_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalEntry.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; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int index_; + + /** + * optional int32 index = 1; + * + *
      +             * *字段下标*
      +             * 
      + */ + public boolean hasIndex() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int32 index = 1; + * + *
      +             * *字段下标*
      +             * 
      + */ + public int getIndex() { + return index_; + } + + /** + * optional int32 index = 1; + * + *
      +             * *字段下标*
      +             * 
      + */ + public Builder setIndex(int value) { + bitField0_ |= 0x00000001; + index_ = value; + onChanged(); + return this; + } + + /** + * optional int32 index = 1; + * + *
      +             * *字段下标*
      +             * 
      + */ + public Builder clearIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + index_ = 0; + onChanged(); + return this; + } + + private int sqlType_; + + /** + * optional int32 sqlType = 2; + * + *
      +             * *字段java中类型*
      +             * 
      + */ + public boolean hasSqlType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional int32 sqlType = 2; + * + *
      +             * *字段java中类型*
      +             * 
      + */ + public int getSqlType() { + return sqlType_; + } + + /** + * optional int32 sqlType = 2; + * + *
      +             * *字段java中类型*
      +             * 
      + */ + public Builder setSqlType(int value) { + bitField0_ |= 0x00000002; + sqlType_ = value; + onChanged(); + return this; + } + + /** + * optional int32 sqlType = 2; + * + *
      +             * *字段java中类型*
      +             * 
      + */ + public Builder clearSqlType() { + bitField0_ = (bitField0_ & ~0x00000002); + sqlType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * optional string name = 3; + * + *
      +             * *字段名称(忽略大小写),在mysql中是没有的*
      +             * 
      + */ + public boolean hasName() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional string name = 3; + * + *
      +             * *字段名称(忽略大小写),在mysql中是没有的*
      +             * 
      + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string name = 3; + * + *
      +             * *字段名称(忽略大小写),在mysql中是没有的*
      +             * 
      + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string name = 3; + * + *
      +             * *字段名称(忽略大小写),在mysql中是没有的*
      +             * 
      + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + name_ = value; + onChanged(); + return this; + } + + /** + * optional string name = 3; + * + *
      +             * *字段名称(忽略大小写),在mysql中是没有的*
      +             * 
      + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000004); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * optional string name = 3; + * + *
      +             * *字段名称(忽略大小写),在mysql中是没有的*
      +             * 
      + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + name_ = value; + onChanged(); + return this; + } + + private boolean isKey_; + + /** + * optional bool isKey = 4; + * + *
      +             * *是否是主键*
      +             * 
      + */ + public boolean hasIsKey() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional bool isKey = 4; + * + *
      +             * *是否是主键*
      +             * 
      + */ + public boolean getIsKey() { + return isKey_; + } + + /** + * optional bool isKey = 4; + * + *
      +             * *是否是主键*
      +             * 
      + */ + public Builder setIsKey(boolean value) { + bitField0_ |= 0x00000008; + isKey_ = value; + onChanged(); + return this; + } + + /** + * optional bool isKey = 4; + * + *
      +             * *是否是主键*
      +             * 
      + */ + public Builder clearIsKey() { + bitField0_ = (bitField0_ & ~0x00000008); + isKey_ = false; + onChanged(); + return this; + } + + private boolean updated_; + + /** + * optional bool updated = 5; + * + *
      +             * *如果EventType=UPDATE,用于标识这个字段值是否有修改*
      +             * 
      + */ + public boolean hasUpdated() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional bool updated = 5; + * + *
      +             * *如果EventType=UPDATE,用于标识这个字段值是否有修改*
      +             * 
      + */ + public boolean getUpdated() { + return updated_; + } + + /** + * optional bool updated = 5; + * + *
      +             * *如果EventType=UPDATE,用于标识这个字段值是否有修改*
      +             * 
      + */ + public Builder setUpdated(boolean value) { + bitField0_ |= 0x00000010; + updated_ = value; + onChanged(); + return this; + } + + /** + * optional bool updated = 5; + * + *
      +             * *如果EventType=UPDATE,用于标识这个字段值是否有修改*
      +             * 
      + */ + public Builder clearUpdated() { + bitField0_ = (bitField0_ & ~0x00000010); + updated_ = false; + onChanged(); + return this; + } + + private boolean isNull_; + + /** + * optional bool isNull = 6 [default = false]; + * + *
      +             * * 标识是否为空  *
      +             * 
      + */ + public boolean hasIsNull() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + + /** + * optional bool isNull = 6 [default = false]; + * + *
      +             * * 标识是否为空  *
      +             * 
      + */ + public boolean getIsNull() { + return isNull_; + } + + /** + * optional bool isNull = 6 [default = false]; + * + *
      +             * * 标识是否为空  *
      +             * 
      + */ + public Builder setIsNull(boolean value) { + bitField0_ |= 0x00000020; + isNull_ = value; + onChanged(); + return this; + } + + /** + * optional bool isNull = 6 [default = false]; + * + *
      +             * * 标识是否为空  *
      +             * 
      + */ + public Builder clearIsNull() { + bitField0_ = (bitField0_ & ~0x00000020); + isNull_ = false; + onChanged(); + return this; + } + + private java.util.List props_ = java.util.Collections.emptyList(); + + private void ensurePropsIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + props_ = new java.util.ArrayList(props_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder propsBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsList() { + if (propsBuilder_ == null) { + return java.util.Collections.unmodifiableList(props_); + } else { + return propsBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public int getPropsCount() { + if (propsBuilder_ == null) { + return props_.size(); + } else { + return propsBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.set(index, value); + onChanged(); + } else { + propsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.set(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(value); + onChanged(); + } else { + propsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(index, value); + onChanged(); + } else { + propsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addAllProps(java.lang.Iterable values) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, props_); + onChanged(); + } else { + propsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder clearProps() { + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + propsBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder removeProps(int index) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.remove(index); + onChanged(); + } else { + propsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder(int index) { + return getPropsFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsOrBuilderList() { + if (propsBuilder_ != null) { + return propsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(props_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + return getPropsFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder(int index) { + return getPropsFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 7; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsBuilderList() { + return getPropsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getPropsFieldBuilder() { + if (propsBuilder_ == null) { + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(props_, + ((bitField0_ & 0x00000040) == 0x00000040), + getParentForChildren(), + isClean()); + props_ = null; + } + return propsBuilder_; + } + + private java.lang.Object value_ = ""; + + /** + * optional string value = 8; + * + *
      +             * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +             * 
      + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + + /** + * optional string value = 8; + * + *
      +             * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +             * 
      + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string value = 8; + * + *
      +             * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +             * 
      + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string value = 8; + * + *
      +             * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +             * 
      + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + value_ = value; + onChanged(); + return this; + } + + /** + * optional string value = 8; + * + *
      +             * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +             * 
      + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000080); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + + /** + * optional string value = 8; + * + *
      +             * * 字段值,timestamp,Datetime是一个时间格式的文本 *
      +             * 
      + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + value_ = value; + onChanged(); + return this; + } + + private int length_; + + /** + * optional int32 length = 9; + * + *
      +             * * 对应数据对象原始长度 *
      +             * 
      + */ + public boolean hasLength() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + + /** + * optional int32 length = 9; + * + *
      +             * * 对应数据对象原始长度 *
      +             * 
      + */ + public int getLength() { + return length_; + } + + /** + * optional int32 length = 9; + * + *
      +             * * 对应数据对象原始长度 *
      +             * 
      + */ + public Builder setLength(int value) { + bitField0_ |= 0x00000100; + length_ = value; + onChanged(); + return this; + } + + /** + * optional int32 length = 9; + * + *
      +             * * 对应数据对象原始长度 *
      +             * 
      + */ + public Builder clearLength() { + bitField0_ = (bitField0_ & ~0x00000100); + length_ = 0; + onChanged(); + return this; + } + + private java.lang.Object mysqlType_ = ""; + + /** + * optional string mysqlType = 10; + * + *
      +             * *字段mysql类型*
      +             * 
      + */ + public boolean hasMysqlType() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + + /** + * optional string mysqlType = 10; + * + *
      +             * *字段mysql类型*
      +             * 
      + */ + public java.lang.String getMysqlType() { + java.lang.Object ref = mysqlType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + mysqlType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string mysqlType = 10; + * + *
      +             * *字段mysql类型*
      +             * 
      + */ + public com.google.protobuf.ByteString getMysqlTypeBytes() { + java.lang.Object ref = mysqlType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mysqlType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string mysqlType = 10; + * + *
      +             * *字段mysql类型*
      +             * 
      + */ + public Builder setMysqlType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + mysqlType_ = value; + onChanged(); + return this; + } + + /** + * optional string mysqlType = 10; + * + *
      +             * *字段mysql类型*
      +             * 
      + */ + public Builder clearMysqlType() { + bitField0_ = (bitField0_ & ~0x00000200); + mysqlType_ = getDefaultInstance().getMysqlType(); + onChanged(); + return this; + } + + /** + * optional string mysqlType = 10; + * + *
      +             * *字段mysql类型*
      +             * 
      + */ + public Builder setMysqlTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + mysqlType_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Column) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - beforeColumns_ = java.util.Collections.unmodifiableList(beforeColumns_); + + static { + defaultInstance = new Column(true); + defaultInstance.initFields(); } - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - afterColumns_ = java.util.Collections.unmodifiableList(afterColumns_); - } - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = java.util.Collections.unmodifiableList(props_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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; + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Column) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); + public interface RowDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.RowData) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + java.util.List getBeforeColumnsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + int getBeforeColumnsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + java.util.List getBeforeColumnsOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + java.util.List getAfterColumnsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + int getAfterColumnsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + java.util.List getAfterColumnsOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + int getPropsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index); } - 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); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public static final int BEFORECOLUMNS_FIELD_NUMBER = 1; - private java.util.List beforeColumns_; - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - public java.util.List getBeforeColumnsList() { - return beforeColumns_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - public java.util.List - getBeforeColumnsOrBuilderList() { - return beforeColumns_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - public int getBeforeColumnsCount() { - return beforeColumns_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index) { - return beforeColumns_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -     ** 字段信息,增量数据(修改前,删除前) *
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( - int index) { - return beforeColumns_.get(index); - } - - public static final int AFTERCOLUMNS_FIELD_NUMBER = 2; - private java.util.List afterColumns_; - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - public java.util.List getAfterColumnsList() { - return afterColumns_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - public java.util.List - getAfterColumnsOrBuilderList() { - return afterColumns_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - public int getAfterColumnsCount() { - return afterColumns_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index) { - return afterColumns_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -     ** 字段信息,增量数据(修改后,新增后)  *
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( - int index) { - return afterColumns_.get(index); - } - - public static final int PROPS_FIELD_NUMBER = 3; - private java.util.List props_; - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List getPropsList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List - getPropsOrBuilderList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public int getPropsCount() { - return props_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - return props_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - return props_.get(index); - } - - private void initFields() { - beforeColumns_ = java.util.Collections.emptyList(); - afterColumns_ = java.util.Collections.emptyList(); - props_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < beforeColumns_.size(); i++) { - output.writeMessage(1, beforeColumns_.get(i)); - } - for (int i = 0; i < afterColumns_.size(); i++) { - output.writeMessage(2, afterColumns_.get(i)); - } - for (int i = 0; i < props_.size(); i++) { - output.writeMessage(3, props_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < beforeColumns_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, beforeColumns_.get(i)); - } - for (int i = 0; i < afterColumns_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, afterColumns_.get(i)); - } - for (int i = 0; i < props_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, props_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.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( - 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) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.RowData prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.RowData} */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class RowData extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.RowData) + RowDataOrBuilder { + + // Use RowData.newBuilder() to construct. + private RowData(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private RowData(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final RowData defaultInstance; + + public static RowData getDefaultInstance() { + return defaultInstance; + } + + public RowData getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RowData(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + beforeColumns_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + beforeColumns_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.PARSER, + extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + afterColumns_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + afterColumns_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Column.PARSER, + extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + props_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, + extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + beforeColumns_ = java.util.Collections.unmodifiableList(beforeColumns_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + afterColumns_ = java.util.Collections.unmodifiableList(afterColumns_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + props_ = java.util.Collections.unmodifiableList(props_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + 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; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } + + 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); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public static final int BEFORECOLUMNS_FIELD_NUMBER = 1; + private java.util.List beforeColumns_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + public java.util.List getBeforeColumnsList() { + return beforeColumns_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + public java.util.List getBeforeColumnsOrBuilderList() { + return beforeColumns_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + public int getBeforeColumnsCount() { + return beforeColumns_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index) { + return beforeColumns_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +         * * 字段信息,增量数据(修改前,删除前) *
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder(int index) { + return beforeColumns_.get(index); + } + + public static final int AFTERCOLUMNS_FIELD_NUMBER = 2; + private java.util.List afterColumns_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + public java.util.List getAfterColumnsList() { + return afterColumns_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + public java.util.List getAfterColumnsOrBuilderList() { + return afterColumns_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + public int getAfterColumnsCount() { + return afterColumns_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index) { + return afterColumns_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +         * * 字段信息,增量数据(修改后,新增后)  *
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder(int index) { + return afterColumns_.get(index); + } + + public static final int PROPS_FIELD_NUMBER = 3; + private java.util.List props_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsOrBuilderList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public int getPropsCount() { + return props_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + return props_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + return props_.get(index); + } + + private void initFields() { + beforeColumns_ = java.util.Collections.emptyList(); + afterColumns_ = java.util.Collections.emptyList(); + props_ = java.util.Collections.emptyList(); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < beforeColumns_.size(); i++) { + output.writeMessage(1, beforeColumns_.get(i)); + } + for (int i = 0; i < afterColumns_.size(); i++) { + output.writeMessage(2, afterColumns_.get(i)); + } + for (int i = 0; i < props_.size(); i++) { + output.writeMessage(3, props_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < beforeColumns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, beforeColumns_.get(i)); + } + for (int i = 0; i < afterColumns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, afterColumns_.get(i)); + } + for (int i = 0; i < props_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, props_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.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(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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowData parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.RowData prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.RowData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.RowData) com.alibaba.otter.canal.protocol.CanalEntry.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; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalEntry.RowData.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getBeforeColumnsFieldBuilder(); - getAfterColumnsFieldBuilder(); - getPropsFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (beforeColumnsBuilder_ == null) { - beforeColumns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - beforeColumnsBuilder_.clear(); - } - if (afterColumnsBuilder_ == null) { - afterColumns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - afterColumnsBuilder_.clear(); - } - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - propsBuilder_.clear(); - } - return this; - } - - 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; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.RowData getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalEntry.RowData build() { - com.alibaba.otter.canal.protocol.CanalEntry.RowData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.RowData buildPartial() { - com.alibaba.otter.canal.protocol.CanalEntry.RowData result = new com.alibaba.otter.canal.protocol.CanalEntry.RowData(this); - int from_bitField0_ = bitField0_; - if (beforeColumnsBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - beforeColumns_ = java.util.Collections.unmodifiableList(beforeColumns_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.beforeColumns_ = beforeColumns_; - } else { - result.beforeColumns_ = beforeColumnsBuilder_.build(); - } - if (afterColumnsBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - afterColumns_ = java.util.Collections.unmodifiableList(afterColumns_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.afterColumns_ = afterColumns_; - } else { - result.afterColumns_ = afterColumnsBuilder_.build(); - } - if (propsBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = java.util.Collections.unmodifiableList(props_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.props_ = props_; - } else { - result.props_ = propsBuilder_.build(); - } - onBuilt(); - return result; - } - - 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); - } 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; - if (beforeColumnsBuilder_ == null) { - if (!other.beforeColumns_.isEmpty()) { - if (beforeColumns_.isEmpty()) { - beforeColumns_ = other.beforeColumns_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBeforeColumnsIsMutable(); - beforeColumns_.addAll(other.beforeColumns_); + 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; } - onChanged(); - } - } else { - if (!other.beforeColumns_.isEmpty()) { - if (beforeColumnsBuilder_.isEmpty()) { - beforeColumnsBuilder_.dispose(); - beforeColumnsBuilder_ = null; - beforeColumns_ = other.beforeColumns_; - bitField0_ = (bitField0_ & ~0x00000001); - beforeColumnsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getBeforeColumnsFieldBuilder() : null; - } else { - beforeColumnsBuilder_.addAllMessages(other.beforeColumns_); + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); } - } - } - if (afterColumnsBuilder_ == null) { - if (!other.afterColumns_.isEmpty()) { - if (afterColumns_.isEmpty()) { - afterColumns_ = other.afterColumns_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureAfterColumnsIsMutable(); - afterColumns_.addAll(other.afterColumns_); + + // Construct using + // com.alibaba.otter.canal.protocol.CanalEntry.RowData.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - onChanged(); - } - } else { - if (!other.afterColumns_.isEmpty()) { - if (afterColumnsBuilder_.isEmpty()) { - afterColumnsBuilder_.dispose(); - afterColumnsBuilder_ = null; - afterColumns_ = other.afterColumns_; - bitField0_ = (bitField0_ & ~0x00000002); - afterColumnsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getAfterColumnsFieldBuilder() : null; - } else { - afterColumnsBuilder_.addAllMessages(other.afterColumns_); + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - } - } - if (propsBuilder_ == null) { - if (!other.props_.isEmpty()) { - if (props_.isEmpty()) { - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensurePropsIsMutable(); - props_.addAll(other.props_); + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getBeforeColumnsFieldBuilder(); + getAfterColumnsFieldBuilder(); + getPropsFieldBuilder(); + } } - onChanged(); - } - } else { - if (!other.props_.isEmpty()) { - if (propsBuilder_.isEmpty()) { - propsBuilder_.dispose(); - propsBuilder_ = null; - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000004); - propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPropsFieldBuilder() : null; - } else { - propsBuilder_.addAllMessages(other.props_); + + private static Builder create() { + return new Builder(); } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalEntry.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; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List beforeColumns_ = - java.util.Collections.emptyList(); - private void ensureBeforeColumnsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - beforeColumns_ = new java.util.ArrayList(beforeColumns_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> beforeColumnsBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public java.util.List getBeforeColumnsList() { - if (beforeColumnsBuilder_ == null) { - return java.util.Collections.unmodifiableList(beforeColumns_); - } else { - return beforeColumnsBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public int getBeforeColumnsCount() { - if (beforeColumnsBuilder_ == null) { - return beforeColumns_.size(); - } else { - return beforeColumnsBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index) { - if (beforeColumnsBuilder_ == null) { - return beforeColumns_.get(index); - } else { - return beforeColumnsBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder setBeforeColumns( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { - if (beforeColumnsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBeforeColumnsIsMutable(); - beforeColumns_.set(index, value); - onChanged(); - } else { - beforeColumnsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder setBeforeColumns( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { - if (beforeColumnsBuilder_ == null) { - ensureBeforeColumnsIsMutable(); - beforeColumns_.set(index, builderForValue.build()); - onChanged(); - } else { - beforeColumnsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder addBeforeColumns(com.alibaba.otter.canal.protocol.CanalEntry.Column value) { - if (beforeColumnsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBeforeColumnsIsMutable(); - beforeColumns_.add(value); - onChanged(); - } else { - beforeColumnsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder addBeforeColumns( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { - if (beforeColumnsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBeforeColumnsIsMutable(); - beforeColumns_.add(index, value); - onChanged(); - } else { - beforeColumnsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder addBeforeColumns( - com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { - if (beforeColumnsBuilder_ == null) { - ensureBeforeColumnsIsMutable(); - beforeColumns_.add(builderForValue.build()); - onChanged(); - } else { - beforeColumnsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder addBeforeColumns( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { - if (beforeColumnsBuilder_ == null) { - ensureBeforeColumnsIsMutable(); - beforeColumns_.add(index, builderForValue.build()); - onChanged(); - } else { - beforeColumnsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder addAllBeforeColumns( - java.lang.Iterable values) { - if (beforeColumnsBuilder_ == null) { - ensureBeforeColumnsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, beforeColumns_); - onChanged(); - } else { - beforeColumnsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder clearBeforeColumns() { - if (beforeColumnsBuilder_ == null) { - beforeColumns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - beforeColumnsBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public Builder removeBeforeColumns(int index) { - if (beforeColumnsBuilder_ == null) { - ensureBeforeColumnsIsMutable(); - beforeColumns_.remove(index); - onChanged(); - } else { - beforeColumnsBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder getBeforeColumnsBuilder( - int index) { - return getBeforeColumnsFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder( - int index) { - if (beforeColumnsBuilder_ == null) { - return beforeColumns_.get(index); } else { - return beforeColumnsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public java.util.List - getBeforeColumnsOrBuilderList() { - if (beforeColumnsBuilder_ != null) { - return beforeColumnsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(beforeColumns_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addBeforeColumnsBuilder() { - return getBeforeColumnsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addBeforeColumnsBuilder( - int index) { - return getBeforeColumnsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; - * - *
      -       ** 字段信息,增量数据(修改前,删除前) *
      -       * 
      - */ - public java.util.List - getBeforeColumnsBuilderList() { - return getBeforeColumnsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> - getBeforeColumnsFieldBuilder() { - if (beforeColumnsBuilder_ == null) { - beforeColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder>( - beforeColumns_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - beforeColumns_ = null; - } - return beforeColumnsBuilder_; - } - - private java.util.List afterColumns_ = - java.util.Collections.emptyList(); - private void ensureAfterColumnsIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - afterColumns_ = new java.util.ArrayList(afterColumns_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> afterColumnsBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public java.util.List getAfterColumnsList() { - if (afterColumnsBuilder_ == null) { - return java.util.Collections.unmodifiableList(afterColumns_); - } else { - return afterColumnsBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public int getAfterColumnsCount() { - if (afterColumnsBuilder_ == null) { - return afterColumns_.size(); - } else { - return afterColumnsBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index) { - if (afterColumnsBuilder_ == null) { - return afterColumns_.get(index); - } else { - return afterColumnsBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder setAfterColumns( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { - if (afterColumnsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAfterColumnsIsMutable(); - afterColumns_.set(index, value); - onChanged(); - } else { - afterColumnsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder setAfterColumns( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { - if (afterColumnsBuilder_ == null) { - ensureAfterColumnsIsMutable(); - afterColumns_.set(index, builderForValue.build()); - onChanged(); - } else { - afterColumnsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder addAfterColumns(com.alibaba.otter.canal.protocol.CanalEntry.Column value) { - if (afterColumnsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAfterColumnsIsMutable(); - afterColumns_.add(value); - onChanged(); - } else { - afterColumnsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder addAfterColumns( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { - if (afterColumnsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAfterColumnsIsMutable(); - afterColumns_.add(index, value); - onChanged(); - } else { - afterColumnsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder addAfterColumns( - com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { - if (afterColumnsBuilder_ == null) { - ensureAfterColumnsIsMutable(); - afterColumns_.add(builderForValue.build()); - onChanged(); - } else { - afterColumnsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder addAfterColumns( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { - if (afterColumnsBuilder_ == null) { - ensureAfterColumnsIsMutable(); - afterColumns_.add(index, builderForValue.build()); - onChanged(); - } else { - afterColumnsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder addAllAfterColumns( - java.lang.Iterable values) { - if (afterColumnsBuilder_ == null) { - ensureAfterColumnsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, afterColumns_); - onChanged(); - } else { - afterColumnsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder clearAfterColumns() { - if (afterColumnsBuilder_ == null) { - afterColumns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - afterColumnsBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public Builder removeAfterColumns(int index) { - if (afterColumnsBuilder_ == null) { - ensureAfterColumnsIsMutable(); - afterColumns_.remove(index); - onChanged(); - } else { - afterColumnsBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder getAfterColumnsBuilder( - int index) { - return getAfterColumnsFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder( - int index) { - if (afterColumnsBuilder_ == null) { - return afterColumns_.get(index); } else { - return afterColumnsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public java.util.List - getAfterColumnsOrBuilderList() { - if (afterColumnsBuilder_ != null) { - return afterColumnsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(afterColumns_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addAfterColumnsBuilder() { - return getAfterColumnsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addAfterColumnsBuilder( - int index) { - return getAfterColumnsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; - * - *
      -       ** 字段信息,增量数据(修改后,新增后)  *
      -       * 
      - */ - public java.util.List - getAfterColumnsBuilderList() { - return getAfterColumnsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder> - getAfterColumnsFieldBuilder() { - if (afterColumnsBuilder_ == null) { - afterColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Column, com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder, com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder>( - afterColumns_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - afterColumns_ = null; - } - return afterColumnsBuilder_; - } - - private java.util.List props_ = - java.util.Collections.emptyList(); - private void ensurePropsIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(props_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List getPropsList() { - if (propsBuilder_ == null) { - return java.util.Collections.unmodifiableList(props_); - } else { - return propsBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public int getPropsCount() { - if (propsBuilder_ == null) { - return props_.size(); - } else { - return propsBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - if (propsBuilder_ == null) { - return props_.get(index); - } else { - return propsBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.set(index, value); - onChanged(); - } else { - propsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.set(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(value); - onChanged(); - } else { - propsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(index, value); - onChanged(); - } else { - propsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addAllProps( - java.lang.Iterable values) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, props_); - onChanged(); - } else { - propsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder clearProps() { - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - propsBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder removeProps(int index) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.remove(index); - onChanged(); - } else { - propsBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( - int index) { - return getPropsFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - if (propsBuilder_ == null) { - return props_.get(index); } else { - return propsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsOrBuilderList() { - if (propsBuilder_ != null) { - return propsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(props_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { - return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( - int index) { - return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsBuilderList() { - return getPropsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> - getPropsFieldBuilder() { - if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( - props_, - ((bitField0_ & 0x00000004) == 0x00000004), - getParentForChildren(), - isClean()); - props_ = null; - } - return propsBuilder_; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.RowData) - } - - static { - defaultInstance = new RowData(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowData) - } - - public interface RowChangeOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.RowChange) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 tableId = 1; - * - *
      -     **tableId,由数据库产生*
      -     * 
      - */ - boolean hasTableId(); - /** - * optional int64 tableId = 1; - * - *
      -     **tableId,由数据库产生*
      -     * 
      - */ - long getTableId(); - - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * - *
      -     **数据变更类型*
      -     * 
      - */ - boolean hasEventType(); - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * - *
      -     **数据变更类型*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); - - /** - * 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语句  *
      -     * 
      - */ - boolean hasSql(); - /** - * optional string sql = 11; - * - *
      -     ** ddl/query的sql语句  *
      -     * 
      - */ - java.lang.String getSql(); - /** - * optional string sql = 11; - * - *
      -     ** ddl/query的sql语句  *
      -     * 
      - */ - com.google.protobuf.ByteString - getSqlBytes(); - - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - java.util.List - getRowDatasList(); - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - int getRowDatasCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - java.util.List - getRowDatasOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( - int index); - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - int getPropsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); - - /** - * optional string ddlSchemaName = 14; - * - *
      -     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -     * 
      - */ - boolean hasDdlSchemaName(); - /** - * optional string ddlSchemaName = 14; - * - *
      -     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -     * 
      - */ - java.lang.String getDdlSchemaName(); - /** - * optional string ddlSchemaName = 14; - * - *
      -     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -     * 
      - */ - com.google.protobuf.ByteString - getDdlSchemaNameBytes(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.RowChange} - * - *
      -   **message row 每行变更数据的数据结构*
      -   * 
      - */ - public static final class RowChange extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.RowChange) - RowChangeOrBuilder { - // Use RowChange.newBuilder() to construct. - private RowChange(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private RowChange(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final RowChange defaultInstance; - public static RowChange getDefaultInstance() { - return defaultInstance; - } - - public RowChange getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RowChange( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public Builder clear() { + super.clear(); + if (beforeColumnsBuilder_ == null) { + beforeColumns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + beforeColumnsBuilder_.clear(); + } + if (afterColumnsBuilder_ == null) { + afterColumns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + afterColumnsBuilder_.clear(); + } + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + propsBuilder_.clear(); + } + return this; } - case 8: { - bitField0_ |= 0x00000001; - tableId_ = input.readInt64(); - break; + + public Builder clone() { + return create().mergeFrom(buildPartial()); } - case 16: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalEntry.EventType value = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(2, rawValue); - } else { - bitField0_ |= 0x00000002; - eventType_ = value; - } - break; + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; } - case 80: { - bitField0_ |= 0x00000004; - isDdl_ = input.readBool(); - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.RowData getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance(); } - case 90: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000008; - sql_ = bs; - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.RowData build() { + com.alibaba.otter.canal.protocol.CanalEntry.RowData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; } - case 98: { - if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - rowDatas_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - rowDatas_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.RowData.PARSER, extensionRegistry)); - break; + + public com.alibaba.otter.canal.protocol.CanalEntry.RowData buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.RowData result = new com.alibaba.otter.canal.protocol.CanalEntry.RowData(this); + int from_bitField0_ = bitField0_; + if (beforeColumnsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + beforeColumns_ = java.util.Collections.unmodifiableList(beforeColumns_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.beforeColumns_ = beforeColumns_; + } else { + result.beforeColumns_ = beforeColumnsBuilder_.build(); + } + if (afterColumnsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + afterColumns_ = java.util.Collections.unmodifiableList(afterColumns_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.afterColumns_ = afterColumns_; + } else { + result.afterColumns_ = afterColumnsBuilder_.build(); + } + if (propsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + props_ = java.util.Collections.unmodifiableList(props_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.props_ = props_; + } else { + result.props_ = propsBuilder_.build(); + } + onBuilt(); + return result; } - case 106: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - props_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); - break; + + 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); + } else { + super.mergeFrom(other); + return this; + } } - case 114: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000010; - ddlSchemaName_ = bs; - break; + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalEntry.RowData other) { + if (other == com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()) return this; + if (beforeColumnsBuilder_ == null) { + if (!other.beforeColumns_.isEmpty()) { + if (beforeColumns_.isEmpty()) { + beforeColumns_ = other.beforeColumns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBeforeColumnsIsMutable(); + beforeColumns_.addAll(other.beforeColumns_); + } + onChanged(); + } + } else { + if (!other.beforeColumns_.isEmpty()) { + if (beforeColumnsBuilder_.isEmpty()) { + beforeColumnsBuilder_.dispose(); + beforeColumnsBuilder_ = null; + beforeColumns_ = other.beforeColumns_; + bitField0_ = (bitField0_ & ~0x00000001); + beforeColumnsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getBeforeColumnsFieldBuilder() : null; + } else { + beforeColumnsBuilder_.addAllMessages(other.beforeColumns_); + } + } + } + if (afterColumnsBuilder_ == null) { + if (!other.afterColumns_.isEmpty()) { + if (afterColumns_.isEmpty()) { + afterColumns_ = other.afterColumns_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAfterColumnsIsMutable(); + afterColumns_.addAll(other.afterColumns_); + } + onChanged(); + } + } else { + if (!other.afterColumns_.isEmpty()) { + if (afterColumnsBuilder_.isEmpty()) { + afterColumnsBuilder_.dispose(); + afterColumnsBuilder_ = null; + afterColumns_ = other.afterColumns_; + bitField0_ = (bitField0_ & ~0x00000002); + afterColumnsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getAfterColumnsFieldBuilder() : null; + } else { + afterColumnsBuilder_.addAllMessages(other.afterColumns_); + } + } + } + if (propsBuilder_ == null) { + if (!other.props_.isEmpty()) { + if (props_.isEmpty()) { + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePropsIsMutable(); + props_.addAll(other.props_); + } + onChanged(); + } + } else { + if (!other.props_.isEmpty()) { + if (propsBuilder_.isEmpty()) { + propsBuilder_.dispose(); + propsBuilder_ = null; + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000004); + propsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; + } else { + propsBuilder_.addAllMessages(other.props_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; } - } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalEntry.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; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List beforeColumns_ = java.util.Collections.emptyList(); + + private void ensureBeforeColumnsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + beforeColumns_ = new java.util.ArrayList(beforeColumns_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder beforeColumnsBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public java.util.List getBeforeColumnsList() { + if (beforeColumnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(beforeColumns_); + } else { + return beforeColumnsBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public int getBeforeColumnsCount() { + if (beforeColumnsBuilder_ == null) { + return beforeColumns_.size(); + } else { + return beforeColumnsBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column getBeforeColumns(int index) { + if (beforeColumnsBuilder_ == null) { + return beforeColumns_.get(index); + } else { + return beforeColumnsBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder setBeforeColumns(int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + if (beforeColumnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBeforeColumnsIsMutable(); + beforeColumns_.set(index, value); + onChanged(); + } else { + beforeColumnsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder setBeforeColumns(int index, + com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + if (beforeColumnsBuilder_ == null) { + ensureBeforeColumnsIsMutable(); + beforeColumns_.set(index, builderForValue.build()); + onChanged(); + } else { + beforeColumnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder addBeforeColumns(com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + if (beforeColumnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBeforeColumnsIsMutable(); + beforeColumns_.add(value); + onChanged(); + } else { + beforeColumnsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder addBeforeColumns(int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + if (beforeColumnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBeforeColumnsIsMutable(); + beforeColumns_.add(index, value); + onChanged(); + } else { + beforeColumnsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder addBeforeColumns(com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + if (beforeColumnsBuilder_ == null) { + ensureBeforeColumnsIsMutable(); + beforeColumns_.add(builderForValue.build()); + onChanged(); + } else { + beforeColumnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder addBeforeColumns(int index, + com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + if (beforeColumnsBuilder_ == null) { + ensureBeforeColumnsIsMutable(); + beforeColumns_.add(index, builderForValue.build()); + onChanged(); + } else { + beforeColumnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder addAllBeforeColumns(java.lang.Iterable values) { + if (beforeColumnsBuilder_ == null) { + ensureBeforeColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, beforeColumns_); + onChanged(); + } else { + beforeColumnsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder clearBeforeColumns() { + if (beforeColumnsBuilder_ == null) { + beforeColumns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + beforeColumnsBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public Builder removeBeforeColumns(int index) { + if (beforeColumnsBuilder_ == null) { + ensureBeforeColumnsIsMutable(); + beforeColumns_.remove(index); + onChanged(); + } else { + beforeColumnsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder getBeforeColumnsBuilder(int index) { + return getBeforeColumnsFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getBeforeColumnsOrBuilder(int index) { + if (beforeColumnsBuilder_ == null) { + return beforeColumns_.get(index); + } else { + return beforeColumnsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public java.util.List getBeforeColumnsOrBuilderList() { + if (beforeColumnsBuilder_ != null) { + return beforeColumnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(beforeColumns_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addBeforeColumnsBuilder() { + return getBeforeColumnsFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addBeforeColumnsBuilder(int index) { + return getBeforeColumnsFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; + * + *
      +             * * 字段信息,增量数据(修改前,删除前) *
      +             * 
      + */ + public java.util.List getBeforeColumnsBuilderList() { + return getBeforeColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getBeforeColumnsFieldBuilder() { + if (beforeColumnsBuilder_ == null) { + beforeColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(beforeColumns_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + beforeColumns_ = null; + } + return beforeColumnsBuilder_; + } + + private java.util.List afterColumns_ = java.util.Collections.emptyList(); + + private void ensureAfterColumnsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + afterColumns_ = new java.util.ArrayList(afterColumns_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder afterColumnsBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public java.util.List getAfterColumnsList() { + if (afterColumnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(afterColumns_); + } else { + return afterColumnsBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public int getAfterColumnsCount() { + if (afterColumnsBuilder_ == null) { + return afterColumns_.size(); + } else { + return afterColumnsBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column getAfterColumns(int index) { + if (afterColumnsBuilder_ == null) { + return afterColumns_.get(index); + } else { + return afterColumnsBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder setAfterColumns(int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + if (afterColumnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAfterColumnsIsMutable(); + afterColumns_.set(index, value); + onChanged(); + } else { + afterColumnsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder setAfterColumns(int index, + com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + if (afterColumnsBuilder_ == null) { + ensureAfterColumnsIsMutable(); + afterColumns_.set(index, builderForValue.build()); + onChanged(); + } else { + afterColumnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder addAfterColumns(com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + if (afterColumnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAfterColumnsIsMutable(); + afterColumns_.add(value); + onChanged(); + } else { + afterColumnsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder addAfterColumns(int index, com.alibaba.otter.canal.protocol.CanalEntry.Column value) { + if (afterColumnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAfterColumnsIsMutable(); + afterColumns_.add(index, value); + onChanged(); + } else { + afterColumnsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder addAfterColumns(com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + if (afterColumnsBuilder_ == null) { + ensureAfterColumnsIsMutable(); + afterColumns_.add(builderForValue.build()); + onChanged(); + } else { + afterColumnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder addAfterColumns(int index, + com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder builderForValue) { + if (afterColumnsBuilder_ == null) { + ensureAfterColumnsIsMutable(); + afterColumns_.add(index, builderForValue.build()); + onChanged(); + } else { + afterColumnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder addAllAfterColumns(java.lang.Iterable values) { + if (afterColumnsBuilder_ == null) { + ensureAfterColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, afterColumns_); + onChanged(); + } else { + afterColumnsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder clearAfterColumns() { + if (afterColumnsBuilder_ == null) { + afterColumns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + afterColumnsBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public Builder removeAfterColumns(int index) { + if (afterColumnsBuilder_ == null) { + ensureAfterColumnsIsMutable(); + afterColumns_.remove(index); + onChanged(); + } else { + afterColumnsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder getAfterColumnsBuilder(int index) { + return getAfterColumnsFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.ColumnOrBuilder getAfterColumnsOrBuilder(int index) { + if (afterColumnsBuilder_ == null) { + return afterColumns_.get(index); + } else { + return afterColumnsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public java.util.List getAfterColumnsOrBuilderList() { + if (afterColumnsBuilder_ != null) { + return afterColumnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(afterColumns_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addAfterColumnsBuilder() { + return getAfterColumnsFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Column.Builder addAfterColumnsBuilder(int index) { + return getAfterColumnsFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.Column.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; + * + *
      +             * * 字段信息,增量数据(修改后,新增后)  *
      +             * 
      + */ + public java.util.List getAfterColumnsBuilderList() { + return getAfterColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getAfterColumnsFieldBuilder() { + if (afterColumnsBuilder_ == null) { + afterColumnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(afterColumns_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + afterColumns_ = null; + } + return afterColumnsBuilder_; + } + + private java.util.List props_ = java.util.Collections.emptyList(); + + private void ensurePropsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + props_ = new java.util.ArrayList(props_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder propsBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsList() { + if (propsBuilder_ == null) { + return java.util.Collections.unmodifiableList(props_); + } else { + return propsBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public int getPropsCount() { + if (propsBuilder_ == null) { + return props_.size(); + } else { + return propsBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.set(index, value); + onChanged(); + } else { + propsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.set(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(value); + onChanged(); + } else { + propsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(index, value); + onChanged(); + } else { + propsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addAllProps(java.lang.Iterable values) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, props_); + onChanged(); + } else { + propsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder clearProps() { + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + propsBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder removeProps(int index) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.remove(index); + onChanged(); + } else { + propsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder(int index) { + return getPropsFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsOrBuilderList() { + if (propsBuilder_ != null) { + return propsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(props_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + return getPropsFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder(int index) { + return getPropsFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsBuilderList() { + return getPropsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getPropsFieldBuilder() { + if (propsBuilder_ == null) { + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(props_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + props_ = null; + } + return propsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.RowData) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - rowDatas_ = java.util.Collections.unmodifiableList(rowDatas_); + + static { + defaultInstance = new RowData(true); + defaultInstance.initFields(); } - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - props_ = java.util.Collections.unmodifiableList(props_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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; + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowData) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); + public interface RowChangeOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.RowChange) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 tableId = 1; + * + *
      +         * *tableId,由数据库产生*
      +         * 
      + */ + boolean hasTableId(); + + /** + * optional int64 tableId = 1; + * + *
      +         * *tableId,由数据库产生*
      +         * 
      + */ + long getTableId(); + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
      +         * *数据变更类型*
      +         * 
      + */ + boolean hasEventType(); + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
      +         * *数据变更类型*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType(); + + /** + * 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语句  *
      +         * 
      + */ + boolean hasSql(); + + /** + * optional string sql = 11; + * + *
      +         * * ddl/query的sql语句  *
      +         * 
      + */ + java.lang.String getSql(); + + /** + * optional string sql = 11; + * + *
      +         * * ddl/query的sql语句  *
      +         * 
      + */ + com.google.protobuf.ByteString getSqlBytes(); + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + java.util.List getRowDatasList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + int getRowDatasCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + java.util.List getRowDatasOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + int getPropsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index); + + /** + * optional string ddlSchemaName = 14; + * + *
      +         * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +         * 
      + */ + boolean hasDdlSchemaName(); + + /** + * optional string ddlSchemaName = 14; + * + *
      +         * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +         * 
      + */ + java.lang.String getDdlSchemaName(); + + /** + * optional string ddlSchemaName = 14; + * + *
      +         * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +         * 
      + */ + com.google.protobuf.ByteString getDdlSchemaNameBytes(); } - 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); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - 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; - * - *
      -     **tableId,由数据库产生*
      -     * 
      - */ - public long getTableId() { - return tableId_; - } - - public static final int EVENTTYPE_FIELD_NUMBER = 2; - private com.alibaba.otter.canal.protocol.CanalEntry.EventType eventType_; - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * - *
      -     **数据变更类型*
      -     * 
      - */ - public boolean hasEventType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * - *
      -     **数据变更类型*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - return eventType_; - } - - public static final int ISDDL_FIELD_NUMBER = 10; - private boolean isDdl_; - /** - * optional bool isDdl = 10 [default = false]; - * - *
      -     ** 标识是否是ddl语句  *
      -     * 
      - */ - public boolean hasIsDdl() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional bool isDdl = 10 [default = false]; - * - *
      -     ** 标识是否是ddl语句  *
      -     * 
      - */ - public boolean getIsDdl() { - return isDdl_; - } - - public static final int SQL_FIELD_NUMBER = 11; - private java.lang.Object sql_; - /** - * optional string sql = 11; - * - *
      -     ** ddl/query的sql语句  *
      -     * 
      - */ - public boolean hasSql() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional string sql = 11; - * - *
      -     ** ddl/query的sql语句  *
      -     * 
      - */ - public java.lang.String getSql() { - java.lang.Object ref = sql_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - sql_ = s; - } - return s; - } - } - /** - * optional string sql = 11; - * - *
      -     ** ddl/query的sql语句  *
      -     * 
      - */ - public com.google.protobuf.ByteString - getSqlBytes() { - java.lang.Object ref = sql_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - sql_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ROWDATAS_FIELD_NUMBER = 12; - private java.util.List rowDatas_; - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - public java.util.List getRowDatasList() { - return rowDatas_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - public java.util.List - getRowDatasOrBuilderList() { - return rowDatas_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - public int getRowDatasCount() { - return rowDatas_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index) { - return rowDatas_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -     ** 一次数据库变更可能存在多行  *
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( - int index) { - return rowDatas_.get(index); - } - - public static final int PROPS_FIELD_NUMBER = 13; - private java.util.List props_; - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List getPropsList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List - getPropsOrBuilderList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - public int getPropsCount() { - return props_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - return props_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - return props_.get(index); - } - - public static final int DDLSCHEMANAME_FIELD_NUMBER = 14; - private java.lang.Object ddlSchemaName_; - /** - * optional string ddlSchemaName = 14; - * - *
      -     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -     * 
      - */ - public boolean hasDdlSchemaName() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string ddlSchemaName = 14; - * - *
      -     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -     * 
      - */ - public java.lang.String getDdlSchemaName() { - java.lang.Object ref = ddlSchemaName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - ddlSchemaName_ = s; - } - return s; - } - } - /** - * optional string ddlSchemaName = 14; - * - *
      -     ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -     * 
      - */ - public com.google.protobuf.ByteString - getDdlSchemaNameBytes() { - java.lang.Object ref = ddlSchemaName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - ddlSchemaName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - tableId_ = 0L; - eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; - isDdl_ = false; - sql_ = ""; - rowDatas_ = java.util.Collections.emptyList(); - props_ = java.util.Collections.emptyList(); - ddlSchemaName_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, tableId_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, eventType_.getNumber()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBool(10, isDdl_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(11, getSqlBytes()); - } - for (int i = 0; i < rowDatas_.size(); i++) { - output.writeMessage(12, rowDatas_.get(i)); - } - for (int i = 0; i < props_.size(); i++) { - output.writeMessage(13, props_.get(i)); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(14, getDdlSchemaNameBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, tableId_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, eventType_.getNumber()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(10, isDdl_); - } - 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 - .computeMessageSize(12, rowDatas_.get(i)); - } - for (int i = 0; i < props_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(13, props_.get(i)); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(14, getDdlSchemaNameBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.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( - 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) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.RowChange prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.RowChange} * *
      -     **message row 每行变更数据的数据结构*
      +     * *message row 每行变更数据的数据结构*
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class RowChange extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.RowChange) + RowChangeOrBuilder { + + // Use RowChange.newBuilder() to construct. + private RowChange(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private RowChange(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final RowChange defaultInstance; + + public static RowChange getDefaultInstance() { + return defaultInstance; + } + + public RowChange getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RowChange(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + tableId_ = input.readInt64(); + break; + } + case 16: { + int rawValue = input.readEnum(); + com.alibaba.otter.canal.protocol.CanalEntry.EventType value = com.alibaba.otter.canal.protocol.CanalEntry.EventType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(2, rawValue); + } else { + bitField0_ |= 0x00000002; + eventType_ = value; + } + break; + } + case 80: { + bitField0_ |= 0x00000004; + isDdl_ = input.readBool(); + break; + } + case 90: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + sql_ = bs; + break; + } + case 98: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + rowDatas_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + rowDatas_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.RowData.PARSER, + extensionRegistry)); + break; + } + case 106: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + props_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, + extensionRegistry)); + break; + } + case 114: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + ddlSchemaName_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + rowDatas_ = java.util.Collections.unmodifiableList(rowDatas_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + props_ = java.util.Collections.unmodifiableList(props_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + 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; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } + + 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); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + 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; + * + *
      +         * *tableId,由数据库产生*
      +         * 
      + */ + public long getTableId() { + return tableId_; + } + + public static final int EVENTTYPE_FIELD_NUMBER = 2; + private com.alibaba.otter.canal.protocol.CanalEntry.EventType eventType_; + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
      +         * *数据变更类型*
      +         * 
      + */ + public boolean hasEventType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
      +         * *数据变更类型*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { + return eventType_; + } + + public static final int ISDDL_FIELD_NUMBER = 10; + private boolean isDdl_; + + /** + * optional bool isDdl = 10 [default = false]; + * + *
      +         * * 标识是否是ddl语句  *
      +         * 
      + */ + public boolean hasIsDdl() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional bool isDdl = 10 [default = false]; + * + *
      +         * * 标识是否是ddl语句  *
      +         * 
      + */ + public boolean getIsDdl() { + return isDdl_; + } + + public static final int SQL_FIELD_NUMBER = 11; + private java.lang.Object sql_; + + /** + * optional string sql = 11; + * + *
      +         * * ddl/query的sql语句  *
      +         * 
      + */ + public boolean hasSql() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional string sql = 11; + * + *
      +         * * ddl/query的sql语句  *
      +         * 
      + */ + public java.lang.String getSql() { + java.lang.Object ref = sql_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + sql_ = s; + } + return s; + } + } + + /** + * optional string sql = 11; + * + *
      +         * * ddl/query的sql语句  *
      +         * 
      + */ + public com.google.protobuf.ByteString getSqlBytes() { + java.lang.Object ref = sql_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sql_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ROWDATAS_FIELD_NUMBER = 12; + private java.util.List rowDatas_; + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + public java.util.List getRowDatasList() { + return rowDatas_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + public java.util.List getRowDatasOrBuilderList() { + return rowDatas_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + public int getRowDatasCount() { + return rowDatas_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index) { + return rowDatas_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +         * * 一次数据库变更可能存在多行  *
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder(int index) { + return rowDatas_.get(index); + } + + public static final int PROPS_FIELD_NUMBER = 13; + private java.util.List props_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsOrBuilderList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public int getPropsCount() { + return props_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + return props_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + return props_.get(index); + } + + public static final int DDLSCHEMANAME_FIELD_NUMBER = 14; + private java.lang.Object ddlSchemaName_; + + /** + * optional string ddlSchemaName = 14; + * + *
      +         * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +         * 
      + */ + public boolean hasDdlSchemaName() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional string ddlSchemaName = 14; + * + *
      +         * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +         * 
      + */ + public java.lang.String getDdlSchemaName() { + java.lang.Object ref = ddlSchemaName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + ddlSchemaName_ = s; + } + return s; + } + } + + /** + * optional string ddlSchemaName = 14; + * + *
      +         * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +         * 
      + */ + public com.google.protobuf.ByteString getDdlSchemaNameBytes() { + java.lang.Object ref = ddlSchemaName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ddlSchemaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + tableId_ = 0L; + eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; + isDdl_ = false; + sql_ = ""; + rowDatas_ = java.util.Collections.emptyList(); + props_ = java.util.Collections.emptyList(); + ddlSchemaName_ = ""; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, tableId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeEnum(2, eventType_.getNumber()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(10, isDdl_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(11, getSqlBytes()); + } + for (int i = 0; i < rowDatas_.size(); i++) { + output.writeMessage(12, rowDatas_.get(i)); + } + for (int i = 0; i < props_.size(); i++) { + output.writeMessage(13, props_.get(i)); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(14, getDdlSchemaNameBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, tableId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, eventType_.getNumber()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, isDdl_); + } + 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.computeMessageSize(12, rowDatas_.get(i)); + } + for (int i = 0; i < props_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, props_.get(i)); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(14, getDdlSchemaNameBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.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(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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.RowChange parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.RowChange prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.RowChange} + * + *
      +         * *message row 每行变更数据的数据结构*
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.RowChange) com.alibaba.otter.canal.protocol.CanalEntry.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; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalEntry.RowChange.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getRowDatasFieldBuilder(); - getPropsFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - tableId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.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); - } else { - rowDatasBuilder_.clear(); - } - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - } else { - propsBuilder_.clear(); - } - ddlSchemaName_ = ""; - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } - - 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; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.RowChange getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.RowChange.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalEntry.RowChange build() { - com.alibaba.otter.canal.protocol.CanalEntry.RowChange result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.RowChange buildPartial() { - com.alibaba.otter.canal.protocol.CanalEntry.RowChange result = new com.alibaba.otter.canal.protocol.CanalEntry.RowChange(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - 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) { - if (((bitField0_ & 0x00000010) == 0x00000010)) { - rowDatas_ = java.util.Collections.unmodifiableList(rowDatas_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.rowDatas_ = rowDatas_; - } else { - result.rowDatas_ = rowDatasBuilder_.build(); - } - if (propsBuilder_ == null) { - if (((bitField0_ & 0x00000020) == 0x00000020)) { - props_ = java.util.Collections.unmodifiableList(props_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.props_ = props_; - } else { - result.props_ = propsBuilder_.build(); - } - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000010; - } - result.ddlSchemaName_ = ddlSchemaName_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - 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); - } 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.hasTableId()) { - setTableId(other.getTableId()); - } - if (other.hasEventType()) { - setEventType(other.getEventType()); - } - if (other.hasIsDdl()) { - setIsDdl(other.getIsDdl()); - } - if (other.hasSql()) { - bitField0_ |= 0x00000008; - sql_ = other.sql_; - onChanged(); - } - if (rowDatasBuilder_ == null) { - if (!other.rowDatas_.isEmpty()) { - if (rowDatas_.isEmpty()) { - rowDatas_ = other.rowDatas_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureRowDatasIsMutable(); - rowDatas_.addAll(other.rowDatas_); + 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; } - onChanged(); - } - } else { - if (!other.rowDatas_.isEmpty()) { - if (rowDatasBuilder_.isEmpty()) { - rowDatasBuilder_.dispose(); - rowDatasBuilder_ = null; - rowDatas_ = other.rowDatas_; - bitField0_ = (bitField0_ & ~0x00000010); - rowDatasBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getRowDatasFieldBuilder() : null; - } else { - rowDatasBuilder_.addAllMessages(other.rowDatas_); + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); } - } - } - if (propsBuilder_ == null) { - if (!other.props_.isEmpty()) { - if (props_.isEmpty()) { - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensurePropsIsMutable(); - props_.addAll(other.props_); + + // Construct using + // com.alibaba.otter.canal.protocol.CanalEntry.RowChange.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - onChanged(); - } - } else { - if (!other.props_.isEmpty()) { - if (propsBuilder_.isEmpty()) { - propsBuilder_.dispose(); - propsBuilder_ = null; - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000020); - propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPropsFieldBuilder() : null; - } else { - propsBuilder_.addAllMessages(other.props_); + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - } - } - if (other.hasDdlSchemaName()) { - bitField0_ |= 0x00000040; - ddlSchemaName_ = other.ddlSchemaName_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalEntry.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; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long tableId_ ; - /** - * optional int64 tableId = 1; - * - *
      -       **tableId,由数据库产生*
      -       * 
      - */ - public boolean hasTableId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 tableId = 1; - * - *
      -       **tableId,由数据库产生*
      -       * 
      - */ - public long getTableId() { - return tableId_; - } - /** - * optional int64 tableId = 1; - * - *
      -       **tableId,由数据库产生*
      -       * 
      - */ - public Builder setTableId(long value) { - bitField0_ |= 0x00000001; - tableId_ = value; - onChanged(); - return this; - } - /** - * optional int64 tableId = 1; - * - *
      -       **tableId,由数据库产生*
      -       * 
      - */ - public Builder clearTableId() { - bitField0_ = (bitField0_ & ~0x00000001); - tableId_ = 0L; - onChanged(); - return this; - } - - private com.alibaba.otter.canal.protocol.CanalEntry.EventType eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * - *
      -       **数据变更类型*
      -       * 
      - */ - public boolean hasEventType() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * - *
      -       **数据变更类型*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { - return eventType_; - } - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * - *
      -       **数据变更类型*
      -       * 
      - */ - public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - eventType_ = value; - onChanged(); - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; - * - *
      -       **数据变更类型*
      -       * 
      - */ - public Builder clearEventType() { - bitField0_ = (bitField0_ & ~0x00000002); - eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; - onChanged(); - return this; - } - - private boolean isDdl_ ; - /** - * optional bool isDdl = 10 [default = false]; - * - *
      -       ** 标识是否是ddl语句  *
      -       * 
      - */ - public boolean hasIsDdl() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional bool isDdl = 10 [default = false]; - * - *
      -       ** 标识是否是ddl语句  *
      -       * 
      - */ - public boolean getIsDdl() { - return isDdl_; - } - /** - * optional bool isDdl = 10 [default = false]; - * - *
      -       ** 标识是否是ddl语句  *
      -       * 
      - */ - public Builder setIsDdl(boolean value) { - bitField0_ |= 0x00000004; - isDdl_ = value; - onChanged(); - return this; - } - /** - * optional bool isDdl = 10 [default = false]; - * - *
      -       ** 标识是否是ddl语句  *
      -       * 
      - */ - public Builder clearIsDdl() { - bitField0_ = (bitField0_ & ~0x00000004); - isDdl_ = false; - onChanged(); - return this; - } - - private java.lang.Object sql_ = ""; - /** - * optional string sql = 11; - * - *
      -       ** ddl/query的sql语句  *
      -       * 
      - */ - public boolean hasSql() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional string sql = 11; - * - *
      -       ** ddl/query的sql语句  *
      -       * 
      - */ - public java.lang.String getSql() { - java.lang.Object ref = sql_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - sql_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string sql = 11; - * - *
      -       ** ddl/query的sql语句  *
      -       * 
      - */ - public com.google.protobuf.ByteString - getSqlBytes() { - java.lang.Object ref = sql_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - sql_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string sql = 11; - * - *
      -       ** ddl/query的sql语句  *
      -       * 
      - */ - public Builder setSql( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - sql_ = value; - onChanged(); - return this; - } - /** - * optional string sql = 11; - * - *
      -       ** ddl/query的sql语句  *
      -       * 
      - */ - public Builder clearSql() { - bitField0_ = (bitField0_ & ~0x00000008); - sql_ = getDefaultInstance().getSql(); - onChanged(); - return this; - } - /** - * optional string sql = 11; - * - *
      -       ** ddl/query的sql语句  *
      -       * 
      - */ - public Builder setSqlBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - sql_ = value; - onChanged(); - return this; - } - - private java.util.List rowDatas_ = - java.util.Collections.emptyList(); - private void ensureRowDatasIsMutable() { - if (!((bitField0_ & 0x00000010) == 0x00000010)) { - rowDatas_ = new java.util.ArrayList(rowDatas_); - bitField0_ |= 0x00000010; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.RowData, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder, com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder> rowDatasBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public java.util.List getRowDatasList() { - if (rowDatasBuilder_ == null) { - return java.util.Collections.unmodifiableList(rowDatas_); - } else { - return rowDatasBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public int getRowDatasCount() { - if (rowDatasBuilder_ == null) { - return rowDatas_.size(); - } else { - return rowDatasBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index) { - if (rowDatasBuilder_ == null) { - return rowDatas_.get(index); - } else { - return rowDatasBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder setRowDatas( - int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { - if (rowDatasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRowDatasIsMutable(); - rowDatas_.set(index, value); - onChanged(); - } else { - rowDatasBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder setRowDatas( - int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { - if (rowDatasBuilder_ == null) { - ensureRowDatasIsMutable(); - rowDatas_.set(index, builderForValue.build()); - onChanged(); - } else { - rowDatasBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder addRowDatas(com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { - if (rowDatasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRowDatasIsMutable(); - rowDatas_.add(value); - onChanged(); - } else { - rowDatasBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder addRowDatas( - int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { - if (rowDatasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRowDatasIsMutable(); - rowDatas_.add(index, value); - onChanged(); - } else { - rowDatasBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder addRowDatas( - com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { - if (rowDatasBuilder_ == null) { - ensureRowDatasIsMutable(); - rowDatas_.add(builderForValue.build()); - onChanged(); - } else { - rowDatasBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder addRowDatas( - int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { - if (rowDatasBuilder_ == null) { - ensureRowDatasIsMutable(); - rowDatas_.add(index, builderForValue.build()); - onChanged(); - } else { - rowDatasBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder addAllRowDatas( - java.lang.Iterable values) { - if (rowDatasBuilder_ == null) { - ensureRowDatasIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, rowDatas_); - onChanged(); - } else { - rowDatasBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder clearRowDatas() { - if (rowDatasBuilder_ == null) { - rowDatas_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - } else { - rowDatasBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public Builder removeRowDatas(int index) { - if (rowDatasBuilder_ == null) { - ensureRowDatasIsMutable(); - rowDatas_.remove(index); - onChanged(); - } else { - rowDatasBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder getRowDatasBuilder( - int index) { - return getRowDatasFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder( - int index) { - if (rowDatasBuilder_ == null) { - return rowDatas_.get(index); } else { - return rowDatasBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public java.util.List - getRowDatasOrBuilderList() { - if (rowDatasBuilder_ != null) { - return rowDatasBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(rowDatas_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder addRowDatasBuilder() { - return getRowDatasFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder addRowDatasBuilder( - int index) { - return getRowDatasFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; - * - *
      -       ** 一次数据库变更可能存在多行  *
      -       * 
      - */ - public java.util.List - getRowDatasBuilderList() { - return getRowDatasFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.RowData, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder, com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder> - getRowDatasFieldBuilder() { - if (rowDatasBuilder_ == null) { - rowDatasBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.RowData, com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder, com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder>( - rowDatas_, - ((bitField0_ & 0x00000010) == 0x00000010), - getParentForChildren(), - isClean()); - rowDatas_ = null; - } - return rowDatasBuilder_; - } - - private java.util.List props_ = - java.util.Collections.emptyList(); - private void ensurePropsIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - props_ = new java.util.ArrayList(props_); - bitField0_ |= 0x00000020; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List getPropsList() { - if (propsBuilder_ == null) { - return java.util.Collections.unmodifiableList(props_); - } else { - return propsBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public int getPropsCount() { - if (propsBuilder_ == null) { - return props_.size(); - } else { - return propsBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - if (propsBuilder_ == null) { - return props_.get(index); - } else { - return propsBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.set(index, value); - onChanged(); - } else { - propsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.set(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(value); - onChanged(); - } else { - propsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(index, value); - onChanged(); - } else { - propsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addAllProps( - java.lang.Iterable values) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, props_); - onChanged(); - } else { - propsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder clearProps() { - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - } else { - propsBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder removeProps(int index) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.remove(index); - onChanged(); - } else { - propsBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( - int index) { - return getPropsFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - if (propsBuilder_ == null) { - return props_.get(index); } else { - return propsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsOrBuilderList() { - if (propsBuilder_ != null) { - return propsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(props_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { - return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( - int index) { - return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsBuilderList() { - return getPropsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> - getPropsFieldBuilder() { - if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( - props_, - ((bitField0_ & 0x00000020) == 0x00000020), - getParentForChildren(), - isClean()); - props_ = null; - } - return propsBuilder_; - } - - private java.lang.Object ddlSchemaName_ = ""; - /** - * optional string ddlSchemaName = 14; - * - *
      -       ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -       * 
      - */ - public boolean hasDdlSchemaName() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional string ddlSchemaName = 14; - * - *
      -       ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -       * 
      - */ - public java.lang.String getDdlSchemaName() { - java.lang.Object ref = ddlSchemaName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - ddlSchemaName_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string ddlSchemaName = 14; - * - *
      -       ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -       * 
      - */ - public com.google.protobuf.ByteString - getDdlSchemaNameBytes() { - java.lang.Object ref = ddlSchemaName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - ddlSchemaName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string ddlSchemaName = 14; - * - *
      -       ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -       * 
      - */ - public Builder setDdlSchemaName( - java.lang.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  *
      -       * 
      - */ - public Builder clearDdlSchemaName() { - bitField0_ = (bitField0_ & ~0x00000040); - ddlSchemaName_ = getDefaultInstance().getDdlSchemaName(); - onChanged(); - return this; - } - /** - * optional string ddlSchemaName = 14; - * - *
      -       ** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      -       * 
      - */ - public Builder setDdlSchemaNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000040; - ddlSchemaName_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.RowChange) - } - - static { - defaultInstance = new RowChange(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowChange) - } - - public interface TransactionBeginOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.TransactionBegin) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 executeTime = 1; - * - *
      -     **已废弃,请使用header里的executeTime*
      -     * 
      - */ - boolean hasExecuteTime(); - /** - * optional int64 executeTime = 1; - * - *
      -     **已废弃,请使用header里的executeTime*
      -     * 
      - */ - long getExecuteTime(); - - /** - * optional string transactionId = 2; - * - *
      -     **已废弃,Begin里不提供事务id*
      -     * 
      - */ - boolean hasTransactionId(); - /** - * optional string transactionId = 2; - * - *
      -     **已废弃,Begin里不提供事务id*
      -     * 
      - */ - java.lang.String getTransactionId(); - /** - * optional string transactionId = 2; - * - *
      -     **已废弃,Begin里不提供事务id*
      -     * 
      - */ - com.google.protobuf.ByteString - getTransactionIdBytes(); - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - int getPropsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); - - /** - * optional int64 threadId = 4; - * - *
      -     **执行的thread Id*
      -     * 
      - */ - boolean hasThreadId(); - /** - * optional int64 threadId = 4; - * - *
      -     **执行的thread Id*
      -     * 
      - */ - long getThreadId(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionBegin} - * - *
      -   **开始事务的一些信息*
      -   * 
      - */ - public static final class TransactionBegin extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.TransactionBegin) - TransactionBeginOrBuilder { - // Use TransactionBegin.newBuilder() to construct. - private TransactionBegin(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private TransactionBegin(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final TransactionBegin defaultInstance; - public static TransactionBegin getDefaultInstance() { - return defaultInstance; - } - - public TransactionBegin getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TransactionBegin( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getRowDatasFieldBuilder(); + getPropsFieldBuilder(); + } } - case 8: { - bitField0_ |= 0x00000001; - executeTime_ = input.readInt64(); - break; + + private static Builder create() { + return new Builder(); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - transactionId_ = bs; - break; + + public Builder clear() { + super.clear(); + tableId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.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); + } else { + rowDatasBuilder_.clear(); + } + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + } else { + propsBuilder_.clear(); + } + ddlSchemaName_ = ""; + bitField0_ = (bitField0_ & ~0x00000040); + return this; } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); - break; + + public Builder clone() { + return create().mergeFrom(buildPartial()); } - case 32: { - bitField0_ |= 0x00000004; - threadId_ = input.readInt64(); - break; + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; } - } + + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.RowChange.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange build() { + com.alibaba.otter.canal.protocol.CanalEntry.RowChange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.RowChange buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.RowChange result = new com.alibaba.otter.canal.protocol.CanalEntry.RowChange(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + 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) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + rowDatas_ = java.util.Collections.unmodifiableList(rowDatas_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.rowDatas_ = rowDatas_; + } else { + result.rowDatas_ = rowDatasBuilder_.build(); + } + if (propsBuilder_ == null) { + if (((bitField0_ & 0x00000020) == 0x00000020)) { + props_ = java.util.Collections.unmodifiableList(props_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.props_ = props_; + } else { + result.props_ = propsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000010; + } + result.ddlSchemaName_ = ddlSchemaName_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + 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); + } 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.hasTableId()) { + setTableId(other.getTableId()); + } + if (other.hasEventType()) { + setEventType(other.getEventType()); + } + if (other.hasIsDdl()) { + setIsDdl(other.getIsDdl()); + } + if (other.hasSql()) { + bitField0_ |= 0x00000008; + sql_ = other.sql_; + onChanged(); + } + if (rowDatasBuilder_ == null) { + if (!other.rowDatas_.isEmpty()) { + if (rowDatas_.isEmpty()) { + rowDatas_ = other.rowDatas_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureRowDatasIsMutable(); + rowDatas_.addAll(other.rowDatas_); + } + onChanged(); + } + } else { + if (!other.rowDatas_.isEmpty()) { + if (rowDatasBuilder_.isEmpty()) { + rowDatasBuilder_.dispose(); + rowDatasBuilder_ = null; + rowDatas_ = other.rowDatas_; + bitField0_ = (bitField0_ & ~0x00000010); + rowDatasBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRowDatasFieldBuilder() : null; + } else { + rowDatasBuilder_.addAllMessages(other.rowDatas_); + } + } + } + if (propsBuilder_ == null) { + if (!other.props_.isEmpty()) { + if (props_.isEmpty()) { + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensurePropsIsMutable(); + props_.addAll(other.props_); + } + onChanged(); + } + } else { + if (!other.props_.isEmpty()) { + if (propsBuilder_.isEmpty()) { + propsBuilder_.dispose(); + propsBuilder_ = null; + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000020); + propsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; + } else { + propsBuilder_.addAllMessages(other.props_); + } + } + } + if (other.hasDdlSchemaName()) { + bitField0_ |= 0x00000040; + ddlSchemaName_ = other.ddlSchemaName_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalEntry.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; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long tableId_; + + /** + * optional int64 tableId = 1; + * + *
      +             * *tableId,由数据库产生*
      +             * 
      + */ + public boolean hasTableId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int64 tableId = 1; + * + *
      +             * *tableId,由数据库产生*
      +             * 
      + */ + public long getTableId() { + return tableId_; + } + + /** + * optional int64 tableId = 1; + * + *
      +             * *tableId,由数据库产生*
      +             * 
      + */ + public Builder setTableId(long value) { + bitField0_ |= 0x00000001; + tableId_ = value; + onChanged(); + return this; + } + + /** + * optional int64 tableId = 1; + * + *
      +             * *tableId,由数据库产生*
      +             * 
      + */ + public Builder clearTableId() { + bitField0_ = (bitField0_ & ~0x00000001); + tableId_ = 0L; + onChanged(); + return this; + } + + private com.alibaba.otter.canal.protocol.CanalEntry.EventType eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
      +             * *数据变更类型*
      +             * 
      + */ + public boolean hasEventType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
      +             * *数据变更类型*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.EventType getEventType() { + return eventType_; + } + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
      +             * *数据变更类型*
      +             * 
      + */ + public Builder setEventType(com.alibaba.otter.canal.protocol.CanalEntry.EventType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + eventType_ = value; + onChanged(); + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.EventType eventType = 2 [default = UPDATE]; + * + *
      +             * *数据变更类型*
      +             * 
      + */ + public Builder clearEventType() { + bitField0_ = (bitField0_ & ~0x00000002); + eventType_ = com.alibaba.otter.canal.protocol.CanalEntry.EventType.UPDATE; + onChanged(); + return this; + } + + private boolean isDdl_; + + /** + * optional bool isDdl = 10 [default = false]; + * + *
      +             * * 标识是否是ddl语句  *
      +             * 
      + */ + public boolean hasIsDdl() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional bool isDdl = 10 [default = false]; + * + *
      +             * * 标识是否是ddl语句  *
      +             * 
      + */ + public boolean getIsDdl() { + return isDdl_; + } + + /** + * optional bool isDdl = 10 [default = false]; + * + *
      +             * * 标识是否是ddl语句  *
      +             * 
      + */ + public Builder setIsDdl(boolean value) { + bitField0_ |= 0x00000004; + isDdl_ = value; + onChanged(); + return this; + } + + /** + * optional bool isDdl = 10 [default = false]; + * + *
      +             * * 标识是否是ddl语句  *
      +             * 
      + */ + public Builder clearIsDdl() { + bitField0_ = (bitField0_ & ~0x00000004); + isDdl_ = false; + onChanged(); + return this; + } + + private java.lang.Object sql_ = ""; + + /** + * optional string sql = 11; + * + *
      +             * * ddl/query的sql语句  *
      +             * 
      + */ + public boolean hasSql() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional string sql = 11; + * + *
      +             * * ddl/query的sql语句  *
      +             * 
      + */ + public java.lang.String getSql() { + java.lang.Object ref = sql_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + sql_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string sql = 11; + * + *
      +             * * ddl/query的sql语句  *
      +             * 
      + */ + public com.google.protobuf.ByteString getSqlBytes() { + java.lang.Object ref = sql_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sql_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string sql = 11; + * + *
      +             * * ddl/query的sql语句  *
      +             * 
      + */ + public Builder setSql(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + sql_ = value; + onChanged(); + return this; + } + + /** + * optional string sql = 11; + * + *
      +             * * ddl/query的sql语句  *
      +             * 
      + */ + public Builder clearSql() { + bitField0_ = (bitField0_ & ~0x00000008); + sql_ = getDefaultInstance().getSql(); + onChanged(); + return this; + } + + /** + * optional string sql = 11; + * + *
      +             * * ddl/query的sql语句  *
      +             * 
      + */ + public Builder setSqlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + sql_ = value; + onChanged(); + return this; + } + + private java.util.List rowDatas_ = java.util.Collections.emptyList(); + + private void ensureRowDatasIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + rowDatas_ = new java.util.ArrayList(rowDatas_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder rowDatasBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public java.util.List getRowDatasList() { + if (rowDatasBuilder_ == null) { + return java.util.Collections.unmodifiableList(rowDatas_); + } else { + return rowDatasBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public int getRowDatasCount() { + if (rowDatasBuilder_ == null) { + return rowDatas_.size(); + } else { + return rowDatasBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.RowData getRowDatas(int index) { + if (rowDatasBuilder_ == null) { + return rowDatas_.get(index); + } else { + return rowDatasBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder setRowDatas(int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { + if (rowDatasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowDatasIsMutable(); + rowDatas_.set(index, value); + onChanged(); + } else { + rowDatasBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder setRowDatas(int index, + com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { + if (rowDatasBuilder_ == null) { + ensureRowDatasIsMutable(); + rowDatas_.set(index, builderForValue.build()); + onChanged(); + } else { + rowDatasBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder addRowDatas(com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { + if (rowDatasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowDatasIsMutable(); + rowDatas_.add(value); + onChanged(); + } else { + rowDatasBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder addRowDatas(int index, com.alibaba.otter.canal.protocol.CanalEntry.RowData value) { + if (rowDatasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowDatasIsMutable(); + rowDatas_.add(index, value); + onChanged(); + } else { + rowDatasBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder addRowDatas(com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { + if (rowDatasBuilder_ == null) { + ensureRowDatasIsMutable(); + rowDatas_.add(builderForValue.build()); + onChanged(); + } else { + rowDatasBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder addRowDatas(int index, + com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder builderForValue) { + if (rowDatasBuilder_ == null) { + ensureRowDatasIsMutable(); + rowDatas_.add(index, builderForValue.build()); + onChanged(); + } else { + rowDatasBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder addAllRowDatas(java.lang.Iterable values) { + if (rowDatasBuilder_ == null) { + ensureRowDatasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rowDatas_); + onChanged(); + } else { + rowDatasBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder clearRowDatas() { + if (rowDatasBuilder_ == null) { + rowDatas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + rowDatasBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public Builder removeRowDatas(int index) { + if (rowDatasBuilder_ == null) { + ensureRowDatasIsMutable(); + rowDatas_.remove(index); + onChanged(); + } else { + rowDatasBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder getRowDatasBuilder(int index) { + return getRowDatasFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.RowDataOrBuilder getRowDatasOrBuilder(int index) { + if (rowDatasBuilder_ == null) { + return rowDatas_.get(index); + } else { + return rowDatasBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public java.util.List getRowDatasOrBuilderList() { + if (rowDatasBuilder_ != null) { + return rowDatasBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rowDatas_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder addRowDatasBuilder() { + return getRowDatasFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.RowData.Builder addRowDatasBuilder(int index) { + return getRowDatasFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.RowData.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; + * + *
      +             * * 一次数据库变更可能存在多行  *
      +             * 
      + */ + public java.util.List getRowDatasBuilderList() { + return getRowDatasFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getRowDatasFieldBuilder() { + if (rowDatasBuilder_ == null) { + rowDatasBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(rowDatas_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + rowDatas_ = null; + } + return rowDatasBuilder_; + } + + private java.util.List props_ = java.util.Collections.emptyList(); + + private void ensurePropsIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + props_ = new java.util.ArrayList(props_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder propsBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsList() { + if (propsBuilder_ == null) { + return java.util.Collections.unmodifiableList(props_); + } else { + return propsBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public int getPropsCount() { + if (propsBuilder_ == null) { + return props_.size(); + } else { + return propsBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.set(index, value); + onChanged(); + } else { + propsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.set(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(value); + onChanged(); + } else { + propsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(index, value); + onChanged(); + } else { + propsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addAllProps(java.lang.Iterable values) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, props_); + onChanged(); + } else { + propsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder clearProps() { + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + propsBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder removeProps(int index) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.remove(index); + onChanged(); + } else { + propsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder(int index) { + return getPropsFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsOrBuilderList() { + if (propsBuilder_ != null) { + return propsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(props_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + return getPropsFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder(int index) { + return getPropsFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 13; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsBuilderList() { + return getPropsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getPropsFieldBuilder() { + if (propsBuilder_ == null) { + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(props_, + ((bitField0_ & 0x00000020) == 0x00000020), + getParentForChildren(), + isClean()); + props_ = null; + } + return propsBuilder_; + } + + private java.lang.Object ddlSchemaName_ = ""; + + /** + * optional string ddlSchemaName = 14; + * + *
      +             * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +             * 
      + */ + public boolean hasDdlSchemaName() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + + /** + * optional string ddlSchemaName = 14; + * + *
      +             * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +             * 
      + */ + public java.lang.String getDdlSchemaName() { + java.lang.Object ref = ddlSchemaName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + ddlSchemaName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string ddlSchemaName = 14; + * + *
      +             * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +             * 
      + */ + public com.google.protobuf.ByteString getDdlSchemaNameBytes() { + java.lang.Object ref = ddlSchemaName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ddlSchemaName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string ddlSchemaName = 14; + * + *
      +             * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +             * 
      + */ + public Builder setDdlSchemaName(java.lang.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  *
      +             * 
      + */ + public Builder clearDdlSchemaName() { + bitField0_ = (bitField0_ & ~0x00000040); + ddlSchemaName_ = getDefaultInstance().getDdlSchemaName(); + onChanged(); + return this; + } + + /** + * optional string ddlSchemaName = 14; + * + *
      +             * * ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName  *
      +             * 
      + */ + public Builder setDdlSchemaNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + ddlSchemaName_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.RowChange) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = java.util.Collections.unmodifiableList(props_); + + static { + defaultInstance = new RowChange(true); + defaultInstance.initFields(); } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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; + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.RowChange) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); + public interface TransactionBeginOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.TransactionBegin) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 executeTime = 1; + * + *
      +         * *已废弃,请使用header里的executeTime*
      +         * 
      + */ + boolean hasExecuteTime(); + + /** + * optional int64 executeTime = 1; + * + *
      +         * *已废弃,请使用header里的executeTime*
      +         * 
      + */ + long getExecuteTime(); + + /** + * optional string transactionId = 2; + * + *
      +         * *已废弃,Begin里不提供事务id*
      +         * 
      + */ + boolean hasTransactionId(); + + /** + * optional string transactionId = 2; + * + *
      +         * *已废弃,Begin里不提供事务id*
      +         * 
      + */ + java.lang.String getTransactionId(); + + /** + * optional string transactionId = 2; + * + *
      +         * *已废弃,Begin里不提供事务id*
      +         * 
      + */ + com.google.protobuf.ByteString getTransactionIdBytes(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + int getPropsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index); + + /** + * optional int64 threadId = 4; + * + *
      +         * *执行的thread Id*
      +         * 
      + */ + boolean hasThreadId(); + + /** + * optional int64 threadId = 4; + * + *
      +         * *执行的thread Id*
      +         * 
      + */ + long getThreadId(); } - 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); - } - }; - - @java.lang.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; - * - *
      -     **已废弃,请使用header里的executeTime*
      -     * 
      - */ - public long getExecuteTime() { - return executeTime_; - } - - public static final int TRANSACTIONID_FIELD_NUMBER = 2; - private java.lang.Object transactionId_; - /** - * optional string transactionId = 2; - * - *
      -     **已废弃,Begin里不提供事务id*
      -     * 
      - */ - public boolean hasTransactionId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string transactionId = 2; - * - *
      -     **已废弃,Begin里不提供事务id*
      -     * 
      - */ - public java.lang.String getTransactionId() { - java.lang.Object ref = transactionId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - transactionId_ = s; - } - return s; - } - } - /** - * optional string transactionId = 2; - * - *
      -     **已废弃,Begin里不提供事务id*
      -     * 
      - */ - public com.google.protobuf.ByteString - getTransactionIdBytes() { - java.lang.Object ref = transactionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - transactionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROPS_FIELD_NUMBER = 3; - private java.util.List props_; - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List getPropsList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List - getPropsOrBuilderList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public int getPropsCount() { - return props_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - return props_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - return props_.get(index); - } - - 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; - * - *
      -     **执行的thread Id*
      -     * 
      - */ - public long getThreadId() { - return threadId_; - } - - private void initFields() { - executeTime_ = 0L; - transactionId_ = ""; - props_ = java.util.Collections.emptyList(); - threadId_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, executeTime_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getTransactionIdBytes()); - } - for (int i = 0; i < props_.size(); i++) { - output.writeMessage(3, props_.get(i)); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt64(4, threadId_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, executeTime_); - } - 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 (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, threadId_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.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( - 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) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionBegin} * *
      -     **开始事务的一些信息*
      +     * *开始事务的一些信息*
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class TransactionBegin extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.TransactionBegin) + TransactionBeginOrBuilder { + + // Use TransactionBegin.newBuilder() to construct. + private TransactionBegin(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private TransactionBegin(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final TransactionBegin defaultInstance; + + public static TransactionBegin getDefaultInstance() { + return defaultInstance; + } + + public TransactionBegin getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TransactionBegin(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + executeTime_ = input.readInt64(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + transactionId_ = bs; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + props_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, + extensionRegistry)); + break; + } + case 32: { + bitField0_ |= 0x00000004; + threadId_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + props_ = java.util.Collections.unmodifiableList(props_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + 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; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } + + 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); + } + }; + + @java.lang.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; + * + *
      +         * *已废弃,请使用header里的executeTime*
      +         * 
      + */ + public long getExecuteTime() { + return executeTime_; + } + + public static final int TRANSACTIONID_FIELD_NUMBER = 2; + private java.lang.Object transactionId_; + + /** + * optional string transactionId = 2; + * + *
      +         * *已废弃,Begin里不提供事务id*
      +         * 
      + */ + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string transactionId = 2; + * + *
      +         * *已废弃,Begin里不提供事务id*
      +         * 
      + */ + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } + return s; + } + } + + /** + * optional string transactionId = 2; + * + *
      +         * *已废弃,Begin里不提供事务id*
      +         * 
      + */ + public com.google.protobuf.ByteString getTransactionIdBytes() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROPS_FIELD_NUMBER = 3; + private java.util.List props_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsOrBuilderList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public int getPropsCount() { + return props_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + return props_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + return props_.get(index); + } + + 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; + * + *
      +         * *执行的thread Id*
      +         * 
      + */ + public long getThreadId() { + return threadId_; + } + + private void initFields() { + executeTime_ = 0L; + transactionId_ = ""; + props_ = java.util.Collections.emptyList(); + threadId_ = 0L; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, executeTime_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getTransactionIdBytes()); + } + for (int i = 0; i < props_.size(); i++) { + output.writeMessage(3, props_.get(i)); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(4, threadId_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, executeTime_); + } + 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 (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, threadId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.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(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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type + * {@code com.alibaba.otter.canal.protocol.TransactionBegin} + * + *
      +         * *开始事务的一些信息*
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.TransactionBegin) com.alibaba.otter.canal.protocol.CanalEntry.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; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getPropsFieldBuilder(); - } - } - 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); - } else { - propsBuilder_.clear(); - } - threadId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - 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; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin build() { - com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin buildPartial() { - com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin result = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.executeTime_ = executeTime_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.transactionId_ = transactionId_; - if (propsBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = java.util.Collections.unmodifiableList(props_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.props_ = props_; - } else { - result.props_ = propsBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000004; - } - result.threadId_ = threadId_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - 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); - } 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.hasExecuteTime()) { - setExecuteTime(other.getExecuteTime()); - } - if (other.hasTransactionId()) { - bitField0_ |= 0x00000002; - transactionId_ = other.transactionId_; - onChanged(); - } - if (propsBuilder_ == null) { - if (!other.props_.isEmpty()) { - if (props_.isEmpty()) { - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensurePropsIsMutable(); - props_.addAll(other.props_); + 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; } - onChanged(); - } - } else { - if (!other.props_.isEmpty()) { - if (propsBuilder_.isEmpty()) { - propsBuilder_.dispose(); - propsBuilder_ = null; - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000004); - propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPropsFieldBuilder() : null; - } else { - propsBuilder_.addAllMessages(other.props_); + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); } - } - } - if (other.hasThreadId()) { - setThreadId(other.getThreadId()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalEntry.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; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long executeTime_ ; - /** - * optional int64 executeTime = 1; - * - *
      -       **已废弃,请使用header里的executeTime*
      -       * 
      - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 executeTime = 1; - * - *
      -       **已废弃,请使用header里的executeTime*
      -       * 
      - */ - public long getExecuteTime() { - return executeTime_; - } - /** - * optional int64 executeTime = 1; - * - *
      -       **已废弃,请使用header里的executeTime*
      -       * 
      - */ - public Builder setExecuteTime(long value) { - bitField0_ |= 0x00000001; - executeTime_ = value; - onChanged(); - return this; - } - /** - * optional int64 executeTime = 1; - * - *
      -       **已废弃,请使用header里的executeTime*
      -       * 
      - */ - public Builder clearExecuteTime() { - bitField0_ = (bitField0_ & ~0x00000001); - executeTime_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object transactionId_ = ""; - /** - * optional string transactionId = 2; - * - *
      -       **已废弃,Begin里不提供事务id*
      -       * 
      - */ - public boolean hasTransactionId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string transactionId = 2; - * - *
      -       **已废弃,Begin里不提供事务id*
      -       * 
      - */ - public java.lang.String getTransactionId() { - java.lang.Object ref = transactionId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - transactionId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string transactionId = 2; - * - *
      -       **已废弃,Begin里不提供事务id*
      -       * 
      - */ - public com.google.protobuf.ByteString - getTransactionIdBytes() { - java.lang.Object ref = transactionId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - transactionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string transactionId = 2; - * - *
      -       **已废弃,Begin里不提供事务id*
      -       * 
      - */ - public Builder setTransactionId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - transactionId_ = value; - onChanged(); - return this; - } - /** - * optional string transactionId = 2; - * - *
      -       **已废弃,Begin里不提供事务id*
      -       * 
      - */ - public Builder clearTransactionId() { - bitField0_ = (bitField0_ & ~0x00000002); - transactionId_ = getDefaultInstance().getTransactionId(); - onChanged(); - return this; - } - /** - * optional string transactionId = 2; - * - *
      -       **已废弃,Begin里不提供事务id*
      -       * 
      - */ - public Builder setTransactionIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - transactionId_ = value; - onChanged(); - return this; - } - - private java.util.List props_ = - java.util.Collections.emptyList(); - private void ensurePropsIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(props_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List getPropsList() { - if (propsBuilder_ == null) { - return java.util.Collections.unmodifiableList(props_); - } else { - return propsBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public int getPropsCount() { - if (propsBuilder_ == null) { - return props_.size(); - } else { - return propsBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - if (propsBuilder_ == null) { - return props_.get(index); - } else { - return propsBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.set(index, value); - onChanged(); - } else { - propsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.set(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(value); - onChanged(); - } else { - propsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(index, value); - onChanged(); - } else { - propsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addAllProps( - java.lang.Iterable values) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, props_); - onChanged(); - } else { - propsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder clearProps() { - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - propsBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder removeProps(int index) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.remove(index); - onChanged(); - } else { - propsBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( - int index) { - return getPropsFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - if (propsBuilder_ == null) { - return props_.get(index); } else { - return propsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsOrBuilderList() { - if (propsBuilder_ != null) { - return propsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(props_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { - return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( - int index) { - return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsBuilderList() { - return getPropsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> - getPropsFieldBuilder() { - if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( - props_, - ((bitField0_ & 0x00000004) == 0x00000004), - getParentForChildren(), - isClean()); - props_ = null; - } - return propsBuilder_; - } - - private long threadId_ ; - /** - * optional int64 threadId = 4; - * - *
      -       **执行的thread Id*
      -       * 
      - */ - public boolean hasThreadId() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int64 threadId = 4; - * - *
      -       **执行的thread Id*
      -       * 
      - */ - public long getThreadId() { - return threadId_; - } - /** - * optional int64 threadId = 4; - * - *
      -       **执行的thread Id*
      -       * 
      - */ - public Builder setThreadId(long value) { - bitField0_ |= 0x00000008; - threadId_ = value; - onChanged(); - return this; - } - /** - * optional int64 threadId = 4; - * - *
      -       **执行的thread Id*
      -       * 
      - */ - public Builder clearThreadId() { - bitField0_ = (bitField0_ & ~0x00000008); - threadId_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.TransactionBegin) - } - - static { - defaultInstance = new TransactionBegin(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionBegin) - } - - public interface TransactionEndOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.TransactionEnd) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 executeTime = 1; - * - *
      -     **已废弃,请使用header里的executeTime*
      -     * 
      - */ - boolean hasExecuteTime(); - /** - * optional int64 executeTime = 1; - * - *
      -     **已废弃,请使用header里的executeTime*
      -     * 
      - */ - long getExecuteTime(); - - /** - * optional string transactionId = 2; - * - *
      -     **事务号*
      -     * 
      - */ - boolean hasTransactionId(); - /** - * optional string transactionId = 2; - * - *
      -     **事务号*
      -     * 
      - */ - java.lang.String getTransactionId(); - /** - * optional string transactionId = 2; - * - *
      -     **事务号*
      -     * 
      - */ - com.google.protobuf.ByteString - getTransactionIdBytes(); - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - int getPropsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - java.util.List - getPropsOrBuilderList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionEnd} - * - *
      -   **结束事务的一些信息*
      -   * 
      - */ - public static final class TransactionEnd extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.TransactionEnd) - TransactionEndOrBuilder { - // Use TransactionEnd.newBuilder() to construct. - private TransactionEnd(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private TransactionEnd(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final TransactionEnd defaultInstance; - public static TransactionEnd getDefaultInstance() { - return defaultInstance; - } - - public TransactionEnd getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TransactionEnd( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + // Construct using + // com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 8: { - bitField0_ |= 0x00000001; - executeTime_ = input.readInt64(); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - transactionId_ = bs; - break; + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getPropsFieldBuilder(); + } } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, extensionRegistry)); - break; + + 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); + } else { + propsBuilder_.clear(); + } + threadId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + 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; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin build() { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin result = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionBegin(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.executeTime_ = executeTime_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.transactionId_ = transactionId_; + if (propsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + props_ = java.util.Collections.unmodifiableList(props_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.props_ = props_; + } else { + result.props_ = propsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.threadId_ = threadId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + 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); + } 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.hasExecuteTime()) { + setExecuteTime(other.getExecuteTime()); + } + if (other.hasTransactionId()) { + bitField0_ |= 0x00000002; + transactionId_ = other.transactionId_; + onChanged(); + } + if (propsBuilder_ == null) { + if (!other.props_.isEmpty()) { + if (props_.isEmpty()) { + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePropsIsMutable(); + props_.addAll(other.props_); + } + onChanged(); + } + } else { + if (!other.props_.isEmpty()) { + if (propsBuilder_.isEmpty()) { + propsBuilder_.dispose(); + propsBuilder_ = null; + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000004); + propsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; + } else { + propsBuilder_.addAllMessages(other.props_); + } + } + } + if (other.hasThreadId()) { + setThreadId(other.getThreadId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalEntry.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; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long executeTime_; + + /** + * optional int64 executeTime = 1; + * + *
      +             * *已废弃,请使用header里的executeTime*
      +             * 
      + */ + public boolean hasExecuteTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int64 executeTime = 1; + * + *
      +             * *已废弃,请使用header里的executeTime*
      +             * 
      + */ + public long getExecuteTime() { + return executeTime_; + } + + /** + * optional int64 executeTime = 1; + * + *
      +             * *已废弃,请使用header里的executeTime*
      +             * 
      + */ + public Builder setExecuteTime(long value) { + bitField0_ |= 0x00000001; + executeTime_ = value; + onChanged(); + return this; + } + + /** + * optional int64 executeTime = 1; + * + *
      +             * *已废弃,请使用header里的executeTime*
      +             * 
      + */ + public Builder clearExecuteTime() { + bitField0_ = (bitField0_ & ~0x00000001); + executeTime_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object transactionId_ = ""; + + /** + * optional string transactionId = 2; + * + *
      +             * *已废弃,Begin里不提供事务id*
      +             * 
      + */ + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string transactionId = 2; + * + *
      +             * *已废弃,Begin里不提供事务id*
      +             * 
      + */ + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string transactionId = 2; + * + *
      +             * *已废弃,Begin里不提供事务id*
      +             * 
      + */ + public com.google.protobuf.ByteString getTransactionIdBytes() { + java.lang.Object ref = transactionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string transactionId = 2; + * + *
      +             * *已废弃,Begin里不提供事务id*
      +             * 
      + */ + public Builder setTransactionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + transactionId_ = value; + onChanged(); + return this; + } + + /** + * optional string transactionId = 2; + * + *
      +             * *已废弃,Begin里不提供事务id*
      +             * 
      + */ + public Builder clearTransactionId() { + bitField0_ = (bitField0_ & ~0x00000002); + transactionId_ = getDefaultInstance().getTransactionId(); + onChanged(); + return this; + } + + /** + * optional string transactionId = 2; + * + *
      +             * *已废弃,Begin里不提供事务id*
      +             * 
      + */ + public Builder setTransactionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + transactionId_ = value; + onChanged(); + return this; + } + + private java.util.List props_ = java.util.Collections.emptyList(); + + private void ensurePropsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + props_ = new java.util.ArrayList(props_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder propsBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsList() { + if (propsBuilder_ == null) { + return java.util.Collections.unmodifiableList(props_); + } else { + return propsBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public int getPropsCount() { + if (propsBuilder_ == null) { + return props_.size(); + } else { + return propsBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.set(index, value); + onChanged(); + } else { + propsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.set(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(value); + onChanged(); + } else { + propsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(index, value); + onChanged(); + } else { + propsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addAllProps(java.lang.Iterable values) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, props_); + onChanged(); + } else { + propsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder clearProps() { + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + propsBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder removeProps(int index) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.remove(index); + onChanged(); + } else { + propsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder(int index) { + return getPropsFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsOrBuilderList() { + if (propsBuilder_ != null) { + return propsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(props_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + return getPropsFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder(int index) { + return getPropsFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsBuilderList() { + return getPropsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getPropsFieldBuilder() { + if (propsBuilder_ == null) { + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(props_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + props_ = null; + } + return propsBuilder_; + } + + private long threadId_; + + /** + * optional int64 threadId = 4; + * + *
      +             * *执行的thread Id*
      +             * 
      + */ + public boolean hasThreadId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional int64 threadId = 4; + * + *
      +             * *执行的thread Id*
      +             * 
      + */ + public long getThreadId() { + return threadId_; + } + + /** + * optional int64 threadId = 4; + * + *
      +             * *执行的thread Id*
      +             * 
      + */ + public Builder setThreadId(long value) { + bitField0_ |= 0x00000008; + threadId_ = value; + onChanged(); + return this; + } + + /** + * optional int64 threadId = 4; + * + *
      +             * *执行的thread Id*
      +             * 
      + */ + public Builder clearThreadId() { + bitField0_ = (bitField0_ & ~0x00000008); + threadId_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.TransactionBegin) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - props_ = java.util.Collections.unmodifiableList(props_); + + static { + defaultInstance = new TransactionBegin(true); + defaultInstance.initFields(); } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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; + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionBegin) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); + public interface TransactionEndOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.TransactionEnd) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 executeTime = 1; + * + *
      +         * *已废弃,请使用header里的executeTime*
      +         * 
      + */ + boolean hasExecuteTime(); + + /** + * optional int64 executeTime = 1; + * + *
      +         * *已废弃,请使用header里的executeTime*
      +         * 
      + */ + long getExecuteTime(); + + /** + * optional string transactionId = 2; + * + *
      +         * *事务号*
      +         * 
      + */ + boolean hasTransactionId(); + + /** + * optional string transactionId = 2; + * + *
      +         * *事务号*
      +         * 
      + */ + java.lang.String getTransactionId(); + + /** + * optional string transactionId = 2; + * + *
      +         * *事务号*
      +         * 
      + */ + com.google.protobuf.ByteString getTransactionIdBytes(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + int getPropsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + java.util.List getPropsOrBuilderList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index); } - 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); - } - }; - - @java.lang.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; - * - *
      -     **已废弃,请使用header里的executeTime*
      -     * 
      - */ - public long getExecuteTime() { - return executeTime_; - } - - public static final int TRANSACTIONID_FIELD_NUMBER = 2; - private java.lang.Object transactionId_; - /** - * optional string transactionId = 2; - * - *
      -     **事务号*
      -     * 
      - */ - public boolean hasTransactionId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string transactionId = 2; - * - *
      -     **事务号*
      -     * 
      - */ - public java.lang.String getTransactionId() { - java.lang.Object ref = transactionId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - transactionId_ = s; - } - return s; - } - } - /** - * optional 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 = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - transactionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROPS_FIELD_NUMBER = 3; - private java.util.List props_; - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List getPropsList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public java.util.List - getPropsOrBuilderList() { - return props_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public int getPropsCount() { - return props_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - return props_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -     **预留扩展*
      -     * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - return props_.get(index); - } - - private void initFields() { - executeTime_ = 0L; - transactionId_ = ""; - props_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, executeTime_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getTransactionIdBytes()); - } - for (int i = 0; i < props_.size(); i++) { - output.writeMessage(3, props_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, executeTime_); - } - 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 += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.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( - 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) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionEnd} * *
      -     **结束事务的一些信息*
      +     * *结束事务的一些信息*
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class TransactionEnd extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.TransactionEnd) + TransactionEndOrBuilder { + + // Use TransactionEnd.newBuilder() to construct. + private TransactionEnd(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private TransactionEnd(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final TransactionEnd defaultInstance; + + public static TransactionEnd getDefaultInstance() { + return defaultInstance; + } + + public TransactionEnd getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TransactionEnd(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + executeTime_ = input.readInt64(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + transactionId_ = bs; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + props_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + props_.add(input.readMessage(com.alibaba.otter.canal.protocol.CanalEntry.Pair.PARSER, + extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + props_ = java.util.Collections.unmodifiableList(props_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + 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; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } + + 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); + } + }; + + @java.lang.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; + * + *
      +         * *已废弃,请使用header里的executeTime*
      +         * 
      + */ + public long getExecuteTime() { + return executeTime_; + } + + public static final int TRANSACTIONID_FIELD_NUMBER = 2; + private java.lang.Object transactionId_; + + /** + * optional string transactionId = 2; + * + *
      +         * *事务号*
      +         * 
      + */ + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string transactionId = 2; + * + *
      +         * *事务号*
      +         * 
      + */ + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } + return s; + } + } + + /** + * optional 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 = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROPS_FIELD_NUMBER = 3; + private java.util.List props_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public java.util.List getPropsOrBuilderList() { + return props_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public int getPropsCount() { + return props_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + return props_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +         * *预留扩展*
      +         * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + return props_.get(index); + } + + private void initFields() { + executeTime_ = 0L; + transactionId_ = ""; + props_ = java.util.Collections.emptyList(); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, executeTime_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getTransactionIdBytes()); + } + for (int i = 0; i < props_.size(); i++) { + output.writeMessage(3, props_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, executeTime_); + } + 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 += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.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(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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.TransactionEnd} + * + *
      +         * *结束事务的一些信息*
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.TransactionEnd) com.alibaba.otter.canal.protocol.CanalEntry.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; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getPropsFieldBuilder(); - } - } - 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); - } else { - propsBuilder_.clear(); - } - return this; - } - - 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; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd build() { - com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd buildPartial() { - com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd result = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.executeTime_ = executeTime_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.transactionId_ = transactionId_; - if (propsBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = java.util.Collections.unmodifiableList(props_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.props_ = props_; - } else { - result.props_ = propsBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - 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); - } 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.hasExecuteTime()) { - setExecuteTime(other.getExecuteTime()); - } - if (other.hasTransactionId()) { - bitField0_ |= 0x00000002; - transactionId_ = other.transactionId_; - onChanged(); - } - if (propsBuilder_ == null) { - if (!other.props_.isEmpty()) { - if (props_.isEmpty()) { - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensurePropsIsMutable(); - props_.addAll(other.props_); + 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; } - onChanged(); - } - } else { - if (!other.props_.isEmpty()) { - if (propsBuilder_.isEmpty()) { - propsBuilder_.dispose(); - propsBuilder_ = null; - props_ = other.props_; - bitField0_ = (bitField0_ & ~0x00000004); - propsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPropsFieldBuilder() : null; - } else { - propsBuilder_.addAllMessages(other.props_); + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalEntry.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; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long executeTime_ ; - /** - * optional int64 executeTime = 1; - * - *
      -       **已废弃,请使用header里的executeTime*
      -       * 
      - */ - public boolean hasExecuteTime() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 executeTime = 1; - * - *
      -       **已废弃,请使用header里的executeTime*
      -       * 
      - */ - public long getExecuteTime() { - return executeTime_; - } - /** - * optional int64 executeTime = 1; - * - *
      -       **已废弃,请使用header里的executeTime*
      -       * 
      - */ - public Builder setExecuteTime(long value) { - bitField0_ |= 0x00000001; - executeTime_ = value; - onChanged(); - return this; - } - /** - * optional int64 executeTime = 1; - * - *
      -       **已废弃,请使用header里的executeTime*
      -       * 
      - */ - public Builder clearExecuteTime() { - bitField0_ = (bitField0_ & ~0x00000001); - executeTime_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object transactionId_ = ""; - /** - * optional string transactionId = 2; - * - *
      -       **事务号*
      -       * 
      - */ - public boolean hasTransactionId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string transactionId = 2; - * - *
      -       **事务号*
      -       * 
      - */ - public java.lang.String getTransactionId() { - java.lang.Object ref = transactionId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - transactionId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string transactionId = 2; - * - *
      -       **事务号*
      -       * 
      - */ - public com.google.protobuf.ByteString - getTransactionIdBytes() { - java.lang.Object ref = transactionId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - transactionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string transactionId = 2; - * - *
      -       **事务号*
      -       * 
      - */ - public Builder setTransactionId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - transactionId_ = value; - onChanged(); - return this; - } - /** - * optional string transactionId = 2; - * - *
      -       **事务号*
      -       * 
      - */ - public Builder clearTransactionId() { - bitField0_ = (bitField0_ & ~0x00000002); - transactionId_ = getDefaultInstance().getTransactionId(); - onChanged(); - return this; - } - /** - * optional string transactionId = 2; - * - *
      -       **事务号*
      -       * 
      - */ - public Builder setTransactionIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - transactionId_ = value; - onChanged(); - return this; - } - - private java.util.List props_ = - java.util.Collections.emptyList(); - private void ensurePropsIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - props_ = new java.util.ArrayList(props_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> propsBuilder_; - - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List getPropsList() { - if (propsBuilder_ == null) { - return java.util.Collections.unmodifiableList(props_); - } else { - return propsBuilder_.getMessageList(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public int getPropsCount() { - if (propsBuilder_ == null) { - return props_.size(); - } else { - return propsBuilder_.getCount(); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { - if (propsBuilder_ == null) { - return props_.get(index); - } else { - return propsBuilder_.getMessage(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.set(index, value); - onChanged(); - } else { - propsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder setProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.set(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(value); - onChanged(); - } else { - propsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { - if (propsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePropsIsMutable(); - props_.add(index, value); - onChanged(); - } else { - propsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addProps( - int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.add(index, builderForValue.build()); - onChanged(); - } else { - propsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder addAllProps( - java.lang.Iterable values) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, props_); - onChanged(); - } else { - propsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder clearProps() { - if (propsBuilder_ == null) { - props_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - propsBuilder_.clear(); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public Builder removeProps(int index) { - if (propsBuilder_ == null) { - ensurePropsIsMutable(); - props_.remove(index); - onChanged(); - } else { - propsBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder( - int index) { - return getPropsFieldBuilder().getBuilder(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder( - int index) { - if (propsBuilder_ == null) { - return props_.get(index); } else { - return propsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsOrBuilderList() { - if (propsBuilder_ != null) { - return propsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(props_); - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { - return getPropsFieldBuilder().addBuilder( - com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder( - int index) { - return getPropsFieldBuilder().addBuilder( - index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; - * - *
      -       **预留扩展*
      -       * 
      - */ - public java.util.List - getPropsBuilderList() { - return getPropsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder> - getPropsFieldBuilder() { - if (propsBuilder_ == null) { - propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.alibaba.otter.canal.protocol.CanalEntry.Pair, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder, com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder>( - props_, - ((bitField0_ & 0x00000004) == 0x00000004), - getParentForChildren(), - isClean()); - props_ = null; - } - return propsBuilder_; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.TransactionEnd) - } - - static { - defaultInstance = new TransactionEnd(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionEnd) - } - - public interface PairOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Pair) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string key = 1; - */ - boolean hasKey(); - /** - * optional string key = 1; - */ - java.lang.String getKey(); - /** - * optional string key = 1; - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * optional string value = 2; - */ - boolean hasValue(); - /** - * optional string value = 2; - */ - java.lang.String getValue(); - /** - * optional string value = 2; - */ - com.google.protobuf.ByteString - getValueBytes(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Pair} - * - *
      -   **预留扩展*
      -   * 
      - */ - public static final class Pair extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Pair) - PairOrBuilder { - // Use Pair.newBuilder() to construct. - private Pair(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Pair(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Pair defaultInstance; - public static Pair getDefaultInstance() { - return defaultInstance; - } - - public Pair getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Pair( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + // Construct using + // com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - key_ = bs; - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - value_ = bs; - break; + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getPropsFieldBuilder(); + } } - } + + 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); + } else { + propsBuilder_.clear(); + } + return this; + } + + 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; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd build() { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd result = new com.alibaba.otter.canal.protocol.CanalEntry.TransactionEnd(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.executeTime_ = executeTime_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.transactionId_ = transactionId_; + if (propsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + props_ = java.util.Collections.unmodifiableList(props_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.props_ = props_; + } else { + result.props_ = propsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + 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); + } 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.hasExecuteTime()) { + setExecuteTime(other.getExecuteTime()); + } + if (other.hasTransactionId()) { + bitField0_ |= 0x00000002; + transactionId_ = other.transactionId_; + onChanged(); + } + if (propsBuilder_ == null) { + if (!other.props_.isEmpty()) { + if (props_.isEmpty()) { + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePropsIsMutable(); + props_.addAll(other.props_); + } + onChanged(); + } + } else { + if (!other.props_.isEmpty()) { + if (propsBuilder_.isEmpty()) { + propsBuilder_.dispose(); + propsBuilder_ = null; + props_ = other.props_; + bitField0_ = (bitField0_ & ~0x00000004); + propsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPropsFieldBuilder() : null; + } else { + propsBuilder_.addAllMessages(other.props_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalEntry.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; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long executeTime_; + + /** + * optional int64 executeTime = 1; + * + *
      +             * *已废弃,请使用header里的executeTime*
      +             * 
      + */ + public boolean hasExecuteTime() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int64 executeTime = 1; + * + *
      +             * *已废弃,请使用header里的executeTime*
      +             * 
      + */ + public long getExecuteTime() { + return executeTime_; + } + + /** + * optional int64 executeTime = 1; + * + *
      +             * *已废弃,请使用header里的executeTime*
      +             * 
      + */ + public Builder setExecuteTime(long value) { + bitField0_ |= 0x00000001; + executeTime_ = value; + onChanged(); + return this; + } + + /** + * optional int64 executeTime = 1; + * + *
      +             * *已废弃,请使用header里的executeTime*
      +             * 
      + */ + public Builder clearExecuteTime() { + bitField0_ = (bitField0_ & ~0x00000001); + executeTime_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object transactionId_ = ""; + + /** + * optional string transactionId = 2; + * + *
      +             * *事务号*
      +             * 
      + */ + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string transactionId = 2; + * + *
      +             * *事务号*
      +             * 
      + */ + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string transactionId = 2; + * + *
      +             * *事务号*
      +             * 
      + */ + public com.google.protobuf.ByteString getTransactionIdBytes() { + java.lang.Object ref = transactionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string transactionId = 2; + * + *
      +             * *事务号*
      +             * 
      + */ + public Builder setTransactionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + transactionId_ = value; + onChanged(); + return this; + } + + /** + * optional string transactionId = 2; + * + *
      +             * *事务号*
      +             * 
      + */ + public Builder clearTransactionId() { + bitField0_ = (bitField0_ & ~0x00000002); + transactionId_ = getDefaultInstance().getTransactionId(); + onChanged(); + return this; + } + + /** + * optional string transactionId = 2; + * + *
      +             * *事务号*
      +             * 
      + */ + public Builder setTransactionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + transactionId_ = value; + onChanged(); + return this; + } + + private java.util.List props_ = java.util.Collections.emptyList(); + + private void ensurePropsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + props_ = new java.util.ArrayList(props_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder propsBuilder_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsList() { + if (propsBuilder_ == null) { + return java.util.Collections.unmodifiableList(props_); + } else { + return propsBuilder_.getMessageList(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public int getPropsCount() { + if (propsBuilder_ == null) { + return props_.size(); + } else { + return propsBuilder_.getCount(); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getProps(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessage(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.set(index, value); + onChanged(); + } else { + propsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder setProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.set(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(value); + onChanged(); + } else { + propsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair value) { + if (propsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropsIsMutable(); + props_.add(index, value); + onChanged(); + } else { + propsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addProps(int index, com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder builderForValue) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.add(index, builderForValue.build()); + onChanged(); + } else { + propsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder addAllProps(java.lang.Iterable values) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, props_); + onChanged(); + } else { + propsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder clearProps() { + if (propsBuilder_ == null) { + props_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + propsBuilder_.clear(); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public Builder removeProps(int index) { + if (propsBuilder_ == null) { + ensurePropsIsMutable(); + props_.remove(index); + onChanged(); + } else { + propsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder getPropsBuilder(int index) { + return getPropsFieldBuilder().getBuilder(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.PairOrBuilder getPropsOrBuilder(int index) { + if (propsBuilder_ == null) { + return props_.get(index); + } else { + return propsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsOrBuilderList() { + if (propsBuilder_ != null) { + return propsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(props_); + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder() { + return getPropsFieldBuilder().addBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public com.alibaba.otter.canal.protocol.CanalEntry.Pair.Builder addPropsBuilder(int index) { + return getPropsFieldBuilder().addBuilder(index, + com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance()); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Pair props = 3; + * + *
      +             * *预留扩展*
      +             * 
      + */ + public java.util.List getPropsBuilderList() { + return getPropsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder getPropsFieldBuilder() { + if (propsBuilder_ == null) { + propsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(props_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + props_ = null; + } + return propsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.TransactionEnd) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } - - 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); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int KEY_FIELD_NUMBER = 1; - private java.lang.Object key_; - /** - * optional string key = 1; - */ - public boolean hasKey() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * 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; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - key_ = s; + static { + defaultInstance = new TransactionEnd(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * 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 = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.TransactionEnd) } - public static final int VALUE_FIELD_NUMBER = 2; - private java.lang.Object value_; - /** - * optional string value = 2; - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * 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; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - value_ = s; - } - return s; - } - } - /** - * 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 = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public interface PairOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Pair) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string key = 1; + */ + boolean hasKey(); + + /** + * optional string key = 1; + */ + java.lang.String getKey(); + + /** + * optional string key = 1; + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * optional string value = 2; + */ + boolean hasValue(); + + /** + * optional string value = 2; + */ + java.lang.String getValue(); + + /** + * optional string value = 2; + */ + com.google.protobuf.ByteString getValueBytes(); } - private void initFields() { - key_ = ""; - value_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getKeyBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getValueBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getKeyBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getValueBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalEntry.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( - 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) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Pair} * *
      -     **预留扩展*
      +     * *预留扩展*
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Pair extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Pair) + PairOrBuilder { + + // Use Pair.newBuilder() to construct. + private Pair(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Pair(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Pair defaultInstance; + + public static Pair getDefaultInstance() { + return defaultInstance; + } + + public Pair getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Pair(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + key_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + value_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } + + 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); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private java.lang.Object key_; + + /** + * optional string key = 1; + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * 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; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } + } + + /** + * 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 = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private java.lang.Object value_; + + /** + * optional string value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * 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; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } + } + + /** + * 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 = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + key_ = ""; + value_ = ""; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getValueBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getValueBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.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(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) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalEntry.Pair parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalEntry.Pair prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Pair} + * + *
      +         * *预留扩展*
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Pair) com.alibaba.otter.canal.protocol.CanalEntry.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; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.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); - } + 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; + } - // Construct using com.alibaba.otter.canal.protocol.CanalEntry.Pair.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.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); + } - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + // Construct using + // com.alibaba.otter.canal.protocol.CanalEntry.Pair.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + value_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.Pair getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalEntry.Pair build() { + com.alibaba.otter.canal.protocol.CanalEntry.Pair result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalEntry.Pair buildPartial() { + com.alibaba.otter.canal.protocol.CanalEntry.Pair result = new com.alibaba.otter.canal.protocol.CanalEntry.Pair(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.value_ = value_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + 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); + } 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.hasKey()) { + bitField0_ |= 0x00000001; + key_ = other.key_; + onChanged(); + } + if (other.hasValue()) { + bitField0_ |= 0x00000002; + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalEntry.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; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + + /** + * optional string key = 1; + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string key = 1; + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string key = 1; + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + + /** + * optional string key = 1; + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + + /** + * optional string key = 1; + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + + /** + * optional string value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string value = 2; + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string value = 2; + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + value_ = value; + onChanged(); + return this; + } + + /** + * optional string value = 2; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + + /** + * optional string value = 2; + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + value_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Pair) } - } - private static Builder create() { - return new Builder(); - } - public Builder clear() { - super.clear(); - key_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - value_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Pair getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalEntry.Pair.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalEntry.Pair build() { - com.alibaba.otter.canal.protocol.CanalEntry.Pair result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + static { + defaultInstance = new Pair(true); + defaultInstance.initFields(); } - return result; - } - public com.alibaba.otter.canal.protocol.CanalEntry.Pair buildPartial() { - com.alibaba.otter.canal.protocol.CanalEntry.Pair result = new com.alibaba.otter.canal.protocol.CanalEntry.Pair(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.key_ = key_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.value_ = value_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - 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); - } 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.hasKey()) { - bitField0_ |= 0x00000001; - key_ = other.key_; - onChanged(); - } - if (other.hasValue()) { - bitField0_ |= 0x00000002; - value_ = other.value_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalEntry.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; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object key_ = ""; - /** - * optional string key = 1; - */ - public boolean hasKey() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string key = 1; - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - key_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string key = 1; - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string key = 1; - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - key_ = value; - onChanged(); - return this; - } - /** - * optional string key = 1; - */ - public Builder clearKey() { - bitField0_ = (bitField0_ & ~0x00000001); - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * optional string key = 1; - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - key_ = value; - onChanged(); - return this; - } - - private java.lang.Object value_ = ""; - /** - * optional string value = 2; - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string value = 2; - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - value_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string value = 2; - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string value = 2; - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - value_ = value; - onChanged(); - return this; - } - /** - * optional string value = 2; - */ - public Builder clearValue() { - bitField0_ = (bitField0_ & ~0x00000002); - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - * optional string value = 2; - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - value_ = value; - onChanged(); - return this; - } - - // @@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.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; + 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 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 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 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 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 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 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 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 descriptor; static { - defaultInstance = new Pair(true); - defaultInstance.initFields(); + java.lang.String[] descriptorData = { + "\n\023EntryProtocol.proto\022 com.alibaba.otter" + + ".canal.protocol\"\236\001\n\005Entry\0228\n\006header\030\001 \001(" + + "\0132(.com.alibaba.otter.canal.protocol.Hea" + + "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\"\203\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\"\326\001\n\006Column\022\r\n\005index\030\001 \001(\005\022\017\n\007sqlT" + + "ype\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.alibaba.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\rb" + + "eforeColumns\030\001 \003(\0132(.com.alibaba.otter.c" + + "anal.protocol.Column\022>\n\014afterColumns\030\002 \003" + + "(\0132(.com.alibaba.otter.canal.protocol.Co" + + "lumn\0225\n\005props\030\003 \003(\0132&.com.alibaba.otter." + + "canal.protocol.Pair\"\222\002\n\tRowChange\022\017\n\007tab" + + "leId\030\001 \001(\003\022F\n\teventType\030\002 \001(\0162+.com.alib" + + "aba.otter.canal.protocol.EventType:\006UPDA" + + "TE\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.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(\t\"\207\001\n\020TransactionBegin\022\023\n" + + "\013executeTime\030\001 \001(\003\022\025\n\rtransactionId\030\002 \001(" + + "\t\0225\n\005props\030\003 \003(\0132&.com.alibaba.otter.can" + + "al.protocol.Pair\022\020\n\010threadId\030\004 \001(\003\"s\n\016Tr" + + "ansactionEnd\022\023\n\013executeTime\030\001 \001(\003\022\025\n\rtra" + + "nsactionId\030\002 \001(\t\0225\n\005props\030\003 \003(\0132&.com.al" + + "ibaba.otter.canal.protocol.Pair\"\"\n\004Pair\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t*Q\n\tEntryType", + "\022\024\n\020TRANSACTIONBEGIN\020\001\022\013\n\007ROWDATA\020\002\022\022\n\016T" + + "RANSACTIONEND\020\003\022\r\n\tHEARTBEAT\020\004*\216\001\n\tEvent" + + "Type\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\005QU" + + "ERY\020\007\022\014\n\010TRUNCATE\020\010\022\n\n\006RENAME\020\t\022\n\n\006CINDE" + + "X\020\n\022\n\n\006DINDEX\020\013*(\n\004Type\022\n\n\006ORACLE\020\001\022\t\n\005M" + + "YSQL\020\002\022\t\n\005PGSQL\020\003B0\n com.alibaba.otter.c" + + "anal.protocolB\nCanalEntryH\001" }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + + public com.google.protobuf.ExtensionRegistry assignDescriptors(com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] {}, + assigner); + internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor, + new java.lang.String[] { "Header", "EntryType", "StoreValue", }); + internal_static_com_alibaba_otter_canal_protocol_Header_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(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", }); + internal_static_com_alibaba_otter_canal_protocol_Column_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Column_descriptor, + new java.lang.String[] { "Index", "SqlType", "Name", "IsKey", "Updated", "IsNull", "Props", "Value", + "Length", "MysqlType", }); + internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor, + new java.lang.String[] { "BeforeColumns", "AfterColumns", "Props", }); + internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor = getDescriptor().getMessageTypes() + .get(4); + internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor, + new java.lang.String[] { "TableId", "EventType", "IsDdl", "Sql", "RowDatas", "Props", "DdlSchemaName", }); + internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor = getDescriptor().getMessageTypes() + .get(5); + internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor, + new java.lang.String[] { "ExecuteTime", "TransactionId", "Props", "ThreadId", }); + internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor = getDescriptor().getMessageTypes() + .get(6); + internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor, + new java.lang.String[] { "ExecuteTime", "TransactionId", "Props", }); + internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor = getDescriptor().getMessageTypes().get(7); + internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor, + new java.lang.String[] { "Key", "Value", }); } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Pair) - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Header_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Column_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - 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 - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\023EntryProtocol.proto\022 com.alibaba.otter" + - ".canal.protocol\"\236\001\n\005Entry\0228\n\006header\030\001 \001(" + - "\0132(.com.alibaba.otter.canal.protocol.Hea" + - "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\"\203\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\"\326\001\n\006Column\022\r\n\005index\030\001 \001(\005\022\017\n\007sqlT" + - "ype\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.alibaba.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\rb" + - "eforeColumns\030\001 \003(\0132(.com.alibaba.otter.c" + - "anal.protocol.Column\022>\n\014afterColumns\030\002 \003" + - "(\0132(.com.alibaba.otter.canal.protocol.Co" + - "lumn\0225\n\005props\030\003 \003(\0132&.com.alibaba.otter." + - "canal.protocol.Pair\"\222\002\n\tRowChange\022\017\n\007tab" + - "leId\030\001 \001(\003\022F\n\teventType\030\002 \001(\0162+.com.alib" + - "aba.otter.canal.protocol.EventType:\006UPDA" + - "TE\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.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(\t\"\207\001\n\020TransactionBegin\022\023\n" + - "\013executeTime\030\001 \001(\003\022\025\n\rtransactionId\030\002 \001(" + - "\t\0225\n\005props\030\003 \003(\0132&.com.alibaba.otter.can" + - "al.protocol.Pair\022\020\n\010threadId\030\004 \001(\003\"s\n\016Tr" + - "ansactionEnd\022\023\n\013executeTime\030\001 \001(\003\022\025\n\rtra" + - "nsactionId\030\002 \001(\t\0225\n\005props\030\003 \003(\0132&.com.al" + - "ibaba.otter.canal.protocol.Pair\"\"\n\004Pair\022" + - "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t*Q\n\tEntryType", - "\022\024\n\020TRANSACTIONBEGIN\020\001\022\013\n\007ROWDATA\020\002\022\022\n\016T" + - "RANSACTIONEND\020\003\022\r\n\tHEARTBEAT\020\004*\216\001\n\tEvent" + - "Type\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\005QU" + - "ERY\020\007\022\014\n\010TRUNCATE\020\010\022\n\n\006RENAME\020\t\022\n\n\006CINDE" + - "X\020\n\022\n\n\006DINDEX\020\013*(\n\004Type\022\n\n\006ORACLE\020\001\022\t\n\005M" + - "YSQL\020\002\022\t\n\005PGSQL\020\003B0\n com.alibaba.otter.c" + - "anal.protocolB\nCanalEntryH\001" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_com_alibaba_otter_canal_protocol_Entry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Entry_descriptor, - new java.lang.String[] { "Header", "EntryType", "StoreValue", }); - internal_static_com_alibaba_otter_canal_protocol_Header_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_com_alibaba_otter_canal_protocol_Header_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - 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", }); - internal_static_com_alibaba_otter_canal_protocol_Column_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_com_alibaba_otter_canal_protocol_Column_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Column_descriptor, - new java.lang.String[] { "Index", "SqlType", "Name", "IsKey", "Updated", "IsNull", "Props", "Value", "Length", "MysqlType", }); - internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_com_alibaba_otter_canal_protocol_RowData_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_RowData_descriptor, - new java.lang.String[] { "BeforeColumns", "AfterColumns", "Props", }); - internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_com_alibaba_otter_canal_protocol_RowChange_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_RowChange_descriptor, - new java.lang.String[] { "TableId", "EventType", "IsDdl", "Sql", "RowDatas", "Props", "DdlSchemaName", }); - internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_TransactionBegin_descriptor, - new java.lang.String[] { "ExecuteTime", "TransactionId", "Props", "ThreadId", }); - internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_TransactionEnd_descriptor, - new java.lang.String[] { "ExecuteTime", "TransactionId", "Props", }); - internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_com_alibaba_otter_canal_protocol_Pair_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Pair_descriptor, - new java.lang.String[] { "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) + // @@protoc_insertion_point(outer_class_scope) } diff --git a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java index 23c21ae8..3909668a 100644 --- a/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java +++ b/protocol/src/main/java/com/alibaba/otter/canal/protocol/CanalPacket.java @@ -4,2910 +4,2461 @@ package com.alibaba.otter.canal.protocol; public final class CanalPacket { - private CanalPacket() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.Compression} - */ - public enum Compression - implements com.google.protobuf.ProtocolMessageEnum { - /** - * NONE = 1; - */ - NONE(0, 1), - /** - * ZLIB = 2; - */ - ZLIB(1, 2), - /** - * GZIP = 3; - */ - GZIP(2, 3), - /** - * LZF = 4; - */ - LZF(3, 4), - ; - /** - * NONE = 1; - */ - public static final int NONE_VALUE = 1; - /** - * ZLIB = 2; - */ - public static final int ZLIB_VALUE = 2; - /** - * GZIP = 3; - */ - public static final int GZIP_VALUE = 3; - /** - * LZF = 4; - */ - public static final int LZF_VALUE = 4; - - - public final int getNumber() { return value; } - - public static Compression valueOf(int value) { - switch (value) { - case 1: return NONE; - case 2: return ZLIB; - case 3: return GZIP; - case 4: return LZF; - default: return null; - } + private CanalPacket(){ } - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Compression findValueByNumber(int number) { - return Compression.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.getDescriptor().getEnumTypes().get(0); + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { } - private static final Compression[] VALUES = values(); + /** + * Protobuf enum {@code com.alibaba.otter.canal.protocol.Compression} + */ + public enum Compression implements com.google.protobuf.ProtocolMessageEnum { + /** + * NONE = 1; + */ + NONE(0, 1), + /** + * ZLIB = 2; + */ + ZLIB(1, 2), + /** + * GZIP = 3; + */ + GZIP(2, 3), + /** + * LZF = 4; + */ + LZF(3, 4), ; - public static Compression valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } + /** + * NONE = 1; + */ + public static final int NONE_VALUE = 1; + /** + * ZLIB = 2; + */ + public static final int ZLIB_VALUE = 2; + /** + * GZIP = 3; + */ + public static final int GZIP_VALUE = 3; + /** + * LZF = 4; + */ + public static final int LZF_VALUE = 4; - private final int index; - private final int value; - - private Compression(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.Compression) - } - - /** - * Protobuf enum {@code com.alibaba.otter.canal.protocol.PacketType} - */ - public enum PacketType - implements com.google.protobuf.ProtocolMessageEnum { - /** - * HANDSHAKE = 1; - */ - HANDSHAKE(0, 1), - /** - * CLIENTAUTHENTICATION = 2; - */ - CLIENTAUTHENTICATION(1, 2), - /** - * ACK = 3; - */ - ACK(2, 3), - /** - * SUBSCRIPTION = 4; - */ - SUBSCRIPTION(3, 4), - /** - * UNSUBSCRIPTION = 5; - */ - UNSUBSCRIPTION(4, 5), - /** - * GET = 6; - */ - GET(5, 6), - /** - * MESSAGES = 7; - */ - MESSAGES(6, 7), - /** - * CLIENTACK = 8; - */ - CLIENTACK(7, 8), - /** - * SHUTDOWN = 9; - * - *
      -     * management part
      -     * 
      - */ - SHUTDOWN(8, 9), - /** - * DUMP = 10; - * - *
      -     * integration
      -     * 
      - */ - DUMP(9, 10), - /** - * HEARTBEAT = 11; - */ - HEARTBEAT(10, 11), - /** - * CLIENTROLLBACK = 12; - */ - CLIENTROLLBACK(11, 12), - ; - - /** - * HANDSHAKE = 1; - */ - public static final int HANDSHAKE_VALUE = 1; - /** - * CLIENTAUTHENTICATION = 2; - */ - public static final int CLIENTAUTHENTICATION_VALUE = 2; - /** - * ACK = 3; - */ - public static final int ACK_VALUE = 3; - /** - * SUBSCRIPTION = 4; - */ - public static final int SUBSCRIPTION_VALUE = 4; - /** - * UNSUBSCRIPTION = 5; - */ - public static final int UNSUBSCRIPTION_VALUE = 5; - /** - * GET = 6; - */ - public static final int GET_VALUE = 6; - /** - * MESSAGES = 7; - */ - public static final int MESSAGES_VALUE = 7; - /** - * CLIENTACK = 8; - */ - public static final int CLIENTACK_VALUE = 8; - /** - * SHUTDOWN = 9; - * - *
      -     * management part
      -     * 
      - */ - public static final int SHUTDOWN_VALUE = 9; - /** - * DUMP = 10; - * - *
      -     * integration
      -     * 
      - */ - public static final int DUMP_VALUE = 10; - /** - * HEARTBEAT = 11; - */ - public static final int HEARTBEAT_VALUE = 11; - /** - * CLIENTROLLBACK = 12; - */ - public static final int CLIENTROLLBACK_VALUE = 12; - - - public final int getNumber() { return value; } - - public static PacketType valueOf(int value) { - switch (value) { - case 1: return HANDSHAKE; - case 2: return CLIENTAUTHENTICATION; - case 3: return ACK; - case 4: return SUBSCRIPTION; - case 5: return UNSUBSCRIPTION; - case 6: return GET; - case 7: return MESSAGES; - case 8: return CLIENTACK; - case 9: return SHUTDOWN; - case 10: return DUMP; - case 11: return HEARTBEAT; - case 12: return CLIENTROLLBACK; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PacketType findValueByNumber(int number) { - return PacketType.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.getDescriptor().getEnumTypes().get(1); - } - - private static final PacketType[] VALUES = values(); - - public static PacketType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private PacketType(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.PacketType) - } - - public interface PacketOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Packet) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int32 magic_number = 1 [default = 17]; - */ - boolean hasMagicNumber(); - /** - * optional int32 magic_number = 1 [default = 17]; - */ - int getMagicNumber(); - - /** - * optional int32 version = 2 [default = 1]; - */ - boolean hasVersion(); - /** - * optional int32 version = 2 [default = 1]; - */ - int getVersion(); - - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - boolean hasType(); - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType(); - - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - boolean hasCompression(); - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression(); - - /** - * optional bytes body = 5; - */ - boolean hasBody(); - /** - * optional bytes body = 5; - */ - com.google.protobuf.ByteString getBody(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Packet} - */ - public static final class Packet extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Packet) - PacketOrBuilder { - // Use Packet.newBuilder() to construct. - private Packet(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Packet(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Packet defaultInstance; - public static Packet getDefaultInstance() { - return defaultInstance; - } - - public Packet getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Packet( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - magicNumber_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - version_ = input.readInt32(); - break; - } - case 24: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalPacket.PacketType value = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - bitField0_ |= 0x00000004; - type_ = value; - } - break; - } - case 32: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(4, rawValue); - } else { - bitField0_ |= 0x00000008; - compression_ = value; - } - break; - } - case 42: { - bitField0_ |= 0x00000010; - body_ = input.readBytes(); - break; - } - } + public final int getNumber() { + return value; } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; + + public static Compression valueOf(int value) { + switch (value) { + case 1: + return NONE; + case 2: + return ZLIB; + case 3: + return GZIP; + case 4: + return LZF; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + + public Compression findValueByNumber(int number) { + return Compression.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.getDescriptor().getEnumTypes().get(0); + } + + private static final Compression[] VALUES = values(); + + public static Compression valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private Compression(int index, int value){ + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.Compression) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Packet parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Packet(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int MAGIC_NUMBER_FIELD_NUMBER = 1; - private int magicNumber_; /** - * optional int32 magic_number = 1 [default = 17]; + * Protobuf enum {@code com.alibaba.otter.canal.protocol.PacketType} */ - public boolean hasMagicNumber() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public int getMagicNumber() { - return magicNumber_; + public enum PacketType implements com.google.protobuf.ProtocolMessageEnum { + /** + * HANDSHAKE = 1; + */ + HANDSHAKE(0, 1), + /** + * CLIENTAUTHENTICATION = 2; + */ + CLIENTAUTHENTICATION(1, 2), + /** + * ACK = 3; + */ + ACK(2, 3), + /** + * SUBSCRIPTION = 4; + */ + SUBSCRIPTION(3, 4), + /** + * UNSUBSCRIPTION = 5; + */ + UNSUBSCRIPTION(4, 5), + /** + * GET = 6; + */ + GET(5, 6), + /** + * MESSAGES = 7; + */ + MESSAGES(6, 7), + /** + * CLIENTACK = 8; + */ + CLIENTACK(7, 8), + /** + * SHUTDOWN = 9; + * + *
      +         * management part
      +         * 
      + */ + SHUTDOWN(8, 9), + /** + * DUMP = 10; + * + *
      +         * integration
      +         * 
      + */ + DUMP(9, 10), + /** + * HEARTBEAT = 11; + */ + HEARTBEAT(10, 11), + /** + * CLIENTROLLBACK = 12; + */ + CLIENTROLLBACK(11, 12), ; + + /** + * HANDSHAKE = 1; + */ + public static final int HANDSHAKE_VALUE = 1; + /** + * CLIENTAUTHENTICATION = 2; + */ + public static final int CLIENTAUTHENTICATION_VALUE = 2; + /** + * ACK = 3; + */ + public static final int ACK_VALUE = 3; + /** + * SUBSCRIPTION = 4; + */ + public static final int SUBSCRIPTION_VALUE = 4; + /** + * UNSUBSCRIPTION = 5; + */ + public static final int UNSUBSCRIPTION_VALUE = 5; + /** + * GET = 6; + */ + public static final int GET_VALUE = 6; + /** + * MESSAGES = 7; + */ + public static final int MESSAGES_VALUE = 7; + /** + * CLIENTACK = 8; + */ + public static final int CLIENTACK_VALUE = 8; + /** + * SHUTDOWN = 9; + * + *
      +         * management part
      +         * 
      + */ + public static final int SHUTDOWN_VALUE = 9; + /** + * DUMP = 10; + * + *
      +         * integration
      +         * 
      + */ + public static final int DUMP_VALUE = 10; + /** + * HEARTBEAT = 11; + */ + public static final int HEARTBEAT_VALUE = 11; + /** + * CLIENTROLLBACK = 12; + */ + public static final int CLIENTROLLBACK_VALUE = 12; + + public final int getNumber() { + return value; + } + + public static PacketType valueOf(int value) { + switch (value) { + case 1: + return HANDSHAKE; + case 2: + return CLIENTAUTHENTICATION; + case 3: + return ACK; + case 4: + return SUBSCRIPTION; + case 5: + return UNSUBSCRIPTION; + case 6: + return GET; + case 7: + return MESSAGES; + case 8: + return CLIENTACK; + case 9: + return SHUTDOWN; + case 10: + return DUMP; + case 11: + return HEARTBEAT; + case 12: + return CLIENTROLLBACK; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + + public PacketType findValueByNumber(int number) { + return PacketType.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.getDescriptor().getEnumTypes().get(1); + } + + private static final PacketType[] VALUES = values(); + + public static PacketType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private PacketType(int index, int value){ + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.PacketType) } - public static final int VERSION_FIELD_NUMBER = 2; - private int version_; - /** - * optional int32 version = 2 [default = 1]; - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 version = 2 [default = 1]; - */ - public int getVersion() { - return version_; + public interface PacketOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Packet) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + boolean hasMagicNumber(); + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + int getMagicNumber(); + + /** + * optional int32 version = 2 [default = 1]; + */ + boolean hasVersion(); + + /** + * optional int32 version = 2 [default = 1]; + */ + int getVersion(); + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + boolean hasType(); + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType(); + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + boolean hasCompression(); + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression(); + + /** + * optional bytes body = 5; + */ + boolean hasBody(); + + /** + * optional bytes body = 5; + */ + com.google.protobuf.ByteString getBody(); } - public static final int TYPE_FIELD_NUMBER = 3; - private com.alibaba.otter.canal.protocol.CanalPacket.PacketType type_; - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { - return type_; - } - - public static final int COMPRESSION_FIELD_NUMBER = 4; - private com.alibaba.otter.canal.protocol.CanalPacket.Compression compression_; - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public boolean hasCompression() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { - return compression_; - } - - public static final int BODY_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString body_; - /** - * optional bytes body = 5; - */ - public boolean hasBody() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional bytes body = 5; - */ - public com.google.protobuf.ByteString getBody() { - return body_; - } - - private void initFields() { - magicNumber_ = 17; - version_ = 1; - type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; - compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; - body_ = com.google.protobuf.ByteString.EMPTY; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, magicNumber_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, version_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeEnum(3, type_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeEnum(4, compression_.getNumber()); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, body_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, magicNumber_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, version_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, type_.getNumber()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, compression_.getNumber()); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, body_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Packet prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Packet} */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Packet extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Packet) + PacketOrBuilder { + + // Use Packet.newBuilder() to construct. + private Packet(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Packet(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Packet defaultInstance; + + public static Packet getDefaultInstance() { + return defaultInstance; + } + + public Packet getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Packet(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + magicNumber_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + version_ = input.readInt32(); + break; + } + case 24: { + int rawValue = input.readEnum(); + com.alibaba.otter.canal.protocol.CanalPacket.PacketType value = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + bitField0_ |= 0x00000004; + type_ = value; + } + break; + } + case 32: { + int rawValue = input.readEnum(); + com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(4, rawValue); + } else { + bitField0_ |= 0x00000008; + compression_ = value; + } + break; + } + case 42: { + bitField0_ |= 0x00000010; + body_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, + com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public Packet parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Packet(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int MAGIC_NUMBER_FIELD_NUMBER = 1; + private int magicNumber_; + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public boolean hasMagicNumber() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public int getMagicNumber() { + return magicNumber_; + } + + public static final int VERSION_FIELD_NUMBER = 2; + private int version_; + + /** + * optional int32 version = 2 [default = 1]; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional int32 version = 2 [default = 1]; + */ + public int getVersion() { + return version_; + } + + public static final int TYPE_FIELD_NUMBER = 3; + private com.alibaba.otter.canal.protocol.CanalPacket.PacketType type_; + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { + return type_; + } + + public static final int COMPRESSION_FIELD_NUMBER = 4; + private com.alibaba.otter.canal.protocol.CanalPacket.Compression compression_; + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public boolean hasCompression() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { + return compression_; + } + + public static final int BODY_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString body_; + + /** + * optional bytes body = 5; + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional bytes body = 5; + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + + private void initFields() { + magicNumber_ = 17; + version_ = 1; + type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; + compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; + body_ = com.google.protobuf.ByteString.EMPTY; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, magicNumber_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, version_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeEnum(3, type_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeEnum(4, compression_.getNumber()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, body_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, magicNumber_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, version_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_.getNumber()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, compression_.getNumber()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, body_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Packet prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Packet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Packet) com.alibaba.otter.canal.protocol.CanalPacket.PacketOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Packet.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - magicNumber_ = 17; - bitField0_ = (bitField0_ & ~0x00000001); - version_ = 1; - bitField0_ = (bitField0_ & ~0x00000002); - type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; - bitField0_ = (bitField0_ & ~0x00000004); - compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; - bitField0_ = (bitField0_ & ~0x00000008); - body_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Packet getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Packet build() { - com.alibaba.otter.canal.protocol.CanalPacket.Packet result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Packet buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Packet result = new com.alibaba.otter.canal.protocol.CanalPacket.Packet(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.magicNumber_ = magicNumber_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.version_ = version_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.type_ = type_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.compression_ = compression_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.body_ = body_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Packet) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Packet)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Packet other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance()) return this; - if (other.hasMagicNumber()) { - setMagicNumber(other.getMagicNumber()); - } - if (other.hasVersion()) { - setVersion(other.getVersion()); - } - if (other.hasType()) { - setType(other.getType()); - } - if (other.hasCompression()) { - setCompression(other.getCompression()); - } - if (other.hasBody()) { - setBody(other.getBody()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Packet parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Packet) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int magicNumber_ = 17; - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public boolean hasMagicNumber() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public int getMagicNumber() { - return magicNumber_; - } - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public Builder setMagicNumber(int value) { - bitField0_ |= 0x00000001; - magicNumber_ = value; - onChanged(); - return this; - } - /** - * optional int32 magic_number = 1 [default = 17]; - */ - public Builder clearMagicNumber() { - bitField0_ = (bitField0_ & ~0x00000001); - magicNumber_ = 17; - onChanged(); - return this; - } - - private int version_ = 1; - /** - * optional int32 version = 2 [default = 1]; - */ - public boolean hasVersion() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int32 version = 2 [default = 1]; - */ - public int getVersion() { - return version_; - } - /** - * optional int32 version = 2 [default = 1]; - */ - public Builder setVersion(int value) { - bitField0_ |= 0x00000002; - version_ = value; - onChanged(); - return this; - } - /** - * optional int32 version = 2 [default = 1]; - */ - public Builder clearVersion() { - bitField0_ = (bitField0_ & ~0x00000002); - version_ = 1; - onChanged(); - return this; - } - - private com.alibaba.otter.canal.protocol.CanalPacket.PacketType type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public boolean hasType() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { - return type_; - } - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public Builder setType(com.alibaba.otter.canal.protocol.CanalPacket.PacketType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - type_ = value; - onChanged(); - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; - */ - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000004); - type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; - onChanged(); - return this; - } - - private com.alibaba.otter.canal.protocol.CanalPacket.Compression compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public boolean hasCompression() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { - return compression_; - } - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public Builder setCompression(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - compression_ = value; - onChanged(); - return this; - } - /** - * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; - */ - public Builder clearCompression() { - bitField0_ = (bitField0_ & ~0x00000008); - compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; - /** - * optional bytes body = 5; - */ - public boolean hasBody() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional bytes body = 5; - */ - public com.google.protobuf.ByteString getBody() { - return body_; - } - /** - * optional bytes body = 5; - */ - public Builder setBody(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - body_ = value; - onChanged(); - return this; - } - /** - * optional bytes body = 5; - */ - public Builder clearBody() { - bitField0_ = (bitField0_ & ~0x00000010); - body_ = getDefaultInstance().getBody(); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Packet) - } - - static { - defaultInstance = new Packet(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Packet) - } - - public interface HeartBeatOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.HeartBeat) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 send_timestamp = 1; - */ - boolean hasSendTimestamp(); - /** - * optional int64 send_timestamp = 1; - */ - long getSendTimestamp(); - - /** - * optional int64 start_timestamp = 2; - */ - boolean hasStartTimestamp(); - /** - * optional int64 start_timestamp = 2; - */ - long getStartTimestamp(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.HeartBeat} - */ - public static final class HeartBeat extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.HeartBeat) - HeartBeatOrBuilder { - // Use HeartBeat.newBuilder() to construct. - private HeartBeat(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private HeartBeat(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final HeartBeat defaultInstance; - public static HeartBeat getDefaultInstance() { - return defaultInstance; - } - - public HeartBeat getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private HeartBeat( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; } - case 8: { - bitField0_ |= 0x00000001; - sendTimestamp_ = input.readInt64(); - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Packet.class, + com.alibaba.otter.canal.protocol.CanalPacket.Packet.Builder.class); } - case 16: { - bitField0_ |= 0x00000002; - startTimestamp_ = input.readInt64(); - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.Packet.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + magicNumber_ = 17; + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 1; + bitField0_ = (bitField0_ & ~0x00000002); + type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; + bitField0_ = (bitField0_ & ~0x00000004); + compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; + bitField0_ = (bitField0_ & ~0x00000008); + body_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Packet getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Packet build() { + com.alibaba.otter.canal.protocol.CanalPacket.Packet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Packet buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Packet result = new com.alibaba.otter.canal.protocol.CanalPacket.Packet(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.magicNumber_ = magicNumber_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.version_ = version_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.type_ = type_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.compression_ = compression_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.body_ = body_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Packet) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Packet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Packet other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Packet.getDefaultInstance()) return this; + if (other.hasMagicNumber()) { + setMagicNumber(other.getMagicNumber()); + } + if (other.hasVersion()) { + setVersion(other.getVersion()); + } + if (other.hasType()) { + setType(other.getType()); + } + if (other.hasCompression()) { + setCompression(other.getCompression()); + } + if (other.hasBody()) { + setBody(other.getBody()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Packet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Packet) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int magicNumber_ = 17; + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public boolean hasMagicNumber() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public int getMagicNumber() { + return magicNumber_; + } + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public Builder setMagicNumber(int value) { + bitField0_ |= 0x00000001; + magicNumber_ = value; + onChanged(); + return this; + } + + /** + * optional int32 magic_number = 1 [default = 17]; + */ + public Builder clearMagicNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + magicNumber_ = 17; + onChanged(); + return this; + } + + private int version_ = 1; + + /** + * optional int32 version = 2 [default = 1]; + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional int32 version = 2 [default = 1]; + */ + public int getVersion() { + return version_; + } + + /** + * optional int32 version = 2 [default = 1]; + */ + public Builder setVersion(int value) { + bitField0_ |= 0x00000002; + version_ = value; + onChanged(); + return this; + } + + /** + * optional int32 version = 2 [default = 1]; + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + version_ = 1; + onChanged(); + return this; + } + + private com.alibaba.otter.canal.protocol.CanalPacket.PacketType type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.PacketType getType() { + return type_; + } + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public Builder setType(com.alibaba.otter.canal.protocol.CanalPacket.PacketType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + type_ = value; + onChanged(); + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.PacketType type = 3; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000004); + type_ = com.alibaba.otter.canal.protocol.CanalPacket.PacketType.HANDSHAKE; + onChanged(); + return this; + } + + private com.alibaba.otter.canal.protocol.CanalPacket.Compression compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public boolean hasCompression() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getCompression() { + return compression_; + } + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public Builder setCompression(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + compression_ = value; + onChanged(); + return this; + } + + /** + * optional .com.alibaba.otter.canal.protocol.Compression compression = 4 [default = NONE]; + */ + public Builder clearCompression() { + bitField0_ = (bitField0_ & ~0x00000008); + compression_ = com.alibaba.otter.canal.protocol.CanalPacket.Compression.NONE; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY; + + /** + * optional bytes body = 5; + */ + public boolean hasBody() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional bytes body = 5; + */ + public com.google.protobuf.ByteString getBody() { + return body_; + } + + /** + * optional bytes body = 5; + */ + public Builder setBody(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + body_ = value; + onChanged(); + return this; + } + + /** + * optional bytes body = 5; + */ + public Builder clearBody() { + bitField0_ = (bitField0_ & ~0x00000010); + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Packet) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + + static { + defaultInstance = new Packet(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Packet) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); + public interface HeartBeatOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.HeartBeat) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 send_timestamp = 1; + */ + boolean hasSendTimestamp(); + + /** + * optional int64 send_timestamp = 1; + */ + long getSendTimestamp(); + + /** + * optional int64 start_timestamp = 2; + */ + boolean hasStartTimestamp(); + + /** + * optional int64 start_timestamp = 2; + */ + long getStartTimestamp(); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public HeartBeat parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HeartBeat(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int SEND_TIMESTAMP_FIELD_NUMBER = 1; - private long sendTimestamp_; - /** - * optional int64 send_timestamp = 1; - */ - public boolean hasSendTimestamp() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 send_timestamp = 1; - */ - public long getSendTimestamp() { - return sendTimestamp_; - } - - public static final int START_TIMESTAMP_FIELD_NUMBER = 2; - private long startTimestamp_; - /** - * optional int64 start_timestamp = 2; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int64 start_timestamp = 2; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - - private void initFields() { - sendTimestamp_ = 0L; - startTimestamp_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, sendTimestamp_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt64(2, startTimestamp_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, sendTimestamp_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, startTimestamp_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.HeartBeat} */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class HeartBeat extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.HeartBeat) + HeartBeatOrBuilder { + + // Use HeartBeat.newBuilder() to construct. + private HeartBeat(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private HeartBeat(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final HeartBeat defaultInstance; + + public static HeartBeat getDefaultInstance() { + return defaultInstance; + } + + public HeartBeat getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private HeartBeat(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + sendTimestamp_ = input.readInt64(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + startTimestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public HeartBeat parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HeartBeat(input, + extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int SEND_TIMESTAMP_FIELD_NUMBER = 1; + private long sendTimestamp_; + + /** + * optional int64 send_timestamp = 1; + */ + public boolean hasSendTimestamp() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int64 send_timestamp = 1; + */ + public long getSendTimestamp() { + return sendTimestamp_; + } + + public static final int START_TIMESTAMP_FIELD_NUMBER = 2; + private long startTimestamp_; + + /** + * optional int64 start_timestamp = 2; + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional int64 start_timestamp = 2; + */ + public long getStartTimestamp() { + return startTimestamp_; + } + + private void initFields() { + sendTimestamp_ = 0L; + startTimestamp_ = 0L; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, sendTimestamp_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, startTimestamp_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, sendTimestamp_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, startTimestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.HeartBeat} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.HeartBeat) com.alibaba.otter.canal.protocol.CanalPacket.HeartBeatOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - sendTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - startTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat build() { - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = new com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.sendTimestamp_ = sendTimestamp_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.startTimestamp_ = startTimestamp_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance()) return this; - if (other.hasSendTimestamp()) { - setSendTimestamp(other.getSendTimestamp()); - } - if (other.hasStartTimestamp()) { - setStartTimestamp(other.getStartTimestamp()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long sendTimestamp_ ; - /** - * optional int64 send_timestamp = 1; - */ - public boolean hasSendTimestamp() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 send_timestamp = 1; - */ - public long getSendTimestamp() { - return sendTimestamp_; - } - /** - * optional int64 send_timestamp = 1; - */ - public Builder setSendTimestamp(long value) { - bitField0_ |= 0x00000001; - sendTimestamp_ = value; - onChanged(); - return this; - } - /** - * optional int64 send_timestamp = 1; - */ - public Builder clearSendTimestamp() { - bitField0_ = (bitField0_ & ~0x00000001); - sendTimestamp_ = 0L; - onChanged(); - return this; - } - - private long startTimestamp_ ; - /** - * optional int64 start_timestamp = 2; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int64 start_timestamp = 2; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - /** - * optional int64 start_timestamp = 2; - */ - public Builder setStartTimestamp(long value) { - bitField0_ |= 0x00000002; - startTimestamp_ = value; - onChanged(); - return this; - } - /** - * optional int64 start_timestamp = 2; - */ - public Builder clearStartTimestamp() { - bitField0_ = (bitField0_ & ~0x00000002); - startTimestamp_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.HeartBeat) - } - - static { - defaultInstance = new HeartBeat(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.HeartBeat) - } - - public interface HandshakeOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Handshake) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - boolean hasCommunicationEncoding(); - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - java.lang.String getCommunicationEncoding(); - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - com.google.protobuf.ByteString - getCommunicationEncodingBytes(); - - /** - * optional bytes seeds = 2; - */ - boolean hasSeeds(); - /** - * optional bytes seeds = 2; - */ - com.google.protobuf.ByteString getSeeds(); - - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - java.util.List getSupportedCompressionsList(); - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - int getSupportedCompressionsCount(); - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Handshake} - */ - public static final class Handshake extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Handshake) - HandshakeOrBuilder { - // Use Handshake.newBuilder() to construct. - private Handshake(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Handshake(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Handshake defaultInstance; - public static Handshake getDefaultInstance() { - return defaultInstance; - } - - public Handshake getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Handshake( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - communicationEncoding_ = bs; - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.class, + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.Builder.class); } - case 18: { - bitField0_ |= 0x00000002; - seeds_ = input.readBytes(); - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 24: { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + sendTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + startTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat build() { + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat result = new com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.sendTimestamp_ = sendTimestamp_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.startTimestamp_ = startTimestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) other); } else { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; + super.mergeFrom(other); + return this; } - supportedCompressions_.add(value); - } - break; } - case 26: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while(input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - supportedCompressions_.add(value); + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat.getDefaultInstance()) return this; + if (other.hasSendTimestamp()) { + setSendTimestamp(other.getSendTimestamp()); } - } - input.popLimit(oldLimit); - break; + if (other.hasStartTimestamp()) { + setStartTimestamp(other.getStartTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; } - } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long sendTimestamp_; + + /** + * optional int64 send_timestamp = 1; + */ + public boolean hasSendTimestamp() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int64 send_timestamp = 1; + */ + public long getSendTimestamp() { + return sendTimestamp_; + } + + /** + * optional int64 send_timestamp = 1; + */ + public Builder setSendTimestamp(long value) { + bitField0_ |= 0x00000001; + sendTimestamp_ = value; + onChanged(); + return this; + } + + /** + * optional int64 send_timestamp = 1; + */ + public Builder clearSendTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + sendTimestamp_ = 0L; + onChanged(); + return this; + } + + private long startTimestamp_; + + /** + * optional int64 start_timestamp = 2; + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional int64 start_timestamp = 2; + */ + public long getStartTimestamp() { + return startTimestamp_; + } + + /** + * optional int64 start_timestamp = 2; + */ + public Builder setStartTimestamp(long value) { + bitField0_ |= 0x00000002; + startTimestamp_ = value; + onChanged(); + return this; + } + + /** + * optional int64 start_timestamp = 2; + */ + public Builder clearStartTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + startTimestamp_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.HeartBeat) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); + + static { + defaultInstance = new HeartBeat(true); + defaultInstance.initFields(); } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.HeartBeat) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); + public interface HandshakeOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Handshake) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + boolean hasCommunicationEncoding(); + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + java.lang.String getCommunicationEncoding(); + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + com.google.protobuf.ByteString getCommunicationEncodingBytes(); + + /** + * optional bytes seeds = 2; + */ + boolean hasSeeds(); + + /** + * optional bytes seeds = 2; + */ + com.google.protobuf.ByteString getSeeds(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + java.util.List getSupportedCompressionsList(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + int getSupportedCompressionsCount(); + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Handshake parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Handshake(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int COMMUNICATION_ENCODING_FIELD_NUMBER = 1; - private java.lang.Object communicationEncoding_; - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public boolean hasCommunicationEncoding() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public java.lang.String getCommunicationEncoding() { - java.lang.Object ref = communicationEncoding_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - communicationEncoding_ = s; - } - return s; - } - } - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public com.google.protobuf.ByteString - getCommunicationEncodingBytes() { - java.lang.Object ref = communicationEncoding_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - communicationEncoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SEEDS_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString seeds_; - /** - * optional bytes seeds = 2; - */ - public boolean hasSeeds() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional bytes seeds = 2; - */ - public com.google.protobuf.ByteString getSeeds() { - return seeds_; - } - - public static final int SUPPORTED_COMPRESSIONS_FIELD_NUMBER = 3; - private java.util.List supportedCompressions_; - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public java.util.List getSupportedCompressionsList() { - return supportedCompressions_; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public int getSupportedCompressionsCount() { - return supportedCompressions_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { - return supportedCompressions_.get(index); - } - - private void initFields() { - communicationEncoding_ = "utf8"; - seeds_ = com.google.protobuf.ByteString.EMPTY; - supportedCompressions_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getCommunicationEncodingBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, seeds_); - } - for (int i = 0; i < supportedCompressions_.size(); i++) { - output.writeEnum(3, supportedCompressions_.get(i).getNumber()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getCommunicationEncodingBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, seeds_); - } - { - int dataSize = 0; - for (int i = 0; i < supportedCompressions_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeEnumSizeNoTag(supportedCompressions_.get(i).getNumber()); - } - size += dataSize; - size += 1 * supportedCompressions_.size(); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Handshake prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Handshake} */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Handshake extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Handshake) + HandshakeOrBuilder { + + // Use Handshake.newBuilder() to construct. + private Handshake(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Handshake(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Handshake defaultInstance; + + public static Handshake getDefaultInstance() { + return defaultInstance; + } + + public Handshake getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Handshake(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + communicationEncoding_ = bs; + break; + } + case 18: { + bitField0_ |= 0x00000002; + seeds_ = input.readBytes(); + break; + } + case 24: { + int rawValue = input.readEnum(); + com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + supportedCompressions_.add(value); + } + break; + } + case 26: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + com.alibaba.otter.canal.protocol.CanalPacket.Compression value = com.alibaba.otter.canal.protocol.CanalPacket.Compression.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + supportedCompressions_.add(value); + } + } + input.popLimit(oldLimit); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, + com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public Handshake parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Handshake(input, + extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int COMMUNICATION_ENCODING_FIELD_NUMBER = 1; + private java.lang.Object communicationEncoding_; + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public boolean hasCommunicationEncoding() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public java.lang.String getCommunicationEncoding() { + java.lang.Object ref = communicationEncoding_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + communicationEncoding_ = s; + } + return s; + } + } + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public com.google.protobuf.ByteString getCommunicationEncodingBytes() { + java.lang.Object ref = communicationEncoding_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + communicationEncoding_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEEDS_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString seeds_; + + /** + * optional bytes seeds = 2; + */ + public boolean hasSeeds() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional bytes seeds = 2; + */ + public com.google.protobuf.ByteString getSeeds() { + return seeds_; + } + + public static final int SUPPORTED_COMPRESSIONS_FIELD_NUMBER = 3; + private java.util.List supportedCompressions_; + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public java.util.List getSupportedCompressionsList() { + return supportedCompressions_; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public int getSupportedCompressionsCount() { + return supportedCompressions_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { + return supportedCompressions_.get(index); + } + + private void initFields() { + communicationEncoding_ = "utf8"; + seeds_ = com.google.protobuf.ByteString.EMPTY; + supportedCompressions_ = java.util.Collections.emptyList(); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getCommunicationEncodingBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, seeds_); + } + for (int i = 0; i < supportedCompressions_.size(); i++) { + output.writeEnum(3, supportedCompressions_.get(i).getNumber()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getCommunicationEncodingBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, seeds_); + } + { + int dataSize = 0; + for (int i = 0; i < supportedCompressions_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(supportedCompressions_.get(i) + .getNumber()); + } + size += dataSize; + size += 1 * supportedCompressions_.size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Handshake parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Handshake prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Handshake} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Handshake) com.alibaba.otter.canal.protocol.CanalPacket.HandshakeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Handshake.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - communicationEncoding_ = "utf8"; - bitField0_ = (bitField0_ & ~0x00000001); - seeds_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - supportedCompressions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Handshake getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Handshake build() { - com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Handshake buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = new com.alibaba.otter.canal.protocol.CanalPacket.Handshake(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.communicationEncoding_ = communicationEncoding_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.seeds_ = seeds_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.supportedCompressions_ = supportedCompressions_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Handshake) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Handshake)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Handshake other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance()) return this; - if (other.hasCommunicationEncoding()) { - bitField0_ |= 0x00000001; - communicationEncoding_ = other.communicationEncoding_; - onChanged(); - } - if (other.hasSeeds()) { - setSeeds(other.getSeeds()); - } - if (!other.supportedCompressions_.isEmpty()) { - if (supportedCompressions_.isEmpty()) { - supportedCompressions_ = other.supportedCompressions_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.addAll(other.supportedCompressions_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Handshake parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Handshake) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object communicationEncoding_ = "utf8"; - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public boolean hasCommunicationEncoding() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public java.lang.String getCommunicationEncoding() { - java.lang.Object ref = communicationEncoding_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - communicationEncoding_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public com.google.protobuf.ByteString - getCommunicationEncodingBytes() { - java.lang.Object ref = communicationEncoding_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - communicationEncoding_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public Builder setCommunicationEncoding( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - communicationEncoding_ = value; - onChanged(); - return this; - } - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public Builder clearCommunicationEncoding() { - bitField0_ = (bitField0_ & ~0x00000001); - communicationEncoding_ = getDefaultInstance().getCommunicationEncoding(); - onChanged(); - return this; - } - /** - * optional string communication_encoding = 1 [default = "utf8"]; - */ - public Builder setCommunicationEncodingBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - communicationEncoding_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString seeds_ = com.google.protobuf.ByteString.EMPTY; - /** - * optional bytes seeds = 2; - */ - public boolean hasSeeds() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional bytes seeds = 2; - */ - public com.google.protobuf.ByteString getSeeds() { - return seeds_; - } - /** - * optional bytes seeds = 2; - */ - public Builder setSeeds(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - seeds_ = value; - onChanged(); - return this; - } - /** - * optional bytes seeds = 2; - */ - public Builder clearSeeds() { - bitField0_ = (bitField0_ & ~0x00000002); - seeds_ = getDefaultInstance().getSeeds(); - onChanged(); - return this; - } - - private java.util.List supportedCompressions_ = - java.util.Collections.emptyList(); - private void ensureSupportedCompressionsIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - supportedCompressions_ = new java.util.ArrayList(supportedCompressions_); - bitField0_ |= 0x00000004; - } - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public java.util.List getSupportedCompressionsList() { - return java.util.Collections.unmodifiableList(supportedCompressions_); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public int getSupportedCompressionsCount() { - return supportedCompressions_.size(); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { - return supportedCompressions_.get(index); - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder setSupportedCompressions( - int index, com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.set(index, value); - onChanged(); - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder addSupportedCompressions(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSupportedCompressionsIsMutable(); - supportedCompressions_.add(value); - onChanged(); - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder addAllSupportedCompressions( - java.lang.Iterable values) { - ensureSupportedCompressionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, supportedCompressions_); - onChanged(); - return this; - } - /** - * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; - */ - public Builder clearSupportedCompressions() { - supportedCompressions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Handshake) - } - - static { - defaultInstance = new Handshake(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Handshake) - } - - public interface ClientAuthOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientAuth) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string username = 1; - */ - boolean hasUsername(); - /** - * optional string username = 1; - */ - java.lang.String getUsername(); - /** - * optional string username = 1; - */ - com.google.protobuf.ByteString - getUsernameBytes(); - - /** - * optional bytes password = 2; - * - *
      -     * hashed password with seeds from Handshake message
      -     * 
      - */ - boolean hasPassword(); - /** - * optional bytes password = 2; - * - *
      -     * hashed password with seeds from Handshake message
      -     * 
      - */ - com.google.protobuf.ByteString getPassword(); - - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
      -     * in seconds
      -     * 
      - */ - boolean hasNetReadTimeout(); - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
      -     * in seconds
      -     * 
      - */ - int getNetReadTimeout(); - - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
      -     * in seconds
      -     * 
      - */ - boolean hasNetWriteTimeout(); - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
      -     * in seconds
      -     * 
      - */ - int getNetWriteTimeout(); - - /** - * optional string destination = 5; - */ - boolean hasDestination(); - /** - * optional string destination = 5; - */ - java.lang.String getDestination(); - /** - * optional string destination = 5; - */ - com.google.protobuf.ByteString - getDestinationBytes(); - - /** - * optional string client_id = 6; - */ - boolean hasClientId(); - /** - * optional string client_id = 6; - */ - java.lang.String getClientId(); - /** - * optional string client_id = 6; - */ - com.google.protobuf.ByteString - getClientIdBytes(); - - /** - * optional string filter = 7; - */ - boolean hasFilter(); - /** - * optional string filter = 7; - */ - java.lang.String getFilter(); - /** - * optional string filter = 7; - */ - com.google.protobuf.ByteString - getFilterBytes(); - - /** - * optional int64 start_timestamp = 8; - */ - boolean hasStartTimestamp(); - /** - * optional int64 start_timestamp = 8; - */ - long getStartTimestamp(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAuth} - * - *
      -   * client authentication
      -   * 
      - */ - public static final class ClientAuth extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientAuth) - ClientAuthOrBuilder { - // Use ClientAuth.newBuilder() to construct. - private ClientAuth(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private ClientAuth(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final ClientAuth defaultInstance; - public static ClientAuth getDefaultInstance() { - return defaultInstance; - } - - public ClientAuth getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ClientAuth( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - username_ = bs; - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Handshake.class, + com.alibaba.otter.canal.protocol.CanalPacket.Handshake.Builder.class); } - case 18: { - bitField0_ |= 0x00000002; - password_ = input.readBytes(); - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.Handshake.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 24: { - bitField0_ |= 0x00000004; - netReadTimeout_ = input.readInt32(); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - case 32: { - bitField0_ |= 0x00000008; - netWriteTimeout_ = input.readInt32(); - break; + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } } - case 42: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000010; - destination_ = bs; - break; + + private static Builder create() { + return new Builder(); } - case 50: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000020; - clientId_ = bs; - break; + + public Builder clear() { + super.clear(); + communicationEncoding_ = "utf8"; + bitField0_ = (bitField0_ & ~0x00000001); + seeds_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + supportedCompressions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + return this; } - case 58: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000040; - filter_ = bs; - break; + + public Builder clone() { + return create().mergeFrom(buildPartial()); } - case 64: { - bitField0_ |= 0x00000080; - startTimestamp_ = input.readInt64(); - break; + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; } - } + + public com.alibaba.otter.canal.protocol.CanalPacket.Handshake getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Handshake build() { + com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Handshake buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Handshake result = new com.alibaba.otter.canal.protocol.CanalPacket.Handshake(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.communicationEncoding_ = communicationEncoding_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.seeds_ = seeds_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = java.util.Collections.unmodifiableList(supportedCompressions_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.supportedCompressions_ = supportedCompressions_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Handshake) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Handshake) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Handshake other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Handshake.getDefaultInstance()) return this; + if (other.hasCommunicationEncoding()) { + bitField0_ |= 0x00000001; + communicationEncoding_ = other.communicationEncoding_; + onChanged(); + } + if (other.hasSeeds()) { + setSeeds(other.getSeeds()); + } + if (!other.supportedCompressions_.isEmpty()) { + if (supportedCompressions_.isEmpty()) { + supportedCompressions_ = other.supportedCompressions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSupportedCompressionsIsMutable(); + supportedCompressions_.addAll(other.supportedCompressions_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Handshake parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Handshake) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object communicationEncoding_ = "utf8"; + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public boolean hasCommunicationEncoding() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public java.lang.String getCommunicationEncoding() { + java.lang.Object ref = communicationEncoding_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + communicationEncoding_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public com.google.protobuf.ByteString getCommunicationEncodingBytes() { + java.lang.Object ref = communicationEncoding_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + communicationEncoding_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public Builder setCommunicationEncoding(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + communicationEncoding_ = value; + onChanged(); + return this; + } + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public Builder clearCommunicationEncoding() { + bitField0_ = (bitField0_ & ~0x00000001); + communicationEncoding_ = getDefaultInstance().getCommunicationEncoding(); + onChanged(); + return this; + } + + /** + * optional string communication_encoding = 1 [default = "utf8"]; + */ + public Builder setCommunicationEncodingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + communicationEncoding_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString seeds_ = com.google.protobuf.ByteString.EMPTY; + + /** + * optional bytes seeds = 2; + */ + public boolean hasSeeds() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional bytes seeds = 2; + */ + public com.google.protobuf.ByteString getSeeds() { + return seeds_; + } + + /** + * optional bytes seeds = 2; + */ + public Builder setSeeds(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + seeds_ = value; + onChanged(); + return this; + } + + /** + * optional bytes seeds = 2; + */ + public Builder clearSeeds() { + bitField0_ = (bitField0_ & ~0x00000002); + seeds_ = getDefaultInstance().getSeeds(); + onChanged(); + return this; + } + + private java.util.List supportedCompressions_ = java.util.Collections.emptyList(); + + private void ensureSupportedCompressionsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + supportedCompressions_ = new java.util.ArrayList(supportedCompressions_); + bitField0_ |= 0x00000004; + } + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public java.util.List getSupportedCompressionsList() { + return java.util.Collections.unmodifiableList(supportedCompressions_); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public int getSupportedCompressionsCount() { + return supportedCompressions_.size(); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public com.alibaba.otter.canal.protocol.CanalPacket.Compression getSupportedCompressions(int index) { + return supportedCompressions_.get(index); + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public Builder setSupportedCompressions(int index, + com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedCompressionsIsMutable(); + supportedCompressions_.set(index, value); + onChanged(); + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public Builder addSupportedCompressions(com.alibaba.otter.canal.protocol.CanalPacket.Compression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSupportedCompressionsIsMutable(); + supportedCompressions_.add(value); + onChanged(); + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public Builder addAllSupportedCompressions(java.lang.Iterable values) { + ensureSupportedCompressionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, supportedCompressions_); + onChanged(); + return this; + } + + /** + * repeated .com.alibaba.otter.canal.protocol.Compression supported_compressions = 3; + */ + public Builder clearSupportedCompressions() { + supportedCompressions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Handshake) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ClientAuth parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClientAuth(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int USERNAME_FIELD_NUMBER = 1; - private java.lang.Object username_; - /** - * optional string username = 1; - */ - public boolean hasUsername() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string username = 1; - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - username_ = s; + static { + defaultInstance = new Handshake(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * optional string username = 1; - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Handshake) } - public static final int PASSWORD_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString password_; - /** - * optional bytes password = 2; - * - *
      -     * hashed password with seeds from Handshake message
      -     * 
      - */ - public boolean hasPassword() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional bytes password = 2; - * - *
      -     * hashed password with seeds from Handshake message
      -     * 
      - */ - public com.google.protobuf.ByteString getPassword() { - return password_; + public interface ClientAuthOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientAuth) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string username = 1; + */ + boolean hasUsername(); + + /** + * optional string username = 1; + */ + java.lang.String getUsername(); + + /** + * optional string username = 1; + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * optional bytes password = 2; + * + *
      +         * hashed password with seeds from Handshake message
      +         * 
      + */ + boolean hasPassword(); + + /** + * optional bytes password = 2; + * + *
      +         * hashed password with seeds from Handshake message
      +         * 
      + */ + com.google.protobuf.ByteString getPassword(); + + /** + * optional int32 net_read_timeout = 3 [default = 0]; + * + *
      +         * in seconds
      +         * 
      + */ + boolean hasNetReadTimeout(); + + /** + * optional int32 net_read_timeout = 3 [default = 0]; + * + *
      +         * in seconds
      +         * 
      + */ + int getNetReadTimeout(); + + /** + * optional int32 net_write_timeout = 4 [default = 0]; + * + *
      +         * in seconds
      +         * 
      + */ + boolean hasNetWriteTimeout(); + + /** + * optional int32 net_write_timeout = 4 [default = 0]; + * + *
      +         * in seconds
      +         * 
      + */ + int getNetWriteTimeout(); + + /** + * optional string destination = 5; + */ + boolean hasDestination(); + + /** + * optional string destination = 5; + */ + java.lang.String getDestination(); + + /** + * optional string destination = 5; + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * optional string client_id = 6; + */ + boolean hasClientId(); + + /** + * optional string client_id = 6; + */ + java.lang.String getClientId(); + + /** + * optional string client_id = 6; + */ + com.google.protobuf.ByteString getClientIdBytes(); + + /** + * optional string filter = 7; + */ + boolean hasFilter(); + + /** + * optional string filter = 7; + */ + java.lang.String getFilter(); + + /** + * optional string filter = 7; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * optional int64 start_timestamp = 8; + */ + boolean hasStartTimestamp(); + + /** + * optional int64 start_timestamp = 8; + */ + long getStartTimestamp(); } - public static final int NET_READ_TIMEOUT_FIELD_NUMBER = 3; - private int netReadTimeout_; - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
      -     * in seconds
      -     * 
      - */ - public boolean hasNetReadTimeout() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
      -     * in seconds
      -     * 
      - */ - public int getNetReadTimeout() { - return netReadTimeout_; - } - - public static final int NET_WRITE_TIMEOUT_FIELD_NUMBER = 4; - private int netWriteTimeout_; - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
      -     * in seconds
      -     * 
      - */ - public boolean hasNetWriteTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
      -     * in seconds
      -     * 
      - */ - public int getNetWriteTimeout() { - return netWriteTimeout_; - } - - public static final int DESTINATION_FIELD_NUMBER = 5; - private java.lang.Object destination_; - /** - * optional string destination = 5; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string destination = 5; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } - } - /** - * optional string destination = 5; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLIENT_ID_FIELD_NUMBER = 6; - private java.lang.Object clientId_; - /** - * optional string client_id = 6; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional string client_id = 6; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - /** - * optional string client_id = 6; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 7; - private java.lang.Object filter_; - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } - } - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int START_TIMESTAMP_FIELD_NUMBER = 8; - private long startTimestamp_; - /** - * optional int64 start_timestamp = 8; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int64 start_timestamp = 8; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - - private void initFields() { - username_ = ""; - password_ = com.google.protobuf.ByteString.EMPTY; - netReadTimeout_ = 0; - netWriteTimeout_ = 0; - destination_ = ""; - clientId_ = ""; - filter_ = ""; - startTimestamp_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getUsernameBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, password_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, netReadTimeout_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(4, netWriteTimeout_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, getDestinationBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBytes(6, getClientIdBytes()); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeBytes(7, getFilterBytes()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeInt64(8, startTimestamp_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getUsernameBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, password_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, netReadTimeout_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, netWriteTimeout_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, getDestinationBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(6, getClientIdBytes()); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(7, getFilterBytes()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(8, startTimestamp_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAuth} * @@ -2915,2412 +2466,2660 @@ public final class CanalPacket { * client authentication * */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class ClientAuth extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientAuth) + ClientAuthOrBuilder { + + // Use ClientAuth.newBuilder() to construct. + private ClientAuth(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private ClientAuth(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final ClientAuth defaultInstance; + + public static ClientAuth getDefaultInstance() { + return defaultInstance; + } + + public ClientAuth getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClientAuth(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + username_ = bs; + break; + } + case 18: { + bitField0_ |= 0x00000002; + password_ = input.readBytes(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + netReadTimeout_ = input.readInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + netWriteTimeout_ = input.readInt32(); + break; + } + case 42: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + destination_ = bs; + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + clientId_ = bs; + break; + } + case 58: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000040; + filter_ = bs; + break; + } + case 64: { + bitField0_ |= 0x00000080; + startTimestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public ClientAuth parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientAuth(input, + extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int USERNAME_FIELD_NUMBER = 1; + private java.lang.Object username_; + + /** + * optional string username = 1; + */ + public boolean hasUsername() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string username = 1; + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + username_ = s; + } + return s; + } + } + + /** + * optional string username = 1; + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString password_; + + /** + * optional bytes password = 2; + * + *
      +         * hashed password with seeds from Handshake message
      +         * 
      + */ + public boolean hasPassword() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional bytes password = 2; + * + *
      +         * hashed password with seeds from Handshake message
      +         * 
      + */ + public com.google.protobuf.ByteString getPassword() { + return password_; + } + + public static final int NET_READ_TIMEOUT_FIELD_NUMBER = 3; + private int netReadTimeout_; + + /** + * optional int32 net_read_timeout = 3 [default = 0]; + * + *
      +         * in seconds
      +         * 
      + */ + public boolean hasNetReadTimeout() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int32 net_read_timeout = 3 [default = 0]; + * + *
      +         * in seconds
      +         * 
      + */ + public int getNetReadTimeout() { + return netReadTimeout_; + } + + public static final int NET_WRITE_TIMEOUT_FIELD_NUMBER = 4; + private int netWriteTimeout_; + + /** + * optional int32 net_write_timeout = 4 [default = 0]; + * + *
      +         * in seconds
      +         * 
      + */ + public boolean hasNetWriteTimeout() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional int32 net_write_timeout = 4 [default = 0]; + * + *
      +         * in seconds
      +         * 
      + */ + public int getNetWriteTimeout() { + return netWriteTimeout_; + } + + public static final int DESTINATION_FIELD_NUMBER = 5; + private java.lang.Object destination_; + + /** + * optional string destination = 5; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional string destination = 5; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + + /** + * optional string destination = 5; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 6; + private java.lang.Object clientId_; + + /** + * optional string client_id = 6; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + + /** + * optional string client_id = 6; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + + /** + * optional string client_id = 6; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 7; + private java.lang.Object filter_; + + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } + } + + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIMESTAMP_FIELD_NUMBER = 8; + private long startTimestamp_; + + /** + * optional int64 start_timestamp = 8; + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + + /** + * optional int64 start_timestamp = 8; + */ + public long getStartTimestamp() { + return startTimestamp_; + } + + private void initFields() { + username_ = ""; + password_ = com.google.protobuf.ByteString.EMPTY; + netReadTimeout_ = 0; + netWriteTimeout_ = 0; + destination_ = ""; + clientId_ = ""; + filter_ = ""; + startTimestamp_ = 0L; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getUsernameBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, password_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, netReadTimeout_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, netWriteTimeout_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, getDestinationBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBytes(6, getClientIdBytes()); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBytes(7, getFilterBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeInt64(8, startTimestamp_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getUsernameBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, password_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, netReadTimeout_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, netWriteTimeout_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, getDestinationBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(6, getClientIdBytes()); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, getFilterBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, startTimestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAuth} + * + *
      +         * client authentication
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.ClientAuth) com.alibaba.otter.canal.protocol.CanalPacket.ClientAuthOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - username_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - password_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - netReadTimeout_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - netWriteTimeout_ = 0; - bitField0_ = (bitField0_ & ~0x00000008); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000010); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000020); - filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000040); - startTimestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000080); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth build() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.username_ = username_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.password_ = password_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.netReadTimeout_ = netReadTimeout_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.netWriteTimeout_ = netWriteTimeout_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - result.filter_ = filter_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; - } - result.startTimestamp_ = startTimestamp_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance()) return this; - if (other.hasUsername()) { - bitField0_ |= 0x00000001; - username_ = other.username_; - onChanged(); - } - if (other.hasPassword()) { - setPassword(other.getPassword()); - } - if (other.hasNetReadTimeout()) { - setNetReadTimeout(other.getNetReadTimeout()); - } - if (other.hasNetWriteTimeout()) { - setNetWriteTimeout(other.getNetWriteTimeout()); - } - if (other.hasDestination()) { - bitField0_ |= 0x00000010; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000020; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasFilter()) { - bitField0_ |= 0x00000040; - filter_ = other.filter_; - onChanged(); - } - if (other.hasStartTimestamp()) { - setStartTimestamp(other.getStartTimestamp()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object username_ = ""; - /** - * optional string username = 1; - */ - public boolean hasUsername() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string username = 1; - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - username_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string username = 1; - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string username = 1; - */ - public Builder setUsername( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - username_ = value; - onChanged(); - return this; - } - /** - * optional string username = 1; - */ - public Builder clearUsername() { - bitField0_ = (bitField0_ & ~0x00000001); - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - /** - * optional string username = 1; - */ - public Builder setUsernameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - username_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString password_ = com.google.protobuf.ByteString.EMPTY; - /** - * optional bytes password = 2; - * - *
      -       * hashed password with seeds from Handshake message
      -       * 
      - */ - public boolean hasPassword() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional bytes password = 2; - * - *
      -       * hashed password with seeds from Handshake message
      -       * 
      - */ - public com.google.protobuf.ByteString getPassword() { - return password_; - } - /** - * optional bytes password = 2; - * - *
      -       * hashed password with seeds from Handshake message
      -       * 
      - */ - public Builder setPassword(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - password_ = value; - onChanged(); - return this; - } - /** - * optional bytes password = 2; - * - *
      -       * hashed password with seeds from Handshake message
      -       * 
      - */ - public Builder clearPassword() { - bitField0_ = (bitField0_ & ~0x00000002); - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - - private int netReadTimeout_ ; - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
      -       * in seconds
      -       * 
      - */ - public boolean hasNetReadTimeout() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
      -       * in seconds
      -       * 
      - */ - public int getNetReadTimeout() { - return netReadTimeout_; - } - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
      -       * in seconds
      -       * 
      - */ - public Builder setNetReadTimeout(int value) { - bitField0_ |= 0x00000004; - netReadTimeout_ = value; - onChanged(); - return this; - } - /** - * optional int32 net_read_timeout = 3 [default = 0]; - * - *
      -       * in seconds
      -       * 
      - */ - public Builder clearNetReadTimeout() { - bitField0_ = (bitField0_ & ~0x00000004); - netReadTimeout_ = 0; - onChanged(); - return this; - } - - private int netWriteTimeout_ ; - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
      -       * in seconds
      -       * 
      - */ - public boolean hasNetWriteTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
      -       * in seconds
      -       * 
      - */ - public int getNetWriteTimeout() { - return netWriteTimeout_; - } - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
      -       * in seconds
      -       * 
      - */ - public Builder setNetWriteTimeout(int value) { - bitField0_ |= 0x00000008; - netWriteTimeout_ = value; - onChanged(); - return this; - } - /** - * optional int32 net_write_timeout = 4 [default = 0]; - * - *
      -       * in seconds
      -       * 
      - */ - public Builder clearNetWriteTimeout() { - bitField0_ = (bitField0_ & ~0x00000008); - netWriteTimeout_ = 0; - onChanged(); - return this; - } - - private java.lang.Object destination_ = ""; - /** - * optional string destination = 5; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional string destination = 5; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string destination = 5; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string destination = 5; - */ - public Builder setDestination( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - destination_ = value; - onChanged(); - return this; - } - /** - * optional string destination = 5; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000010); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - /** - * optional string destination = 5; - */ - public Builder setDestinationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - /** - * optional string client_id = 6; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional string client_id = 6; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string client_id = 6; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string client_id = 6; - */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - clientId_ = value; - onChanged(); - return this; - } - /** - * optional string client_id = 6; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000020); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * optional string client_id = 6; - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000020; - clientId_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string filter = 7; - */ - public Builder setFilter( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000040; - filter_ = value; - onChanged(); - return this; - } - /** - * optional string filter = 7; - */ - public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000040); - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - /** - * optional string filter = 7; - */ - public Builder setFilterBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000040; - filter_ = value; - onChanged(); - return this; - } - - private long startTimestamp_ ; - /** - * optional int64 start_timestamp = 8; - */ - public boolean hasStartTimestamp() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - /** - * optional int64 start_timestamp = 8; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - /** - * optional int64 start_timestamp = 8; - */ - public Builder setStartTimestamp(long value) { - bitField0_ |= 0x00000080; - startTimestamp_ = value; - onChanged(); - return this; - } - /** - * optional int64 start_timestamp = 8; - */ - public Builder clearStartTimestamp() { - bitField0_ = (bitField0_ & ~0x00000080); - startTimestamp_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientAuth) - } - - static { - defaultInstance = new ClientAuth(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientAuth) - } - - public interface AckOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Ack) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int32 error_code = 1 [default = 0]; - */ - boolean hasErrorCode(); - /** - * optional int32 error_code = 1 [default = 0]; - */ - int getErrorCode(); - - /** - * optional string error_message = 2; - * - *
      -     * if something like compression is not supported, erorr_message will tell about it.
      -     * 
      - */ - boolean hasErrorMessage(); - /** - * optional string error_message = 2; - * - *
      -     * if something like compression is not supported, erorr_message will tell about it.
      -     * 
      - */ - java.lang.String getErrorMessage(); - /** - * optional string error_message = 2; - * - *
      -     * if something like compression is not supported, erorr_message will tell about it.
      -     * 
      - */ - com.google.protobuf.ByteString - getErrorMessageBytes(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Ack} - */ - public static final class Ack extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Ack) - AckOrBuilder { - // Use Ack.newBuilder() to construct. - private Ack(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Ack(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Ack defaultInstance; - public static Ack getDefaultInstance() { - return defaultInstance; - } - - public Ack getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Ack( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; } - case 8: { - bitField0_ |= 0x00000001; - errorCode_ = input.readInt32(); - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.class, + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.Builder.class); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - errorMessage_ = bs; - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + username_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + password_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + netReadTimeout_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + netWriteTimeout_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + filter_ = ""; + bitField0_ = (bitField0_ & ~0x00000040); + startTimestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth build() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.username_ = username_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.password_ = password_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.netReadTimeout_ = netReadTimeout_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.netWriteTimeout_ = netWriteTimeout_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.filter_ = filter_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.startTimestamp_ = startTimestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth.getDefaultInstance()) return this; + if (other.hasUsername()) { + bitField0_ |= 0x00000001; + username_ = other.username_; + onChanged(); + } + if (other.hasPassword()) { + setPassword(other.getPassword()); + } + if (other.hasNetReadTimeout()) { + setNetReadTimeout(other.getNetReadTimeout()); + } + if (other.hasNetWriteTimeout()) { + setNetWriteTimeout(other.getNetWriteTimeout()); + } + if (other.hasDestination()) { + bitField0_ |= 0x00000010; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000020; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasFilter()) { + bitField0_ |= 0x00000040; + filter_ = other.filter_; + onChanged(); + } + if (other.hasStartTimestamp()) { + setStartTimestamp(other.getStartTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object username_ = ""; + + /** + * optional string username = 1; + */ + public boolean hasUsername() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string username = 1; + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + username_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string username = 1; + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string username = 1; + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + username_ = value; + onChanged(); + return this; + } + + /** + * optional string username = 1; + */ + public Builder clearUsername() { + bitField0_ = (bitField0_ & ~0x00000001); + username_ = getDefaultInstance().getUsername(); + onChanged(); + return this; + } + + /** + * optional string username = 1; + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + username_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString password_ = com.google.protobuf.ByteString.EMPTY; + + /** + * optional bytes password = 2; + * + *
      +             * hashed password with seeds from Handshake message
      +             * 
      + */ + public boolean hasPassword() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional bytes password = 2; + * + *
      +             * hashed password with seeds from Handshake message
      +             * 
      + */ + public com.google.protobuf.ByteString getPassword() { + return password_; + } + + /** + * optional bytes password = 2; + * + *
      +             * hashed password with seeds from Handshake message
      +             * 
      + */ + public Builder setPassword(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + password_ = value; + onChanged(); + return this; + } + + /** + * optional bytes password = 2; + * + *
      +             * hashed password with seeds from Handshake message
      +             * 
      + */ + public Builder clearPassword() { + bitField0_ = (bitField0_ & ~0x00000002); + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + + private int netReadTimeout_; + + /** + * optional int32 net_read_timeout = 3 [default = 0]; + * + *
      +             * in seconds
      +             * 
      + */ + public boolean hasNetReadTimeout() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int32 net_read_timeout = 3 [default = 0]; + * + *
      +             * in seconds
      +             * 
      + */ + public int getNetReadTimeout() { + return netReadTimeout_; + } + + /** + * optional int32 net_read_timeout = 3 [default = 0]; + * + *
      +             * in seconds
      +             * 
      + */ + public Builder setNetReadTimeout(int value) { + bitField0_ |= 0x00000004; + netReadTimeout_ = value; + onChanged(); + return this; + } + + /** + * optional int32 net_read_timeout = 3 [default = 0]; + * + *
      +             * in seconds
      +             * 
      + */ + public Builder clearNetReadTimeout() { + bitField0_ = (bitField0_ & ~0x00000004); + netReadTimeout_ = 0; + onChanged(); + return this; + } + + private int netWriteTimeout_; + + /** + * optional int32 net_write_timeout = 4 [default = 0]; + * + *
      +             * in seconds
      +             * 
      + */ + public boolean hasNetWriteTimeout() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional int32 net_write_timeout = 4 [default = 0]; + * + *
      +             * in seconds
      +             * 
      + */ + public int getNetWriteTimeout() { + return netWriteTimeout_; + } + + /** + * optional int32 net_write_timeout = 4 [default = 0]; + * + *
      +             * in seconds
      +             * 
      + */ + public Builder setNetWriteTimeout(int value) { + bitField0_ |= 0x00000008; + netWriteTimeout_ = value; + onChanged(); + return this; + } + + /** + * optional int32 net_write_timeout = 4 [default = 0]; + * + *
      +             * in seconds
      +             * 
      + */ + public Builder clearNetWriteTimeout() { + bitField0_ = (bitField0_ & ~0x00000008); + netWriteTimeout_ = 0; + onChanged(); + return this; + } + + private java.lang.Object destination_ = ""; + + /** + * optional string destination = 5; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional string destination = 5; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string destination = 5; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string destination = 5; + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + destination_ = value; + onChanged(); + return this; + } + + /** + * optional string destination = 5; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000010); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + + /** + * optional string destination = 5; + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + + /** + * optional string client_id = 6; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + + /** + * optional string client_id = 6; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string client_id = 6; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string client_id = 6; + */ + public Builder setClientId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + clientId_ = value; + onChanged(); + return this; + } + + /** + * optional string client_id = 6; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000020); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + + /** + * optional string client_id = 6; + */ + public Builder setClientIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + clientId_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string filter = 7; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + filter_ = value; + onChanged(); + return this; + } + + /** + * optional string filter = 7; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000040); + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + + /** + * optional string filter = 7; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + filter_ = value; + onChanged(); + return this; + } + + private long startTimestamp_; + + /** + * optional int64 start_timestamp = 8; + */ + public boolean hasStartTimestamp() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + + /** + * optional int64 start_timestamp = 8; + */ + public long getStartTimestamp() { + return startTimestamp_; + } + + /** + * optional int64 start_timestamp = 8; + */ + public Builder setStartTimestamp(long value) { + bitField0_ |= 0x00000080; + startTimestamp_ = value; + onChanged(); + return this; + } + + /** + * optional int64 start_timestamp = 8; + */ + public Builder clearStartTimestamp() { + bitField0_ = (bitField0_ & ~0x00000080); + startTimestamp_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientAuth) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Ack parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Ack(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int ERROR_CODE_FIELD_NUMBER = 1; - private int errorCode_; - /** - * optional int32 error_code = 1 [default = 0]; - */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 error_code = 1 [default = 0]; - */ - public int getErrorCode() { - return errorCode_; - } - - public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; - private java.lang.Object errorMessage_; - /** - * optional string error_message = 2; - * - *
      -     * if something like compression is not supported, erorr_message will tell about it.
      -     * 
      - */ - public boolean hasErrorMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string error_message = 2; - * - *
      -     * if something like compression is not supported, erorr_message will tell about it.
      -     * 
      - */ - public java.lang.String getErrorMessage() { - java.lang.Object ref = errorMessage_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - errorMessage_ = s; + static { + defaultInstance = new ClientAuth(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * optional string error_message = 2; - * - *
      -     * if something like compression is not supported, erorr_message will tell about it.
      -     * 
      - */ - public com.google.protobuf.ByteString - getErrorMessageBytes() { - java.lang.Object ref = errorMessage_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - errorMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientAuth) } - private void initFields() { - errorCode_ = 0; - errorMessage_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + public interface AckOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Ack) + com.google.protobuf.MessageOrBuilder { - memoizedIsInitialized = 1; - return true; + /** + * optional int32 error_code = 1 [default = 0]; + */ + boolean hasErrorCode(); + + /** + * optional int32 error_code = 1 [default = 0]; + */ + int getErrorCode(); + + /** + * optional string error_message = 2; + * + *
      +         * if something like compression is not supported, erorr_message will tell about it.
      +         * 
      + */ + boolean hasErrorMessage(); + + /** + * optional string error_message = 2; + * + *
      +         * if something like compression is not supported, erorr_message will tell about it.
      +         * 
      + */ + java.lang.String getErrorMessage(); + + /** + * optional string error_message = 2; + * + *
      +         * if something like compression is not supported, erorr_message will tell about it.
      +         * 
      + */ + com.google.protobuf.ByteString getErrorMessageBytes(); } - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, errorCode_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getErrorMessageBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, errorCode_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getErrorMessageBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Ack prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Ack} */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Ack extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Ack) + AckOrBuilder { + + // Use Ack.newBuilder() to construct. + private Ack(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Ack(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Ack defaultInstance; + + public static Ack getDefaultInstance() { + return defaultInstance; + } + + public Ack getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Ack(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + errorCode_ = input.readInt32(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + errorMessage_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, + com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public Ack parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Ack(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int ERROR_CODE_FIELD_NUMBER = 1; + private int errorCode_; + + /** + * optional int32 error_code = 1 [default = 0]; + */ + public boolean hasErrorCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int32 error_code = 1 [default = 0]; + */ + public int getErrorCode() { + return errorCode_; + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; + private java.lang.Object errorMessage_; + + /** + * optional string error_message = 2; + * + *
      +         * if something like compression is not supported, erorr_message will tell about it.
      +         * 
      + */ + public boolean hasErrorMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string error_message = 2; + * + *
      +         * if something like compression is not supported, erorr_message will tell about it.
      +         * 
      + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + errorMessage_ = s; + } + return s; + } + } + + /** + * optional string error_message = 2; + * + *
      +         * if something like compression is not supported, erorr_message will tell about it.
      +         * 
      + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + errorCode_ = 0; + errorMessage_ = ""; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, errorCode_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getErrorMessageBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, errorCode_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getErrorMessageBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Ack prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Ack} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Ack) com.alibaba.otter.canal.protocol.CanalPacket.AckOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Ack.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - errorCode_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - errorMessage_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Ack getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Ack build() { - com.alibaba.otter.canal.protocol.CanalPacket.Ack result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Ack buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Ack result = new com.alibaba.otter.canal.protocol.CanalPacket.Ack(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.errorCode_ = errorCode_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.errorMessage_ = errorMessage_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Ack) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Ack)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Ack other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance()) return this; - if (other.hasErrorCode()) { - setErrorCode(other.getErrorCode()); - } - if (other.hasErrorMessage()) { - bitField0_ |= 0x00000002; - errorMessage_ = other.errorMessage_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Ack parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Ack) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int errorCode_ ; - /** - * optional int32 error_code = 1 [default = 0]; - */ - public boolean hasErrorCode() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int32 error_code = 1 [default = 0]; - */ - public int getErrorCode() { - return errorCode_; - } - /** - * optional int32 error_code = 1 [default = 0]; - */ - public Builder setErrorCode(int value) { - bitField0_ |= 0x00000001; - errorCode_ = value; - onChanged(); - return this; - } - /** - * optional int32 error_code = 1 [default = 0]; - */ - public Builder clearErrorCode() { - bitField0_ = (bitField0_ & ~0x00000001); - errorCode_ = 0; - onChanged(); - return this; - } - - private java.lang.Object errorMessage_ = ""; - /** - * optional string error_message = 2; - * - *
      -       * if something like compression is not supported, erorr_message will tell about it.
      -       * 
      - */ - public boolean hasErrorMessage() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string error_message = 2; - * - *
      -       * if something like compression is not supported, erorr_message will tell about it.
      -       * 
      - */ - public java.lang.String getErrorMessage() { - java.lang.Object ref = errorMessage_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - errorMessage_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string error_message = 2; - * - *
      -       * if something like compression is not supported, erorr_message will tell about it.
      -       * 
      - */ - public com.google.protobuf.ByteString - getErrorMessageBytes() { - java.lang.Object ref = errorMessage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - errorMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string error_message = 2; - * - *
      -       * if something like compression is not supported, erorr_message will tell about it.
      -       * 
      - */ - public Builder setErrorMessage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - errorMessage_ = value; - onChanged(); - return this; - } - /** - * optional string error_message = 2; - * - *
      -       * if something like compression is not supported, erorr_message will tell about it.
      -       * 
      - */ - public Builder clearErrorMessage() { - bitField0_ = (bitField0_ & ~0x00000002); - errorMessage_ = getDefaultInstance().getErrorMessage(); - onChanged(); - return this; - } - /** - * optional string error_message = 2; - * - *
      -       * if something like compression is not supported, erorr_message will tell about it.
      -       * 
      - */ - public Builder setErrorMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - errorMessage_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Ack) - } - - static { - defaultInstance = new Ack(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Ack) - } - - public interface ClientAckOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientAck) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString - getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString - getClientIdBytes(); - - /** - * optional int64 batch_id = 3; - */ - boolean hasBatchId(); - /** - * optional int64 batch_id = 3; - */ - long getBatchId(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAck} - */ - public static final class ClientAck extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientAck) - ClientAckOrBuilder { - // Use ClientAck.newBuilder() to construct. - private ClientAck(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private ClientAck(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final ClientAck defaultInstance; - public static ClientAck getDefaultInstance() { - return defaultInstance; - } - - public ClientAck getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ClientAck( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Ack.class, + com.alibaba.otter.canal.protocol.CanalPacket.Ack.Builder.class); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.Ack.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 24: { - bitField0_ |= 0x00000004; - batchId_ = input.readInt64(); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + errorCode_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + errorMessage_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Ack getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Ack build() { + com.alibaba.otter.canal.protocol.CanalPacket.Ack result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Ack buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Ack result = new com.alibaba.otter.canal.protocol.CanalPacket.Ack(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.errorCode_ = errorCode_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.errorMessage_ = errorMessage_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Ack) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Ack) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Ack other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Ack.getDefaultInstance()) return this; + if (other.hasErrorCode()) { + setErrorCode(other.getErrorCode()); + } + if (other.hasErrorMessage()) { + bitField0_ |= 0x00000002; + errorMessage_ = other.errorMessage_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Ack parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Ack) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int errorCode_; + + /** + * optional int32 error_code = 1 [default = 0]; + */ + public boolean hasErrorCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int32 error_code = 1 [default = 0]; + */ + public int getErrorCode() { + return errorCode_; + } + + /** + * optional int32 error_code = 1 [default = 0]; + */ + public Builder setErrorCode(int value) { + bitField0_ |= 0x00000001; + errorCode_ = value; + onChanged(); + return this; + } + + /** + * optional int32 error_code = 1 [default = 0]; + */ + public Builder clearErrorCode() { + bitField0_ = (bitField0_ & ~0x00000001); + errorCode_ = 0; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + + /** + * optional string error_message = 2; + * + *
      +             * if something like compression is not supported, erorr_message will tell about it.
      +             * 
      + */ + public boolean hasErrorMessage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string error_message = 2; + * + *
      +             * if something like compression is not supported, erorr_message will tell about it.
      +             * 
      + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + errorMessage_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string error_message = 2; + * + *
      +             * if something like compression is not supported, erorr_message will tell about it.
      +             * 
      + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string error_message = 2; + * + *
      +             * if something like compression is not supported, erorr_message will tell about it.
      +             * 
      + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + errorMessage_ = value; + onChanged(); + return this; + } + + /** + * optional string error_message = 2; + * + *
      +             * if something like compression is not supported, erorr_message will tell about it.
      +             * 
      + */ + public Builder clearErrorMessage() { + bitField0_ = (bitField0_ & ~0x00000002); + errorMessage_ = getDefaultInstance().getErrorMessage(); + onChanged(); + return this; + } + + /** + * optional string error_message = 2; + * + *
      +             * if something like compression is not supported, erorr_message will tell about it.
      +             * 
      + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + errorMessage_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Ack) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ClientAck parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClientAck(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; + static { + defaultInstance = new Ack(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Ack) } - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public interface ClientAckOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientAck) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString getClientIdBytes(); + + /** + * optional int64 batch_id = 3; + */ + boolean hasBatchId(); + + /** + * optional int64 batch_id = 3; + */ + long getBatchId(); } - public static final int BATCH_ID_FIELD_NUMBER = 3; - private long batchId_; - /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 batch_id = 3; - */ - public long getBatchId() { - return batchId_; - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - batchId_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt64(3, batchId_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, batchId_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAck} */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class ClientAck extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientAck) + ClientAckOrBuilder { + + // Use ClientAck.newBuilder() to construct. + private ClientAck(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private ClientAck(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final ClientAck defaultInstance; + + public static ClientAck getDefaultInstance() { + return defaultInstance; + } + + public ClientAck getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClientAck(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 24: { + bitField0_ |= 0x00000004; + batchId_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public ClientAck parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientAck(input, + extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private java.lang.Object destination_; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private java.lang.Object clientId_; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BATCH_ID_FIELD_NUMBER = 3; + private long batchId_; + + /** + * optional int64 batch_id = 3; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int64 batch_id = 3; + */ + public long getBatchId() { + return batchId_; + } + + private void initFields() { + destination_ = ""; + clientId_ = ""; + batchId_ = 0L; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(3, batchId_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, batchId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientAck} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.ClientAck) com.alibaba.otter.canal.protocol.CanalPacket.ClientAckOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - batchId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck build() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAck(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.batchId_ = batchId_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientAck)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasBatchId()) { - setBatchId(other.getBatchId()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object destination_ = ""; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string destination = 1; - */ - public Builder setDestination( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string client_id = 2; - */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private long batchId_ ; - /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 batch_id = 3; - */ - public long getBatchId() { - return batchId_; - } - /** - * optional int64 batch_id = 3; - */ - public Builder setBatchId(long value) { - bitField0_ |= 0x00000004; - batchId_ = value; - onChanged(); - return this; - } - /** - * optional int64 batch_id = 3; - */ - public Builder clearBatchId() { - bitField0_ = (bitField0_ & ~0x00000004); - batchId_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientAck) - } - - static { - defaultInstance = new ClientAck(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientAck) - } - - public interface SubOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Sub) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString - getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString - getClientIdBytes(); - - /** - * optional string filter = 7; - */ - boolean hasFilter(); - /** - * optional string filter = 7; - */ - java.lang.String getFilter(); - /** - * optional string filter = 7; - */ - com.google.protobuf.ByteString - getFilterBytes(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Sub} - * - *
      -   * subscription
      -   * 
      - */ - public static final class Sub extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Sub) - SubOrBuilder { - // Use Sub.newBuilder() to construct. - private Sub(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Sub(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Sub defaultInstance; - public static Sub getDefaultInstance() { - return defaultInstance; - } - - public Sub getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Sub( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.class, + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.Builder.class); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 58: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - filter_ = bs; - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + batchId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck build() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientAck buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientAck(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.batchId_ = batchId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientAck other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientAck.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasBatchId()) { + setBatchId(other.getBatchId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object destination_ = ""; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string destination = 1; + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string client_id = 2; + */ + public Builder setClientId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private long batchId_; + + /** + * optional int64 batch_id = 3; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int64 batch_id = 3; + */ + public long getBatchId() { + return batchId_; + } + + /** + * optional int64 batch_id = 3; + */ + public Builder setBatchId(long value) { + bitField0_ |= 0x00000004; + batchId_ = value; + onChanged(); + return this; + } + + /** + * optional int64 batch_id = 3; + */ + public Builder clearBatchId() { + bitField0_ = (bitField0_ & ~0x00000004); + batchId_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientAck) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Sub parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Sub(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; + static { + defaultInstance = new ClientAck(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientAck) } - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public interface SubOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Sub) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString getClientIdBytes(); + + /** + * optional string filter = 7; + */ + boolean hasFilter(); + + /** + * optional string filter = 7; + */ + java.lang.String getFilter(); + + /** + * optional string filter = 7; + */ + com.google.protobuf.ByteString getFilterBytes(); } - public static final int FILTER_FIELD_NUMBER = 7; - private java.lang.Object filter_; - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } - } - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - filter_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(7, getFilterBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(7, getFilterBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Sub prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Sub} * @@ -5328,797 +5127,804 @@ public final class CanalPacket { * subscription * */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Sub extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Sub) + SubOrBuilder { + + // Use Sub.newBuilder() to construct. + private Sub(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Sub(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Sub defaultInstance; + + public static Sub getDefaultInstance() { + return defaultInstance; + } + + public Sub getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Sub(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 58: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + filter_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, + com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public Sub parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Sub(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private java.lang.Object destination_; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private java.lang.Object clientId_; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 7; + private java.lang.Object filter_; + + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } + } + + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + destination_ = ""; + clientId_ = ""; + filter_ = ""; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(7, getFilterBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, getFilterBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Sub parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Sub prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Sub} + * + *
      +         * subscription
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Sub) com.alibaba.otter.canal.protocol.CanalPacket.SubOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Sub.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Sub getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Sub build() { - com.alibaba.otter.canal.protocol.CanalPacket.Sub result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Sub buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Sub result = new com.alibaba.otter.canal.protocol.CanalPacket.Sub(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.filter_ = filter_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Sub) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Sub)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Sub other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasFilter()) { - bitField0_ |= 0x00000004; - filter_ = other.filter_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Sub parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Sub) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object destination_ = ""; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string destination = 1; - */ - public Builder setDestination( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string client_id = 2; - */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string filter = 7; - */ - public Builder setFilter( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - filter_ = value; - onChanged(); - return this; - } - /** - * optional string filter = 7; - */ - public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000004); - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - /** - * optional string filter = 7; - */ - public Builder setFilterBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - filter_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Sub) - } - - static { - defaultInstance = new Sub(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Sub) - } - - public interface UnsubOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Unsub) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString - getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString - getClientIdBytes(); - - /** - * optional string filter = 7; - */ - boolean hasFilter(); - /** - * optional string filter = 7; - */ - java.lang.String getFilter(); - /** - * optional string filter = 7; - */ - com.google.protobuf.ByteString - getFilterBytes(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Unsub} - * - *
      -   * Unsubscription
      -   * 
      - */ - public static final class Unsub extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Unsub) - UnsubOrBuilder { - // Use Unsub.newBuilder() to construct. - private Unsub(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Unsub(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Unsub defaultInstance; - public static Unsub getDefaultInstance() { - return defaultInstance; - } - - public Unsub getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Unsub( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Sub.class, + com.alibaba.otter.canal.protocol.CanalPacket.Sub.Builder.class); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.Sub.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 58: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000004; - filter_ = bs; - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + filter_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Sub getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Sub build() { + com.alibaba.otter.canal.protocol.CanalPacket.Sub result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Sub buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Sub result = new com.alibaba.otter.canal.protocol.CanalPacket.Sub(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.filter_ = filter_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Sub) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Sub) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Sub other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Sub.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasFilter()) { + bitField0_ |= 0x00000004; + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Sub parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Sub) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object destination_ = ""; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string destination = 1; + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string client_id = 2; + */ + public Builder setClientId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string filter = 7; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + filter_ = value; + onChanged(); + return this; + } + + /** + * optional string filter = 7; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000004); + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + + /** + * optional string filter = 7; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + filter_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Sub) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Unsub parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Unsub(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; + static { + defaultInstance = new Sub(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Sub) } - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public interface UnsubOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Unsub) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString getClientIdBytes(); + + /** + * optional string filter = 7; + */ + boolean hasFilter(); + + /** + * optional string filter = 7; + */ + java.lang.String getFilter(); + + /** + * optional string filter = 7; + */ + com.google.protobuf.ByteString getFilterBytes(); } - public static final int FILTER_FIELD_NUMBER = 7; - private java.lang.Object filter_; - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } - } - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - filter_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(7, getFilterBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(7, getFilterBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Unsub prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Unsub} * @@ -6126,2331 +5932,2449 @@ public final class CanalPacket { * Unsubscription * */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Unsub extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Unsub) + UnsubOrBuilder { + + // Use Unsub.newBuilder() to construct. + private Unsub(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Unsub(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Unsub defaultInstance; + + public static Unsub getDefaultInstance() { + return defaultInstance; + } + + public Unsub getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Unsub(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 58: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + filter_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, + com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public Unsub parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Unsub(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private java.lang.Object destination_; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private java.lang.Object clientId_; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 7; + private java.lang.Object filter_; + + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } + } + + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + destination_ = ""; + clientId_ = ""; + filter_ = ""; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(7, getFilterBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(7, getFilterBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Unsub parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Unsub prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Unsub} + * + *
      +         * Unsubscription
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Unsub) com.alibaba.otter.canal.protocol.CanalPacket.UnsubOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Unsub.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - filter_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Unsub getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Unsub build() { - com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Unsub buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = new com.alibaba.otter.canal.protocol.CanalPacket.Unsub(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.filter_ = filter_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Unsub) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Unsub)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Unsub other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasFilter()) { - bitField0_ |= 0x00000004; - filter_ = other.filter_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Unsub parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Unsub) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object destination_ = ""; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string destination = 1; - */ - public Builder setDestination( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string client_id = 2; - */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * optional string filter = 7; - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional string filter = 7; - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - filter_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string filter = 7; - */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string filter = 7; - */ - public Builder setFilter( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - filter_ = value; - onChanged(); - return this; - } - /** - * optional string filter = 7; - */ - public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000004); - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - /** - * optional string filter = 7; - */ - public Builder setFilterBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - filter_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Unsub) - } - - static { - defaultInstance = new Unsub(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Unsub) - } - - public interface GetOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Get) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString - getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString - getClientIdBytes(); - - /** - * optional int32 fetch_size = 3; - */ - boolean hasFetchSize(); - /** - * optional int32 fetch_size = 3; - */ - int getFetchSize(); - - /** - * optional int64 timeout = 4 [default = -1]; - * - *
      -     * 默认-1时代表不控制
      -     * 
      - */ - boolean hasTimeout(); - /** - * optional int64 timeout = 4 [default = -1]; - * - *
      -     * 默认-1时代表不控制
      -     * 
      - */ - long getTimeout(); - - /** - * optional int32 unit = 5 [default = 2]; - * - *
      -     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      -     * 
      - */ - boolean hasUnit(); - /** - * optional int32 unit = 5 [default = 2]; - * - *
      -     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      -     * 
      - */ - int getUnit(); - - /** - * optional bool auto_ack = 6 [default = false]; - * - *
      -     * 是否自动ack
      -     * 
      - */ - boolean hasAutoAck(); - /** - * optional bool auto_ack = 6 [default = false]; - * - *
      -     * 是否自动ack
      -     * 
      - */ - boolean getAutoAck(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Get} - * - *
      -   *  PullRequest
      -   * 
      - */ - public static final class Get extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Get) - GetOrBuilder { - // Use Get.newBuilder() to construct. - private Get(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Get(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Get defaultInstance; - public static Get getDefaultInstance() { - return defaultInstance; - } - - public Get getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Get( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Unsub.class, + com.alibaba.otter.canal.protocol.CanalPacket.Unsub.Builder.class); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.Unsub.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 24: { - bitField0_ |= 0x00000004; - fetchSize_ = input.readInt32(); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - case 32: { - bitField0_ |= 0x00000008; - timeout_ = input.readInt64(); - break; + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } } - case 40: { - bitField0_ |= 0x00000010; - unit_ = input.readInt32(); - break; + + private static Builder create() { + return new Builder(); } - case 48: { - bitField0_ |= 0x00000020; - autoAck_ = input.readBool(); - break; + + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + filter_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + return this; } - } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Unsub getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Unsub build() { + com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Unsub buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Unsub result = new com.alibaba.otter.canal.protocol.CanalPacket.Unsub(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.filter_ = filter_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Unsub) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Unsub) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Unsub other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Unsub.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasFilter()) { + bitField0_ |= 0x00000004; + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Unsub parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Unsub) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object destination_ = ""; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string destination = 1; + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string client_id = 2; + */ + public Builder setClientId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * optional string filter = 7; + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional string filter = 7; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + filter_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string filter = 7; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string filter = 7; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + filter_ = value; + onChanged(); + return this; + } + + /** + * optional string filter = 7; + */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000004); + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + + /** + * optional string filter = 7; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + filter_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Unsub) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Get.class, com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Get parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Get(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; + static { + defaultInstance = new Unsub(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Unsub) } - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public interface GetOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Get) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString getClientIdBytes(); + + /** + * optional int32 fetch_size = 3; + */ + boolean hasFetchSize(); + + /** + * optional int32 fetch_size = 3; + */ + int getFetchSize(); + + /** + * optional int64 timeout = 4 [default = -1]; + * + *
      +         * 默认-1时代表不控制
      +         * 
      + */ + boolean hasTimeout(); + + /** + * optional int64 timeout = 4 [default = -1]; + * + *
      +         * 默认-1时代表不控制
      +         * 
      + */ + long getTimeout(); + + /** + * optional int32 unit = 5 [default = 2]; + * + *
      +         * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      +         * 
      + */ + boolean hasUnit(); + + /** + * optional int32 unit = 5 [default = 2]; + * + *
      +         * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      +         * 
      + */ + int getUnit(); + + /** + * optional bool auto_ack = 6 [default = false]; + * + *
      +         * 是否自动ack
      +         * 
      + */ + boolean hasAutoAck(); + + /** + * optional bool auto_ack = 6 [default = false]; + * + *
      +         * 是否自动ack
      +         * 
      + */ + boolean getAutoAck(); } - public static final int FETCH_SIZE_FIELD_NUMBER = 3; - private int fetchSize_; - /** - * optional int32 fetch_size = 3; - */ - public boolean hasFetchSize() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 fetch_size = 3; - */ - public int getFetchSize() { - return fetchSize_; - } - - public static final int TIMEOUT_FIELD_NUMBER = 4; - private long timeout_; - /** - * optional int64 timeout = 4 [default = -1]; - * - *
      -     * 默认-1时代表不控制
      -     * 
      - */ - public boolean hasTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int64 timeout = 4 [default = -1]; - * - *
      -     * 默认-1时代表不控制
      -     * 
      - */ - public long getTimeout() { - return timeout_; - } - - public static final int UNIT_FIELD_NUMBER = 5; - private int unit_; - /** - * optional int32 unit = 5 [default = 2]; - * - *
      -     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      -     * 
      - */ - public boolean hasUnit() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 unit = 5 [default = 2]; - * - *
      -     * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      -     * 
      - */ - public int getUnit() { - return unit_; - } - - public static final int AUTO_ACK_FIELD_NUMBER = 6; - private boolean autoAck_; - /** - * optional bool auto_ack = 6 [default = false]; - * - *
      -     * 是否自动ack
      -     * 
      - */ - public boolean hasAutoAck() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional bool auto_ack = 6 [default = false]; - * - *
      -     * 是否自动ack
      -     * 
      - */ - public boolean getAutoAck() { - return autoAck_; - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - fetchSize_ = 0; - timeout_ = -1L; - unit_ = 2; - autoAck_ = false; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, fetchSize_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt64(4, timeout_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeInt32(5, unit_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBool(6, autoAck_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, fetchSize_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, timeout_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, unit_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, autoAck_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Get prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Get} * *
      -     *  PullRequest
      +     * PullRequest
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Get extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Get) + GetOrBuilder { + + // Use Get.newBuilder() to construct. + private Get(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Get(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Get defaultInstance; + + public static Get getDefaultInstance() { + return defaultInstance; + } + + public Get getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Get(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 24: { + bitField0_ |= 0x00000004; + fetchSize_ = input.readInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + timeout_ = input.readInt64(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + unit_ = input.readInt32(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + autoAck_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Get.class, + com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public Get parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Get(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private java.lang.Object destination_; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private java.lang.Object clientId_; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FETCH_SIZE_FIELD_NUMBER = 3; + private int fetchSize_; + + /** + * optional int32 fetch_size = 3; + */ + public boolean hasFetchSize() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int32 fetch_size = 3; + */ + public int getFetchSize() { + return fetchSize_; + } + + public static final int TIMEOUT_FIELD_NUMBER = 4; + private long timeout_; + + /** + * optional int64 timeout = 4 [default = -1]; + * + *
      +         * 默认-1时代表不控制
      +         * 
      + */ + public boolean hasTimeout() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional int64 timeout = 4 [default = -1]; + * + *
      +         * 默认-1时代表不控制
      +         * 
      + */ + public long getTimeout() { + return timeout_; + } + + public static final int UNIT_FIELD_NUMBER = 5; + private int unit_; + + /** + * optional int32 unit = 5 [default = 2]; + * + *
      +         * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      +         * 
      + */ + public boolean hasUnit() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional int32 unit = 5 [default = 2]; + * + *
      +         * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      +         * 
      + */ + public int getUnit() { + return unit_; + } + + public static final int AUTO_ACK_FIELD_NUMBER = 6; + private boolean autoAck_; + + /** + * optional bool auto_ack = 6 [default = false]; + * + *
      +         * 是否自动ack
      +         * 
      + */ + public boolean hasAutoAck() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + + /** + * optional bool auto_ack = 6 [default = false]; + * + *
      +         * 是否自动ack
      +         * 
      + */ + public boolean getAutoAck() { + return autoAck_; + } + + private void initFields() { + destination_ = ""; + clientId_ = ""; + fetchSize_ = 0; + timeout_ = -1L; + unit_ = 2; + autoAck_ = false; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, fetchSize_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt64(4, timeout_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, unit_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBool(6, autoAck_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, fetchSize_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, timeout_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, unit_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, autoAck_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Get parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Get prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Get} + * + *
      +         * PullRequest
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Get) com.alibaba.otter.canal.protocol.CanalPacket.GetOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Get.class, com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Get.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - fetchSize_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); - timeout_ = -1L; - bitField0_ = (bitField0_ & ~0x00000008); - unit_ = 2; - bitField0_ = (bitField0_ & ~0x00000010); - autoAck_ = false; - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Get getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Get build() { - com.alibaba.otter.canal.protocol.CanalPacket.Get result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Get buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Get result = new com.alibaba.otter.canal.protocol.CanalPacket.Get(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.fetchSize_ = fetchSize_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.timeout_ = timeout_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.unit_ = unit_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.autoAck_ = autoAck_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Get) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Get)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Get other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasFetchSize()) { - setFetchSize(other.getFetchSize()); - } - if (other.hasTimeout()) { - setTimeout(other.getTimeout()); - } - if (other.hasUnit()) { - setUnit(other.getUnit()); - } - if (other.hasAutoAck()) { - setAutoAck(other.getAutoAck()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Get parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Get) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object destination_ = ""; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string destination = 1; - */ - public Builder setDestination( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string client_id = 2; - */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private int fetchSize_ ; - /** - * optional int32 fetch_size = 3; - */ - public boolean hasFetchSize() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int32 fetch_size = 3; - */ - public int getFetchSize() { - return fetchSize_; - } - /** - * optional int32 fetch_size = 3; - */ - public Builder setFetchSize(int value) { - bitField0_ |= 0x00000004; - fetchSize_ = value; - onChanged(); - return this; - } - /** - * optional int32 fetch_size = 3; - */ - public Builder clearFetchSize() { - bitField0_ = (bitField0_ & ~0x00000004); - fetchSize_ = 0; - onChanged(); - return this; - } - - private long timeout_ = -1L; - /** - * optional int64 timeout = 4 [default = -1]; - * - *
      -       * 默认-1时代表不控制
      -       * 
      - */ - public boolean hasTimeout() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - /** - * optional int64 timeout = 4 [default = -1]; - * - *
      -       * 默认-1时代表不控制
      -       * 
      - */ - public long getTimeout() { - return timeout_; - } - /** - * optional int64 timeout = 4 [default = -1]; - * - *
      -       * 默认-1时代表不控制
      -       * 
      - */ - public Builder setTimeout(long value) { - bitField0_ |= 0x00000008; - timeout_ = value; - onChanged(); - return this; - } - /** - * optional int64 timeout = 4 [default = -1]; - * - *
      -       * 默认-1时代表不控制
      -       * 
      - */ - public Builder clearTimeout() { - bitField0_ = (bitField0_ & ~0x00000008); - timeout_ = -1L; - onChanged(); - return this; - } - - private int unit_ = 2; - /** - * optional int32 unit = 5 [default = 2]; - * - *
      -       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      -       * 
      - */ - public boolean hasUnit() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional int32 unit = 5 [default = 2]; - * - *
      -       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      -       * 
      - */ - public int getUnit() { - return unit_; - } - /** - * optional int32 unit = 5 [default = 2]; - * - *
      -       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      -       * 
      - */ - public Builder setUnit(int value) { - bitField0_ |= 0x00000010; - unit_ = value; - onChanged(); - return this; - } - /** - * optional int32 unit = 5 [default = 2]; - * - *
      -       * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      -       * 
      - */ - public Builder clearUnit() { - bitField0_ = (bitField0_ & ~0x00000010); - unit_ = 2; - onChanged(); - return this; - } - - private boolean autoAck_ ; - /** - * optional bool auto_ack = 6 [default = false]; - * - *
      -       * 是否自动ack
      -       * 
      - */ - public boolean hasAutoAck() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - /** - * optional bool auto_ack = 6 [default = false]; - * - *
      -       * 是否自动ack
      -       * 
      - */ - public boolean getAutoAck() { - return autoAck_; - } - /** - * optional bool auto_ack = 6 [default = false]; - * - *
      -       * 是否自动ack
      -       * 
      - */ - public Builder setAutoAck(boolean value) { - bitField0_ |= 0x00000020; - autoAck_ = value; - onChanged(); - return this; - } - /** - * optional bool auto_ack = 6 [default = false]; - * - *
      -       * 是否自动ack
      -       * 
      - */ - public Builder clearAutoAck() { - bitField0_ = (bitField0_ & ~0x00000020); - autoAck_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Get) - } - - static { - defaultInstance = new Get(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Get) - } - - public interface MessagesOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Messages) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 batch_id = 1; - */ - boolean hasBatchId(); - /** - * optional int64 batch_id = 1; - */ - long getBatchId(); - - /** - * repeated bytes messages = 2; - */ - java.util.List getMessagesList(); - /** - * repeated bytes messages = 2; - */ - int getMessagesCount(); - /** - * repeated bytes messages = 2; - */ - com.google.protobuf.ByteString getMessages(int index); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Messages} - * - *
      -   * 
      - */ - public static final class Messages extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Messages) - MessagesOrBuilder { - // Use Messages.newBuilder() to construct. - private Messages(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Messages(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Messages defaultInstance; - public static Messages getDefaultInstance() { - return defaultInstance; - } - - public Messages getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Messages( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; } - case 8: { - bitField0_ |= 0x00000001; - batchId_ = input.readInt64(); - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Get.class, + com.alibaba.otter.canal.protocol.CanalPacket.Get.Builder.class); } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - messages_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - messages_.add(input.readBytes()); - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.Get.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + fetchSize_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + timeout_ = -1L; + bitField0_ = (bitField0_ & ~0x00000008); + unit_ = 2; + bitField0_ = (bitField0_ & ~0x00000010); + autoAck_ = false; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Get getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Get build() { + com.alibaba.otter.canal.protocol.CanalPacket.Get result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Get buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Get result = new com.alibaba.otter.canal.protocol.CanalPacket.Get(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.fetchSize_ = fetchSize_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.timeout_ = timeout_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.unit_ = unit_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.autoAck_ = autoAck_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Get) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Get) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Get other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Get.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasFetchSize()) { + setFetchSize(other.getFetchSize()); + } + if (other.hasTimeout()) { + setTimeout(other.getTimeout()); + } + if (other.hasUnit()) { + setUnit(other.getUnit()); + } + if (other.hasAutoAck()) { + setAutoAck(other.getAutoAck()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Get parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Get) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object destination_ = ""; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string destination = 1; + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string client_id = 2; + */ + public Builder setClientId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private int fetchSize_; + + /** + * optional int32 fetch_size = 3; + */ + public boolean hasFetchSize() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int32 fetch_size = 3; + */ + public int getFetchSize() { + return fetchSize_; + } + + /** + * optional int32 fetch_size = 3; + */ + public Builder setFetchSize(int value) { + bitField0_ |= 0x00000004; + fetchSize_ = value; + onChanged(); + return this; + } + + /** + * optional int32 fetch_size = 3; + */ + public Builder clearFetchSize() { + bitField0_ = (bitField0_ & ~0x00000004); + fetchSize_ = 0; + onChanged(); + return this; + } + + private long timeout_ = -1L; + + /** + * optional int64 timeout = 4 [default = -1]; + * + *
      +             * 默认-1时代表不控制
      +             * 
      + */ + public boolean hasTimeout() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + + /** + * optional int64 timeout = 4 [default = -1]; + * + *
      +             * 默认-1时代表不控制
      +             * 
      + */ + public long getTimeout() { + return timeout_; + } + + /** + * optional int64 timeout = 4 [default = -1]; + * + *
      +             * 默认-1时代表不控制
      +             * 
      + */ + public Builder setTimeout(long value) { + bitField0_ |= 0x00000008; + timeout_ = value; + onChanged(); + return this; + } + + /** + * optional int64 timeout = 4 [default = -1]; + * + *
      +             * 默认-1时代表不控制
      +             * 
      + */ + public Builder clearTimeout() { + bitField0_ = (bitField0_ & ~0x00000008); + timeout_ = -1L; + onChanged(); + return this; + } + + private int unit_ = 2; + + /** + * optional int32 unit = 5 [default = 2]; + * + *
      +             * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      +             * 
      + */ + public boolean hasUnit() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + + /** + * optional int32 unit = 5 [default = 2]; + * + *
      +             * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      +             * 
      + */ + public int getUnit() { + return unit_; + } + + /** + * optional int32 unit = 5 [default = 2]; + * + *
      +             * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      +             * 
      + */ + public Builder setUnit(int value) { + bitField0_ |= 0x00000010; + unit_ = value; + onChanged(); + return this; + } + + /** + * optional int32 unit = 5 [default = 2]; + * + *
      +             * 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
      +             * 
      + */ + public Builder clearUnit() { + bitField0_ = (bitField0_ & ~0x00000010); + unit_ = 2; + onChanged(); + return this; + } + + private boolean autoAck_; + + /** + * optional bool auto_ack = 6 [default = false]; + * + *
      +             * 是否自动ack
      +             * 
      + */ + public boolean hasAutoAck() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + + /** + * optional bool auto_ack = 6 [default = false]; + * + *
      +             * 是否自动ack
      +             * 
      + */ + public boolean getAutoAck() { + return autoAck_; + } + + /** + * optional bool auto_ack = 6 [default = false]; + * + *
      +             * 是否自动ack
      +             * 
      + */ + public Builder setAutoAck(boolean value) { + bitField0_ |= 0x00000020; + autoAck_ = value; + onChanged(); + return this; + } + + /** + * optional bool auto_ack = 6 [default = false]; + * + *
      +             * 是否自动ack
      +             * 
      + */ + public Builder clearAutoAck() { + bitField0_ = (bitField0_ & ~0x00000020); + autoAck_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Get) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - messages_ = java.util.Collections.unmodifiableList(messages_); + + static { + defaultInstance = new Get(true); + defaultInstance.initFields(); } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Get) } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Messages.class, com.alibaba.otter.canal.protocol.CanalPacket.Messages.Builder.class); + public interface MessagesOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Messages) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 batch_id = 1; + */ + boolean hasBatchId(); + + /** + * optional int64 batch_id = 1; + */ + long getBatchId(); + + /** + * repeated bytes messages = 2; + */ + java.util.List getMessagesList(); + + /** + * repeated bytes messages = 2; + */ + int getMessagesCount(); + + /** + * repeated bytes messages = 2; + */ + com.google.protobuf.ByteString getMessages(int index); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Messages parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Messages(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int BATCH_ID_FIELD_NUMBER = 1; - private long batchId_; - /** - * optional int64 batch_id = 1; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 batch_id = 1; - */ - public long getBatchId() { - return batchId_; - } - - public static final int MESSAGES_FIELD_NUMBER = 2; - private java.util.List messages_; - /** - * repeated bytes messages = 2; - */ - public java.util.List - getMessagesList() { - return messages_; - } - /** - * repeated bytes messages = 2; - */ - public int getMessagesCount() { - return messages_.size(); - } - /** - * repeated bytes messages = 2; - */ - public com.google.protobuf.ByteString getMessages(int index) { - return messages_.get(index); - } - - private void initFields() { - batchId_ = 0L; - messages_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, batchId_); - } - for (int i = 0; i < messages_.size(); i++) { - output.writeBytes(2, messages_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, batchId_); - } - { - int dataSize = 0; - for (int i = 0; i < messages_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(messages_.get(i)); - } - size += dataSize; - size += 1 * getMessagesList().size(); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Messages prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Messages} * *
            * 
      */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Messages extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Messages) + MessagesOrBuilder { + + // Use Messages.newBuilder() to construct. + private Messages(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Messages(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Messages defaultInstance; + + public static Messages getDefaultInstance() { + return defaultInstance; + } + + public Messages getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Messages(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + batchId_ = input.readInt64(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + messages_.add(input.readBytes()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Messages.class, + com.alibaba.otter.canal.protocol.CanalPacket.Messages.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public Messages parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Messages(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int BATCH_ID_FIELD_NUMBER = 1; + private long batchId_; + + /** + * optional int64 batch_id = 1; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int64 batch_id = 1; + */ + public long getBatchId() { + return batchId_; + } + + public static final int MESSAGES_FIELD_NUMBER = 2; + private java.util.List messages_; + + /** + * repeated bytes messages = 2; + */ + public java.util.List getMessagesList() { + return messages_; + } + + /** + * repeated bytes messages = 2; + */ + public int getMessagesCount() { + return messages_.size(); + } + + /** + * repeated bytes messages = 2; + */ + public com.google.protobuf.ByteString getMessages(int index) { + return messages_.get(index); + } + + private void initFields() { + batchId_ = 0L; + messages_ = java.util.Collections.emptyList(); + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, batchId_); + } + for (int i = 0; i < messages_.size(); i++) { + output.writeBytes(2, messages_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, batchId_); + } + { + int dataSize = 0; + for (int i = 0; i < messages_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(messages_.get(i)); + } + size += dataSize; + size += 1 * getMessagesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Messages parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Messages prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Messages} + * + *
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Messages) com.alibaba.otter.canal.protocol.CanalPacket.MessagesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Messages.class, com.alibaba.otter.canal.protocol.CanalPacket.Messages.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Messages.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - batchId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - messages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Messages getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Messages build() { - com.alibaba.otter.canal.protocol.CanalPacket.Messages result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Messages buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Messages result = new com.alibaba.otter.canal.protocol.CanalPacket.Messages(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.batchId_ = batchId_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - messages_ = java.util.Collections.unmodifiableList(messages_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.messages_ = messages_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Messages) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Messages)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Messages other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance()) return this; - if (other.hasBatchId()) { - setBatchId(other.getBatchId()); - } - if (!other.messages_.isEmpty()) { - if (messages_.isEmpty()) { - messages_ = other.messages_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureMessagesIsMutable(); - messages_.addAll(other.messages_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Messages parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Messages) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long batchId_ ; - /** - * optional int64 batch_id = 1; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 batch_id = 1; - */ - public long getBatchId() { - return batchId_; - } - /** - * optional int64 batch_id = 1; - */ - public Builder setBatchId(long value) { - bitField0_ |= 0x00000001; - batchId_ = value; - onChanged(); - return this; - } - /** - * optional int64 batch_id = 1; - */ - public Builder clearBatchId() { - bitField0_ = (bitField0_ & ~0x00000001); - batchId_ = 0L; - onChanged(); - return this; - } - - private java.util.List messages_ = java.util.Collections.emptyList(); - private void ensureMessagesIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - messages_ = new java.util.ArrayList(messages_); - bitField0_ |= 0x00000002; - } - } - /** - * repeated bytes messages = 2; - */ - public java.util.List - getMessagesList() { - return java.util.Collections.unmodifiableList(messages_); - } - /** - * repeated bytes messages = 2; - */ - public int getMessagesCount() { - return messages_.size(); - } - /** - * repeated bytes messages = 2; - */ - public com.google.protobuf.ByteString getMessages(int index) { - return messages_.get(index); - } - /** - * repeated bytes messages = 2; - */ - public Builder setMessages( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.set(index, value); - onChanged(); - return this; - } - /** - * repeated bytes messages = 2; - */ - public Builder addMessages(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.add(value); - onChanged(); - return this; - } - /** - * repeated bytes messages = 2; - */ - public Builder addAllMessages( - java.lang.Iterable values) { - ensureMessagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, messages_); - onChanged(); - return this; - } - /** - * repeated bytes messages = 2; - */ - public Builder clearMessages() { - messages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Messages) - } - - static { - defaultInstance = new Messages(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Messages) - } - - public interface DumpOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Dump) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string journal = 1; - */ - boolean hasJournal(); - /** - * optional string journal = 1; - */ - java.lang.String getJournal(); - /** - * optional string journal = 1; - */ - com.google.protobuf.ByteString - getJournalBytes(); - - /** - * optional int64 position = 2; - */ - boolean hasPosition(); - /** - * optional int64 position = 2; - */ - long getPosition(); - - /** - * optional int64 timestamp = 3 [default = 0]; - */ - boolean hasTimestamp(); - /** - * optional int64 timestamp = 3 [default = 0]; - */ - long getTimestamp(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.Dump} - * - *
      -   * TBD when new packets are required
      -   * 
      - */ - public static final class Dump extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Dump) - DumpOrBuilder { - // Use Dump.newBuilder() to construct. - private Dump(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Dump(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Dump defaultInstance; - public static Dump getDefaultInstance() { - return defaultInstance; - } - - public Dump getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Dump( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - journal_ = bs; - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Messages.class, + com.alibaba.otter.canal.protocol.CanalPacket.Messages.Builder.class); } - case 16: { - bitField0_ |= 0x00000002; - position_ = input.readInt64(); - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.Messages.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 24: { - bitField0_ |= 0x00000004; - timestamp_ = input.readInt64(); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + batchId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Messages getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Messages build() { + com.alibaba.otter.canal.protocol.CanalPacket.Messages result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Messages buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Messages result = new com.alibaba.otter.canal.protocol.CanalPacket.Messages(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.batchId_ = batchId_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.messages_ = messages_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Messages) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Messages) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Messages other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Messages.getDefaultInstance()) return this; + if (other.hasBatchId()) { + setBatchId(other.getBatchId()); + } + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Messages parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Messages) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long batchId_; + + /** + * optional int64 batch_id = 1; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional int64 batch_id = 1; + */ + public long getBatchId() { + return batchId_; + } + + /** + * optional int64 batch_id = 1; + */ + public Builder setBatchId(long value) { + bitField0_ |= 0x00000001; + batchId_ = value; + onChanged(); + return this; + } + + /** + * optional int64 batch_id = 1; + */ + public Builder clearBatchId() { + bitField0_ = (bitField0_ & ~0x00000001); + batchId_ = 0L; + onChanged(); + return this; + } + + private java.util.List messages_ = java.util.Collections.emptyList(); + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = new java.util.ArrayList(messages_); + bitField0_ |= 0x00000002; + } + } + + /** + * repeated bytes messages = 2; + */ + public java.util.List getMessagesList() { + return java.util.Collections.unmodifiableList(messages_); + } + + /** + * repeated bytes messages = 2; + */ + public int getMessagesCount() { + return messages_.size(); + } + + /** + * repeated bytes messages = 2; + */ + public com.google.protobuf.ByteString getMessages(int index) { + return messages_.get(index); + } + + /** + * repeated bytes messages = 2; + */ + public Builder setMessages(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + return this; + } + + /** + * repeated bytes messages = 2; + */ + public Builder addMessages(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + return this; + } + + /** + * repeated bytes messages = 2; + */ + public Builder addAllMessages(java.lang.Iterable values) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + return this; + } + + /** + * repeated bytes messages = 2; + */ + public Builder clearMessages() { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Messages) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Dump parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Dump(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int JOURNAL_FIELD_NUMBER = 1; - private java.lang.Object journal_; - /** - * optional string journal = 1; - */ - public boolean hasJournal() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string journal = 1; - */ - public java.lang.String getJournal() { - java.lang.Object ref = journal_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - journal_ = s; + static { + defaultInstance = new Messages(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * optional string journal = 1; - */ - public com.google.protobuf.ByteString - getJournalBytes() { - java.lang.Object ref = journal_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - journal_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Messages) } - public static final int POSITION_FIELD_NUMBER = 2; - private long position_; - /** - * optional int64 position = 2; - */ - public boolean hasPosition() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int64 position = 2; - */ - public long getPosition() { - return position_; + public interface DumpOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.Dump) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string journal = 1; + */ + boolean hasJournal(); + + /** + * optional string journal = 1; + */ + java.lang.String getJournal(); + + /** + * optional string journal = 1; + */ + com.google.protobuf.ByteString getJournalBytes(); + + /** + * optional int64 position = 2; + */ + boolean hasPosition(); + + /** + * optional int64 position = 2; + */ + long getPosition(); + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + boolean hasTimestamp(); + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + long getTimestamp(); } - public static final int TIMESTAMP_FIELD_NUMBER = 3; - private long timestamp_; - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public boolean hasTimestamp() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public long getTimestamp() { - return timestamp_; - } - - private void initFields() { - journal_ = ""; - position_ = 0L; - timestamp_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getJournalBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt64(2, position_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt64(3, timestamp_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getJournalBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, position_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, timestamp_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Dump prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.Dump} * @@ -8458,1198 +8382,1469 @@ public final class CanalPacket { * TBD when new packets are required * */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class Dump extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.Dump) + DumpOrBuilder { + + // Use Dump.newBuilder() to construct. + private Dump(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private Dump(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final Dump defaultInstance; + + public static Dump getDefaultInstance() { + return defaultInstance; + } + + public Dump getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Dump(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + journal_ = bs; + break; + } + case 16: { + bitField0_ |= 0x00000002; + position_ = input.readInt64(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + timestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, + com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public Dump parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Dump(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int JOURNAL_FIELD_NUMBER = 1; + private java.lang.Object journal_; + + /** + * optional string journal = 1; + */ + public boolean hasJournal() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string journal = 1; + */ + public java.lang.String getJournal() { + java.lang.Object ref = journal_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + journal_ = s; + } + return s; + } + } + + /** + * optional string journal = 1; + */ + public com.google.protobuf.ByteString getJournalBytes() { + java.lang.Object ref = journal_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + journal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POSITION_FIELD_NUMBER = 2; + private long position_; + + /** + * optional int64 position = 2; + */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional int64 position = 2; + */ + public long getPosition() { + return position_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private long timestamp_; + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public long getTimestamp() { + return timestamp_; + } + + private void initFields() { + journal_ = ""; + position_ = 0L; + timestamp_ = 0L; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getJournalBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt64(2, position_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(3, timestamp_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getJournalBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, position_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, timestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.Dump parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.Dump prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.Dump} + * + *
      +         * TBD when new packets are required
      +         * 
      + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.Dump) com.alibaba.otter.canal.protocol.CanalPacket.DumpOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class); - } - - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.Dump.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - journal_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - position_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - timestamp_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Dump getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Dump build() { - com.alibaba.otter.canal.protocol.CanalPacket.Dump result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.Dump buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.Dump result = new com.alibaba.otter.canal.protocol.CanalPacket.Dump(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.journal_ = journal_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.position_ = position_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.timestamp_ = timestamp_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Dump) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Dump)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Dump other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance()) return this; - if (other.hasJournal()) { - bitField0_ |= 0x00000001; - journal_ = other.journal_; - onChanged(); - } - if (other.hasPosition()) { - setPosition(other.getPosition()); - } - if (other.hasTimestamp()) { - setTimestamp(other.getTimestamp()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.Dump parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Dump) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object journal_ = ""; - /** - * optional string journal = 1; - */ - public boolean hasJournal() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string journal = 1; - */ - public java.lang.String getJournal() { - java.lang.Object ref = journal_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - journal_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string journal = 1; - */ - public com.google.protobuf.ByteString - getJournalBytes() { - java.lang.Object ref = journal_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - journal_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string journal = 1; - */ - public Builder setJournal( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - journal_ = value; - onChanged(); - return this; - } - /** - * optional string journal = 1; - */ - public Builder clearJournal() { - bitField0_ = (bitField0_ & ~0x00000001); - journal_ = getDefaultInstance().getJournal(); - onChanged(); - return this; - } - /** - * optional string journal = 1; - */ - public Builder setJournalBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - journal_ = value; - onChanged(); - return this; - } - - private long position_ ; - /** - * optional int64 position = 2; - */ - public boolean hasPosition() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional int64 position = 2; - */ - public long getPosition() { - return position_; - } - /** - * optional int64 position = 2; - */ - public Builder setPosition(long value) { - bitField0_ |= 0x00000002; - position_ = value; - onChanged(); - return this; - } - /** - * optional int64 position = 2; - */ - public Builder clearPosition() { - bitField0_ = (bitField0_ & ~0x00000002); - position_ = 0L; - onChanged(); - return this; - } - - private long timestamp_ ; - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public boolean hasTimestamp() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public long getTimestamp() { - return timestamp_; - } - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public Builder setTimestamp(long value) { - bitField0_ |= 0x00000004; - timestamp_ = value; - onChanged(); - return this; - } - /** - * optional int64 timestamp = 3 [default = 0]; - */ - public Builder clearTimestamp() { - bitField0_ = (bitField0_ & ~0x00000004); - timestamp_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Dump) - } - - static { - defaultInstance = new Dump(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Dump) - } - - public interface ClientRollbackOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientRollback) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string destination = 1; - */ - boolean hasDestination(); - /** - * optional string destination = 1; - */ - java.lang.String getDestination(); - /** - * optional string destination = 1; - */ - com.google.protobuf.ByteString - getDestinationBytes(); - - /** - * optional string client_id = 2; - */ - boolean hasClientId(); - /** - * optional string client_id = 2; - */ - java.lang.String getClientId(); - /** - * optional string client_id = 2; - */ - com.google.protobuf.ByteString - getClientIdBytes(); - - /** - * optional int64 batch_id = 3; - */ - boolean hasBatchId(); - /** - * optional int64 batch_id = 3; - */ - long getBatchId(); - } - /** - * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientRollback} - */ - public static final class ClientRollback extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientRollback) - ClientRollbackOrBuilder { - // Use ClientRollback.newBuilder() to construct. - private ClientRollback(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private ClientRollback(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final ClientRollback defaultInstance; - public static ClientRollback getDefaultInstance() { - return defaultInstance; - } - - public ClientRollback getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ClientRollback( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; } - case 10: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000001; - destination_ = bs; - break; + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.Dump.class, + com.alibaba.otter.canal.protocol.CanalPacket.Dump.Builder.class); } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - clientId_ = bs; - break; + + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.Dump.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); } - case 24: { - bitField0_ |= 0x00000004; - batchId_ = input.readInt64(); - break; + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); } - } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + journal_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + position_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + timestamp_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Dump getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Dump build() { + com.alibaba.otter.canal.protocol.CanalPacket.Dump result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.Dump buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.Dump result = new com.alibaba.otter.canal.protocol.CanalPacket.Dump(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.journal_ = journal_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.position_ = position_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.timestamp_ = timestamp_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.Dump) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.Dump) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.Dump other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.Dump.getDefaultInstance()) return this; + if (other.hasJournal()) { + bitField0_ |= 0x00000001; + journal_ = other.journal_; + onChanged(); + } + if (other.hasPosition()) { + setPosition(other.getPosition()); + } + if (other.hasTimestamp()) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.Dump parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Dump) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object journal_ = ""; + + /** + * optional string journal = 1; + */ + public boolean hasJournal() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string journal = 1; + */ + public java.lang.String getJournal() { + java.lang.Object ref = journal_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + journal_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string journal = 1; + */ + public com.google.protobuf.ByteString getJournalBytes() { + java.lang.Object ref = journal_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + journal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string journal = 1; + */ + public Builder setJournal(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + journal_ = value; + onChanged(); + return this; + } + + /** + * optional string journal = 1; + */ + public Builder clearJournal() { + bitField0_ = (bitField0_ & ~0x00000001); + journal_ = getDefaultInstance().getJournal(); + onChanged(); + return this; + } + + /** + * optional string journal = 1; + */ + public Builder setJournalBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + journal_ = value; + onChanged(); + return this; + } + + private long position_; + + /** + * optional int64 position = 2; + */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional int64 position = 2; + */ + public long getPosition() { + return position_; + } + + /** + * optional int64 position = 2; + */ + public Builder setPosition(long value) { + bitField0_ |= 0x00000002; + position_ = value; + onChanged(); + return this; + } + + /** + * optional int64 position = 2; + */ + public Builder clearPosition() { + bitField0_ = (bitField0_ & ~0x00000002); + position_ = 0L; + onChanged(); + return this; + } + + private long timestamp_; + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public long getTimestamp() { + return timestamp_; + } + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public Builder setTimestamp(long value) { + bitField0_ |= 0x00000004; + timestamp_ = value; + onChanged(); + return this; + } + + /** + * optional int64 timestamp = 3 [default = 0]; + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + timestamp_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.Dump) } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public ClientRollback parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClientRollback(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int DESTINATION_FIELD_NUMBER = 1; - private java.lang.Object destination_; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; + static { + defaultInstance = new Dump(true); + defaultInstance.initFields(); } - return s; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.Dump) } - public static final int CLIENT_ID_FIELD_NUMBER = 2; - private java.lang.Object clientId_; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public interface ClientRollbackOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.alibaba.otter.canal.protocol.ClientRollback) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string destination = 1; + */ + boolean hasDestination(); + + /** + * optional string destination = 1; + */ + java.lang.String getDestination(); + + /** + * optional string destination = 1; + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * optional string client_id = 2; + */ + boolean hasClientId(); + + /** + * optional string client_id = 2; + */ + java.lang.String getClientId(); + + /** + * optional string client_id = 2; + */ + com.google.protobuf.ByteString getClientIdBytes(); + + /** + * optional int64 batch_id = 3; + */ + boolean hasBatchId(); + + /** + * optional int64 batch_id = 3; + */ + long getBatchId(); } - public static final int BATCH_ID_FIELD_NUMBER = 3; - private long batchId_; - /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 batch_id = 3; - */ - public long getBatchId() { - return batchId_; - } - - private void initFields() { - destination_ = ""; - clientId_ = ""; - batchId_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt64(3, batchId_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getDestinationBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getClientIdBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, batchId_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } /** * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientRollback} */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + public static final class ClientRollback extends com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:com.alibaba.otter.canal.protocol.ClientRollback) + ClientRollbackOrBuilder { + + // Use ClientRollback.newBuilder() to construct. + private ClientRollback(com.google.protobuf.GeneratedMessage.Builder builder){ + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + + private ClientRollback(boolean noInit){ + this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + + private static final ClientRollback defaultInstance; + + public static ClientRollback getDefaultInstance() { + return defaultInstance; + } + + public ClientRollback getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClientRollback(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException{ + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + destination_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + clientId_ = bs; + break; + } + case 24: { + bitField0_ |= 0x00000004; + batchId_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + + public ClientRollback parsePartialFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientRollback(input, + extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + private java.lang.Object destination_; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLIENT_ID_FIELD_NUMBER = 2; + private java.lang.Object clientId_; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BATCH_ID_FIELD_NUMBER = 3; + private long batchId_; + + /** + * optional int64 batch_id = 3; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int64 batch_id = 3; + */ + public long getBatchId() { + return batchId_; + } + + private void initFields() { + destination_ = ""; + clientId_ = ""; + batchId_ = 0L; + } + + private byte memoizedIsInitialized = -1; + + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt64(3, batchId_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, getDestinationBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, getClientIdBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, batchId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + + @java.lang.Override + protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseDelimitedFrom(java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + + public static com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parseFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { + return Builder.create(); + } + + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback prototype) { + return newBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return newBuilder(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code com.alibaba.otter.canal.protocol.ClientRollback} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:com.alibaba.otter.canal.protocol.ClientRollback) com.alibaba.otter.canal.protocol.CanalPacket.ClientRollbackOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class); - } + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; + } - // Construct using com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable.ensureFieldAccessorsInitialized(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.class, + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.Builder.class); + } - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + // Construct using + // com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.newBuilder() + private Builder(){ + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent){ + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + destination_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + clientId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + batchId_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback getDefaultInstanceForType() { + return com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance(); + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback build() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback buildPartial() { + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.destination_ = destination_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.clientId_ = clientId_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.batchId_ = batchId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) { + return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback other) { + if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance()) return this; + if (other.hasDestination()) { + bitField0_ |= 0x00000001; + destination_ = other.destination_; + onChanged(); + } + if (other.hasClientId()) { + bitField0_ |= 0x00000002; + clientId_ = other.clientId_; + onChanged(); + } + if (other.hasBatchId()) { + setBatchId(other.getBatchId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom(com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object destination_ = ""; + + /** + * optional string destination = 1; + */ + public boolean hasDestination() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + + /** + * optional string destination = 1; + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + destination_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string destination = 1; + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string destination = 1; + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = getDefaultInstance().getDestination(); + onChanged(); + return this; + } + + /** + * optional string destination = 1; + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value; + onChanged(); + return this; + } + + private java.lang.Object clientId_ = ""; + + /** + * optional string client_id = 2; + */ + public boolean hasClientId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + + /** + * optional string client_id = 2; + */ + public java.lang.String getClientId() { + java.lang.Object ref = clientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + clientId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string client_id = 2; + */ + public com.google.protobuf.ByteString getClientIdBytes() { + java.lang.Object ref = clientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string client_id = 2; + */ + public Builder setClientId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder clearClientId() { + bitField0_ = (bitField0_ & ~0x00000002); + clientId_ = getDefaultInstance().getClientId(); + onChanged(); + return this; + } + + /** + * optional string client_id = 2; + */ + public Builder setClientIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + clientId_ = value; + onChanged(); + return this; + } + + private long batchId_; + + /** + * optional int64 batch_id = 3; + */ + public boolean hasBatchId() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + + /** + * optional int64 batch_id = 3; + */ + public long getBatchId() { + return batchId_; + } + + /** + * optional int64 batch_id = 3; + */ + public Builder setBatchId(long value) { + bitField0_ |= 0x00000004; + batchId_ = value; + onChanged(); + return this; + } + + /** + * optional int64 batch_id = 3; + */ + public Builder clearBatchId() { + bitField0_ = (bitField0_ & ~0x00000004); + batchId_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientRollback) } - } - private static Builder create() { - return new Builder(); - } - public Builder clear() { - super.clear(); - destination_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - clientId_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - batchId_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback getDefaultInstanceForType() { - return com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance(); - } - - public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback build() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + static { + defaultInstance = new ClientRollback(true); + defaultInstance.initFields(); } - return result; - } - public com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback buildPartial() { - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback result = new com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.destination_ = destination_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.clientId_ = clientId_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.batchId_ = batchId_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) { - return mergeFrom((com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback other) { - if (other == com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback.getDefaultInstance()) return this; - if (other.hasDestination()) { - bitField0_ |= 0x00000001; - destination_ = other.destination_; - onChanged(); - } - if (other.hasClientId()) { - bitField0_ |= 0x00000002; - clientId_ = other.clientId_; - onChanged(); - } - if (other.hasBatchId()) { - setBatchId(other.getBatchId()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object destination_ = ""; - /** - * optional string destination = 1; - */ - public boolean hasDestination() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional string destination = 1; - */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - destination_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string destination = 1; - */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string destination = 1; - */ - public Builder setDestination( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder clearDestination() { - bitField0_ = (bitField0_ & ~0x00000001); - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - /** - * optional string destination = 1; - */ - public Builder setDestinationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - /** - * optional string client_id = 2; - */ - public boolean hasClientId() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * optional string client_id = 2; - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - clientId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string client_id = 2; - */ - public com.google.protobuf.ByteString - getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string client_id = 2; - */ - public Builder setClientId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder clearClientId() { - bitField0_ = (bitField0_ & ~0x00000002); - clientId_ = getDefaultInstance().getClientId(); - onChanged(); - return this; - } - /** - * optional string client_id = 2; - */ - public Builder setClientIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - clientId_ = value; - onChanged(); - return this; - } - - private long batchId_ ; - /** - * optional int64 batch_id = 3; - */ - public boolean hasBatchId() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional int64 batch_id = 3; - */ - public long getBatchId() { - return batchId_; - } - /** - * optional int64 batch_id = 3; - */ - public Builder setBatchId(long value) { - bitField0_ |= 0x00000004; - batchId_ = value; - onChanged(); - return this; - } - /** - * optional int64 batch_id = 3; - */ - public Builder clearBatchId() { - bitField0_ = (bitField0_ & ~0x00000004); - batchId_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:com.alibaba.otter.canal.protocol.ClientRollback) + // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientRollback) } + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; + private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { - defaultInstance = new ClientRollback(true); - defaultInstance.initFields(); + java.lang.String[] descriptorData = { + "\n\023CanalProtocol.proto\022 com.alibaba.otter" + + ".canal.protocol\"\312\001\n\006Packet\022\030\n\014magic_numb" + + "er\030\001 \001(\005:\00217\022\022\n\007version\030\002 \001(\005:\0011\022:\n\004type" + + "\030\003 \001(\0162,.com.alibaba.otter.canal.protoco" + + "l.PacketType\022H\n\013compression\030\004 \001(\0162-.com." + + "alibaba.otter.canal.protocol.Compression" + + ":\004NONE\022\014\n\004body\030\005 \001(\014\"<\n\tHeartBeat\022\026\n\016sen" + + "d_timestamp\030\001 \001(\003\022\027\n\017start_timestamp\030\002 \001" + + "(\003\"\217\001\n\tHandshake\022$\n\026communication_encodi" + + "ng\030\001 \001(\t:\004utf8\022\r\n\005seeds\030\002 \001(\014\022M\n\026support", + "ed_compressions\030\003 \003(\0162-.com.alibaba.otte" + + "r.canal.protocol.Compression\"\274\001\n\nClientA" + + "uth\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\014\022" + + "\033\n\020net_read_timeout\030\003 \001(\005:\0010\022\034\n\021net_writ" + + "e_timeout\030\004 \001(\005:\0010\022\023\n\013destination\030\005 \001(\t\022" + + "\021\n\tclient_id\030\006 \001(\t\022\016\n\006filter\030\007 \001(\t\022\027\n\017st" + + "art_timestamp\030\010 \001(\003\"3\n\003Ack\022\025\n\nerror_code" + + "\030\001 \001(\005:\0010\022\025\n\rerror_message\030\002 \001(\t\"E\n\tClie" + + "ntAck\022\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030" + + "\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003\"=\n\003Sub\022\023\n\013destin", + "ation\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022\016\n\006filter" + + "\030\007 \001(\t\"?\n\005Unsub\022\023\n\013destination\030\001 \001(\t\022\021\n\t" + + "client_id\030\002 \001(\t\022\016\n\006filter\030\007 \001(\t\"\200\001\n\003Get\022" + + "\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022" + + "\022\n\nfetch_size\030\003 \001(\005\022\023\n\007timeout\030\004 \001(\003:\002-1" + + "\022\017\n\004unit\030\005 \001(\005:\0012\022\027\n\010auto_ack\030\006 \001(\010:\005fal" + + "se\".\n\010Messages\022\020\n\010batch_id\030\001 \001(\003\022\020\n\010mess" + + "ages\030\002 \003(\014\"?\n\004Dump\022\017\n\007journal\030\001 \001(\t\022\020\n\010p" + + "osition\030\002 \001(\003\022\024\n\ttimestamp\030\003 \001(\003:\0010\"J\n\016C" + + "lientRollback\022\023\n\013destination\030\001 \001(\t\022\021\n\tcl", + "ient_id\030\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003*4\n\013Compr" + + "ession\022\010\n\004NONE\020\001\022\010\n\004ZLIB\020\002\022\010\n\004GZIP\020\003\022\007\n\003" + + "LZF\020\004*\305\001\n\nPacketType\022\r\n\tHANDSHAKE\020\001\022\030\n\024C" + + "LIENTAUTHENTICATION\020\002\022\007\n\003ACK\020\003\022\020\n\014SUBSCR" + + "IPTION\020\004\022\022\n\016UNSUBSCRIPTION\020\005\022\007\n\003GET\020\006\022\014\n" + + "\010MESSAGES\020\007\022\r\n\tCLIENTACK\020\010\022\014\n\010SHUTDOWN\020\t" + + "\022\010\n\004DUMP\020\n\022\r\n\tHEARTBEAT\020\013\022\022\n\016CLIENTROLLB" + + "ACK\020\014B1\n com.alibaba.otter.canal.protoco" + "lB\013CanalPacketH\001" }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + + public com.google.protobuf.ExtensionRegistry assignDescriptors(com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] {}, + assigner); + internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor, + new java.lang.String[] { "MagicNumber", "Version", "Type", "Compression", "Body", }); + internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor = getDescriptor().getMessageTypes() + .get(1); + internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor, + new java.lang.String[] { "SendTimestamp", "StartTimestamp", }); + internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor = getDescriptor().getMessageTypes() + .get(2); + internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor, + new java.lang.String[] { "CommunicationEncoding", "Seeds", "SupportedCompressions", }); + internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor = getDescriptor().getMessageTypes() + .get(3); + internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor, + new java.lang.String[] { "Username", "Password", "NetReadTimeout", "NetWriteTimeout", "Destination", + "ClientId", "Filter", "StartTimestamp", }); + internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor, + new java.lang.String[] { "ErrorCode", "ErrorMessage", }); + internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor = getDescriptor().getMessageTypes() + .get(5); + internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor, + new java.lang.String[] { "Destination", "ClientId", "BatchId", }); + internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor = getDescriptor().getMessageTypes().get(6); + internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor, + new java.lang.String[] { "Destination", "ClientId", "Filter", }); + internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor = getDescriptor().getMessageTypes().get(7); + internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor, + new java.lang.String[] { "Destination", "ClientId", "Filter", }); + internal_static_com_alibaba_otter_canal_protocol_Get_descriptor = getDescriptor().getMessageTypes().get(8); + internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Get_descriptor, + new java.lang.String[] { "Destination", "ClientId", "FetchSize", "Timeout", "Unit", "AutoAck", }); + internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor = getDescriptor().getMessageTypes().get(9); + internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor, + new java.lang.String[] { "BatchId", "Messages", }); + internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor, + new java.lang.String[] { "Journal", "Position", "Timestamp", }); + internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor = getDescriptor().getMessageTypes() + .get(11); + internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor, + new java.lang.String[] { "Destination", "ClientId", "BatchId", }); } - // @@protoc_insertion_point(class_scope:com.alibaba.otter.canal.protocol.ClientRollback) - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Get_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\023CanalProtocol.proto\022 com.alibaba.otter" + - ".canal.protocol\"\312\001\n\006Packet\022\030\n\014magic_numb" + - "er\030\001 \001(\005:\00217\022\022\n\007version\030\002 \001(\005:\0011\022:\n\004type" + - "\030\003 \001(\0162,.com.alibaba.otter.canal.protoco" + - "l.PacketType\022H\n\013compression\030\004 \001(\0162-.com." + - "alibaba.otter.canal.protocol.Compression" + - ":\004NONE\022\014\n\004body\030\005 \001(\014\"<\n\tHeartBeat\022\026\n\016sen" + - "d_timestamp\030\001 \001(\003\022\027\n\017start_timestamp\030\002 \001" + - "(\003\"\217\001\n\tHandshake\022$\n\026communication_encodi" + - "ng\030\001 \001(\t:\004utf8\022\r\n\005seeds\030\002 \001(\014\022M\n\026support", - "ed_compressions\030\003 \003(\0162-.com.alibaba.otte" + - "r.canal.protocol.Compression\"\274\001\n\nClientA" + - "uth\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\014\022" + - "\033\n\020net_read_timeout\030\003 \001(\005:\0010\022\034\n\021net_writ" + - "e_timeout\030\004 \001(\005:\0010\022\023\n\013destination\030\005 \001(\t\022" + - "\021\n\tclient_id\030\006 \001(\t\022\016\n\006filter\030\007 \001(\t\022\027\n\017st" + - "art_timestamp\030\010 \001(\003\"3\n\003Ack\022\025\n\nerror_code" + - "\030\001 \001(\005:\0010\022\025\n\rerror_message\030\002 \001(\t\"E\n\tClie" + - "ntAck\022\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030" + - "\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003\"=\n\003Sub\022\023\n\013destin", - "ation\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022\016\n\006filter" + - "\030\007 \001(\t\"?\n\005Unsub\022\023\n\013destination\030\001 \001(\t\022\021\n\t" + - "client_id\030\002 \001(\t\022\016\n\006filter\030\007 \001(\t\"\200\001\n\003Get\022" + - "\023\n\013destination\030\001 \001(\t\022\021\n\tclient_id\030\002 \001(\t\022" + - "\022\n\nfetch_size\030\003 \001(\005\022\023\n\007timeout\030\004 \001(\003:\002-1" + - "\022\017\n\004unit\030\005 \001(\005:\0012\022\027\n\010auto_ack\030\006 \001(\010:\005fal" + - "se\".\n\010Messages\022\020\n\010batch_id\030\001 \001(\003\022\020\n\010mess" + - "ages\030\002 \003(\014\"?\n\004Dump\022\017\n\007journal\030\001 \001(\t\022\020\n\010p" + - "osition\030\002 \001(\003\022\024\n\ttimestamp\030\003 \001(\003:\0010\"J\n\016C" + - "lientRollback\022\023\n\013destination\030\001 \001(\t\022\021\n\tcl", - "ient_id\030\002 \001(\t\022\020\n\010batch_id\030\003 \001(\003*4\n\013Compr" + - "ession\022\010\n\004NONE\020\001\022\010\n\004ZLIB\020\002\022\010\n\004GZIP\020\003\022\007\n\003" + - "LZF\020\004*\305\001\n\nPacketType\022\r\n\tHANDSHAKE\020\001\022\030\n\024C" + - "LIENTAUTHENTICATION\020\002\022\007\n\003ACK\020\003\022\020\n\014SUBSCR" + - "IPTION\020\004\022\022\n\016UNSUBSCRIPTION\020\005\022\007\n\003GET\020\006\022\014\n" + - "\010MESSAGES\020\007\022\r\n\tCLIENTACK\020\010\022\014\n\010SHUTDOWN\020\t" + - "\022\010\n\004DUMP\020\n\022\r\n\tHEARTBEAT\020\013\022\022\n\016CLIENTROLLB" + - "ACK\020\014B1\n com.alibaba.otter.canal.protoco" + - "lB\013CanalPacketH\001" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_com_alibaba_otter_canal_protocol_Packet_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Packet_descriptor, - new java.lang.String[] { "MagicNumber", "Version", "Type", "Compression", "Body", }); - internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_com_alibaba_otter_canal_protocol_HeartBeat_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_HeartBeat_descriptor, - new java.lang.String[] { "SendTimestamp", "StartTimestamp", }); - internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_com_alibaba_otter_canal_protocol_Handshake_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Handshake_descriptor, - new java.lang.String[] { "CommunicationEncoding", "Seeds", "SupportedCompressions", }); - internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_com_alibaba_otter_canal_protocol_ClientAuth_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_ClientAuth_descriptor, - new java.lang.String[] { "Username", "Password", "NetReadTimeout", "NetWriteTimeout", "Destination", "ClientId", "Filter", "StartTimestamp", }); - internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_com_alibaba_otter_canal_protocol_Ack_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Ack_descriptor, - new java.lang.String[] { "ErrorCode", "ErrorMessage", }); - internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_com_alibaba_otter_canal_protocol_ClientAck_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_ClientAck_descriptor, - new java.lang.String[] { "Destination", "ClientId", "BatchId", }); - internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_com_alibaba_otter_canal_protocol_Sub_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Sub_descriptor, - new java.lang.String[] { "Destination", "ClientId", "Filter", }); - internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_com_alibaba_otter_canal_protocol_Unsub_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Unsub_descriptor, - new java.lang.String[] { "Destination", "ClientId", "Filter", }); - internal_static_com_alibaba_otter_canal_protocol_Get_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_com_alibaba_otter_canal_protocol_Get_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Get_descriptor, - new java.lang.String[] { "Destination", "ClientId", "FetchSize", "Timeout", "Unit", "AutoAck", }); - internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_com_alibaba_otter_canal_protocol_Messages_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Messages_descriptor, - new java.lang.String[] { "BatchId", "Messages", }); - internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_com_alibaba_otter_canal_protocol_Dump_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_Dump_descriptor, - new java.lang.String[] { "Journal", "Position", "Timestamp", }); - internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_com_alibaba_otter_canal_protocol_ClientRollback_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_com_alibaba_otter_canal_protocol_ClientRollback_descriptor, - new java.lang.String[] { "Destination", "ClientId", "BatchId", }); - } - - // @@protoc_insertion_point(outer_class_scope) + // @@protoc_insertion_point(outer_class_scope) } diff --git a/server/pom.xml b/server/pom.xml index 250d4151..5538d9f5 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml canal.server diff --git a/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java b/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java index 7123e389..1d973522 100644 --- a/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java +++ b/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java @@ -131,8 +131,8 @@ public class CanalServerWithEmbedded extends AbstractCanalLifeCycle implements C */ @Override public void subscribe(ClientIdentity clientIdentity) throws CanalServerException { - checkStart(clientIdentity.getDestination()); - + checkStart(clientIdentity.getDestination()); + CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination()); if (!canalInstance.getMetaManager().isStart()) { canalInstance.getMetaManager().start(); diff --git a/server/src/main/java/com/alibaba/otter/canal/server/netty/CanalServerWithNetty.java b/server/src/main/java/com/alibaba/otter/canal/server/netty/CanalServerWithNetty.java index 873bea70..19a7827d 100644 --- a/server/src/main/java/com/alibaba/otter/canal/server/netty/CanalServerWithNetty.java +++ b/server/src/main/java/com/alibaba/otter/canal/server/netty/CanalServerWithNetty.java @@ -9,6 +9,8 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.Channels; +import org.jboss.netty.channel.group.ChannelGroup; +import org.jboss.netty.channel.group.DefaultChannelGroup; import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; import com.alibaba.otter.canal.common.AbstractCanalLifeCycle; @@ -32,6 +34,10 @@ public class CanalServerWithNetty extends AbstractCanalLifeCycle implements Cana private int port; private Channel serverChannel = null; private ServerBootstrap bootstrap = null; + private ChannelGroup childGroups = null; // socket channel + // container, used to + // close sockets + // explicitly. private static class SingletonHolder { @@ -40,6 +46,7 @@ public class CanalServerWithNetty extends AbstractCanalLifeCycle implements Cana private CanalServerWithNetty(){ this.embeddedServer = CanalServerWithEmbedded.instance(); + this.childGroups = new DefaultChannelGroup(); } public static CanalServerWithNetty instance() { @@ -55,6 +62,17 @@ public class CanalServerWithNetty extends AbstractCanalLifeCycle implements Cana this.bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool())); + /* + * enable keep-alive mechanism, handle abnormal network connection + * scenarios on OS level. the threshold parameters are depended on OS. + * e.g. On Linux: net.ipv4.tcp_keepalive_time = 300 + * net.ipv4.tcp_keepalive_probes = 2 net.ipv4.tcp_keepalive_intvl = 30 + */ + bootstrap.setOption("child.keepAlive", true); + /* + * optional parameter. + */ + bootstrap.setOption("child.tcpNoDelay", true); // 构造对应的pipeline bootstrap.setPipelineFactory(new ChannelPipelineFactory() { @@ -62,7 +80,9 @@ public class CanalServerWithNetty extends AbstractCanalLifeCycle implements Cana public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipelines = Channels.pipeline(); pipelines.addLast(FixedHeaderFrameDecoder.class.getName(), new FixedHeaderFrameDecoder()); - pipelines.addLast(HandshakeInitializationHandler.class.getName(), new HandshakeInitializationHandler()); + // support to maintain child socket channel. + pipelines.addLast(HandshakeInitializationHandler.class.getName(), + new HandshakeInitializationHandler(childGroups)); pipelines.addLast(ClientAuthenticationHandler.class.getName(), new ClientAuthenticationHandler(embeddedServer)); @@ -87,6 +107,12 @@ public class CanalServerWithNetty extends AbstractCanalLifeCycle implements Cana this.serverChannel.close().awaitUninterruptibly(1000); } + // close sockets explicitly to reduce socket channel hung in complicated + // network environment. + if (this.childGroups != null) { + this.childGroups.close().awaitUninterruptibly(5000); + } + if (this.bootstrap != null) { this.bootstrap.releaseExternalResources(); } diff --git a/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/ClientAuthenticationHandler.java b/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/ClientAuthenticationHandler.java index 0656e8aa..eaa6b636 100644 --- a/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/ClientAuthenticationHandler.java +++ b/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/ClientAuthenticationHandler.java @@ -1,5 +1,7 @@ package com.alibaba.otter.canal.server.netty.handler; +import java.util.concurrent.TimeUnit; + import org.apache.commons.lang.StringUtils; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.ChannelFuture; @@ -87,10 +89,13 @@ public class ClientAuthenticationHandler extends SimpleChannelHandler { if (clientAuth.getNetWriteTimeout() > 0) { writeTimeout = clientAuth.getNetWriteTimeout(); } + // fix bug: soTimeout parameter's unit from connector is + // millseconds. IdleStateHandler idleStateHandler = new IdleStateHandler(NettyUtils.hashedWheelTimer, readTimeout, writeTimeout, - 0); + 0, + TimeUnit.MILLISECONDS); ctx.getPipeline().addBefore(SessionHandler.class.getName(), IdleStateHandler.class.getName(), idleStateHandler); diff --git a/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/HandshakeInitializationHandler.java b/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/HandshakeInitializationHandler.java index b65ff2a1..178a93dd 100644 --- a/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/HandshakeInitializationHandler.java +++ b/server/src/main/java/com/alibaba/otter/canal/server/netty/handler/HandshakeInitializationHandler.java @@ -3,6 +3,7 @@ package com.alibaba.otter.canal.server.netty.handler; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.SimpleChannelHandler; +import org.jboss.netty.channel.group.ChannelGroup; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,9 +20,21 @@ import com.alibaba.otter.canal.server.netty.NettyUtils; */ public class HandshakeInitializationHandler extends SimpleChannelHandler { + // support to maintain socket channel. + private ChannelGroup childGroups; + + public HandshakeInitializationHandler(ChannelGroup childGroups){ + this.childGroups = childGroups; + } + private static final Logger logger = LoggerFactory.getLogger(HandshakeInitializationHandler.class); public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { + // add new socket channel in channel container, used to manage sockets. + if (childGroups != null) { + childGroups.add(ctx.getChannel()); + } + byte[] body = Packet.newBuilder() .setType(CanalPacket.PacketType.HANDSHAKE) .setBody(Handshake.newBuilder().build().toByteString()) diff --git a/sink/pom.xml b/sink/pom.xml index 3348e0aa..bffb8bdf 100644 --- a/sink/pom.xml +++ b/sink/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/store/pom.xml b/store/pom.xml index 4c8ded43..a0b478fd 100644 --- a/store/pom.xml +++ b/store/pom.xml @@ -3,7 +3,7 @@ com.alibaba.otter canal - 1.0.24-SNAPSHOT + 1.0.25-SNAPSHOT ../pom.xml com.alibaba.otter diff --git a/store/src/test/java/com/alibaba/otter/cancel/store/memory/buffer/MemoryEventStoreMultiThreadTest.java b/store/src/test/java/com/alibaba/otter/cancel/store/memory/buffer/MemoryEventStoreMultiThreadTest.java index 23355194..4209e4f1 100644 --- a/store/src/test/java/com/alibaba/otter/cancel/store/memory/buffer/MemoryEventStoreMultiThreadTest.java +++ b/store/src/test/java/com/alibaba/otter/cancel/store/memory/buffer/MemoryEventStoreMultiThreadTest.java @@ -7,10 +7,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import org.junit.Assert; - import org.apache.commons.lang.math.RandomUtils; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.springframework.util.CollectionUtils;