mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
format & import
This commit is contained in:
@@ -114,5 +114,4 @@ public class ClusterNodeAccessStrategy implements CanalNodeAccessStrategy {
|
|||||||
return zkClient;
|
return zkClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty-all</artifactId>
|
<artifactId>netty-all</artifactId>
|
||||||
<version>4.1.6.Final</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- zk -->
|
<!-- zk -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.zookeeper</groupId>
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
@@ -36,7 +34,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-lang</groupId>
|
<groupId>commons-lang</groupId>
|
||||||
<artifactId>commons-lang</artifactId>
|
<artifactId>commons-lang</artifactId>
|
||||||
<version>2.6</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
|
|||||||
@@ -168,8 +168,8 @@ public class LogBuffer {
|
|||||||
* @param newLimit The new limit value; must be non-negative and no larger
|
* @param newLimit The new limit value; must be non-negative and no larger
|
||||||
* than this buffer's capacity
|
* than this buffer's capacity
|
||||||
* @return This buffer
|
* @return This buffer
|
||||||
* @throws IllegalArgumentException If the preconditions on <tt>newLimit</tt>
|
* @throws IllegalArgumentException If the preconditions on
|
||||||
* do not hold
|
* <tt>newLimit</tt> do not hold
|
||||||
*/
|
*/
|
||||||
public final LogBuffer limit(int newLimit) {
|
public final LogBuffer limit(int newLimit) {
|
||||||
if (origin + newLimit > buffer.length || newLimit < 0) throw new IllegalArgumentException("capacity excceed: "
|
if (origin + newLimit > buffer.length || newLimit < 0) throw new IllegalArgumentException("capacity excceed: "
|
||||||
|
|||||||
@@ -10,11 +10,10 @@ import java.net.SocketAddress;
|
|||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author luoyaogui
|
* @author luoyaogui 封装netty的通信channel和数据接收缓存,实现读、写、连接校验的功能。 2016-12-28
|
||||||
* 封装netty的通信channel和数据接收缓存,实现读、写、连接校验的功能。
|
|
||||||
* 2016-12-28
|
|
||||||
*/
|
*/
|
||||||
public class SocketChannel {
|
public class SocketChannel {
|
||||||
|
|
||||||
private Channel channel = null;
|
private Channel channel = null;
|
||||||
private Object lock = new Object();
|
private Object lock = new Object();
|
||||||
private ByteBuf cache = PooledByteBufAllocator.DEFAULT.directBuffer(1024 * 1024 * 5); // 缓存大小
|
private ByteBuf cache = PooledByteBufAllocator.DEFAULT.directBuffer(1024 * 1024 * 5); // 缓存大小
|
||||||
@@ -22,6 +21,7 @@ public class SocketChannel {
|
|||||||
public Channel getChannel() {
|
public Channel getChannel() {
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChannel(Channel channel, boolean notify) {
|
public void setChannel(Channel channel, boolean notify) {
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
if (notify) {// 是否需要通知,主要时channel不可用时
|
if (notify) {// 是否需要通知,主要时channel不可用时
|
||||||
@@ -40,18 +40,23 @@ public class SocketChannel {
|
|||||||
notifyAll();
|
notifyAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeChannel(byte[]... buf) throws IOException {
|
public void writeChannel(byte[]... buf) throws IOException {
|
||||||
if(channel != null && channel.isWritable())
|
if (channel != null && channel.isWritable()) {
|
||||||
channel.writeAndFlush(Unpooled.copiedBuffer(buf));
|
channel.writeAndFlush(Unpooled.copiedBuffer(buf));
|
||||||
else
|
} else {
|
||||||
throw new IOException("write failed ! please checking !");
|
throw new IOException("write failed ! please checking !");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int read(ByteBuffer buffer) throws IOException {
|
public int read(ByteBuffer buffer) throws IOException {
|
||||||
if(null == channel)
|
if (null == channel) throw new IOException("socket has Interrupted !");
|
||||||
throw new IOException("socket has Interrupted !");
|
|
||||||
if (cache.readableBytes() < buffer.remaining()) {
|
if (cache.readableBytes() < buffer.remaining()) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
try {wait();} catch (InterruptedException e) {}
|
try {
|
||||||
|
wait();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
@@ -60,12 +65,15 @@ public class SocketChannel {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isConnected() {
|
public boolean isConnected() {
|
||||||
return channel != null ? true : false;
|
return channel != null ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SocketAddress getRemoteSocketAddress() {
|
public SocketAddress getRemoteSocketAddress() {
|
||||||
return channel != null ? channel.remoteAddress() : null;
|
return channel != null ? channel.remoteAddress() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
if (channel != null) {
|
if (channel != null) {
|
||||||
channel.close();
|
channel.close();
|
||||||
|
|||||||
@@ -20,10 +20,9 @@ import java.io.IOException;
|
|||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author luoyaogui
|
* @author luoyaogui 实现channel的管理(监听连接、读数据、回收) 2016-12-28
|
||||||
* 实现channel的管理(监听连接、读数据、回收)
|
|
||||||
* 2016-12-28
|
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public abstract class SocketChannelPool {
|
public abstract class SocketChannelPool {
|
||||||
@@ -33,14 +32,18 @@ public abstract class SocketChannelPool {
|
|||||||
private static Map<Channel, SocketChannel> chManager = new ConcurrentHashMap<Channel, SocketChannel>();
|
private static Map<Channel, SocketChannel> chManager = new ConcurrentHashMap<Channel, SocketChannel>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
boot.group(group).channel(NioSocketChannel.class)
|
boot.group(group)
|
||||||
|
.channel(NioSocketChannel.class)
|
||||||
.option(ChannelOption.SO_RCVBUF, 32 * 1024)
|
.option(ChannelOption.SO_RCVBUF, 32 * 1024)
|
||||||
.option(ChannelOption.SO_SNDBUF, 32 * 1024)
|
.option(ChannelOption.SO_SNDBUF, 32 * 1024)
|
||||||
.option(ChannelOption.TCP_NODELAY, true)//如果是延时敏感型应用,建议关闭Nagle算法
|
.option(ChannelOption.TCP_NODELAY, true)
|
||||||
|
// 如果是延时敏感型应用,建议关闭Nagle算法
|
||||||
.option(ChannelOption.SO_KEEPALIVE, true)
|
.option(ChannelOption.SO_KEEPALIVE, true)
|
||||||
.option(ChannelOption.RCVBUF_ALLOCATOR, AdaptiveRecvByteBufAllocator.DEFAULT)
|
.option(ChannelOption.RCVBUF_ALLOCATOR, AdaptiveRecvByteBufAllocator.DEFAULT)
|
||||||
.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) //
|
.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
|
||||||
|
//
|
||||||
.handler(new ChannelInitializer() {
|
.handler(new ChannelInitializer() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initChannel(Channel arg0) throws Exception {
|
protected void initChannel(Channel arg0) throws Exception {
|
||||||
arg0.pipeline().addLast(new BusinessHandler());// 命令过滤和handler添加管理
|
arg0.pipeline().addLast(new BusinessHandler());// 命令过滤和handler添加管理
|
||||||
@@ -51,14 +54,15 @@ public abstract class SocketChannelPool {
|
|||||||
public static SocketChannel open(SocketAddress address) throws Exception {
|
public static SocketChannel open(SocketAddress address) throws Exception {
|
||||||
final SocketChannel socket = new SocketChannel();
|
final SocketChannel socket = new SocketChannel();
|
||||||
boot.connect(address).addListener(new ChannelFutureListener() {
|
boot.connect(address).addListener(new ChannelFutureListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationComplete(ChannelFuture arg0) throws Exception {
|
public void operationComplete(ChannelFuture arg0) throws Exception {
|
||||||
if(arg0.isSuccess())
|
if (arg0.isSuccess()) socket.setChannel(arg0.channel(), false);
|
||||||
socket.setChannel(arg0.channel(),false);
|
|
||||||
synchronized (socket) {
|
synchronized (socket) {
|
||||||
socket.notify();
|
socket.notify();
|
||||||
}
|
}
|
||||||
}});
|
}
|
||||||
|
});
|
||||||
synchronized (socket) {
|
synchronized (socket) {
|
||||||
socket.wait();
|
socket.wait();
|
||||||
}
|
}
|
||||||
@@ -70,25 +74,25 @@ public abstract class SocketChannelPool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class BusinessHandler extends ChannelInboundHandlerAdapter {
|
public static class BusinessHandler extends ChannelInboundHandlerAdapter {
|
||||||
|
|
||||||
private SocketChannel socket = null;
|
private SocketChannel socket = null;
|
||||||
@Override
|
|
||||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
socket.setChannel(null, true);
|
socket.setChannel(null, true);
|
||||||
chManager.remove(ctx.channel());// 移除
|
chManager.remove(ctx.channel());// 移除
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void channelRead(ChannelHandlerContext ctx, Object msg)
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
throws Exception {
|
if (null == socket) {
|
||||||
if(null == socket)
|
|
||||||
socket = chManager.get(ctx.channel());
|
socket = chManager.get(ctx.channel());
|
||||||
|
}
|
||||||
if (socket != null) {
|
if (socket != null) {
|
||||||
socket.writeCache((ByteBuf) msg);
|
socket.writeCache((ByteBuf) msg);
|
||||||
}
|
}
|
||||||
ReferenceCountUtil.release(msg);// 添加防止内存泄漏的
|
ReferenceCountUtil.release(msg);// 添加防止内存泄漏的
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
throws Exception {
|
|
||||||
ctx.close();
|
ctx.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import java.io.IOException;
|
|||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.parse.driver.mysql.packets.server.ResultSetPacket;
|
import com.alibaba.otter.canal.parse.driver.mysql.packets.server.ResultSetPacket;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.alibaba.otter.canal.filter;
|
package com.alibaba.otter.canal.filter;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.filter.aviater.AviaterELFilter;
|
import com.alibaba.otter.canal.filter.aviater.AviaterELFilter;
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import java.util.concurrent.ExecutorService;
|
|||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.RandomStringUtils;
|
import org.apache.commons.lang.RandomStringUtils;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter;
|
import com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter;
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
package com.alibaba.otter.canal.instance.core;
|
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.AbstractCanalLifeCycle;
|
||||||
import com.alibaba.otter.canal.common.alarm.CanalAlarmHandler;
|
import com.alibaba.otter.canal.common.alarm.CanalAlarmHandler;
|
||||||
import com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter;
|
import com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter;
|
||||||
@@ -16,17 +22,9 @@ import com.alibaba.otter.canal.protocol.ClientIdentity;
|
|||||||
import com.alibaba.otter.canal.sink.CanalEventSink;
|
import com.alibaba.otter.canal.sink.CanalEventSink;
|
||||||
import com.alibaba.otter.canal.store.CanalEventStore;
|
import com.alibaba.otter.canal.store.CanalEventStore;
|
||||||
import com.alibaba.otter.canal.store.model.Event;
|
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.
|
* Created with Intellig IDEA. Author: yinxiu Date: 2016-01-07 Time: 22:26
|
||||||
* Author: yinxiu
|
|
||||||
* Date: 2016-01-07
|
|
||||||
* Time: 22:26
|
|
||||||
*/
|
*/
|
||||||
public class AbstractCanalInstance extends AbstractCanalLifeCycle implements CanalInstance {
|
public class AbstractCanalInstance extends AbstractCanalLifeCycle implements CanalInstance {
|
||||||
|
|
||||||
@@ -121,7 +119,6 @@ public class AbstractCanalInstance extends AbstractCanalLifeCycle implements Can
|
|||||||
alarmHandler.stop();
|
alarmHandler.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
logger.info("stop successful....");
|
logger.info("stop successful....");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ package com.alibaba.otter.canal.instance.spring;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.instance.core.AbstractCanalInstance;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.common.alarm.CanalAlarmHandler;
|
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.meta.CanalMetaManager;
|
||||||
import com.alibaba.otter.canal.parse.CanalEventParser;
|
import com.alibaba.otter.canal.parse.CanalEventParser;
|
||||||
import com.alibaba.otter.canal.protocol.CanalEntry;
|
import com.alibaba.otter.canal.protocol.CanalEntry;
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import java.io.IOException;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.alibaba.otter.canal.meta;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.protocol.position.PositionRange;
|
import com.alibaba.otter.canal.protocol.position.PositionRange;
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ package com.alibaba.otter.canal.meta;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ package com.alibaba.otter.canal.meta;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,8 @@ package com.alibaba.otter.canal.meta;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
@@ -85,19 +85,16 @@ public class LocalBinLogConnection implements ErosaConnection {
|
|||||||
boolean needContinue = true;
|
boolean needContinue = true;
|
||||||
LogEvent event = null;
|
LogEvent event = null;
|
||||||
L: while (fetcher.fetch()) {
|
L: while (fetcher.fetch()) {
|
||||||
/*event = decoder.decode(fetcher, context);
|
/*
|
||||||
if (event == null) {
|
* event = decoder.decode(fetcher, context); if (event ==
|
||||||
throw new CanalParseException("parse failed");
|
* null) { throw new CanalParseException("parse failed"); }
|
||||||
}
|
* if (!func.sink(event)) { needContinue = false; break; }
|
||||||
|
*/
|
||||||
if (!func.sink(event)) {
|
|
||||||
needContinue = false;
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
event = new RotateLogEvent(context.getLogPosition().getFileName(), context.getLogPosition().getPosition());
|
event = new RotateLogEvent(context.getLogPosition().getFileName(), context.getLogPosition()
|
||||||
|
.getPosition());
|
||||||
} else {
|
} else {
|
||||||
event = decoder.decode(fetcher, context);
|
event = decoder.decode(fetcher, context);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.alibaba.otter.canal.parse.inbound.mysql;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -148,8 +147,7 @@ public class MysqlConnection implements ErosaConnection {
|
|||||||
HeaderPacket binlogDumpHeader = new HeaderPacket();
|
HeaderPacket binlogDumpHeader = new HeaderPacket();
|
||||||
binlogDumpHeader.setPacketBodyLength(cmdBody.length);
|
binlogDumpHeader.setPacketBodyLength(cmdBody.length);
|
||||||
binlogDumpHeader.setPacketSequenceNumber((byte) 0x00);
|
binlogDumpHeader.setPacketSequenceNumber((byte) 0x00);
|
||||||
PacketManager.write(connector.getChannel(), binlogDumpHeader.toBytes(),
|
PacketManager.write(connector.getChannel(), binlogDumpHeader.toBytes(), cmdBody);
|
||||||
cmdBody);
|
|
||||||
|
|
||||||
connector.setDumping(true);
|
connector.setDumping(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.alibaba.otter.canal.parse;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.parse.inbound.EventTransactionBuffer.TransactionFlushCallback;
|
import com.alibaba.otter.canal.parse.inbound.EventTransactionBuffer.TransactionFlushCallback;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.nio.charset.Charset;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.parse.stub.AbstractCanalEventSinkTest;
|
import com.alibaba.otter.canal.parse.stub.AbstractCanalEventSinkTest;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.nio.charset.Charset;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.parse.stub.AbstractCanalEventSinkTest;
|
import com.alibaba.otter.canal.parse.stub.AbstractCanalEventSinkTest;
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ package com.alibaba.otter.canal.parse.index;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ package com.alibaba.otter.canal.parse.index;
|
|||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.alibaba.otter.canal.parse.index;
|
package com.alibaba.otter.canal.parse.index;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package com.alibaba.otter.canal.parse.index;
|
package com.alibaba.otter.canal.parse.index;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
5
pom.xml
5
pom.xml
@@ -199,6 +199,11 @@
|
|||||||
<artifactId>netty</artifactId>
|
<artifactId>netty</artifactId>
|
||||||
<version>3.2.5.Final</version>
|
<version>3.2.5.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-all</artifactId>
|
||||||
|
<version>4.1.6.Final</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.protobuf</groupId>
|
<groupId>com.google.protobuf</groupId>
|
||||||
<artifactId>protobuf-java</artifactId>
|
<artifactId>protobuf-java</artifactId>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -7,10 +7,9 @@ import java.util.concurrent.ExecutorService;
|
|||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.math.RandomUtils;
|
import org.apache.commons.lang.math.RandomUtils;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|||||||
Reference in New Issue
Block a user