flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uce <...@git.apache.org>
Subject [GitHub] flink pull request #3785: [FLINK-6337][network] Remove the buffer provider f...
Date Thu, 27 Apr 2017 13:10:50 GMT
Github user uce commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3785#discussion_r113690239
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
---
    @@ -351,15 +351,15 @@ public void destroyBufferPool() {
     	/**
     	 * Returns the requested subpartition.
     	 */
    -	public ResultSubpartitionView createSubpartitionView(int index, BufferProvider bufferProvider,
BufferAvailabilityListener availabilityListener) throws IOException {
    +	public ResultSubpartitionView createSubpartitionView(int index, BufferAvailabilityListener
availabilityListener) throws IOException {
     		int refCnt = pendingReferences.get();
     
     		checkState(refCnt != -1, "Partition released.");
     		checkState(refCnt > 0, "Partition not pinned.");
     
     		checkElementIndex(index, subpartitions.length, "Subpartition not found.");
     
    -		ResultSubpartitionView readView = subpartitions[index].createReadView(bufferProvider,
availabilityListener);
    +		ResultSubpartitionView readView = subpartitions[index].createReadView(bufferPool, availabilityListener);
    --- End diff --
    
    I think we can completely remove the buffer provider from the `createReadView` method:
    
    - In `SpillableSubpartition#createReadView` we can use the segment size of the buffer
pool of the spillable subpartition itself (`parent.getBufferProvider().getMemorySegmentSize()`).
    - In `PipelinedSubpartition#createReadView` we don't use the argument anyways.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message