Github user uce commented on a diff in the pull request:
https://github.com/apache/flink/pull/2805#discussion_r90778003
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/writer/RecordWriterTest.java
---
@@ -421,22 +423,19 @@ private ResultPartitionWriter
createCollectingPartitionWriter(
@Override
public Void answer(InvocationOnMock invocationOnMock)
throws Throwable {
Buffer buffer = (Buffer)
invocationOnMock.getArguments()[0];
- Integer targetChannel = (Integer)
invocationOnMock.getArguments()[1];
- queues[targetChannel].add(new
BufferOrEvent(buffer, targetChannel));
+ if (buffer.isBuffer()) {
+ Integer targetChannel = (Integer)
invocationOnMock.getArguments()[1];
+ queues[targetChannel].add(new
BufferOrEvent(buffer, targetChannel));
+ } else {
+ // is event:
+ AbstractEvent event =
EventSerializer.fromBuffer(buffer, getClass().getClassLoader());
+ Integer targetChannel = (Integer)
invocationOnMock.getArguments()[1];
--- End diff --
Was missing before, too, but we should recycle the buffer after creating
the event.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---