Author: brandonwilliams Date: Thu Jul 29 19:05:24 2010 New Revision: 980542
URL: http://svn.apache.org/viewvc?rev=980542&view=rev Log: page within a single row during hinted handoff. Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-1327 Modified: cassandra/trunk/CHANGES.txt cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Modified: cassandra/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=980542&r1=980541&r2=980542&view=diff ============================================================================== --- cassandra/trunk/CHANGES.txt (original) +++ cassandra/trunk/CHANGES.txt Thu Jul 29 19:05:24 2010 @@ -42,7 +42,7 @@ dev * make GCGraceSeconds a per-ColumnFamily value (CASSANDRA-1276) * keep persistent row size and column count statistics (CASSANDRA-1155) * add IntegerType (CASSANDRA-1282) - + * page within a single row during hinted handoff (CASSANDRA-1327) 0.6.4 * avoid queuing multiple hint deliveries for the same endpoint Modified: cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=980542&r1=980541&r2=980542&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Thu Jul 29 19:05:24 2010 @@ -109,23 +109,29 @@ public class HintedHandOffManager } Table table = Table.open(tableName); - RowMutation rm = new RowMutation(tableName, key); DecoratedKey dkey = StorageService.getPartitioner().decorateKey(key); ColumnFamilyStore cfs = table.getColumnFamilyStore(cfName); - ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(dkey, new QueryPath(cfs.getColumnFamilyName()))); - if (cf != null) - rm.add(cf); - Message message = rm.makeRowMutationMessage(); - WriteResponseHandler responseHandler = new WriteResponseHandler(endpoint); - MessagingService.instance.sendRR(message, new InetAddress[] { endpoint }, responseHandler); - - try - { - responseHandler.get(); - } - catch (TimeoutException e) + byte[] startColumn = ArrayUtils.EMPTY_BYTE_ARRAY; + while (true) { - return false; + QueryFilter filter = QueryFilter.getSliceFilter(dkey, new QueryPath(cfs.getColumnFamilyName()), startColumn, ArrayUtils.EMPTY_BYTE_ARRAY, null, 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(endpoint); + MessagingService.instance.sendRR(message, new InetAddress[] { endpoint }, responseHandler); + try + { + responseHandler.get(); + } + catch (TimeoutException e) + { + return false; + } } return true; }