当前位置: 首页>>代码示例>>Java>>正文


Java IDiskAtomFilter.collectReducedColumns方法代码示例

本文整理汇总了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());
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:38,代码来源:PrecompactedRow.java

示例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);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:32,代码来源:PrecompactedRow.java


注:本文中的org.apache.cassandra.db.filter.IDiskAtomFilter.collectReducedColumns方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。