ptupitsyn commented on a change in pull request #466:
URL: https://github.com/apache/ignite-3/pull/466#discussion_r755207895



##########
File path: 
modules/network/src/main/java/org/apache/ignite/network/NettyBootstrapFactory.java
##########
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.network;
+
+import io.netty.bootstrap.Bootstrap;
+import io.netty.bootstrap.ServerBootstrap;
+import io.netty.channel.ChannelOption;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.socket.nio.NioServerSocketChannel;
+import io.netty.channel.socket.nio.NioSocketChannel;
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.configuration.schemas.network.InboundView;
+import org.apache.ignite.configuration.schemas.network.NetworkConfiguration;
+import org.apache.ignite.configuration.schemas.network.OutboundView;
+import org.apache.ignite.internal.manager.IgniteComponent;
+import org.apache.ignite.internal.network.netty.NamedNioEventLoopGroup;
+
+/**
+ * Netty bootstrap factory.
+ */
+public class NettyBootstrapFactory implements IgniteComponent {
+    /** Network configuration. */
+    private final NetworkConfiguration networkConfiguration;
+    
+    /** Prefix for event loop group names. */
+    private final String eventLoopGroupNamePrefix;
+    
+    /** Server boss socket channel handler event loop group. */
+    private EventLoopGroup bossGroup;
+    
+    /** Server work socket channel handler event loop group. */
+    private EventLoopGroup workerGroup;
+    
+    /** Client socket channel handler event loop group. */
+    private EventLoopGroup clientWorkerGroup;
+    
+    /**
+     * Constructor.
+     *
+     * @param networkConfiguration     Network configuration.
+     * @param eventLoopGroupNamePrefix Prefix for event loop group names.
+     */
+    public NettyBootstrapFactory(
+            NetworkConfiguration networkConfiguration,

Review comment:
       This is what I did initially, but it does not work, some tests fail with 
NPE due to missing configuration. As I understand, we should not retrieve the 
configuration before the configuration manager has started. In `IgniteImpl` 
constructor we create all components, and later after `start()` is called, we 
can get the configuration.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to