flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetz...@apache.org
Subject [30/30] git commit: Check number of designated buffers before returning buffer to BufferAvailabilityListener
Date Mon, 09 Jun 2014 18:31:05 GMT
Check number of designated buffers before returning buffer to BufferAvailabilityListener


Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/3beca629
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/3beca629
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/3beca629

Branch: refs/heads/master
Commit: 3beca629b8f11073415e8107784b2ffe4368f613
Parents: 6d8fea9
Author: uce <u.celebi@fu-berlin.de>
Authored: Mon Jun 2 16:23:40 2014 +0200
Committer: StephanEwen <stephan.ewen@tu-berlin.de>
Committed: Sat Jun 7 09:41:22 2014 +0200

----------------------------------------------------------------------
 .../runtime/io/network/bufferprovider/LocalBufferPool.java  | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/3beca629/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java
b/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java
index 3eb10c1..6285726 100644
--- a/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java
+++ b/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java
@@ -294,6 +294,15 @@ public final class LocalBufferPool implements BufferProvider {
 				this.globalBufferPool.returnBuffer(buffer);
 				this.numRequestedBuffers--;
 			} else {
+				// if the number of designated buffers changed in the meantime, make sure
+				// to return the buffer to the global buffer pool
+				if (this.numRequestedBuffers > this.numDesignatedBuffers) {
+					this.globalBufferPool.returnBuffer(buffer);
+					this.numRequestedBuffers--;
+
+					return;
+				}
+
 				if (!this.listeners.isEmpty()) {
 					Buffer availableBuffer = new Buffer(buffer, buffer.size(), this.recycler);
 					try {


Mime
View raw message