hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1557663 - in /hama/trunk: CHANGES.txt core/src/main/java/org/apache/hama/bsp/message/queue/SpillingQueue.java core/src/test/java/org/apache/hama/bsp/message/TestSpillingQueue.java
Date Mon, 13 Jan 2014 08:43:23 GMT
Author: edwardyoon
Date: Mon Jan 13 08:43:23 2014
New Revision: 1557663

URL: http://svn.apache.org/r1557663
Log:
HAMA-845: The size() of Spilling Queue returns always numMessagesWritten (edwardyoon)

Modified:
    hama/trunk/CHANGES.txt
    hama/trunk/core/src/main/java/org/apache/hama/bsp/message/queue/SpillingQueue.java
    hama/trunk/core/src/test/java/org/apache/hama/bsp/message/TestSpillingQueue.java

Modified: hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hama/trunk/CHANGES.txt?rev=1557663&r1=1557662&r2=1557663&view=diff
==============================================================================
--- hama/trunk/CHANGES.txt (original)
+++ hama/trunk/CHANGES.txt Mon Jan 13 08:43:23 2014
@@ -14,6 +14,7 @@ Release 0.7.0 (unreleased changes)
 
   BUG FIXES
 
+   HAMA-845: The size() of Spilling Queue returns always numMessagesWritten (edwardyoon)
    HAMA-834: Fix KMeans example (Martin Illecker)
    HAMA-831: Support for multi records with same vertexID (edwardyoon)
    HAMA-830: KMeans and NeuralNetwork doesn't load config file (edwardyoon)

Modified: hama/trunk/core/src/main/java/org/apache/hama/bsp/message/queue/SpillingQueue.java
URL: http://svn.apache.org/viewvc/hama/trunk/core/src/main/java/org/apache/hama/bsp/message/queue/SpillingQueue.java?rev=1557663&r1=1557662&r2=1557663&view=diff
==============================================================================
--- hama/trunk/core/src/main/java/org/apache/hama/bsp/message/queue/SpillingQueue.java (original)
+++ hama/trunk/core/src/main/java/org/apache/hama/bsp/message/queue/SpillingQueue.java Mon
Jan 13 08:43:23 2014
@@ -336,7 +336,7 @@ public class SpillingQueue<M extends Wri
 
   @Override
   public int size() {
-    return numMessagesWritten;
+    return numMessagesWritten - numMessagesRead;
   }
 
   @Override

Modified: hama/trunk/core/src/test/java/org/apache/hama/bsp/message/TestSpillingQueue.java
URL: http://svn.apache.org/viewvc/hama/trunk/core/src/test/java/org/apache/hama/bsp/message/TestSpillingQueue.java?rev=1557663&r1=1557662&r2=1557663&view=diff
==============================================================================
--- hama/trunk/core/src/test/java/org/apache/hama/bsp/message/TestSpillingQueue.java (original)
+++ hama/trunk/core/src/test/java/org/apache/hama/bsp/message/TestSpillingQueue.java Mon Jan
13 08:43:23 2014
@@ -57,11 +57,13 @@ public class TestSpillingQueue extends T
     for (int i = 0; i < 1000; ++i) {
       queue.add(text);
     }
+    assertEquals(queue.size(), 1000);
     queue.prepareRead();
-    for (Text t : queue) {
+    Text t;
+    while ((t = queue.poll()) != null) {
       assertTrue(msg.equals(t.toString()));
-      text.clear();
     }
+    assertEquals(queue.size(), 0);
 
     assertTrue(queue.poll() == null);
 



Mime
View raw message