mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed compiler error
This commit is contained in:
@@ -6,7 +6,6 @@ import io.netty.buffer.PooledByteBufAllocator;
|
|||||||
import io.netty.channel.AdaptiveRecvByteBufAllocator;
|
import io.netty.channel.AdaptiveRecvByteBufAllocator;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelFutureListener;
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
@@ -20,8 +19,10 @@ 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;
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
|
||||||
import com.alibaba.otter.canal.common.utils.BooleanMutex;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author luoyaogui 实现channel的管理(监听连接、读数据、回收) 2016-12-28
|
* @author luoyaogui 实现channel的管理(监听连接、读数据、回收) 2016-12-28
|
||||||
@@ -32,6 +33,7 @@ public abstract class SocketChannelPool {
|
|||||||
private static EventLoopGroup group = new NioEventLoopGroup(); // 非阻塞IO线程组
|
private static EventLoopGroup group = new NioEventLoopGroup(); // 非阻塞IO线程组
|
||||||
private static Bootstrap boot = new Bootstrap(); // 主
|
private static Bootstrap boot = new Bootstrap(); // 主
|
||||||
private static Map<Channel, SocketChannel> chManager = new ConcurrentHashMap<Channel, SocketChannel>();
|
private static Map<Channel, SocketChannel> chManager = new ConcurrentHashMap<Channel, SocketChannel>();
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SocketChannelPool.class);
|
||||||
|
|
||||||
static {
|
static {
|
||||||
boot.group(group)
|
boot.group(group)
|
||||||
@@ -94,7 +96,7 @@ public abstract class SocketChannelPool {
|
|||||||
if (socket != null) {
|
if (socket != null) {
|
||||||
socket.writeCache((ByteBuf) msg);
|
socket.writeCache((ByteBuf) msg);
|
||||||
} else {
|
} else {
|
||||||
//TODO: need graceful error handler.
|
// TODO: need graceful error handler.
|
||||||
logger.error("no socket available.");
|
logger.error("no socket available.");
|
||||||
}
|
}
|
||||||
ReferenceCountUtil.release(msg);// 添加防止内存泄漏的
|
ReferenceCountUtil.release(msg);// 添加防止内存泄漏的
|
||||||
|
|||||||
Reference in New Issue
Block a user