cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r899280 - in /incubator/cassandra/branches/cassandra-0.5: CHANGES.txt src/java/org/apache/cassandra/io/Streaming.java
Date Thu, 14 Jan 2010 16:39:36 GMT
Author: gdusbabek
Date: Thu Jan 14 16:39:36 2010
New Revision: 899280

URL: http://svn.apache.org/viewvc?rev=899280&view=rev
Log:
wait for table flush before streaming data back to a bootstrapping node. Patch by Gary Dusbabek,
reviewed by Jonathan Ellis.

Modified:
    incubator/cassandra/branches/cassandra-0.5/CHANGES.txt
    incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/io/Streaming.java

Modified: incubator/cassandra/branches/cassandra-0.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/cassandra/branches/cassandra-0.5/CHANGES.txt?rev=899280&r1=899279&r2=899280&view=diff
==============================================================================
--- incubator/cassandra/branches/cassandra-0.5/CHANGES.txt (original)
+++ incubator/cassandra/branches/cassandra-0.5/CHANGES.txt Thu Jan 14 16:39:36 2010
@@ -5,6 +5,8 @@
    (CASSANDRA-694)
  * optimize inner read in MessagingService, vastly improving multiple-node
    performance (CASSANDRA-675)
+ * wait for table flush before streaming data back to a bootstrapping node.
+   (CASSANDRA-696)
 
 
 0.5.0 RC3

Modified: incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/io/Streaming.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/io/Streaming.java?rev=899280&r1=899279&r2=899280&view=diff
==============================================================================
--- incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/io/Streaming.java
(original)
+++ incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/io/Streaming.java
Thu Jan 14 16:39:36 2010
@@ -26,6 +26,8 @@
 import java.io.IOException;
 import java.io.File;
 import java.io.IOError;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
 
 import org.apache.log4j.Logger;
 import org.apache.commons.lang.StringUtils;
@@ -73,7 +75,21 @@
                 Table table = Table.open(tName);
                 if (logger.isDebugEnabled())
                   logger.debug("Flushing memtables ...");
-                table.flush();
+                for (Future f : table.flush())
+                {
+                    try
+                    {
+                        f.get();
+                    }
+                    catch (InterruptedException e)
+                    {
+                        throw new RuntimeException(e);
+                    }
+                    catch (ExecutionException e)
+                    {
+                        throw new RuntimeException(e);
+                    }
+                }
                 if (logger.isDebugEnabled())
                   logger.debug("Performing anticompaction ...");
                 /* Get the list of files that need to be streamed */



Mime
View raw message