本文整理汇总了Java中org.apache.cassandra.db.filter.IDiskAtomFilter.collectReducedColumns方法的典型用法代码示例。如果您正苦于以下问题:Java IDiskAtomFilter.collectReducedColumns方法的具体用法?Java IDiskAtomFilter.collectReducedColumns怎么用?Java IDiskAtomFilter.collectReducedColumns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.db.filter.IDiskAtomFilter
的用法示例。
在下文中一共展示了IDiskAtomFilter.collectReducedColumns方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: merge
import org.apache.cassandra.db.filter.IDiskAtomFilter; //导入方法依赖的package包/类
public static void merge(final ColumnFamily returnCF, List<CloseableIterator<Column>> data, final SecondaryIndexManager.Updater indexer)
{
IDiskAtomFilter filter = new IdentityQueryFilter();
Comparator<Column> fcomp = filter.getColumnComparator(returnCF.getComparator());
MergeIterator.Reducer<Column, Column> reducer = new MergeIterator.Reducer<Column, Column>()
{
ColumnFamily container = returnCF.cloneMeShallow();
public void reduce(Column column)
{
container.addColumn(column);
// skip the index-update checks if there is no indexing needed since they are a bit expensive
if (indexer == SecondaryIndexManager.nullUpdater)
return;
// notify the index that the column has been overwritten if the value being reduced has been
// superceded by another directly, or indirectly by a range tombstone
if ((!column.isMarkedForDelete(System.currentTimeMillis()) && !container.getColumn(column.name()).equals(column))
|| returnCF.deletionInfo().isDeleted(column.name(), CompactionManager.NO_GC))
{
indexer.remove(column);
}
}
protected Column getReduced()
{
Column c = container.iterator().next();
container.clear();
return c;
}
};
Iterator<Column> reduced = MergeIterator.get(data, fcomp, reducer);
filter.collectReducedColumns(returnCF, reduced, CompactionManager.NO_GC, System.currentTimeMillis());
}
示例2: merge
import org.apache.cassandra.db.filter.IDiskAtomFilter; //导入方法依赖的package包/类
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);
}