• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ColumnCounter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.cassandra.db.filter.ColumnCounter的典型用法代码示例。如果您正苦于以下问题:Java ColumnCounter类的具体用法?Java ColumnCounter怎么用?Java ColumnCounter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ColumnCounter类属于org.apache.cassandra.db.filter包,在下文中一共展示了ColumnCounter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: discardHead

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
private int discardHead(ColumnFamily cf, int toDiscard, ColumnFamily copy, Iterator<Cell> iter, DeletionInfo.InOrderTester tester)
{
    ColumnCounter counter = columnCounter();

    // Discard the first 'toDiscard' live
    while (iter.hasNext())
    {
        Cell c = iter.next();
        counter.count(c, tester);
        if (counter.live() > toDiscard)
        {
            copy.addColumn(c);
            while (iter.hasNext())
                copy.addColumn(iter.next());
        }
    }
    return Math.min(counter.live(), toDiscard);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:19,代码来源:AbstractQueryPager.java


示例2: discardTail

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
private int discardTail(ColumnFamily cf, int toDiscard, ColumnFamily copy, Iterator<Cell> iter, DeletionInfo.InOrderTester tester)
{
    // Redoing the counting like that is not extremely efficient.
    // This is called only for reversed slices or in the case of a race between
    // paging and a deletion (pretty unlikely), so this is probably acceptable.
    int liveCount = columnCounter().countAll(cf).live();

    ColumnCounter counter = columnCounter();
    // Discard the last 'toDiscard' live (so stop adding as sound as we're past 'liveCount - toDiscard')
    while (iter.hasNext())
    {
        Cell c = iter.next();
        counter.count(c, tester);
        if (counter.live() > liveCount - toDiscard)
            break;

        copy.addColumn(c);
    }
    return Math.min(liveCount, toDiscard);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:21,代码来源:AbstractQueryPager.java


示例3: countPaged

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
/**
 * Convenience method that count (live) cells/rows for a given slice of a row, but page underneath.
 */
public static int countPaged(String keyspace,
                             String columnFamily,
                             ByteBuffer key,
                             SliceQueryFilter filter,
                             ConsistencyLevel consistencyLevel,
                             ClientState cState,
                             final int pageSize,
                             long now) throws RequestValidationException, RequestExecutionException
{
    SliceFromReadCommand command = new SliceFromReadCommand(keyspace, key, columnFamily, now, filter);
    final SliceQueryPager pager = new SliceQueryPager(command, consistencyLevel, cState, false);

    ColumnCounter counter = filter.columnCounter(Schema.instance.getCFMetaData(keyspace, columnFamily).comparator, now);
    while (!pager.isExhausted())
    {
        List<Row> next = pager.fetchPage(pageSize);
        if (!next.isEmpty())
            counter.countAll(next.get(0).cf);
    }
    return counter.live();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:25,代码来源:QueryPagers.java


示例4: discardFirst

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
private ColumnFamily discardFirst(ColumnFamily cf)
{
    ColumnFamily copy = cf.cloneMeShallow();
    ColumnCounter counter = columnCounter();

    Iterator<Column> iter = cf.iterator();
    DeletionInfo.InOrderTester tester = cf.inOrderDeletionTester();
    // Discard the first live
    while (iter.hasNext())
    {
        Column c = iter.next();
        counter.count(c, tester);
        if (counter.live() > 1)
        {
            copy.addColumn(c);
            while (iter.hasNext())
                copy.addColumn(iter.next());
        }
    }
    return copy;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:22,代码来源:AbstractQueryPager.java


示例5: discardLast

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
private ColumnFamily discardLast(ColumnFamily cf)
{
    ColumnFamily copy = cf.cloneMeShallow();
    // Redoing the counting like that is not extremely efficient, but
    // discardLast is only called in case of a race between paging and
    // a deletion, which is pretty unlikely, so probably not a big deal
    int liveCount = columnCounter().countAll(cf).live();

    ColumnCounter counter = columnCounter();
    DeletionInfo.InOrderTester tester = cf.inOrderDeletionTester();
    // Discard the first live
    for (Column c : cf)
    {
        counter.count(c, tester);
        if (counter.live() < liveCount)
            copy.addColumn(c);
    }
    return copy;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:20,代码来源:AbstractQueryPager.java


示例6: countPaged

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
/**
 * Convenience method that count (live) cells/rows for a given slice of a row, but page underneath.
 */
public static int countPaged(String keyspace,
                             String columnFamily,
                             ByteBuffer key,
                             SliceQueryFilter filter,
                             ConsistencyLevel consistencyLevel,
                             final int pageSize,
                             long now) throws RequestValidationException, RequestExecutionException
{
    SliceFromReadCommand command = new SliceFromReadCommand(keyspace, key, columnFamily, now, filter);
    final SliceQueryPager pager = new SliceQueryPager(command, consistencyLevel, false);

    ColumnCounter counter = filter.columnCounter(Schema.instance.getComparator(keyspace, columnFamily), now);
    while (!pager.isExhausted())
    {
        List<Row> next = pager.fetchPage(pageSize);
        if (!next.isEmpty())
            counter.countAll(next.get(0).cf);
    }
    return counter.live();
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:24,代码来源:QueryPagers.java


示例7: countPaged

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
/**
 * Convenience method that count (live) cells/rows for a given slice of a row, but page underneath.
 */
public static int countPaged(String keyspace,
                             String columnFamily,
                             ByteBuffer key,
                             SliceQueryFilter filter,
                             ConsistencyLevel consistencyLevel,
                             final int pageSize,
                             long now) throws RequestValidationException, RequestExecutionException
{
    SliceFromReadCommand command = new SliceFromReadCommand(keyspace, key, columnFamily, now, filter);
    final SliceQueryPager pager = new SliceQueryPager(command, consistencyLevel, false);

    ColumnCounter counter = filter.columnCounter(Schema.instance.getCFMetaData(keyspace, columnFamily).comparator, now);
    while (!pager.isExhausted())
    {
        List<Row> next = pager.fetchPage(pageSize);
        if (!next.isEmpty())
            counter.countAll(next.get(0).cf);
    }
    return counter.live();
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:24,代码来源:QueryPagers.java


示例8: liveCQL3RowCount

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
public int liveCQL3RowCount(long now)
{
    ColumnCounter counter = getComparator().isDense()
                          ? new ColumnCounter(now)
                          : new ColumnCounter.GroupByPrefix(now, getComparator(), metadata.clusteringColumns().size());
    return counter.countAll(this).live();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:ColumnFamily.java


示例9: columnCounter

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
public ColumnCounter columnCounter()
{
    return columnFilter.columnCounter(cfm.comparator, timestamp);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:AbstractQueryPager.java


示例10: columnCounter

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
public ColumnCounter columnCounter()
{
    // We know NamesQueryFilter.columnCounter don't care about his argument
    return command.filter.columnCounter(null, command.timestamp);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:NamesQueryPager.java


示例11: columnCounter

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
@Override
public ColumnCounter columnCounter()
{
    return new ColumnCounter(0);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:AbstractQueryPagerTest.java


示例12: columnCounter

import org.apache.cassandra.db.filter.ColumnCounter; //导入依赖的package包/类
public ColumnCounter columnCounter(); 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:2,代码来源:SinglePartitionPager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DynamicStringListProperty类代码示例发布时间:2022-05-22
下一篇:
Java TransformContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap