[
https://issues.apache.org/jira/browse/FLINK-7394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16167594#comment-16167594
]
ASF GitHub Bot commented on FLINK-7394:
---------------------------------------
Github user NicoK commented on a diff in the pull request:
https://github.com/apache/flink/pull/4499#discussion_r138918917
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/RemoteInputChannel.java
---
@@ -100,7 +122,16 @@ public RemoteInputChannel(
}
void assignExclusiveSegments(List<MemorySegment> segments) {
--- End diff --
This method is currently **adding** memory segments and multiple calls are
allowed (making `initialCredit` reflect the newest call though). I know, we
don't plan to call this multiple times, but there's also probably no harm. We
should either
1. rename the method to `addExclusiveSegments` and adapt the
`initialCredit` (if we actually keep this), or
2. implement the "assign" behaviour, i.e. recycle previously assigned
elements and only use the new ones as exclusive buffers (for this you actually
need the `initialCredit` but you may not be able to return previously added
buffers immediately), or
3. prevent the user from calling the method multiple times
For simplicity, I'd go with number 1. What do you think?
> Implement basic InputChannel for credit-based logic
> ---------------------------------------------------
>
> Key: FLINK-7394
> URL: https://issues.apache.org/jira/browse/FLINK-7394
> Project: Flink
> Issue Type: Sub-task
> Components: Core
> Reporter: zhijiang
> Assignee: zhijiang
> Fix For: 1.4.0
>
>
> This is a part of work for credit-based network flow control.
> The basic works are:
> * Propose the {{BufferListener}} interface for notifying buffer availability
> and buffer destroyed.
> * {{RemoteInputChannel}} implements {{BufferRecycler}} interface to manage
> the exclusive buffers itself.
> * {{RemoteInputChannel}} implements {{BufferListener}} interface to be
> notified repeatedly .
> * {{RemoteInputChannel}} maintains and notifies of unannounced credit.
> * {{RemoteInputChannel}} maintains current sender backlog to trigger requests
> of floating buffers.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)