private EventLoop nextChild() throws Exception { if (shuttingDown) { throw new RejectedExecutionException("shutting down"); } EventLoop loop = idleChildren.poll(); if (loop == null) { if (maxChannels > 0 && activeChildren.size() >= maxChannels) { throw tooManyChannels; } loop = newChild(childArgs); loop.terminationFuture().addListener(childTerminationListener); } activeChildren.add(loop); return loop; } }
private EventLoop nextChild() throws Exception { if (shuttingDown) { throw new RejectedExecutionException("shutting down"); } EventLoop loop = idleChildren.poll(); if (loop == null) { if (maxChannels > 0 && activeChildren.size() >= maxChannels) { throw tooManyChannels; } loop = newChild(childArgs); loop.terminationFuture().addListener(childTerminationListener); } activeChildren.add(loop); return loop; } }
@Override public Future<?> terminationFuture() { return delegate().terminationFuture(); }
private EventLoop nextChild() throws Exception { if (shuttingDown) { throw new RejectedExecutionException("shutting down"); } EventLoop loop = idleChildren.poll(); if (loop == null) { if (maxChannels > 0 && activeChildren.size() >= maxChannels) { throw tooManyChannels; } loop = newChild(childArgs); loop.terminationFuture().addListener(childTerminationListener); } activeChildren.add(loop); return loop; } }
@Override public Future<?> terminationFuture() { return getDelegate().terminationFuture(); }
private EventLoop nextChild() throws Exception { if (shuttingDown) { throw new RejectedExecutionException("shutting down"); } EventLoop loop = idleChildren.poll(); if (loop == null) { if (maxChannels > 0 && activeChildren.size() >= maxChannels) { throw tooManyChannels; } loop = newChild(childArgs); loop.terminationFuture().addListener(childTerminationListener); } activeChildren.add(loop); return loop; } }
private EventLoop nextChild() throws Exception { if (shuttingDown) { throw new RejectedExecutionException("shutting down"); } EventLoop loop = idleChildren.poll(); if (loop == null) { if (maxChannels > 0 && activeChildren.size() >= maxChannels) { throw tooManyChannels; } loop = newChild(childArgs); loop.terminationFuture().addListener(childTerminationListener); } activeChildren.add(loop); return loop; } }
private EventLoop nextChild() throws Exception { if (shuttingDown) { throw new RejectedExecutionException("shutting down"); } EventLoop loop = idleChildren.poll(); if (loop == null) { if (maxChannels > 0 && activeChildren.size() >= maxChannels) { throw tooManyChannels; } loop = newChild(childArgs); loop.terminationFuture().addListener(childTerminationListener); } activeChildren.add(loop); return loop; } }
@Test public void testClientRPCInterference() throws Exception { TajoClient client = cluster.newTajoClient(); TajoClient client2 = cluster.newTajoClient(); NettyClientBase rpcClient = Whitebox.getInternalState(client, NettyClientBase.class); assertNotNull(rpcClient); NettyClientBase rpcClient2 = Whitebox.getInternalState(client2, NettyClientBase.class); assertNotNull(rpcClient); assertNotEquals(rpcClient.getChannel().eventLoop(), rpcClient2.getChannel().eventLoop()); client.close(); client2.close(); rpcClient.getChannel().eventLoop().terminationFuture().sync(); assertTrue(rpcClient.getChannel().eventLoop().isTerminated()); rpcClient2.getChannel().eventLoop().terminationFuture().sync(); assertTrue(rpcClient2.getChannel().eventLoop().isTerminated()); }