azagrebin commented on a change in pull request #8191: [FLINK-12213][network] 
Pass TaskManagerMetricGroup into constructor of NetworkEnvironment
URL: https://github.com/apache/flink/pull/8191#discussion_r276233404
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/NetworkEnvironment.java
 ##########
 @@ -63,11 +70,19 @@
 
        private boolean isShutdown;
 
-       public NetworkEnvironment(NetworkEnvironmentConfiguration config, 
TaskEventPublisher taskEventPublisher) {
+       public NetworkEnvironment(
 
 Review comment:
   From dependency injection perspective, could we add a static factory method 
here which would create all dependency components, like networkBufferPool, 
connectionManager, doing metrics registration etc? Then it could just call the 
private constructor passing all configured dependencies. I know we do not use 
this constructor at the moment but it would help to keep code cleaner in long 
term. At the end `ShuffleMaster.createShuffleService(flinkConfig)` could merge 
parsing `NetworkEnvironmentConfiguration` and creation of dependency components 
before creating `NetworkEnvironment` as `ShuffleService`.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to