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 #2805: [FLINK-5059] only serialise events once in RecordW...
Date Sun, 04 Dec 2016 14:03:45 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message