zhijiangW commented on a change in pull request #10083: 
[FLINK-14472][runtime]Implement back-pressure monitor with non-blocking outputs.
URL: https://github.com/apache/flink/pull/10083#discussion_r344541099
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/BackPressureSampleService.java
 ##########
 @@ -53,64 +53,58 @@
 
                this.numSamples = numSamples;
                this.delayBetweenSamples = checkNotNull(delayBetweenSamples);
-               this.scheduledExecutor = checkNotNull(scheduledExecutor, "The 
scheduledExecutor must not be null.");
+               this.scheduledExecutor = checkNotNull(scheduledExecutor);
        }
 
        /**
-        * Returns a future that completes with the back pressure ratio of a 
task.
+        * Schedules to sample the task back pressure and returns a future that 
completes
+        * with the back pressure ratio.
         *
         * @param task The task to be sampled.
-        * @return A future of the task back pressure ratio.
+        * @return A future containing the task back pressure ratio.
         */
        public CompletableFuture<Double> 
sampleTaskBackPressure(BackPressureSampleableTask task) {
+               if (!task.isRunning()) {
+                       throw new IllegalStateException("Cannot sample task. 
Because it is not running.");
 
 Review comment:
   It is better to give some debug info here. E.g we could give 
`task.toString()` in the message, then in the specific task implementation, it 
can provide `executionId` info as before.

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