azagrebin commented on a change in pull request #7822: [FLINK-11726][network] 
Refactor the creation of ResultPartition and InputGate into NetworkEnvironment
URL: https://github.com/apache/flink/pull/7822#discussion_r278907109
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
 ##########
 @@ -367,50 +366,47 @@ public Task(
 
                final String taskNameWithSubtaskAndId = taskNameWithSubtask + " 
(" + executionId + ')';
 
-               // Produced intermediate result partitions
-               this.producedPartitions = new 
ResultPartition[resultPartitionDeploymentDescriptors.size()];
+               // add metrics for buffers
+               final MetricGroup buffersGroup = 
metrics.getIOMetricGroup().addGroup("buffers");
 
-               int counter = 0;
+               final Optional<MetricGroup> outputGroup, inputGroup;
 
-               for (ResultPartitionDeploymentDescriptor desc: 
resultPartitionDeploymentDescriptors) {
-                       ResultPartitionID partitionId = new 
ResultPartitionID(desc.getPartitionId(), executionId);
-
-                       this.producedPartitions[counter] = new ResultPartition(
-                               taskNameWithSubtaskAndId,
-                               this,
-                               jobId,
-                               partitionId,
-                               desc.getPartitionType(),
-                               desc.getNumberOfSubpartitions(),
-                               desc.getMaxParallelism(),
-                               networkEnvironment.getResultPartitionManager(),
-                               resultPartitionConsumableNotifier,
-                               ioManager,
-                               desc.sendScheduleOrUpdateConsumersMessage());
-
-                       ++counter;
+               // register detailed network metrics, if configured
+               if 
(taskManagerConfig.getConfiguration().getBoolean(TaskManagerOptions.NETWORK_DETAILED_METRICS))
 {
 
 Review comment:
   I think it does not hurt always to add only the metric group. I would 
suggest to move `NETWORK_DETAILED_METRICS` to 
`NetworkEnvironmentConfiguration`. Then we do not need `optionals` and 
`NetworkEnvironment.registerIn(Out)putMetrics` can decide whether to add 
metrics to the group based on 
`NetworkEnvironmentConfiguration.isDetailedMetrics()`.

----------------------------------------------------------------
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