@Override public int getDataPort() { if (server != null && server.getLocalAddress() != null) { return server.getLocalAddress().getPort(); } else { return -1; } }
private void initNioBootstrap() { // Add the server port number to the name in order to distinguish // multiple clients running on the same host. String name = NettyConfig.CLIENT_THREAD_GROUP_NAME + " (" + config.getServerPort() + ")"; NioEventLoopGroup nioGroup = new NioEventLoopGroup(config.getClientNumThreads(), NettyServer.getNamedThreadFactory(name)); bootstrap.group(nioGroup).channel(NioSocketChannel.class); }
@Override public void start(ResultPartitionProvider partitionProvider, TaskEventDispatcher taskEventDispatcher) throws IOException { PartitionRequestProtocol partitionRequestProtocol = new PartitionRequestProtocol(partitionProvider, taskEventDispatcher); client.init(partitionRequestProtocol, bufferPool); server.init(partitionRequestProtocol, bufferPool); }
public NettyConnectionManager(NettyConfig nettyConfig) { this.server = new NettyServer(nettyConfig); this.client = new NettyClient(nettyConfig); this.bufferPool = new NettyBufferPool(nettyConfig.getNumberOfArenas()); this.partitionRequestClientFactory = new PartitionRequestClientFactory(client); }
@Override public void shutdown() { client.shutdown(); server.shutdown(); }
initNioBootstrap(); break; initEpollBootstrap(); break; initEpollBootstrap(); LOG.info("Transport type 'auto': using EPOLL."); initNioBootstrap(); LOG.info("Transport type 'auto': using NIO.");
public NettyConnectionManager(NettyConfig nettyConfig) { this.server = new NettyServer(nettyConfig); this.client = new NettyClient(nettyConfig); this.bufferPool = new NettyBufferPool(nettyConfig.getNumberOfArenas()); this.partitionRequestClientFactory = new PartitionRequestClientFactory(client); }
@Override public void shutdown() { client.shutdown(); server.shutdown(); }
initNioBootstrap(); break; initEpollBootstrap(); break; initEpollBootstrap(); LOG.info("Transport type 'auto': using EPOLL."); initNioBootstrap(); LOG.info("Transport type 'auto': using NIO.");
private void initNioBootstrap() { // Add the server port number to the name in order to distinguish // multiple servers running on the same host. String name = NettyConfig.SERVER_THREAD_GROUP_NAME + " (" + config.getServerPort() + ")"; NioEventLoopGroup nioGroup = new NioEventLoopGroup(config.getServerNumThreads(), getNamedThreadFactory(name)); bootstrap.group(nioGroup).channel(NioServerSocketChannel.class); }
public NettyConnectionManager(NettyConfig nettyConfig) { this.server = new NettyServer(nettyConfig); this.client = new NettyClient(nettyConfig); this.bufferPool = new NettyBufferPool(nettyConfig.getNumberOfArenas()); this.partitionRequestClientFactory = new PartitionRequestClientFactory(client); }
public void start() throws IOException { TaskEventDispatcher taskEventDispatcher = new TaskEventDispatcher(); NettyProtocol protocol = new NettyProtocol( partitionProvider, taskEventDispatcher, true); server.init(protocol, bufferPool); }
@Override public void shutdown() { client.shutdown(); server.shutdown(); }
@Override public int getDataPort() { if (server != null && server.getLocalAddress() != null) { return server.getLocalAddress().getPort(); } else { return -1; } }
private void initEpollBootstrap() { // Add the server port number to the name in order to distinguish // multiple clients running on the same host. String name = NettyConfig.CLIENT_THREAD_GROUP_NAME + " (" + config.getServerPort() + ")"; EpollEventLoopGroup epollGroup = new EpollEventLoopGroup(config.getClientNumThreads(), NettyServer.getNamedThreadFactory(name)); bootstrap.group(epollGroup).channel(EpollSocketChannel.class); }
public NettyConnectionManager(NettyConfig nettyConfig) { this.server = new NettyServer(nettyConfig); this.client = new NettyClient(nettyConfig); this.bufferPool = new NettyBufferPool(nettyConfig.getNumberOfArenas(), nettyConfig.getMaxOrder(), nettyConfig.getChunkSize()); this.partitionRequestClientFactory = new PartitionRequestClientFactory(client); }
@Override public void start(ResultPartitionProvider partitionProvider, TaskEventDispatcher taskEventDispatcher) throws IOException { NettyProtocol partitionRequestProtocol = new NettyProtocol( partitionProvider, taskEventDispatcher, client.getConfig().isCreditBasedEnabled()); client.init(partitionRequestProtocol, bufferPool); server.init(partitionRequestProtocol, bufferPool); }
@Override public void shutdown() { client.shutdown(); server.shutdown(); }
@Override public int getDataPort() { if (server != null && server.getLocalAddress() != null) { return server.getLocalAddress().getPort(); } else { return -1; } }
private void initEpollBootstrap() { // Add the server port number to the name in order to distinguish // multiple servers running on the same host. String name = NettyConfig.SERVER_THREAD_GROUP_NAME + " (" + config.getServerPort() + ")"; EpollEventLoopGroup epollGroup = new EpollEventLoopGroup(config.getServerNumThreads(), getNamedThreadFactory(name)); bootstrap.group(epollGroup).channel(EpollServerSocketChannel.class); }