org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoopGroup.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(316)

本文整理了Java中org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoopGroup.<init>()方法的一些代码示例,展示了NioEventLoopGroup.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NioEventLoopGroup.<init>()方法的具体详情如下:
包路径:org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoopGroup
类名称:NioEventLoopGroup
方法名:<init>

NioEventLoopGroup.<init>介绍

暂无

代码示例

代码示例来源:origin: apache/flink

@Before
public void setUp() throws Exception {
  nioGroup = new NioEventLoopGroup();
}

代码示例来源:origin: apache/flink

NioEventLoopGroup bossGroup   = new NioEventLoopGroup(1);
NioEventLoopGroup workerGroup = new NioEventLoopGroup();

代码示例来源:origin: apache/flink

NioEventLoopGroup bossGroup = new NioEventLoopGroup(1);
NioEventLoopGroup workerGroup = new NioEventLoopGroup();

代码示例来源:origin: apache/flink

.build();
final NioEventLoopGroup nioGroup = new NioEventLoopGroup(numEventLoopThreads, threadFactory);

代码示例来源:origin: apache/flink

/**
 * Creates a client instance for the server at the target host and port.
 *
 * @param host Host of the HTTP server
 * @param port Port of the HTTP server
 */
public HttpTestClient(String host, int port) {
  this.host = host;
  this.port = port;
  this.group = new NioEventLoopGroup();
  this.bootstrap = new Bootstrap();
  this.bootstrap.group(group)
      .channel(NioSocketChannel.class)
      .handler(new ChannelInitializer<SocketChannel>() {
        @Override
        protected void initChannel(SocketChannel ch) throws Exception {
          ChannelPipeline p = ch.pipeline();
          p.addLast(new HttpClientCodec());
          p.addLast(new HttpContentDecompressor());
          p.addLast(new ClientHandler(responses));
        }
      });
}

代码示例来源:origin: apache/flink

.build();
final EventLoopGroup nioGroup = new NioEventLoopGroup(numEventLoopThreads, threadFactory);
final ByteBufAllocator bufferPool = new NettyBufferPool(numEventLoopThreads);

代码示例来源:origin: com.alibaba.blink/flink-table

@Override
public void open(Configuration config) throws Exception{
  tableServiceId = config.getString(TableServiceOptions.TABLE_SERVICE_ID);
  logger.info("TableServiceClient open with tableServiceId = " + tableServiceId);
  if (getRegistry() != null) {
    getRegistry().open(config);
  }
  readBufferSize = config.getInteger(TableServiceOptions.TABLE_SERVICE_CLIENT_READ_BUFFER_SIZE);
  writeBufferSize = config.getInteger(TableServiceOptions.TABLE_SERVICE_CLIENT_WRITE_BUFFER_SIZE);
  eventLoopGroup = new NioEventLoopGroup();
}

代码示例来源:origin: com.alibaba.blink/flink-table

masterGroup = new NioEventLoopGroup();
slaveGroup = new NioEventLoopGroup();

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

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);
}

代码示例来源:origin: org.apache.flink/flink-runtime

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);
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

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);
}

代码示例来源:origin: org.apache.flink/flink-runtime

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);
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

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);
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

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);
}

代码示例来源:origin: org.apache.flink/flink-runtime-web_2.11

NioEventLoopGroup bossGroup   = new NioEventLoopGroup(1);
NioEventLoopGroup workerGroup = new NioEventLoopGroup();

代码示例来源:origin: org.apache.flink/flink-runtime

NioEventLoopGroup group = new NioEventLoopGroup(1, new ExecutorThreadFactory("flink-rest-client-netty"));

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

NioEventLoopGroup group = new NioEventLoopGroup(1, new ExecutorThreadFactory("flink-rest-client-netty"));

代码示例来源:origin: com.alibaba.blink/flink-runtime

public RestClient(RestClientConfiguration configuration, Executor executor) {
  Preconditions.checkNotNull(configuration);
  this.executor = Preconditions.checkNotNull(executor);
  final SSLEngineFactory sslEngineFactory = configuration.getSslEngineFactory();
  ChannelInitializer<SocketChannel> initializer = new ChannelInitializer<SocketChannel>() {
    @Override
    protected void initChannel(SocketChannel socketChannel) {
      // SSL should be the first handler in the pipeline
      if (sslEngineFactory != null) {
        socketChannel.pipeline().addLast("ssl", new SslHandler(sslEngineFactory.createSSLEngine()));
      }
      socketChannel.pipeline()
        .addLast(new HttpClientCodec())
        .addLast(new HttpObjectAggregator(configuration.getMaxContentLength()))
        .addLast(new ChunkedWriteHandler()) // required for multipart-requests
        .addLast(new ClientHandler());
    }
  };
  NioEventLoopGroup group = new NioEventLoopGroup(1, new DefaultThreadFactory("flink-rest-client-netty"));
  bootstrap = new Bootstrap();
  bootstrap
    .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, Math.toIntExact(configuration.getConnectionTimeout()))
    .group(group)
    .channel(NioSocketChannel.class)
    .handler(initializer);
  LOG.info("Rest client endpoint started.");
}

代码示例来源:origin: org.apache.flink/flink-queryable-state-client-java_2.11

.build();
final EventLoopGroup nioGroup = new NioEventLoopGroup(numEventLoopThreads, threadFactory);
final ByteBufAllocator bufferPool = new NettyBufferPool(numEventLoopThreads);

代码示例来源:origin: com.alibaba.blink/flink-queryable-state-client-java

.build();
final EventLoopGroup nioGroup = new NioEventLoopGroup(numEventLoopThreads, threadFactory);
final ByteBufAllocator bufferPool = new NettyBufferPool(numEventLoopThreads);

相关文章

微信公众号

最新文章

更多

NioEventLoopGroup类方法