zhijiangW commented on a change in pull request #6829: [FLINK-10367][network]
Introduce NotificationResult for BufferListener to solve recursive stack
overflow
URL: https://github.com/apache/flink/pull/6829#discussion_r235759923
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/BufferListener.java
##########
@@ -24,6 +24,41 @@
*/
public interface BufferListener {
+ /**
+ * Status of the notification result from the buffer listener.
+ */
+ enum NotificationResult {
+ NONE(false, false),
+ BUFFER_USED_FINISHED(true, false),
+ BUFFER_USED_NEED_MORE(true, true);
+
+ private final boolean bufferUsed;
+ private final boolean needsMoreBuffers;
+
+ NotificationResult(boolean bufferUsed, boolean
needsMoreBuffers) {
+ this.bufferUsed = bufferUsed;
+ this.needsMoreBuffers = needsMoreBuffers;
+ }
+
+ /**
+ * Whether the notified buffer is accepted to use by the
listener.
+ *
+ * @return <tt>true</tt> if the notified buffer is accepted.
+ */
+ boolean bufferUsed() {
Review comment:
I would take `isBufferUsed()`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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