zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eolivelli <...@git.apache.org>
Subject [GitHub] zookeeper pull request #669: ZOOKEEPER-3152: Port ZK netty stack to netty4
Date Fri, 19 Oct 2018 15:38:52 GMT
Github user eolivelli commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/669#discussion_r226681741
  
    --- Diff: zookeeper-common/src/main/java/org/apache/zookeeper/ClientCnxnSocketNetty.java
---
    @@ -68,18 +70,21 @@
     public class ClientCnxnSocketNetty extends ClientCnxnSocket {
         private static final Logger LOG = LoggerFactory.getLogger(ClientCnxnSocketNetty.class);
     
    -    ChannelFactory channelFactory = new NioClientSocketChannelFactory(
    -            Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
    -    Channel channel;
    -    CountDownLatch firstConnect;
    -    ChannelFuture connectFuture;
    -    Lock connectLock = new ReentrantLock();
    -    AtomicBoolean disconnected = new AtomicBoolean();
    -    AtomicBoolean needSasl = new AtomicBoolean();
    -    Semaphore waitSasl = new Semaphore(0);
    +    private final EventLoopGroup eventLoopGroup;
    +    private Channel channel;
    +    private CountDownLatch firstConnect;
    +    private ChannelFuture connectFuture;
    +    private final Lock connectLock = new ReentrantLock();
    +    private final AtomicBoolean disconnected = new AtomicBoolean();
    +    private final AtomicBoolean needSasl = new AtomicBoolean();
    +    private final Semaphore waitSasl = new Semaphore(0);
    +
    +    private static final AtomicReference<ByteBufAllocator> TEST_ALLOCATOR =
    +            new AtomicReference<>(null);
     
         ClientCnxnSocketNetty(ZKClientConfig clientConfig) throws IOException {
             this.clientConfig = clientConfig;
    +        eventLoopGroup = new NioEventLoopGroup(0, Executors.newCachedThreadPool());
    --- End diff --
    
    Let's move to Epoll.
    It can be a followup change (I can send of you don't have already it on your stack of
changes)


---

Mime
View raw message