zhijiangW commented on a change in pull request #11155: 
[FLINK-14818][benchmark] Fix receiving InputGate setup of 
StreamNetworkBenchmarkEnvironment.
URL: https://github.com/apache/flink/pull/11155#discussion_r382399441
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/benchmark/StreamNetworkBenchmarkEnvironment.java
 ##########
 @@ -272,11 +287,161 @@ private static ShuffleDescriptor 
createShuffleDescriptor(
                        ResultPartitionID resultPartitionID,
                        ResourceID location,
                        TaskManagerLocation senderLocation,
-                       int channel) {
+                       int connectionIndex) {
                final NettyShuffleDescriptorBuilder builder = 
NettyShuffleDescriptorBuilder.newBuilder()
                        .setId(resultPartitionID)
                        .setProducerInfoFromTaskManagerLocation(senderLocation)
-                       .setConnectionIndex(channel);
+                       .setConnectionIndex(connectionIndex);
                return localMode ? 
builder.setProducerLocation(location).buildLocal() : builder.buildRemote();
        }
+
+       /**
+        * A {@link SingleInputGateFactory} which replaces the default {@link 
RemoteInputChannel} and
+        * {@link LocalInputChannel} implementation with costume ones.
+        */
+       private static class TestSingleInputGateFactory extends 
SingleInputGateFactory {
+
+               private final ResourceID taskExecutorResourceId;
+               private final int partitionRequestInitialBackoff;
+               private final int partitionRequestMaxBackoff;
+               private final ConnectionManager connectionManager;
+               private final ResultPartitionManager partitionManager;
+               private final TaskEventPublisher taskEventPublisher;
+               private final NetworkBufferPool networkBufferPool;
+
+               public TestSingleInputGateFactory(
+                               @Nonnull ResourceID taskExecutorResourceId,
 
 Review comment:
   nit: I am a bit torn for `@Nonnull` with arguments. I know we did it in some 
cases before like `SingleInputGateFactory`. 
   In common sense we still consider them as `Nonnull` w/o this annotation. And 
we only need to emphasis the `Nullable` case to add the annotation.
   
   In another aspect, it seems not very consistent in this class because other 
constructors do not have it.

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