cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r980564 - in /cassandra/branches/cassandra-0.6: CHANGES.txt src/java/org/apache/cassandra/db/HintedHandOffManager.java
Date Thu, 29 Jul 2010 20:36:19 GMT
Author: brandonwilliams
Date: Thu Jul 29 20:36:19 2010
New Revision: 980564

URL: http://svn.apache.org/viewvc?rev=980564&view=rev
Log:
page within a single row during hinted handoff. Patch by brandonwilliams, reviewed by jbellis
for CASSANDRA-1327

Modified:
    cassandra/branches/cassandra-0.6/CHANGES.txt
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/HintedHandOffManager.java

Modified: cassandra/branches/cassandra-0.6/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/CHANGES.txt?rev=980564&r1=980563&r2=980564&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.6/CHANGES.txt Thu Jul 29 20:36:19 2010
@@ -1,3 +1,6 @@
+0.6.5
+ * page within a single row during hinted handoff (CASSANDRA-1327)
+
 0.6.4
  * avoid queuing multiple hint deliveries for the same endpoint
    (CASSANDRA-1229)

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=980564&r1=980563&r2=980564&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/HintedHandOffManager.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/HintedHandOffManager.java
Thu Jul 29 20:36:19 2010
@@ -21,7 +21,6 @@ package org.apache.cassandra.db;
 import java.net.UnknownHostException;
 import java.util.Collection;
 import java.util.Arrays;
-import java.util.concurrent.ConcurrentSkipListSet;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.ExecutorService;
 import java.io.IOException;
@@ -43,7 +42,6 @@ import org.apache.cassandra.net.Message;
 import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.service.*;
 import org.apache.cassandra.thrift.InvalidRequestException;
-import org.apache.cassandra.db.filter.IdentityQueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.utils.WrappedRunnable;
 import org.cliffc.high_scale_lib.NonBlockingHashSet;
@@ -113,24 +111,30 @@ public class HintedHandOffManager
         }
 
         Table table = Table.open(tableName);
-        RowMutation rm = new RowMutation(tableName, key);
-        for (ColumnFamilyStore cfstore : table.getColumnFamilyStores())
+        for (ColumnFamilyStore cfs : table.getColumnFamilyStores())
         {
-            ColumnFamily cf = cfstore.getColumnFamily(new IdentityQueryFilter(key, new QueryPath(cfstore.getColumnFamilyName())));
-            if (cf != null)
+            byte[] startColumn = ArrayUtils.EMPTY_BYTE_ARRAY;
+            while (true)
+            {
+                QueryFilter filter = new SliceQueryFilter(tableName, new QueryPath(cfs.getColumnFamilyName()),
startColumn, ArrayUtils.EMPTY_BYTE_ARRAY, false, PAGE_SIZE);
+                ColumnFamily cf = cfs.getColumnFamily(filter);
+                if (pagingFinished(cf, startColumn))
+                    break;
+                startColumn = cf.getColumnNames().last();
+                RowMutation rm = new RowMutation(tableName, key);
                 rm.add(cf);
-        }
-        Message message = rm.makeRowMutationMessage();
-        WriteResponseHandler responseHandler = new WriteResponseHandler(1, tableName);
-        MessagingService.instance.sendRR(message, new InetAddress[] { endPoint }, responseHandler);
-
-        try
-        {
-            responseHandler.get();
-        }
-        catch (TimeoutException e)
-        {
-            return false;
+                Message message = rm.makeRowMutationMessage();
+                WriteResponseHandler responseHandler = new WriteResponseHandler(1, tableName);
+                MessagingService.instance.sendRR(message, new InetAddress[] { endPoint },
responseHandler);
+                try
+                {
+                    responseHandler.get();
+                }
+                catch (TimeoutException e)
+                {
+                    return false;
+                }
+            }
         }
         return true;
     }



Mime
View raw message