azagrebin commented on a change in pull request #8090: [FLINK-12067][network] 
Refactor the constructor of NetworkEnvironment
URL: https://github.com/apache/flink/pull/8090#discussion_r272103567
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java
 ##########
 @@ -105,16 +112,381 @@ public NettyConfig nettyConfig() {
                return nettyConfig;
        }
 
+       public boolean isCreditBased() {
+               return isCreditBased;
+       }
+
+       // 
------------------------------------------------------------------------
+
+       /**
+        * Utility method to extract network related parameters from the 
configuration and to
+        * sanity check them.
+        *
+        * @param configuration configuration object
+        * @param maxJvmHeapMemory the maximum JVM heap size (in bytes)
+        * @param localTaskManagerCommunication true, to skip initializing the 
network stack
+        * @param taskManagerAddress identifying the IP address under which the 
TaskManager will be accessible
+        * @return NetworkEnvironmentConfiguration
+        */
+       @Deprecated
+       public static NetworkEnvironmentConfiguration fromConfiguration(
+               Configuration configuration,
+               long maxJvmHeapMemory,
+               boolean localTaskManagerCommunication,
+               InetAddress taskManagerAddress) {
+
+               final int dataport = getDataport(configuration);
+
+               final int pageSize = getPageSize(configuration);
+
+               final int numberOfNetworkBuffers = 
calculateNumberOfNetworkBuffers(configuration, maxJvmHeapMemory);
+
+               final NettyConfig nettyConfig = 
createNettyConfig(configuration, localTaskManagerCommunication, 
taskManagerAddress, dataport);
+
+               int initialRequestBackoff = 
configuration.getInteger(TaskManagerOptions.NETWORK_REQUEST_BACKOFF_INITIAL);
 
 Review comment:
   We should also try to move all options which are used only for network 
environment from `TaskManagerOptions` to new class `NetworkEnvironmentOptions` 
to separate them for different shuffle services. What do you think?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to