}
// returnCF should already have row-level tombstones applied
public static void merge(final ColumnFamily returnCF, List<CloseableIterator<IColumn>> data, final SecondaryIndexManager.Updater indexer)
{
IDiskAtomFilter filter = new IdentityQueryFilter();
Comparator<IColumn> fcomp = filter.getColumnComparator(returnCF.getComparator());
MergeIterator.Reducer<IColumn, IColumn> reducer = new MergeIterator.Reducer<IColumn, IColumn>()
{
ColumnFamily container = returnCF.cloneMeShallow();
public void reduce(IColumn column)
{
container.addColumn(column);
if (indexer != SecondaryIndexManager.nullUpdater
&& !column.isMarkedForDelete()
&& !container.getColumn(column.name()).equals(column))
{
indexer.remove(column);
}
}
protected IColumn getReduced()
{
IColumn c = container.iterator().next();
container.clear();
return c;
}
};
Iterator<IColumn> reduced = MergeIterator.get(data, fcomp, reducer);
filter.collectReducedColumns(returnCF, reduced, CompactionManager.NO_GC);
}