zhijiangW commented on a change in pull request #8485: [FLINK-12555] Introduce 
an encapsulated metric group layout for shuffle API
URL: https://github.com/apache/flink/pull/8485#discussion_r292258862
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/NettyShuffleEnvironment.java
 ##########
 @@ -228,91 +211,111 @@ public void 
releasePartitions(Collection<ResultPartitionID> partitionIds) {
         * @return collection of partitions which still occupy some resources 
locally on this task executor
         * and have been not released yet.
         */
-       public Collection<ResultPartitionID> getUnreleasedPartitions() {
+       @Override
+       public Collection<ResultPartitionID> 
getPartitionsOccupyingLocalResources() {
                return resultPartitionManager.getUnreleasedPartitions();
        }
 
        // 
--------------------------------------------------------------------------------------------
        //  Create Output Writers and Input Readers
        // 
--------------------------------------------------------------------------------------------
 
-       public ResultPartition[] createResultPartitionWriters(
-                       String taskName,
-                       ExecutionAttemptID executionId,
-                       Collection<ResultPartitionDeploymentDescriptor> 
resultPartitionDeploymentDescriptors,
-                       MetricGroup outputGroup,
-                       MetricGroup buffersGroup) {
+       @Override
+       public ShuffleIOOwnerContext createShuffleIOOwnerContext(
+                       String ownerName,
+                       ExecutionAttemptID executionAttemptID,
+                       MetricGroup parentGroup) {
+               MetricGroup nettyGroup = 
createShuffleIOOwnerMetricGroup(checkNotNull(parentGroup));
+               return new ShuffleIOOwnerContext(
+                       checkNotNull(ownerName),
+                       checkNotNull(executionAttemptID),
+                       parentGroup,
+                       nettyGroup.addGroup(METRIC_GROUP_INPUT),
 
 Review comment:
   Actually I also do not like the way of tuple. 
   But we provide the method of `createShuffleIOOwnerMetricGroup` in factory, 
and it is only used for adding group simple. So it might bring confused that 
which `addGroup` should be done inside factory and which should be done 
outside. The scope/rule seems not clear.

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