/** * Creates a client with the specified number of event loop threads. * * @param numEventLoopThreads Number of event loop threads (minimum 1). */ public KvStateClient(int numEventLoopThreads, KvStateRequestStats stats) { Preconditions.checkArgument(numEventLoopThreads >= 1, "Non-positive number of event loop threads."); NettyBufferPool bufferPool = new NettyBufferPool(numEventLoopThreads); ThreadFactory threadFactory = new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat("Flink KvStateClient Event Loop Thread %d") .build(); NioEventLoopGroup nioGroup = new NioEventLoopGroup(numEventLoopThreads, threadFactory); this.bootstrap = new Bootstrap() .group(nioGroup) .channel(NioSocketChannel.class) .option(ChannelOption.ALLOCATOR, bufferPool) .handler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) throws Exception { ch.pipeline() .addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4)) // ChunkedWriteHandler respects Channel writability .addLast(new ChunkedWriteHandler()); } }); this.stats = Preconditions.checkNotNull(stats, "Statistics tracker"); }
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 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 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 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); }
Preconditions.checkNotNull(stats, "KvStateRequestStats"); NettyBufferPool bufferPool = new NettyBufferPool(numEventLoopThreads);
public ExternalBlockShuffleService(Configuration configuration) throws Exception { this.shuffleServiceConfiguration = ExternalBlockShuffleServiceConfiguration.fromConfiguration(configuration); this.partitionProvider = new ExternalBlockResultPartitionManager(shuffleServiceConfiguration); NettyConfig nettyConfig = shuffleServiceConfiguration.getNettyConfig(); bufferPool = new NettyBufferPool(nettyConfig.getNumberOfArenas(), nettyConfig.getMaxOrder(), nettyConfig.getChunkSize()); server = new NettyServer(nettyConfig); }