fix CFRR iterating through resultset consisting entirely of tombstones

patch by jbellis; tested by Niel Drummand and reviewed by Brandon Williams for CASSANDRA-4466
This commit is contained in:
Jonathan Ellis 2012-07-31 10:41:26 -05:00
parent 813553bea9
commit 8b6ce324bf
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,8 @@
1.0.12
* (Hadoop) fix iterating through a resultset consisting entirely
of tombstoned rows (CASSANDRA-4466)
1.0.11
* allow dropping columns shadowed by not-yet-expired supercolumn or row
tombstones in PrecompactedRow (CASSANDRA-4396)

View File

@ -307,18 +307,21 @@ public class ColumnFamilyRecordReader extends RecordReader<ByteBuffer, SortedMap
if (isEmptyPredicate)
{
Iterator<KeySlice> it = rows.iterator();
while (it.hasNext())
KeySlice ks;
do
{
KeySlice ks = it.next();
ks = it.next();
if (ks.getColumnsSize() == 0)
{
it.remove();
}
}
} while (it.hasNext());
// all ghosts, spooky
if (rows.isEmpty())
{
// maybeInit assumes it can get the start-with key from the rows collection, so add back the last
rows.add(ks);
maybeInit();
return;
}