zhijiangW commented on a change in pull request #8181: [FLINK-12199][network] 
Refactor IOMetrics to not distinguish between local/remote in/out bytes
URL: https://github.com/apache/flink/pull/8181#discussion_r278610658
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/InputChannelTestUtils.java
 ##########
 @@ -93,6 +98,62 @@ public static ConnectionManager 
createDummyConnectionManager() throws Exception
                return connManager;
        }
 
+       public static LocalInputChannel createLocalInputChannel(
+               SingleInputGate inputGate,
+               ResultPartitionManager partitionManager) {
+
+               return createLocalInputChannel(inputGate, partitionManager, new 
Tuple2<>(0, 0));
+       }
+
+       public static LocalInputChannel createLocalInputChannel(
+               SingleInputGate inputGate,
+               int channelIndex,
+               ResultPartitionManager partitionManager) {
+
+               return new LocalInputChannel(
+                       inputGate,
+                       channelIndex,
+                       new ResultPartitionID(),
+                       partitionManager,
+                       new TaskEventDispatcher(),
+                       0,
+                       0,
+                       
UnregisteredMetricGroups.createUnregisteredTaskMetricGroup().getIOMetricGroup());
+       }
+
+       public static LocalInputChannel createLocalInputChannel(
+               SingleInputGate inputGate,
+               ResultPartitionManager partitionManager,
+               Tuple2<Integer, Integer> initialAndMaxRequestBackoff) {
+
+               return new LocalInputChannel(
+                       inputGate,
+                       0,
+                       new ResultPartitionID(),
+                       partitionManager,
+                       new TaskEventDispatcher(),
+                       initialAndMaxRequestBackoff._1(),
+                       initialAndMaxRequestBackoff._2(),
+                       
UnregisteredMetricGroups.createUnregisteredTaskMetricGroup().getIOMetricGroup());
+       }
+
+       public static RemoteInputChannel createRemoteInputChannel(
+               SingleInputGate inputGate,
+               int channelIndex,
+               ConnectionManager connectionManager) {
+
+               return new RemoteInputChannel(
+                       inputGate,
+                       channelIndex,
+                       new ResultPartitionID(),
+                       mock(ConnectionID.class),
 
 Review comment:
   Yes, it is better to not use mock here.

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