zentol commented on a change in pull request #8416: [FLINK-12331] Introduce 
partition/gate setup to decouple task registration with NetworkEnvironment
URL: https://github.com/apache/flink/pull/8416#discussion_r284672050
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
 ##########
 @@ -154,13 +161,16 @@
         * <p>The pool is registered with the partition *after* it as been 
constructed in order to conform
         * to the life-cycle of task registrations in the {@link TaskExecutor}.
         */
-       public void registerBufferPool(BufferPool bufferPool) {
-               checkArgument(bufferPool.getNumberOfRequiredMemorySegments() >= 
getNumberOfSubpartitions(),
-                               "Bug in result partition setup logic: Buffer 
pool has not enough guaranteed buffers for this result partition.");
-
+       @Override
+       public void setup() throws IOException {
                checkState(this.bufferPool == null, "Bug in result partition 
setup logic: Already registered buffer pool.");
 
+               BufferPool bufferPool = bufferPoolFactory.apply(this);
+               checkArgument(bufferPool.getNumberOfRequiredMemorySegments() >= 
getNumberOfSubpartitions(),
+                       "Bug in result partition setup logic: Buffer pool has 
not enough guaranteed buffers for this result partition.");
+
                this.bufferPool = checkNotNull(bufferPool);
 
 Review comment:
   null checks is ineffective

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